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