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