TPC only cut modification
[u/mrichter/AliRoot.git] / PWG0 / Makefile
1 # $Id$
2
3 include Makefile.arch
4
5 default-target: libPWG0base.so libPWG0dep.so libPWG0selectors.so
6
7 ALICEINC      = -I.
8
9 ### define include dir for local case and par case
10 ifneq ($(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
21         ifneq ($(ANALYSISalice_INCLUDE),)
22                 ALICEINC += -I../$(ANALYSISalice_INCLUDE)
23         endif
24 else
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
27 else
28   endif
29 endif
30
31 # for building of PWG0dep.par
32 ifneq ($(PWG0base_INCLUDE),)
33   ALICEINC += -I../$(PWG0base_INCLUDE)
34 endif
35
36 CXXFLAGS     += $(ALICEINC) -g
37
38 PACKAGE = PWG0base
39 include lib$(PACKAGE).pkg
40
41 DHDR_PWG0base := $(DHDR)
42 HDRS_PWG0base := $(HDRS)
43 SRCS_PWG0base := $(SRCS) G__$(PACKAGE).cxx
44 OBJS_PWG0base := $(SRCS_PWG0base:.cxx=.o)
45
46 PARFILE       = $(PACKAGE).par
47
48 lib$(PACKAGE).so: $(OBJS_PWG0base)
49         @echo "Linking" $@ ...
50         @/bin/rm -f $@
51 ifeq ($(ARCH),macosx)
52         @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
53 else
54         @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
55 endif
56         @chmod a+x $@
57         @echo "done"
58
59 %.o:    %.cxx %.h
60         $(CXX) $(CXXFLAGS) -c $< -o $@
61
62 G__PWG0base.cxx G__PWG0base.h: $(HDRS_PWG0base) $(DHDR_PWG0base)
63         @echo "Generating dictionary ..."
64         rootcint -f $@ -c $(ALICEINC) $^
65
66 clean:
67         @rm -f $(OBJS_PWG0base) $(OBJS_PWG0dep) $(OBJS_PWG0selectors) *.so G__PWG0base.* G__PWG0dep.* G__PWG0selectors.* $(PARFILE)
68
69 ### CREATE PAR FILE
70
71 $(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG0base) $(SRCS_PWG0base) $(DHDR_PWG0base) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF))
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 $@)
85         @cp -a $^ $@
86
87 $(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
88         @echo Copying $< to $@
89         @[ -d $(dir $@) ] || mkdir -p $(dir $@)
90         @cp -a -r $^ $@
91
92 $(PACKAGE)/%: %
93         @echo Copying $< to $@
94         @[ -d $(dir $@) ] || mkdir -p $(dir $@)
95         @cp -a $< $@
96
97 test-%.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)"
103
104 ## libPWG0dep part
105 include libPWG0dep.pkg
106
107 DHDR_PWG0dep := $(DHDR)
108 HDRS_PWG0dep := $(HDRS)
109 SRCS_PWG0dep := $(SRCS) G__PWG0dep.cxx
110 OBJS_PWG0dep := $(SRCS_PWG0dep:.cxx=.o)
111
112 libPWG0dep.so: $(OBJS_PWG0dep)
113         @echo "Linking" $@ ...
114         @/bin/rm -f $@
115 ifeq ($(ARCH),macosx)
116         @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
117 else
118         @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
119 endif
120         @chmod a+x $@
121         @echo "done"
122
123 G__PWG0dep.cxx G__PWG0dep.h: $(HDRS_PWG0dep) $(DHDR_PWG0dep)
124         @echo "Generating dictionary ..."
125         rootcint -f $@ -c $(ALICEINC) $^
126
127 ## libPWG0selectors part
128 include libPWG0selectors.pkg
129
130 DHDR_PWG0selectors := $(DHDR)
131 HDRS_PWG0selectors := $(HDRS)
132 SRCS_PWG0selectors := $(SRCS) G__PWG0selectors.cxx
133 OBJS_PWG0selectors := $(SRCS_PWG0selectors:.cxx=.o)
134
135 libPWG0selectors.so: $(OBJS_PWG0selectors)
136         @echo "Linking" $@ ...
137         @/bin/rm -f $@
138 ifeq ($(ARCH),macosx)
139         @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
140 else
141         @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
142 endif
143         @chmod a+x $@
144         @echo "done"
145
146 G__PWG0selectors.cxx G__PWG0selectors.h: $(HDRS_PWG0selectors) $(DHDR_PWG0selectors)
147         @echo "Generating dictionary ..."
148         rootcint -f $@ -c $(ALICEINC) $^
149