Changing once more (hopefully we get it correct this time...) the logic to trig the...
[u/mrichter/AliRoot.git] / PWG2 / Makefile
CommitLineData
937bb49a 1# $Id$
2
937bb49a 3include $(ROOTSYS)/test/Makefile.arch
937bb49a 4
378d0357 5PACKAGE = PWG2
6
7default-target: lib$(PACKAGE).so
deb133c5 8
9ALICEINC = -I.
937bb49a 10
11### define include dir for local case and par case
378d0357 12ifneq ($(ESD_INCLUDE),)
9d28f090 13 ALICEINC += -I../$(ESD_INCLUDE)
14 ALICEINC += -I../$(AOD_INCLUDE)
15 ALICEINC += -I../$(STEERBase_INCLUDE)
16 ALICEINC += -I../$(ANALYSIS_INCLUDE)
17 ALICEINC += -I../$(ANALYSISalice_INCLUDE)
18 else
19 ifneq ($(ALICE_ROOT),)
20 ALICEINC += -I$(ALICE_ROOT)/include
21 endif
aca22c05 22endif
23
f35b656f 24ifneq ($(CORRFW_INCLUDE),)
39f2a708 25 ALICEINC += -I../$(CORRFW_INCLUDE)
26endif
27
aad44575 28ifneq ($(PWG2AOD_INCLUDE),)
29 ALICEINC += -I../$(PWG2AOD_INCLUDE)
30endif
31
32ifneq ($(PWG2femtoscopy_INCLUDE),)
33 ALICEINC += -I../$(PWG2femtoscopy_INCLUDE)
34endif
35
9d28f090 36ifneq ($(PWG2femtoscopyUser_INCLUDE),)
37 ALICEINC += -I../$(PWG2femtoscopyUser_INCLUDE)
38endif
39
29b61d43 40ifneq ($(PWG2flowCommon_INCLUDE),)
41 ALICEINC += -I../$(PWG2flowCommon_INCLUDE)
42endif
43
44ifneq ($(PWG2flowTasks_INCLUDE),)
45 ALICEINC += -I../$(PWG2flowTasks_INCLUDE)
46endif
47
8f4eb10f 48ifneq ($(PWG2resonances_INCLUDE),)
49 ALICEINC += -I../$(PWG2resonances_INCLUDE)
50endif
51
9d28f090 52ifneq ($(PWG2unicor_INCLUDE),)
53 ALICEINC += -I../$(PWG2unicor_INCLUDE)
54endif
55
56ifneq ($(PWG2evchar_INCLUDE),)
57 ALICEINC += -I../$(PWG2evchar_INCLUDE)
58endif
59
60ifneq ($(PWG2kink_INCLUDE),)
61 ALICEINC += -I../$(PWG2kink_INCLUDE)
62endif
63
378d0357 64# only if no par file was loaded before
65ifeq ($(ALICEINC),-I.)
66 ifneq ($(ALICE_ROOT),)
67 ALICEINC += -I$(ALICE_ROOT)/include
937bb49a 68 endif
69endif
70
9c19b5fc 71# for building of PWG0dep.par
72#ifneq ($(PWG0base_INCLUDE),)
73# ALICEINC += -I../$(PWG0base_INCLUDE)
74#endif
75
378d0357 76CXXFLAGS += $(ALICEINC) -g
aad44575 77F77FLAGS += $(ALICEINC) -g -fPIC
4c166e18 78
378d0357 79#ALICEINC += -IFEMTOSCOPY/AliFemto -IANALYSIS -IFEMTOSCOPY/AliFemtoUser
deb133c5 80
deb133c5 81include lib$(PACKAGE).pkg
82
9c19b5fc 83DHDR_PWG2 := $(DHDR)
84HDRS_PWG2 := $(HDRS)
85SRCS_PWG2 := $(SRCS) G__$(PACKAGE).cxx
aad44575 86FSCRS_PWG2 := $(FSRCS)
87OBJS_PWG2 := $(SRCS_PWG2:.cxx=.o) $(FSRCS:.F=.o)
deb133c5 88
937bb49a 89PARFILE = $(PACKAGE).par
90
9c19b5fc 91lib$(PACKAGE).so: $(OBJS_PWG2)
937bb49a 92 @echo "Linking" $@ ...
93 @/bin/rm -f $@
10dc066e 94ifeq ($(ARCH),macosx)
937bb49a 95 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
96else
deb133c5 97 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
937bb49a 98endif
99 @chmod a+x $@
100 @echo "done"
101
102%.o: %.cxx %.h
103 $(CXX) $(CXXFLAGS) -c $< -o $@
104
aad44575 105%.o: %.F
106 $(F77) $(F77FLAGS) -c $< -o $@
107
378d0357 108G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS_PWG2) $(DHDR_PWG2)
937bb49a 109 @echo "Generating dictionary ..."
378d0357 110 rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^
937bb49a 111
deb133c5 112clean:
378d0357 113 @rm -f $(OBJS_PWG2) *.so G__$(PACKAGE).* $(PARFILE)
deb133c5 114
937bb49a 115### CREATE PAR FILE
116
9c19b5fc 117$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG2) $(SRCS_PWG2) $(DHDR_PWG2) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF))
937bb49a 118 @echo "Creating archive" $@ ...
119 @tar cfzh $@ $(PACKAGE)
120 @rm -rf $(PACKAGE)
121 @echo "done"
122
123$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
124 @echo Copying $< to $@ with transformations
125 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
126 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
127
128$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
129 @echo Copying $< to $@
130 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
deb133c5 131 @cp -a $^ $@
937bb49a 132
133$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
134 @echo Copying $< to $@
135 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
deb133c5 136 @cp -a -r $^ $@
937bb49a 137
138$(PACKAGE)/%: %
139 @echo Copying $< to $@
140 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
deb133c5 141 @cp -a $< $@
937bb49a 142
143test-%.par: %.par
144 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
145 @mkdir -p par-tmp
146 @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
147 @rm -rf par-tmp
148 @echo "INFO: Testing succeeded (already cleaned up)"