]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - build/MakefileDA
Using date-config in order to steer the make. Adding amore into the DA.
[u/mrichter/AliRoot.git] / build / MakefileDA
index c202f11fd1c74ee0cc0f2b66e46679391caa04a0..d45a0f7c181ae40fe00fb7f47899ba2bea140075 100644 (file)
@@ -39,9 +39,10 @@ endif
 
 ifneq ($(findstring $(DAMODULE),$(MODULES)),)
 
+CXXFLAGS:=$(filter-out -pedantic-errors,$(CXXFLAGS))
 CXXFLAGS+=-I${ALICE_ROOT}/RAW
 CXXFLAGS+=-I${ALICE_ROOT}/$(DAMODULE)
-CXXFLAGS+=$(addprefix -I,$(filter-out %tgt_${ALICE_TARGET},$(filter-out %CVS,$(patsubst %/,%,$(shell ls -d ${ALICE_ROOT}/$(DAMODULE)/*/)))))
+CXXFLAGS+=$(addprefix -I,$(filter-out %tgt_${ALICE_TARGET},$(patsubst %/,%,$(shell ls -d ${ALICE_ROOT}/$(DAMODULE)/*/))))
 
 DATARGETDIR=${DAMODULE}/tgt_${ALICE_TARGET}
 DASRC=${DAMODULE}/${DAMODULE}$(SUBDAMODULE)${DANAME}da.cxx
@@ -50,14 +51,12 @@ DADEP=${DATARGETDIR}/${DAMODULE}$(SUBDAMODULE)${DANAME}da.d
 DALIB=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}/lib${DAMODULE}$(SUBDAMODULE)${DANAME}DA.a
 DAEXE=${ALICE_ROOT}/bin/tgt_${ALICE_TARGET}/${DAMODULE}$(SUBDAMODULE)${DANAME}da.exe
 
-DAVERSION=$(firstword $(shell cvs status $(DASRC) | grep "Working revision:" | cut -d: -f2 ))
+DAVERSION=$(firstword $(shell svn info $(DASRC) | grep "Last Changed Rev:" | cut -d: -f2 ))
 
 DAROOTRELEASE=$(subst /,.,$(shell root-config --version))
 
-DAALIROOTRELEASE=$(subst -,.,$(firstword $(shell cvs status $(DASRC) | grep "Sticky Tag:" | cut -d: -f2 )))
-ifeq ($(DAALIROOTRELEASE),(none))
-DAALIROOTRELEASE:="HEAD_"$(subst -,.,$(shell date --iso-8601))
-endif
+#DAALIROOTRELEASE=$(notdir $(subst /$(DASRC),,$(shell svn info $(DASRC) | grep "URL:" | cut -d: -f3 )))
+DAALIROOTRELEASE+=$(subst -,.,$(notdir $(subst /$(DASRC),,$(shell svn info $(DASRC) | grep "URL:" | cut -d: -f3 ))))"."$(firstword $(shell svn info $(DASRC) | grep "Revision:" | cut -d: -f2 ))
 
 DAARCNAME=$(patsubst %-,%,daqDA-${ONLINEDETECTORNAME}-${DANAME})
 DAARC=$(DAARCNAME)-$(DAVERSION)
@@ -72,9 +71,18 @@ DAQDADIR=${DAQDALIB_PATH}
 endif
 DAQDALIB=$(DAQDADIR)/libdaqDA.a
 
+ifneq ($(shell amore-config 2>&1 |grep -i usage),)
+AMOREFLAGS = -DALI_AMORE $(shell amore-config --cflags --includes)
+CXXFLAGS  += $(AMOREFLAGS)
+CFLAGS    += $(AMOREFLAGS)
+CINTFLAGS += $(AMOREFLAGS)
+DEPINC    += $(AMOREFLAGS)
+DAQDALIB  += $(shell amore-config --auxlibs)
+endif
+
 ROOTLIBDIR=$(shell root-config --libdir)
 
-SYSLIBS=-ldl
+SYSLIBS=-ldl -lpthread
 
 MONITORLIBS=$(shell date-config --monitorlibs=noshift)
 
