Adding comments (Laurent)
[u/mrichter/AliRoot.git] / PWG2 / Makefile
CommitLineData
937bb49a 1# $Id$
2
937bb49a 3include $(ROOTSYS)/test/Makefile.arch
937bb49a 4
a705009a 5default-target: libPWG2.so libPWG2ebye.so libPWG2flow.so libPWG2femtoscopy.so libPWG2femtoscopyUser.so
deb133c5 6
7ALICEINC = -I.
937bb49a 8
9### define include dir for local case and par case
10ifneq ($(ALICE_ROOT),)
9c19b5fc 11 ALICEINC += -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/PYTHIA6 -I$(ALICE_ROOT)/EVGEN -I$(ALICE_ROOT)/RAW -I$(ALICE_ROOT)/TPC
937bb49a 12else
937bb49a 13 ifneq ($(ESD_INCLUDE),)
14 ALICEINC += -I../$(ESD_INCLUDE)
15 endif
16endif
17
9c19b5fc 18# for building of PWG0dep.par
19#ifneq ($(PWG0base_INCLUDE),)
20# ALICEINC += -I../$(PWG0base_INCLUDE)
21#endif
22
4c166e18 23CXXFLAGS += $(ALICEINC) -g -IFEMTOSCOPY/AliFemto -IFEMTOSCOPY/AliFemto/Base -IFEMTOSCOPY/AliFemto/Infrastructure -IFEMTOSCOPY/AliFemtoUser
24
25ALICEINC += -IFEMTOSCOPY/AliFemto -IFEMTOSCOPY/AliFemto/Base -IFEMTOSCOPY/AliFemto/Infrastructure -IFEMTOSCOPY/AliFemtoUser
deb133c5 26
9c19b5fc 27PACKAGE = PWG2
deb133c5 28include lib$(PACKAGE).pkg
29
9c19b5fc 30DHDR_PWG2 := $(DHDR)
31HDRS_PWG2 := $(HDRS)
32SRCS_PWG2 := $(SRCS) G__$(PACKAGE).cxx
33OBJS_PWG2 := $(SRCS_PWG2:.cxx=.o)
deb133c5 34
937bb49a 35PARFILE = $(PACKAGE).par
36
9c19b5fc 37lib$(PACKAGE).so: $(OBJS_PWG2)
937bb49a 38 @echo "Linking" $@ ...
39 @/bin/rm -f $@
40ifeq ($(PLATFORM),macosx)
41 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
42else
deb133c5 43 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
937bb49a 44endif
45 @chmod a+x $@
46 @echo "done"
47
48%.o: %.cxx %.h
49 $(CXX) $(CXXFLAGS) -c $< -o $@
50
9c19b5fc 51G__PWG2.cxx G__PWG2.h: $(HDRS_PWG2) $(DHDR_PWG2)
937bb49a 52 @echo "Generating dictionary ..."
937bb49a 53 rootcint -f $@ -c $(ALICEINC) $^
54
deb133c5 55clean:
4c166e18 56 @rm -f $(OBJS_PWG2) $(OBJS_PWG2ebye) $(OBJS_PWG2flow) $(OBJS_PWG2femtoscopy) *.so G__PWG2.* G__PWG2ebye.* G__PWG2flow.* G__PWG2femtoscopy.* $(PARFILE)
deb133c5 57
937bb49a 58### CREATE PAR FILE
59
9c19b5fc 60$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG2) $(SRCS_PWG2) $(DHDR_PWG2) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF))
937bb49a 61 @echo "Creating archive" $@ ...
62 @tar cfzh $@ $(PACKAGE)
63 @rm -rf $(PACKAGE)
64 @echo "done"
65
66$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
67 @echo Copying $< to $@ with transformations
68 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
69 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
70
71$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
72 @echo Copying $< to $@
73 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
deb133c5 74 @cp -a $^ $@
937bb49a 75
76$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
77 @echo Copying $< to $@
78 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
deb133c5 79 @cp -a -r $^ $@
937bb49a 80
81$(PACKAGE)/%: %
82 @echo Copying $< to $@
83 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
deb133c5 84 @cp -a $< $@
937bb49a 85
86test-%.par: %.par
87 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
88 @mkdir -p par-tmp
89 @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
90 @rm -rf par-tmp
91 @echo "INFO: Testing succeeded (already cleaned up)"
deb133c5 92
9c19b5fc 93## libPWG0ebye part
94include libPWG2ebye.pkg
95
96DHDR_PWG2ebye := $(DHDR)
97HDRS_PWG2ebye := $(HDRS)
98SRCS_PWG2ebye := $(SRCS) G__PWG2ebye.cxx
99OBJS_PWG2ebye := $(SRCS_PWG2ebye:.cxx=.o)
100
101libPWG2ebye.so: $(OBJS_PWG2ebye)
102 @echo "Linking" $@ ...
103 @/bin/rm -f $@
104ifeq ($(PLATFORM),macosx)
105 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
106else
107 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
108endif
109 @chmod a+x $@
110 @echo "done"
111
112G__PWG2ebye.cxx G__PWG2ebye.h: $(HDRS_PWG2ebye) $(DHDR_PWG2ebye)
113 @echo "Generating dictionary ..."
114 rootcint -f $@ -c $(ALICEINC) $^
115
116## libPWG2flow part
117include libPWG2flow.pkg
118
119DHDR_PWG2flow := $(DHDR)
120HDRS_PWG2flow := $(HDRS)
121SRCS_PWG2flow := $(SRCS) G__PWG2flow.cxx
122OBJS_PWG2flow := $(SRCS_PWG2flow:.cxx=.o)
123
124libPWG2flow.so: $(OBJS_PWG2flow)
125 @echo "Linking" $@ ...
126 @/bin/rm -f $@
127ifeq ($(PLATFORM),macosx)
128 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
129else
130 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
131endif
132 @chmod a+x $@
133 @echo "done"
134
135G__PWG2flow.cxx G__PWG2flow.h: $(HDRS_PWG2flow) $(DHDR_PWG2flow)
136 @echo "Generating dictionary ..."
137 rootcint -f $@ -c $(ALICEINC) $^
138
4c166e18 139
140## libPWG2femtoscopy part
141include libPWG2femtoscopy.pkg
142
143DHDR_PWG2femtoscopy := $(DHDR)
144HDRS_PWG2femtoscopy := $(HDRS)
145SRCS_PWG2femtoscopy := $(SRCS) G__PWG2femtoscopy.cxx
146OBJS_PWG2femtoscopy := $(SRCS_PWG2femtoscopy:.cxx=.o)
147
148libPWG2femtoscopy.so: $(OBJS_PWG2femtoscopy)
149 @echo "Linking" $@ ...
150 @/bin/rm -f $@
151ifeq ($(PLATFORM),macosx)
152 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
153else
154 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
155endif
156 @chmod a+x $@
157 @echo "done"
158
159G__PWG2femtoscopy.cxx G__PWG2femtoscopy.h: $(HDRS_PWG2femtoscopy) $(DHDR_PWG2femtoscopy)
160 @echo "Generating dictionary ..."
161 rootcint -f $@ -c $(ALICEINC) $^
162
a705009a 163## libPWG2femtoscopyUser part
164include libPWG2femtoscopyUser.pkg
165
166DHDR_PWG2femtoscopyUser := $(DHDR)
167HDRS_PWG2femtoscopyUser := $(HDRS)
168SRCS_PWG2femtoscopyUser := $(SRCS) G__PWG2femtoscopyUser.cxx
169OBJS_PWG2femtoscopyUser := $(SRCS_PWG2femtoscopyUser:.cxx=.o)
170
171libPWG2femtoscopyUser.so: $(OBJS_PWG2femtoscopyUser)
172 @echo "Linking" $@ ...
173 @/bin/rm -f $@
174ifeq ($(PLATFORM),macosx)
175 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
176else
177 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
178endif
179 @chmod a+x $@
180 @echo "done"
181
182G__PWG2femtoscopyUser.cxx G__PWG2femtoscopyUser.h: $(HDRS_PWG2femtoscopyUser) $(DHDR_PWG2femtoscopyUser)
183 @echo "Generating dictionary ..."
184 rootcint -f $@ -c $(ALICEINC) $^
185