Added some more scripts
[u/mrichter/AliRoot.git] / PWG3 / Makefile
CommitLineData
c40ad03f 1# $Id$
2
1ea49eed 3include $(ROOTSYS)/test/Makefile.arch
c40ad03f 4
0539bffb 5default-target: libPWG3base.so libPWG3muon.so libPWG3muondep.so libPWG3vertexingHF.so libPWG3hfe.so libPWG3dielectron.so
c40ad03f 6
7ALICEINC = -I.
8
9### define include dir for local case and par case
10ifneq ($(ESD_INCLUDE),)
11 ALICEINC += -I../$(ESD_INCLUDE)
12 ifneq ($(STEERBase_INCLUDE),)
13 ALICEINC += -I../$(STEERBase_INCLUDE)
14 endif
15 ifneq ($(AOD_INCLUDE),)
16 ALICEINC += -I../$(AOD_INCLUDE)
17 endif
18 ifneq ($(ANALYSIS_INCLUDE),)
19 ALICEINC += -I../$(ANALYSIS_INCLUDE)
20 endif
57b8dffb 21 ifneq ($(ANALYSISalice_INCLUDE),)
22 ALICEINC += -I../$(ANALYSISalice_INCLUDE)
23 endif
b0c9efdb 24 ifneq ($(CORRFW_INCLUDE),)
25 ALICEINC += -I../$(CORRFW_INCLUDE)
26 endif
ab9bbfe5 27 ifneq ($(PWG3base_INCLUDE),)
28 ALICEINC += -I../$(PWG3base_INCLUDE)
29 endif
c40ad03f 30else
31 ifneq ($(ALICE_ROOT),)
7f57715e 32 ALICEINC += -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/PWG3/base -I$(ALICE_ROOT)/MUON -I$(ALICE_ROOT)/MUON/mapping
c40ad03f 33else
34 endif
35endif
36
37CXXFLAGS += $(ALICEINC) -g
38
e8fd9be7 39PACKAGE = PWG3
c40ad03f 40include lib$(PACKAGE).pkg
41
e8fd9be7 42DHDR_PWG3 := $(DHDR)
43HDRS_PWG3 := $(HDRS)
44SRCS_PWG3 := $(SRCS) G__$(PACKAGE).cxx
45OBJS_PWG3 := $(SRCS_PWG3:.cxx=.o)
c40ad03f 46
47PARFILE = $(PACKAGE).par
48
e8fd9be7 49lib$(PACKAGE).so: $(OBJS_PWG3)
c40ad03f 50 @echo "Linking" $@ ...
51 @/bin/rm -f $@
10dc066e 52ifeq ($(ARCH),macosx)
c40ad03f 53 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
54else
55 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
56endif
57 @chmod a+x $@
58 @echo "done"
59
60%.o: %.cxx %.h
61 $(CXX) $(CXXFLAGS) -c $< -o $@
62
e8fd9be7 63G__PWG3.cxx G__PWG3.h: $(HDRS_PWG3) $(DHDR_PWG3)
c40ad03f 64 @echo "Generating dictionary ..."
65 rootcint -f $@ -c $(ALICEINC) $^
66
67clean:
e8fd9be7 68 @rm -f $(OBJS_PWG3) *.so G__PWG3.* $(PARFILE)
c40ad03f 69
70### CREATE PAR FILE
71
e8fd9be7 72$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG3) $(SRCS_PWG3) $(DHDR_PWG3) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF))
c40ad03f 73 @echo "Creating archive" $@ ...
74 @tar cfzh $@ $(PACKAGE)
75 @rm -rf $(PACKAGE)
76 @echo "done"
77
78$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
79 @echo Copying $< to $@ with transformations
80 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
81 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
82
83$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
84 @echo Copying $< to $@
85 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
86 @cp -a $^ $@
87
88$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
89 @echo Copying $< to $@
90 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
91 @cp -a -r $^ $@
92
93$(PACKAGE)/%: %
94 @echo Copying $< to $@
95 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
96 @cp -a $< $@
97
98test-%.par: %.par
99 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
100 @mkdir -p par-tmp
101 @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
102 @rm -rf par-tmp
103 @echo "INFO: Testing succeeded (already cleaned up)"
104
e8fd9be7 105## libPWG3base part
106##include libPWG3base.pkg
107
108DHDR_PWG3base := $(DHDR)
109HDRS_PWG3base := $(HDRS)
110SRCS_PWG3base := $(SRCS) G__PWG3base.cxx
111OBJS_PWG3base := $(SRCS_PWG3base:.cxx=.o)
112
113libPWG3base.so: $(OBJS_PWG3base)
114 @echo "Linking" $@ ...
115 @/bin/rm -f $@
116ifeq ($(ARCH),macosx)
117 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
118else
119 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
120endif
121 @chmod a+x $@
122 @echo "done"
123
124G__PWG3base.cxx G__PWG3base.h: $(HDRS_PWG3base) $(DHDR_PWG3base)
125 @echo "Generating dictionary ..."
126 rootcint -f $@ -c $(ALICEINC) $^
127
128
129## libPWG3muon part
130##include libPWG3muon.pkg
131
132DHDR_PWG3muon := $(DHDR)
133HDRS_PWG3muon := $(HDRS)
134SRCS_PWG3muon := $(SRCS) G__PWG3muon.cxx
135OBJS_PWG3muon := $(SRCS_PWG3muon:.cxx=.o)
136
137libPWG3muon.so: $(OBJS_PWG3muon)
138 @echo "Linking" $@ ...
139 @/bin/rm -f $@
140ifeq ($(ARCH),macosx)
141 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
142else
143 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
144endif
145 @chmod a+x $@
146 @echo "done"
147
148G__PWG3muon.cxx G__PWG3muon.h: $(HDRS_PWG3muon) $(DHDR_PWG3muon)
149 @echo "Generating dictionary ..."
150 rootcint -f $@ -c $(ALICEINC) $^
151
128a8042 152## libPWG3muondep part
153##include libPWG3muondep.pkg
154
155DHDR_PWG3muondep := $(DHDR)
156HDRS_PWG3muondep := $(HDRS)
157SRCS_PWG3muondep := $(SRCS) G__PWG3muondep.cxx
158OBJS_PWG3muondep := $(SRCS_PWG3muondep:.cxx=.o)
159
160libPWG3muondep.so: $(OBJS_PWG3muondep)
161 @echo "Linking" $@ ...
162 @/bin/rm -f $@
163ifeq ($(ARCH),macosx)
164 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
165else
166 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
167endif
168 @chmod a+x $@
169 @echo "done"
170
171G__PWG3muondep.cxx G__PWG3muondep.h: $(HDRS_PWG3muondep) $(DHDR_PWG3muondep)
172 @echo "Generating dictionary ..."
173 rootcint -f $@ -c $(ALICEINC) $^
174
e8fd9be7 175## libPWG3vertexingHF part
176##include libPWG3vertexingHF.pkg
177
178DHDR_PWG3vertexingHF := $(DHDR)
179HDRS_PWG3vertexingHF := $(HDRS)
180SRCS_PWG3vertexingHF := $(SRCS) G__PWG3vertexingHF.cxx
181OBJS_PWG3vertexingHF := $(SRCS_PWG3vertexingHF:.cxx=.o)
182
183libPWG3vertexingHF.so: $(OBJS_PWG3vertexingHF)
184 @echo "Linking" $@ ...
185 @/bin/rm -f $@
186ifeq ($(ARCH),macosx)
187 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
188else
189 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
190endif
191 @chmod a+x $@
192 @echo "done"
193
194G__PWG3vertexingHF.cxx G__PWG3vertexingHF.h: $(HDRS_PWG3vertexingHF) $(DHDR_PWG3vertexingHF)
195 @echo "Generating dictionary ..."
196 rootcint -f $@ -c $(ALICEINC) $^
197
8324a835 198
199## libPWG3hfe part
200##include libPWG3hfe.pkg
201
202DHDR_PWG3hfe := $(DHDR)
203HDRS_PWG3hfe := $(HDRS)
204SRCS_PWG3hfe := $(SRCS) G__PWG3hfe.cxx
205OBJS_PWG3hfe := $(SRCS_PWG3hfe:.cxx=.o)
206
207libPWG3hfe.so: $(OBJS_PWG3hfe)
208 @echo "Linking" $@ ...
209 @/bin/rm -f $@
210ifeq ($(ARCH),macosx)
211 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
212else
213 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
214endif
215 @chmod a+x $@
216 @echo "done"
217
218G__PWG3hfe.cxx G__PWG3hfe.h: $(HDRS_PWG3hfe) $(DHDR_PWG3hfe)
219 @echo "Generating dictionary ..."
220 rootcint -f $@ -c $(ALICEINC) $^
221
0539bffb 222## libPWG3dielectron part
223##include libPWG3dielectron.pkg
224
225DHDR_PWG3dielectron := $(DHDR)
226HDRS_PWG3dielectron := $(HDRS)
227SRCS_PWG3dielectron := $(SRCS) G__PWG3dielectron.cxx
228OBJS_PWG3dielectron := $(SRCS_PWG3dielectron:.cxx=.o)
229
230libPWG3dielectron.so: $(OBJS_PWG3dielectron)
231 @echo "Linking" $@ ...
232 @/bin/rm -f $@
233ifeq ($(ARCH),macosx)
234 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
235else
236 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
237endif
238 @chmod a+x $@
239 @echo "done"
240
241G__PWG3dielectron.cxx G__PWG3dielectron.h: $(HDRS_PWG3dielectron) $(DHDR_PWG3dielectron)
242 @echo "Generating dictionary ..."
243 rootcint -f $@ -c $(ALICEINC) $^