Copy constructor implemented.
[u/mrichter/AliRoot.git] / PWG0 / Makefile
CommitLineData
dc740de4 1# $Id$
2
99326024 3include $(ROOTSYS)/test/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
10ifneq ($(ALICE_ROOT),)
4aa497c5 11 ALICEINC += -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/PYTHIA6 -I$(ALICE_ROOT)/EVGEN -I$(ALICE_ROOT)/RAW -I$(ALICE_ROOT)/TPC
d4fe2555 12else
d4fe2555 13 ifneq ($(ESD_INCLUDE),)
14 ALICEINC += -I../$(ESD_INCLUDE)
15 endif
16endif
99326024 17
7229e085 18# for building of PWG0dep.par
19ifneq ($(PWG0base_INCLUDE),)
20 ALICEINC += -I../$(PWG0base_INCLUDE)
21endif
22
16e24ca3 23CXXFLAGS += $(ALICEINC) -g
f2f977f4 24
25PACKAGE = PWG0base
26include lib$(PACKAGE).pkg
27
28DHDR_PWG0base := $(DHDR)
29HDRS_PWG0base := $(HDRS)
30SRCS_PWG0base := $(SRCS) G__$(PACKAGE).cxx
31OBJS_PWG0base := $(SRCS_PWG0base:.cxx=.o)
32
d4fe2555 33PARFILE = $(PACKAGE).par
34
f2f977f4 35lib$(PACKAGE).so: $(OBJS_PWG0base)
d4fe2555 36 @echo "Linking" $@ ...
37 @/bin/rm -f $@
99326024 38ifeq ($(PLATFORM),macosx)
d4fe2555 39 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
99326024 40else
f2f977f4 41 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
99326024 42endif
d4fe2555 43 @chmod a+x $@
99326024 44 @echo "done"
45
46%.o: %.cxx %.h
47 $(CXX) $(CXXFLAGS) -c $< -o $@
48
f2f977f4 49G__PWG0base.cxx G__PWG0base.h: $(HDRS_PWG0base) $(DHDR_PWG0base)
99326024 50 @echo "Generating dictionary ..."
99326024 51 rootcint -f $@ -c $(ALICEINC) $^
d4fe2555 52
f2f977f4 53clean:
54 @rm -f $(OBJS_PWG0base) $(OBJS_PWG0dep) $(OBJS_PWG0selectors) *.so G__PWG0base.* G__PWG0dep.* G__PWG0selectors.* $(PARFILE)
55
d4fe2555 56### CREATE PAR FILE
57
f2f977f4 58$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG0base) $(SRCS_PWG0base) $(DHDR_PWG0base) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF))
d4fe2555 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 $@)
0ab29cfa 72 @cp -a $^ $@
d4fe2555 73
74$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
75 @echo Copying $< to $@
76 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
0ab29cfa 77 @cp -a -r $^ $@
d4fe2555 78
79$(PACKAGE)/%: %
80 @echo Copying $< to $@
81 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
0ab29cfa 82 @cp -a $< $@
d4fe2555 83
84test-%.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)"
f2f977f4 90
91## libPWG0dep part
92include libPWG0dep.pkg
93
94DHDR_PWG0dep := $(DHDR)
95HDRS_PWG0dep := $(HDRS)
96SRCS_PWG0dep := $(SRCS) G__PWG0dep.cxx
97OBJS_PWG0dep := $(SRCS_PWG0dep:.cxx=.o)
98
99libPWG0dep.so: $(OBJS_PWG0dep)
100 @echo "Linking" $@ ...
101 @/bin/rm -f $@
102ifeq ($(PLATFORM),macosx)
103 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
104else
105 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
106endif
107 @chmod a+x $@
108 @echo "done"
109
110G__PWG0dep.cxx G__PWG0dep.h: $(HDRS_PWG0dep) $(DHDR_PWG0dep)
111 @echo "Generating dictionary ..."
112 rootcint -f $@ -c $(ALICEINC) $^
113
114## libPWG0selectors part
115include libPWG0selectors.pkg
116
117DHDR_PWG0selectors := $(DHDR)
118HDRS_PWG0selectors := $(HDRS)
119SRCS_PWG0selectors := $(SRCS) G__PWG0selectors.cxx
120OBJS_PWG0selectors := $(SRCS_PWG0selectors:.cxx=.o)
121
122libPWG0selectors.so: $(OBJS_PWG0selectors)
123 @echo "Linking" $@ ...
124 @/bin/rm -f $@
125ifeq ($(PLATFORM),macosx)
126 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
127else
128 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
129endif
130 @chmod a+x $@
131 @echo "done"
132
133G__PWG0selectors.cxx G__PWG0selectors.h: $(HDRS_PWG0selectors) $(DHDR_PWG0selectors)
134 @echo "Generating dictionary ..."
135 rootcint -f $@ -c $(ALICEINC) $^
136