TPC only cut modification
[u/mrichter/AliRoot.git] / PWG0 / Makefile
CommitLineData
dc740de4 1# $Id$
2
f7a4a0ca 3include Makefile.arch
99326024 4
f2f977f4 5default-target: libPWG0base.so libPWG0dep.so libPWG0selectors.so
6
7ALICEINC = -I.
99326024 8
d4fe2555 9### define include dir for local case and par case
f7a4a0ca 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
bb87cd4b 21 ifneq ($(ANALYSISalice_INCLUDE),)
22 ALICEINC += -I../$(ANALYSISalice_INCLUDE)
23 endif
f7a4a0ca 24else
25 ifneq ($(ALICE_ROOT),)
26 ALICEINC += -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/PYTHIA6 -I$(ALICE_ROOT)/EVGEN -I$(ALICE_ROOT)/RAW -I$(ALICE_ROOT)/TPC
d4fe2555 27else
d4fe2555 28 endif
29endif
99326024 30
7229e085 31# for building of PWG0dep.par
32ifneq ($(PWG0base_INCLUDE),)
33 ALICEINC += -I../$(PWG0base_INCLUDE)
34endif
35
16e24ca3 36CXXFLAGS += $(ALICEINC) -g
f2f977f4 37
38PACKAGE = PWG0base
39include lib$(PACKAGE).pkg
40
41DHDR_PWG0base := $(DHDR)
42HDRS_PWG0base := $(HDRS)
43SRCS_PWG0base := $(SRCS) G__$(PACKAGE).cxx
44OBJS_PWG0base := $(SRCS_PWG0base:.cxx=.o)
45
d4fe2555 46PARFILE = $(PACKAGE).par
47
f2f977f4 48lib$(PACKAGE).so: $(OBJS_PWG0base)
d4fe2555 49 @echo "Linking" $@ ...
50 @/bin/rm -f $@
10dc066e 51ifeq ($(ARCH),macosx)
d4fe2555 52 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
99326024 53else
f2f977f4 54 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
99326024 55endif
d4fe2555 56 @chmod a+x $@
99326024 57 @echo "done"
58
59%.o: %.cxx %.h
60 $(CXX) $(CXXFLAGS) -c $< -o $@
61
f2f977f4 62G__PWG0base.cxx G__PWG0base.h: $(HDRS_PWG0base) $(DHDR_PWG0base)
99326024 63 @echo "Generating dictionary ..."
99326024 64 rootcint -f $@ -c $(ALICEINC) $^
d4fe2555 65
f2f977f4 66clean:
67 @rm -f $(OBJS_PWG0base) $(OBJS_PWG0dep) $(OBJS_PWG0selectors) *.so G__PWG0base.* G__PWG0dep.* G__PWG0selectors.* $(PARFILE)
68
d4fe2555 69### CREATE PAR FILE
70
f2f977f4 71$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG0base) $(SRCS_PWG0base) $(DHDR_PWG0base) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF))
d4fe2555 72 @echo "Creating archive" $@ ...
73 @tar cfzh $@ $(PACKAGE)
74 @rm -rf $(PACKAGE)
75 @echo "done"
76
77$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
78 @echo Copying $< to $@ with transformations
79 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
80 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
81
82$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
83 @echo Copying $< to $@
84 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
0ab29cfa 85 @cp -a $^ $@
d4fe2555 86
87$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
88 @echo Copying $< to $@
89 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
0ab29cfa 90 @cp -a -r $^ $@
d4fe2555 91
92$(PACKAGE)/%: %
93 @echo Copying $< to $@
94 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
0ab29cfa 95 @cp -a $< $@
d4fe2555 96
97test-%.par: %.par
98 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
99 @mkdir -p par-tmp
100 @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
101 @rm -rf par-tmp
102 @echo "INFO: Testing succeeded (already cleaned up)"
f2f977f4 103
104## libPWG0dep part
105include libPWG0dep.pkg
106
107DHDR_PWG0dep := $(DHDR)
108HDRS_PWG0dep := $(HDRS)
109SRCS_PWG0dep := $(SRCS) G__PWG0dep.cxx
110OBJS_PWG0dep := $(SRCS_PWG0dep:.cxx=.o)
111
112libPWG0dep.so: $(OBJS_PWG0dep)
113 @echo "Linking" $@ ...
114 @/bin/rm -f $@
10dc066e 115ifeq ($(ARCH),macosx)
f2f977f4 116 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
117else
118 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
119endif
120 @chmod a+x $@
121 @echo "done"
122
123G__PWG0dep.cxx G__PWG0dep.h: $(HDRS_PWG0dep) $(DHDR_PWG0dep)
124 @echo "Generating dictionary ..."
125 rootcint -f $@ -c $(ALICEINC) $^
126
127## libPWG0selectors part
128include libPWG0selectors.pkg
129
130DHDR_PWG0selectors := $(DHDR)
131HDRS_PWG0selectors := $(HDRS)
132SRCS_PWG0selectors := $(SRCS) G__PWG0selectors.cxx
133OBJS_PWG0selectors := $(SRCS_PWG0selectors:.cxx=.o)
134
135libPWG0selectors.so: $(OBJS_PWG0selectors)
136 @echo "Linking" $@ ...
137 @/bin/rm -f $@
10dc066e 138ifeq ($(ARCH),macosx)
f2f977f4 139 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
140else
141 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
142endif
143 @chmod a+x $@
144 @echo "done"
145
146G__PWG0selectors.cxx G__PWG0selectors.h: $(HDRS_PWG0selectors) $(DHDR_PWG0selectors)
147 @echo "Generating dictionary ..."
148 rootcint -f $@ -c $(ALICEINC) $^
149