# # 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=1 #==================== 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 ${ROOTSPY}/plugins/rootspy-client.so HISTSRC = rootspy_hist.cc hist_lib.cc endif #=========================================================== # Plug in your primary readout lists here.. PROG = daqmon hist_mon_srv # Add shared library dependencies here. (jvme, ti, td, ts, sd, ctp are already included) ROLLIBS = -lfadc -ljvme -lti -ltd -lts -lsd -lctp 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} -DJLAB #CFLAGS += -lrt -lpthread $(ROLLIBS) CFLAGS += -lrt -lpthread CFLAGS += -DLINUX -DDAYTIME=\""`date`"\" #==================== ROOTSPY ============================= ifeq ($(HIST),1) CFLAGS += -DSHM_BUF -DDQM_HIST CFLAGS += $(ROOTCFLAGS) -I ../monitor # CFLAGS += $(ROOTCFLAGS) -I ../monitor -I ${ROOTSPY}/include/libRootSpy/ # CFLAGS += $(ROOTCFLAGS) -I ../monitor -I ${ROOTSPY}/include -L${CODA}/Linux/lib -L${CODA}/Linux/lib64 -levioxx -levio -lexpat # CFLAGS += $(ROOTCFLAGS) -I ../monitor -I ${ROOTSPY}/include -L${CODA}/Linux/lib -L${CODA}/Linux-x86_64/lib -levioxx -levio -lexpat else ifeq ($(HIST),2) CFLAGS += -DSHM_BUF -I ../monitor endif #=========================================================== # DEFs for compiling CODA readout lists CCRL = ${LINUXVME_BIN}/ccrl #CCRL = ccrl CODA_INCS = -I. -I${LINUXVME_INC} -I${CODA}/common/include CODA_LIBDIRS = -L. -L${LINUXVME_LIB} CODA_LIBS = -ljvme -lti -ltd -lts -lsd -lctp CODA_DEFS = -DLINUX -DDAYTIME=\""`date`"\" CODA_CFLAGS = -O -w -fpic -shared ${CODA_INCS} ${CODA_LIBDIRS} \ ${CODA_LIBS} ${CODA_DEFS} #--- Reset CODA_CFLAG --- !!! CODA_CFLAGS += -Wall ifdef DEBUG CODA_CFLAGS += -Wall -g endif CRLFILES = $(wildcard *.crl) CFILES = $(CRLFILES:.crl=.c) SOBJS = $(CRLFILES:.crl=.so) ifeq ($(MACHTYPE),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: $(PROG) $(SOBJS) %.so: %.c Makefile @echo @echo "Building $@ from $<" @echo $(CC) -fpic -shared $(CFLAGS) -DINIT_NAME=$(@:.so=__init) -o $@ $< bank_reader: bank_reader.cc rootspy_hist.cc rootspy_hist.hh Makefile @echo @echo "ROOTSPY = $(ROOTSPY) or ${ROOTSPY}" @echo "OS release ${BMS_OSNAME} LIB= $(SPYLIBS)" @echo "Building $@ from $<" @mkdir -p $(BMS_OSNAME) @echo ${CC} -fpic $(CFLAGS) $(SPYDLIBS) $(ROOTLIBS) bank_reader.cc rootspy_hist.cc -lstdc++ -o ${BMS_OSNAME}/$@ hist_mon_srv: hist_mon_srv.cc rootspy_hist.cc rootspy_hist.hh Makefile @echo @echo "ROOTSPY = $(ROOTSPY) or ${ROOTSPY}" @echo "OS release ${BMS_OSNAME} LIB= $(SPYLIBS)" @echo "Building $@ from $<" @mkdir -p $(BMS_OSNAME) @echo ${CC} -fpic $(CFLAGS) $(SPYDLIBS) $(ROOTLIBS) hist_mon_srv.cc rootspy_hist.cc -lstdc++ -o ${BMS_OSNAME}/$@ daqmon1: daqmon1.cc daqmon1.hh daqMainFrame.cc daqMainFrame.hh @echo @echo "ROOTSPY = $(ROOTSPY) or ${ROOTSPY}" @echo "OS release ${BMS_OSNAME} LIB= $(SPYLIBS)" @echo "Building $@ from $<" @mkdir -p $(BMS_OSNAME) @echo ${CC} -fpic $(CFLAGS) $(SPYDLIBS) $(ROOTGLIBS) daqmon1.cc daqMainFrame.cc -lstdc++ -o ${BMS_OSNAME}/$@ daqmon: daqmon.cc daqmon.hh daqMainFrame.cc daqMainFrame.hh hist_lib.cc hist_lib.hh @echo @echo "ROOTSPY = $(ROOTSPY) or ${ROOTSPY}" @echo "OS release ${BMS_OSNAME} LIB= $(SPYLIBS)" @echo "Building $@ from $<" @mkdir -p $(BMS_OSNAME) @echo ${CC} -fpic $(CFLAGS) $(ROOTGLIBS) daqmon.cc daqMainFrame.cc hist_lib.cc -lstdc++ -o ${BMS_OSNAME}/$@ # -Wl,-z,defs test: @echo @echo ARCH=$(ARCH) @echo MACHTYPE=$(MACHTYPE) @echo "ROOTSPY = $(ROOTSPY) or ${ROOTSPY}" @echo "OS release ${BMS_OSNAME} LIB= $(SPYLIBS)" @echo "Building $@ from $<" @echo clean distclean: @rm -f $(PROG) $(SOBJS) $(CFILES) ${BMS_OSNAME}/* *~ .PHONY: all