# # File: # Makefile # # Description: # Makefile for the CODA 3.0 primary and secondary readout lists # running on an Intel-based controller running Linux # # # Uncomment DEBUG line for debugging info ( -g and -Wall ) DEBUG=1 # HIST=2 #==================== ROOTSPY ============================= ifeq ($(HIST),1) ROOTCFLAGS := $(shell root-config --cflags) ROOTLIBS := $(shell root-config --libs) ROOTGLIBS := $(shell root-config --glibs) #---------- #SPYVERS = /gluex/monitoring/RootSpy-1.3 SPYLIBS = -L${ROOTSPY}/lib/ -lRootSpy -lRootSpy-client SPYDLIBS = ${ROOTSPY}/plugins/rootspy.so HISTSRC = rootspy_hist.cc endif #=========================================================== # Plug in your primary readout lists here.. VMEROL = rol2_list.so # Add shared library dependencies here. (jvme, ti, td, ts, sd, ctp are already included) ROLLIBS = LINUXVME_LIB ?= ../lib LINUXVME_INC ?= ../include LINUXVME_BIN ?= ../bin # DEFs for compiling primary readout lists CC = gcc AR = ar RANLIB = ranlib ifdef DEBUG CFLAGS = -Wall -g else CFLAGS = -O3 endif CFLAGS += -w -I. -I${LINUXVME_INC} -I/usr/include -I${CODA}/common/include\ -L. -L${LINUXVME_LIB} -L${CODA_LIBS} -DJLAB CFLAGS += -lrt -rdynamic -lpthread -ljvme -lti -ltd -lts -lsd -lctp $(ROLLIBS) CFLAGS += -DLINUX -DDAYTIME=\""`date`"\" #==================== ROOTSPY ============================= ifeq ($(HIST),1) CFLAGS += -DSHM_BUF -DDQM_HIST -I ../rcm/monitor -x c ../rcm/monitor/hbook.cc -x none CFLAGS += $(ROOTCFLAGS) -I ${ROOTSPY}/include -L${CODA}/Linux/lib -levioxx -levio -lexpat else ifeq ($(HIST),2) CFLAGS += -DSHM_BUF -I ../rcm/monitor -x c ../rcm/monitor/hbook.cc -x none HISTSRC = tcplib.c endif #=========================================================== # DEFs for compiling CODA readout lists CCRL = ${CODA_BIN}/ccrl CODA_INCS = -I. -I${LINUXVME_INC} -I${CODA}/common/include CODA_LIBDIRS = -L. -L${LINUXVME_LIB} CODA_LIBS = -rdynamic -ljvme -lti -ltd -lts -lsd -lctp CODA_DEFS = -DLINUX -DDAYTIME=\""`date`"\" -DINIT_NAME=$(@:.so=__init) -DINIT_NAME_POLL=$(@:.so=__poll) CODA_CFLAGS = -O -w -fpic -shared ${CODA_INCS} ${CODA_LIBDIRS} \ ${CODA_LIBS} ${CODA_DEFS} ifdef DEBUG CODA_CFLAGS += -Wall -g endif CRLFILES = $(wildcard *.crl) CFILES = $(CRLFILES:.crl=.c) SOBJS = $(CRLFILES:.crl=.so) ifeq ($(ARCH),x86_64) libdir:=/usr/lib64/gef else libdir:=/usr/lib/gef endif # End in error, if the gefvme-kmod-common RPM is not installed. ifeq (,$(wildcard $(libdir)/libvme.a)) $(error gefvme-kmod-common RPM not installed!) endif all: $(VMEROL) $(SOBJS) event_list.c: event_list.crl Makefile @echo @echo "Converting $< to $@" @${CCRL} $< event_list.so: event_list.c @echo @echo "Building $@ from $<" @echo ${CC} ${CODA_CFLAGS} -o $@ $< %.c: %.crl Makefile @echo @echo "Converting $< to $@" @${CCRL} $< %.so: %.c Makefile $(HISTSRC) @echo @echo "Building $@ from $<" @echo $(CC) -fpic -shared $(CFLAGS) $(HIST_FLAGS) $(SPYDLIBS) $(ROOTLIBS) -DINIT_NAME=$(@:.so=__init) -DINIT_NAME_POLL=$(@:.so=__poll) -o $@ $< rol2_list.so: rol2_list.c $(HISTSRC) @echo @echo "Building SF:: $@ from $<" @echo ${CC} -fpic -shared $(CFLAGS) $(HIST_FLAGS) $(SPYDLIBS) $(ROOTLIBS) -DINIT_NAME=$(@:.so=__init) -DINIT_NAME_POLL=$(@:.so=__poll) rol2_list.c $(HISTSRC) -o $@ clean distclean: @rm -f $(VMEROL) $(SOBJS) $(CFILES) *~ .PHONY: all