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