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