# # File: # Makefile # # Description: # Makefile for the coda 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 = fadc_list.so fadc_sd_ctp_list.so # Add shared library dependencies here. (jvme, ti, are already included) ROLLIBS = -lfadc -lremex LINUXVME_LIB ?= ${CODA}/extensions/linuxvme/libs LINUXVME_INC ?= ${CODA}/extensions/linuxvme/include # DEFs for compiling primary readout lists CC = gcc AR = ar RANLIB = ranlib ifdef DEBUG CFLAGS = -Wall -g else CFLAGS = -O3 endif CFLAGS += -w -DLINUX -DDAYTIME=\""`date`"\" INCS = -I. -I${LINUXVME_INC} -I/usr/include -I${CODA}/common/include LIBS = -L. -L${LINUXVME_LIB} -DJLAB \ -lrt -lpthread -ljvme -lti $(ROLLIBS) # 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 = -ljvme -lti 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) DEPS = $(VMEROL:%.so=%.d) DEPS += $(CFILES:%.c=%.d) 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 $@ $< %.so: %.c @echo @echo "Building $@ from $<" @echo $(CC) -fpic -shared $(CFLAGS) $(INCS) $(LIBS) \ -DINIT_NAME=$(@:.so=__init) -o $@ $< clean distclean: @rm -f $(VMEROL) $(SOBJS) $(CFILES) *~ $(DEPS) %.d: %.c @echo "Building $@ from $<" @set -e; rm -f $@; \ $(CC) -MM -shared $(INCS) $(CPPFLAGS) $< > $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.so $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ -include $(DEPS) .PHONY: all