# # Makefile for the DRS DAQ # # Compiled and streamlined from original makefiles - O. Grimm, Nov 2008 # Use the VMECTRL flag to switch between different VME controllers: -DCT_VME # for Concurrent Technologies, -DSTRUCK_VME for Struck VMECTRL = -DCT_VME #CC = g++ # Compiler to use SOURCES = HVFeedback.cc DAQReadout.cc RawDataCTX.cc ../pixelmap/Pixel.cc ../pixelmap/PixelMap.cc DRS/DRS.cc DRS/mxml.c DRS/strlcpy.c drsdaq.cpp OBJECTS = $(addsuffix .o, $(basename $(SOURCES))) SOBJECTS = RawDataCTX INCDIRS = -I. -IDRS -I../pixelmap ifeq ($(VMECTRL),-DCT_VME) VMELIB = -L./VME/atlas/lib -lvme_rcc -lcmem_rcc -lrcc_time_stamp INCDIRS := $(INCDIRS) -I./VME/atlas/include/ else VMELIB = -L./VME/struck INCDIRS := $(INCDIRS) -I./VME/struck/ OBJECTS := $(OBJECTS) ./VME/struck/sis3100.o ./VME/struck/sis3100_vme_calls.o endif CFLAGS = -pipe -fthread-jumps -funroll-all-loops -O3 -Wall -DOS_LINUX CPPFLAGS = -pipe -fPIC -fthread-jumps -funroll-all-loops -O3 -Wall -DOS_LINUX $(VMECTRL) LIBS = -lstdc++ -lz -lpthread -lutil -lfl $(VMELIB) drsdaq: $(OBJECTS) $(CC) $(CPPFLAGS) -o $@ $(OBJECTS) $(LIBS) $(CC) -shared -Wl,-soname,$(SOBJECTS).so -o $(SOBJECTS).so $(SOBJECTS).o -lc clean: @rm -f $(OBJECTS) $(SOBJECTS).so @rm -f *.d @rm -f *~ -include Dep.d # Implicit rules %.o : %.c $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< %.o : %.cc $(CC) $(CPPFLAGS) $(INCDIRS) -c -o $@ $< %.o : %.cpp $(CC) $(CPPFLAGS) $(INCDIRS) -c -o $@ $< %.d : @echo "Generating dependencies" $@ @$(CC) -MM $(SOURCES) $(INCDIRS) \ | sed 's/^\(.*\).o:/$@ \1.o:/' > $@