New Makefile for packaging of the online calibration detector algorithms
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Feb 2007 17:07:40 +0000 (17:07 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Feb 2007 17:07:40 +0000 (17:07 +0000)
build/MakefileDA [new file with mode: 0644]

diff --git a/build/MakefileDA b/build/MakefileDA
new file mode 100644 (file)
index 0000000..db841f3
--- /dev/null
@@ -0,0 +1,99 @@
+#-*- Mode: Makefile -*-
+
+ifdef ALIROOTMODULES
+
+CXXFLAGS+=-I${ALICE_ROOT}/RAW
+
+ifneq ($(EXTRADAMODULE),) 
+CXXFLAGS+=-I${ALICE_ROOT}/$(EXTRADAMODULE)
+endif
+
+DASRC=${DAMODULE}/${DAMODULE}da.cxx
+DADEP=${DAMODULE}/${DAMODULE}da.d
+DAOBJ=${DAMODULE}/tgt_${ALICE_TARGET}/${DAMODULE}da.o
+DALIB=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}/lib${DAMODULE}DA.a
+DAEXE=${ALICE_ROOT}/bin/tgt_${ALICE_TARGET}/${DAMODULE}da.exe
+
+DAQDADIR=${ALICE}/daqDAlib
+DAQDALIB=$(DAQDADIR)/libdaqDA.a
+
+ROOTLIBDIR=$(shell root-config --libdir)
+
+else
+
+CXXFLAGS+=$(shell date-config --cflags)
+CXXFLAGS+=-Iinclude
+LD=$(CXX)
+
+DASRC=./${DAMODULE}da.cxx
+DADEP=./${DAMODULE}da.d
+DAOBJ=./${DAMODULE}da.o
+DALIB=./lib${DAMODULE}DA.a
+DAEXE=./${DAMODULE}da.exe
+
+DAQDADIR=./daqDAlib
+DAQDALIB=$(DAQDADIR)/libdaqDA.a
+
+ROOTLIBDIR=.
+
+LIBPATH=
+
+endif
+
+SYSLIBS="-ldl"
+MONITORLIBS=$(shell date-config --monitorlibs=noshift)
+
+ALIROOTALIBS=$(RAWDatabaseALIB) $(RAWDatarecALIB) $(RAWDatasimALIB) $(STEERALIB) $(CDBALIB) $(ESDALIB)
+
+ALIROOTALIBS+=$($(DAMODULE)baseALIB) $($(DAMODULE)recALIB) $($(DAMODULE)simALIB)
+
+ifneq ($(EXTRADAMODULE),) 
+
+ALIROOTALIBS+=$($(EXTRADAMODULE)baseALIB) $($(EXTRADAMODULE)recALIB) $($(EXTRADAMODULE)simALIB)
+
+endif
+
+static-DA: $(DAEXE)
+
+$(DAEXE): $(LIBPATH) $(DAOBJ) $(DALIB) $(DAQDALIB)
+
+       $(LD) $(LDFLAGS) -o $@ $(DAOBJ) $(DALIB) \
+       $(SYSLIBS) \
+       $(ROOTLIBDIR)/libRoot.a \
+       $(ROOTLIBDIR)/libfreetype.a $(ROOTLIBDIR)/libpcre.a \
+       $(MONITORLIBS) $(DAQDALIB)
+
+$(DAOBJ): $(DASRC) $(DAQDADIR) $(DADEP)
+       $(CXX) -c $(CXXFLAGS) -I$(DAQDADIR) $< -o $@
+       
+$(DADEP): $(DASRC) $(DAQDADIR)
+       $(CPP) -MM $(CXXFLAGS) -I$(DAQDADIR) $< > $@
+
+DAINCLUDES=$(sort $(filter-out %.o:,$(filter-out %.cxx,$(filter-out \,$(shell cat $(DADEP))))))
+
+-include $(DADEP)
+
+$(DALIB): $(ALIROOTALIBS)
+       @rm -rf $@
+       @rm -rf junk
+       mkdir junk && cd junk && $(addprefix $(AR) x ../,$(addsuffix &&,$^)) $(AR) r $@ *.o && cd .. && rm -rf junk
+
+clean-DA:
+       @rm -f $(DAEXE)
+       @rm -f $(DAOBJ)
+       @rm -f $(DADEP)
+ifdef ALIROOTMODULES
+       @rm -f $(DALIB)
+       @rm -f $(ALIROOTALIBS)
+endif
+
+tar-DA: $(DASRC) $(DALIB) $(DAQDADIR) $(DADEP)
+       @rm -rf $(DAMODULE)da.tar
+       @rm -rf junk
+       mkdir junk && mkdir junk/include && \
+       cp -a $(DASRC) $(DALIB) $(ROOTLIBDIR)/libRoot.a $(ROOTLIBDIR)/libfreetype.a $(ROOTLIBDIR)/libpcre.a $(DAQDADIR) junk && \
+       $(foreach daincfile,$(DAINCLUDES), cp -a $(daincfile) junk/include &&) \
+       cp -a build/MakefileDA junk/Makefile && \
+       cd junk && \
+       tar cvf ../$(DAMODULE)da.tar * && \
+       cd .. && rm -rf junk