# 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 # # Plug in your primary readout lists here.. VMEROL = ti_master_list.so vme_list.so ts_list.so ts_list_cdconly.so ts_list_cdcandfdc.so ts_list_cdcandfdcTS.so vme_list_tdc_startcounter.so ts_list_cdc_fdc_bcal_andSTALL.c # Add shared library dependencies here. (jvme, ti, td, ts, sd, ctp are already included) ROLLIBS = -lfadc LINUXVME_LIB ?= ../lib LINUXVME_INC ?= ../include LINUXVME_BIN ?= ../bin INCSCCDB = -I$(CCDB_HOME)/include \ -I/usr/include/mysql \ # 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 -ljvme -lti -ltd -lts -lsd -lctp -lvmeDSC $(ROLLIBS) CFLAGS += -DLINUX -DDAYTIME=\""`date`"\" # DEFs for compiling CODA readout lists CCRL = ${LINUXVME_BIN}/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 -la125 CODA_DEFS = -DLINUX -DDAYTIME=\""`date`"\" 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 @echo @echo "Building $@ from $<" @echo $(CC) -fpic -shared $(CFLAGS) -DINIT_NAME=$(@:.so=__init) -o $@ $< TDCLIBS = -lf1tdc ccdb_code.so: ccdb_code.cc ccdb_inc.h g++ -fpic -shared -L$(CCDB_HOME)/lib -lccdb $(INCSCCDB) ccdb_code.cc -o ccdb_code.so vme_list.so: vme_list.c ccdb_inc.h ccdb_code.so Makefile $(CC) -fpic -shared $(CFLAGS) -DINIT_NAME=$(@:.so=__init) \ ccdb_code.so -L$(CCDB_HOME)/lib -lccdb -lfa125 -o vme_list.so vme_list.c MYINCCCDB = -I/gluonfs1/home/zihlmann/ccdb/trunk/include \ -I/gluonfs1/home/zihlmann/ccdb/trunk/include/CCDB \ -I./ MYLIBSCCDB = -L/home/zihlmann/ccdb/trunk/lib vme_list_tdc.so: vme_list_tdc.c ccdb_inc.h ccdb_code.so Makefile $(CC) -fpic -shared $(CFLAGS) -DINIT_NAME=$(@:.so=__init) $(TDCLIBS) \ ccdb_code.so -L$(CCDB_HOME)/lib -lccdb -lf1tdc -o vme_list_tdc.so vme_list_tdc.c vme_list_tdc_special.so: vme_list_tdc_special.c ccdb_inc.h ccdb_code.so Makefile $(CC) -fpic -shared $(CFLAGS) -DINIT_NAME=$(@:.so=__init) $(TDCLIBS) \ ccdb_code.so -L$(CCDB_HOME)/lib -lccdb -lf1tdc -o vme_list_tdc_special.so vme_list_tdc_special.c test: test.c Makefile ccdb_code.so $(CC) ccdb_code.so $(CFLAGS) -L$(CCDB_HOME)/lib -lccdb -o test test.c mkconfigfiles: mkconfigfiles.c Makefile ccdb_code.so g++ ccdb_code.so $(CFLAGS) $(INCSCCDB) -L$(CCDB_HOME)/lib -lccdb -o mkconfigfiles mkconfigfiles.c turnoffadcs: turnoffadcs.c $(CC) $(CFLAGS) -lfa125 -o turnoffadcs turnoffadcs.c clean distclean: @rm -f $(VMEROL) $(SOBJS) $(CFILES) *~ .PHONY: all