@@ -92,8 +100,16 @@ CXXFLAGS+=$(addprefix -I,$(filter-out %tgt_${ALICE_TARGET},$(filter-out %CVS,$(p
 ALIROOTALIBS+=$($(EXTRADAMODULE)ALIBS)
 endif
 
-DAOUTPUTFILES=$(sort $(shell grep TFile $(DASRC) | grep '(' | grep ')' | grep -i recreate | cut -d'(' -f2 | cut -d',' -f1 | cut -d')' -f1 ))
-DAINPUTFILES=$(sort $(shell grep TFile $(DASRC) | grep '(' | grep ')' | grep -vi recreate | cut -d'(' -f2 | cut -d',' -f1 | cut -d')' -f1 ))
+DACONTACT=$(sort $(shell grep -i "Contact:" $(DASRC) | cut -d':' -f2))
+DALINKPAGE=$(sort $(subst Link:,,$(shell grep -i "Link:" $(DASRC))))
+DAREFRUN=$(sort $(shell grep -i "Reference Run:" $(DASRC) | cut -d':' -f2))
+DARUNTYPE=$(sort $(shell grep -i "Run Type:" $(DASRC) | cut -d':' -f2))
+DATYPE=$(sort $(shell grep -i "DA Type:" $(DASRC) | cut -d':' -f2))
+DANUMBEROFEVENTS=$(sort $(shell grep -i "Number of events needed:" $(DASRC) | cut -d':' -f2))
+DAINPUTFILES=$(sort $(shell grep -i "Input Files:" $(DASRC) | cut -d':' -f2))
+DAOUTPUTFILES=$(sort $(shell grep -i "Output Files:" $(DASRC) | cut -d':' -f2))
+DATRIGGERTYPE=$(sort $(shell grep -i "Trigger types used:" $(DASRC) | cut -d':' -f2))
+
 $(DATARGETNAME): $(DAEXE)
 
 $(DAEXE): $(DAOBJ) $(LIBPATH) $(DALIB) $(DAQDALIB) $(EXTRAROOTLIB)
@@ -126,7 +142,7 @@ $(DALIB): $(ALIROOTALIBS)
        $(MUTE)mkdir junk && cd junk && $(addprefix $(AR) x ../,$(addsuffix &&,$^)) $(AR) r $@ *.o && cd .. && rm -rf junk
 
 $(EXTRAROOTLIB): $(LIBPATH) 
-       $(MUTE)$(AR) r $@ `ls ${ROOTSYS}/vmc/src/*.o ${ROOTSYS}/treeplayer/src/*.o`
+       $(MUTE)$(AR) r $@ `ls ${ROOTSYS}/montecarlo/vmc/src/*.o ${ROOTSYS}/tree/treeplayer/src/*.o`
 
 $(DATARGETNAME)-clean:
        @echo "***** Cleaning $(DAMODULE)$(SUBDAMODULE)$(DANAME) detector-algorithm *****"
@@ -232,8 +248,15 @@ $(DASPECFILE): $(DATARGETDIR)
        @echo "It uses data from $(DAMODULE) and $(EXTRADAMODULE) detectors at run time." >> $@
        @echo "Build requires: daqDAlib, date, AliRoot $(DAALIROOTRELEASE), ROOT $(DAROOTRELEASE)." >> $@
        @echo "Runtime requires: date." >> $@
-       @echo "Files produced: $(DAOUTPUTFILES)" >> $@
-       @echo "Files used: $(DAINPUTFILES)" >> $@
+       @echo "Contact: $(DACONTACT)" >> $@
+       @echo "Link: $(DALINKPAGE)" >> $@
+       @echo "Reference Run: $(DAREFRUN)" >> $@
+       @echo "Run type: $(DARUNTYPE)" >> $@
+       @echo "DA type: $(DATYPE)" >> $@
+       @echo "Number of events needed: $(DANUMBEROFEVENTS)" >> $@
+       @echo "Input files: $(DAINPUTFILES)" >> $@
+       @echo "Output files: $(DAOUTPUTFILES)" >> $@
+       @echo "Trigger types used: $(DATRIGGERTYPE)" >> $@
        @echo "" >> $@
        @echo "#################################################################" >> $@
        @echo "# Do not modify following scripts" >> $@
@@ -264,10 +287,10 @@ $(DASPECFILE): $(DATARGETDIR)
        @echo "" >> $@
        @echo "# clean RPM build files" >> $@
        @echo "%clean" >> $@
-       @echo "# remove source files" >> $@
-       @echo "rm -rf ""$$""RPM_BUILD_DIR/%{pkgname}" >> $@
        @echo "# remove installed files" >> $@
        @echo "rm -rf ""$$""RPM_BUILD_ROOT" >> $@
+       @echo "# remove source files" >> $@
+       @echo "rm -rf ""$$""RPM_BUILD_DIR/%{pkgname}" >> $@
        @echo "" >> $@
        @echo "# pre-install script" >> $@
        @echo "%pre" >> $@
@@ -303,14 +326,17 @@ $(DATARGETNAME)-rpm:
        @echo
        @echo "*******************************************************************************************************"
        @echo "* In order to build a detector-algorithm package you have run AliRoot make with the following syntax: *"
-       @echo "* For example: make TPC-da (compiles and link TPC/TPCda.cxx DA source file and produces TPCda.exe)    *"
-       @echo "*              make MUON-TRK-da (MUON is the AliRoot module, TRK is the name of the DA algorithm,     *"
-       @echo "*                                this target will compile and link MUON/MUONTRKda.cxx and will        *"
-       @echo "*                                produce MUONTRKda.exe)                                               *"
+       @echo "* For example: make daqDA-TPC (compiles and link all the TPC DAs and produces the corresponding DA    *"
+       @echo "*                             executables)                                                            *"
+       @echo "*              make daqDA-MCH (MCH is the online code for MUON TRK detector.                          *"
+       @echo "*                              this target will compile and link MUON/MUONTRKda.cxx and will          *"
+       @echo "*                              produce MUONTRKda.exe)                                                 *"
        @echo "* In case you want to build the corresponding DA binary RPM, you have to add -rpm to your target name,*"
        @echo "* for example:                                                                                        *"
-       @echo "*              make TOF-da-rpm  (compiles, links TOF/TOFda.cxx and builds the TOF DA binary RPM)      *"
-       @echo "*              make ITS-SPD-da-rpm (compiles, link ITS/ITSSPDda.cxx and builds ITS SPD DA binary RPM) *"
+       @echo "*              make daqDA-TOF-rpm  (compiles, links TOF/TOFda.cxx and builds the TOF DA binary RPM)   *"
+       @echo "*              make daqDA-SPD-rpm (compiles, link ITS/ITSSPDda.cxx and builds ITS SPD DA binary RPM)  *"
+       @echo "* For more details about the DA targets, please refer to:                                             *"
+       @echo "* http://aliceinfo.cern.ch/static/people/cheshkov/da-packaging/                                       *"
        @echo "*******************************************************************************************************"
        @echo
 
@@ -318,6 +344,8 @@ endif
 
 else
 
+ifneq ($(findstring $(DAMODULE),$(MODULES)),)
+
 DAMODULEALLTARGETS:=$(notdir $(wildcard $(DAMODULE)/$(DAMODULE)$(SUBDAMODULE)*da.cxx))
 
 daqDA-$(ONLINEDETECTORNAME): $(DAMODULEALLTARGETS)
@@ -338,4 +366,18 @@ daqDA-$(ONLINEDETECTORNAME)-clean: $(addsuffix -clean,$(DAMODULEALLTARGETS))
 %da.cxx-clean:
        $(MUTE)make $(subst --,-NONAME-,$(addsuffix -clean,$(addprefix daqDA-,$(subst $(DAMODULE)$(SUBDAMODULE),$(ONLINEDETECTORNAME)-,$(subst da.cxx-clean,,$@)))))
 
+else
+
+daqDA-$(ONLINEDETECTORNAME): daqDA-$(ONLINEDETECTORNAME)-rpm
+daqDA-$(ONLINEDETECTORNAME)-rpm: daqDA-$(ONLINEDETECTORNAME)-clean
+daqDA-$(ONLINEDETECTORNAME)-clean:
+       @echo
+       @echo "========================================================================================================================="
+       @echo " $(ONLINEDETECTORNAME) is not a valid online detector code.                                                              "
+       @echo " The list of the valid codes is SPD SDD SSD TPC TRD TOF HMP PHS CPV PMD MCH MTR FMD T00 V00 ZDC ACO TRI EMC HLT TST GRP  "
+       @echo "========================================================================================================================="
+       @echo
+
+endif
+
 endif