]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/Makefile
Package upgrade.
[u/mrichter/AliRoot.git] / PWG2 / Makefile
CommitLineData
937bb49a 1# $Id$
2
937bb49a 3include $(ROOTSYS)/test/Makefile.arch
937bb49a 4
378d0357 5PACKAGE = PWG2
6
7default-target: lib$(PACKAGE).so
deb133c5 8
9ALICEINC = -I.
937bb49a 10
11### define include dir for local case and par case
378d0357 12ifneq ($(STEERBase_INCLUDE),)
13 ALICEINC += -I../$(STEERBase_INCLUDE)
14endif
15
16ifneq ($(ESD_INCLUDE),)
17 ALICEINC += -I../$(ESD_INCLUDE)
18endif
19
20ifneq ($(AOD_INCLUDE),)
21 ALICEINC += -I../$(AOD_INCLUDE)
22endif
23
aad44575 24ifneq ($(ANALYSIS_INCLUDE),)
25 ALICEINC += -I../$(ANALYSIS_INCLUDE)
26endif
27
aca22c05 28ifneq ($(ANALYSISalice_INCLUDE),)
29 ALICEINC += -I../$(ANALYSISalice_INCLUDE)
30endif
31
aad44575 32ifneq ($(PWG2AOD_INCLUDE),)
33 ALICEINC += -I../$(PWG2AOD_INCLUDE)
34endif
35
36ifneq ($(PWG2femtoscopy_INCLUDE),)
37 ALICEINC += -I../$(PWG2femtoscopy_INCLUDE)
38endif
39
378d0357 40# only if no par file was loaded before
41ifeq ($(ALICEINC),-I.)
42 ifneq ($(ALICE_ROOT),)
43 ALICEINC += -I$(ALICE_ROOT)/include
937bb49a 44 endif
45endif
46
9c19b5fc 47# for building of PWG0dep.par
48#ifneq ($(PWG0base_INCLUDE),)
49# ALICEINC += -I../$(PWG0base_INCLUDE)
50#endif
51
378d0357 52CXXFLAGS += $(ALICEINC) -g
aad44575 53F77FLAGS += $(ALICEINC) -g -fPIC
4c166e18 54
378d0357 55#ALICEINC += -IFEMTOSCOPY/AliFemto -IANALYSIS -IFEMTOSCOPY/AliFemtoUser
deb133c5 56
deb133c5 57include lib$(PACKAGE).pkg
58
9c19b5fc 59DHDR_PWG2 := $(DHDR)
60HDRS_PWG2 := $(HDRS)
61SRCS_PWG2 := $(SRCS) G__$(PACKAGE).cxx
aad44575 62FSCRS_PWG2 := $(FSRCS)
63OBJS_PWG2 := $(SRCS_PWG2:.cxx=.o) $(FSRCS:.F=.o)
deb133c5 64
937bb49a 65PARFILE = $(PACKAGE).par
66
9c19b5fc 67lib$(PACKAGE).so: $(OBJS_PWG2)
937bb49a 68 @echo "Linking" $@ ...
69 @/bin/rm -f $@
10dc066e 70ifeq ($(ARCH),macosx)
937bb49a 71 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
72else
deb133c5 73 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
937bb49a 74endif
75 @chmod a+x $@
76 @echo "done"
77
78%.o: %.cxx %.h
79 $(CXX) $(CXXFLAGS) -c $< -o $@
80
aad44575 81%.o: %.F
82 $(F77) $(F77FLAGS) -c $< -o $@
83
378d0357 84G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS_PWG2) $(DHDR_PWG2)
937bb49a 85 @echo "Generating dictionary ..."
378d0357 86 rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^
937bb49a 87
deb133c5 88clean:
378d0357 89 @rm -f $(OBJS_PWG2) *.so G__$(PACKAGE).* $(PARFILE)
deb133c5 90
937bb49a 91### CREATE PAR FILE
92
9c19b5fc 93$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG2) $(SRCS_PWG2) $(DHDR_PWG2) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF))
937bb49a 94 @echo "Creating archive" $@ ...
95 @tar cfzh $@ $(PACKAGE)
96 @rm -rf $(PACKAGE)
97 @echo "done"
98
99$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
100 @echo Copying $< to $@ with transformations
101 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
102 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
103
104$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
105 @echo Copying $< to $@
106 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
deb133c5 107 @cp -a $^ $@
937bb49a 108
109$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
110 @echo Copying $< to $@
111 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
deb133c5 112 @cp -a -r $^ $@
937bb49a 113
114$(PACKAGE)/%: %
115 @echo Copying $< to $@
116 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
deb133c5 117 @cp -a $< $@
937bb49a 118
119test-%.par: %.par
120 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
121 @mkdir -p par-tmp
122 @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
123 @rm -rf par-tmp
124 @echo "INFO: Testing succeeded (already cleaned up)"