Merge branch 'master', remote branch 'origin' into TPCdev
[u/mrichter/AliRoot.git] / ANALYSIS / Makefile
CommitLineData
379c06ec 1
dd4f0396 2include Makefile.arch
b7c8eec1 3
dd4f0396 4PACKAGE = ANALYSISalice
9af2beba 5
6default-target: lib$(PACKAGE).so
b7c8eec1 7
8ALICEINC = -I.
9
3e228187 10# add include paths from other par files
b7c8eec1 11ifneq ($(ESD_INCLUDE),)
12 ALICEINC += -I../$(ESD_INCLUDE)
b7c8eec1 13endif
14
3e228187 15ifneq ($(AOD_INCLUDE),)
16 ALICEINC += -I../$(AOD_INCLUDE)
17endif
18
19ifneq ($(STEERBase_INCLUDE),)
20 ALICEINC += -I../$(STEERBase_INCLUDE)
21endif
22
9af2beba 23ifneq ($(ANALYSIS_INCLUDE),)
24 ALICEINC += -I../$(ANALYSIS_INCLUDE)
25endif
26
a18817ac 27ifneq ($(OADB_INCLUDE),)
28 ALICEINC += -I../$(OADB_INCLUDE)
29endif
30
02fc82ff 31ifneq ($(ANALYSISalice_INCLUDE),)
32 ALICEINC += -I../$(ANALYSISalice_INCLUDE)
33endif
34
3e228187 35# only if no par file was loaded before
41f671ab 36#ifeq ($(ALICEINC),-I.)
3e228187 37 ifneq ($(ALICE_ROOT),)
e144bdbc 38 ALICEINC += -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/ANALYSIS/Tender -I$(ALICE_ROOT)/TOF -I$(ALICE_ROOT)/TRD/Cal -I$(ALICE_ROOT)/VZERO -I$(ALICE_ROOT)/TPC -I$(ALICE_ROOT)/T0 -I$(ALICE_ROOT)/EMCAL
3e228187 39 endif
41f671ab 40#endif
b7c8eec1 41
8bfe3849 42ifeq ($(PLATFORM),macosx)
43ROOTLIBDIR := $(shell $(RC) --libdir)
44ifeq ($(PACKAGE),ANALYSIS)
45 PACKLDFLAGS = $(STEERBase_LIBS) $(ESD_LIBS) $(AOD_LIBS) -L$(ROOTLIBDIR)
46endif
47ifeq ($(PACKAGE),ANALYSISalice)
48 PACKLDFLAGS = $(STEERBase_LIBS) $(ESD_LIBS) $(AOD_LIBS) $(ANALYSIS_LIBS) $(OADB_LIBS) -L$(ROOTLIBDIR) -lXMLIO -lEG -lTreePlayer
49endif
50endif
51
e9e06a24 52CHECKXML := $(shell root-config --has-xml)
84d4333f 53
dd4f0396 54ifeq ($(CHECKXML),yes)
55 CXXFLAGS += -DWITHXML
56 CINTFLAGS += -DWITHXML
57endif
58
59CXXFLAGS += $(ALICEINC) -g
60
958d9d26 61SRCS = $(wildcard *.cxx)
62HDRS = $(SRCS:.cxx=.h)
63DHDR = $(PACKAGE)LinkDef.h
379c06ec 64
c52c2132 65DHDR_ANALYSIS := $(DHDR)
66HDRS_ANALYSIS := $(HDRS)
67SRCS_ANALYSIS := $(SRCS) G__$(PACKAGE).cxx
68OBJS_ANALYSIS := $(SRCS_ANALYSIS:.cxx=.o)
b7c8eec1 69
70PARFILE = $(PACKAGE).par
71
379c06ec 72
c52c2132 73lib$(PACKAGE).so: $(OBJS_ANALYSIS)
379c06ec 74 @echo "Linking" $@ ...
75 @/bin/rm -f $@
8bfe3849 76ifeq ($(PLATFORM),macosx)
77 $(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@ $(PACKLDFLAGS) $(EXPLLINKLIBS)
78else
79 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(PACKLDFLAGS) $(EXPLLINKLIBS)
80endif
379c06ec 81 @chmod a+x $@
82 @echo "done"
83
84%.o: %.cxx %.h
c16bb9ed 85 $(CXX) $(CXXFLAGS) $(PACKCXXFLAGS) -c $< -o $@
379c06ec 86
87clean:
c52c2132 88 @rm -f $(OBJS_ANALYSIS) *.so G__$(PACKAGE).* $(PARFILE)
379c06ec 89
90G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS) $(DHDR)
91 @echo "Generating dictionary ..."
3f4f3116 92 rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^
379c06ec 93
b7c8eec1 94### CREATE PAR FILE
95
84d4333f 96$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_ANALYSIS) $(SRCS_ANALYSIS) $(DHDR_ANALYSIS) Makefile Makefile.arch PROOF-INF))
b7c8eec1 97 @echo "Creating archive" $@ ...
98 @tar cfzh $@ $(PACKAGE)
99 @rm -rf $(PACKAGE)
100 @echo "done"
101
102$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
103 @echo Copying $< to $@ with transformations
104 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
105 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
106
107$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
108 @echo Copying $< to $@
109 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
110 @cp -a $^ $@
111
112$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
113 @echo Copying $< to $@
114 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
115 @cp -a -r $^ $@
116
117$(PACKAGE)/%: %
118 @echo Copying $< to $@
119 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
120 @cp -a $< $@
121
122test-%.par: %.par
123 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
124 @mkdir -p par-tmp
125 @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
126 @rm -rf par-tmp
127 @echo "INFO: Testing succeeded (already cleaned up)"