]>
Commit | Line | Data |
---|---|---|
937bb49a | 1 | # $Id$ |
2 | ||
937bb49a | 3 | include $(ROOTSYS)/test/Makefile.arch |
937bb49a | 4 | |
378d0357 | 5 | PACKAGE = PWG2 |
6 | ||
7 | default-target: lib$(PACKAGE).so | |
deb133c5 | 8 | |
9 | ALICEINC = -I. | |
937bb49a | 10 | |
11 | ### define include dir for local case and par case | |
378d0357 | 12 | ifneq ($(STEERBase_INCLUDE),) |
13 | ALICEINC += -I../$(STEERBase_INCLUDE) | |
14 | endif | |
15 | ||
16 | ifneq ($(ESD_INCLUDE),) | |
17 | ALICEINC += -I../$(ESD_INCLUDE) | |
18 | endif | |
19 | ||
20 | ifneq ($(AOD_INCLUDE),) | |
21 | ALICEINC += -I../$(AOD_INCLUDE) | |
22 | endif | |
23 | ||
aad44575 | 24 | ifneq ($(ANALYSIS_INCLUDE),) |
25 | ALICEINC += -I../$(ANALYSIS_INCLUDE) | |
26 | endif | |
27 | ||
aca22c05 | 28 | ifneq ($(ANALYSISalice_INCLUDE),) |
29 | ALICEINC += -I../$(ANALYSISalice_INCLUDE) | |
30 | endif | |
31 | ||
aad44575 | 32 | ifneq ($(PWG2AOD_INCLUDE),) |
33 | ALICEINC += -I../$(PWG2AOD_INCLUDE) | |
34 | endif | |
35 | ||
36 | ifneq ($(PWG2femtoscopy_INCLUDE),) | |
37 | ALICEINC += -I../$(PWG2femtoscopy_INCLUDE) | |
38 | endif | |
39 | ||
378d0357 | 40 | # only if no par file was loaded before |
41 | ifeq ($(ALICEINC),-I.) | |
42 | ifneq ($(ALICE_ROOT),) | |
43 | ALICEINC += -I$(ALICE_ROOT)/include | |
937bb49a | 44 | endif |
45 | endif | |
46 | ||
9c19b5fc | 47 | # for building of PWG0dep.par |
48 | #ifneq ($(PWG0base_INCLUDE),) | |
49 | # ALICEINC += -I../$(PWG0base_INCLUDE) | |
50 | #endif | |
51 | ||
378d0357 | 52 | CXXFLAGS += $(ALICEINC) -g |
aad44575 | 53 | F77FLAGS += $(ALICEINC) -g -fPIC |
4c166e18 | 54 | |
378d0357 | 55 | #ALICEINC += -IFEMTOSCOPY/AliFemto -IANALYSIS -IFEMTOSCOPY/AliFemtoUser |
deb133c5 | 56 | |
deb133c5 | 57 | include lib$(PACKAGE).pkg |
58 | ||
9c19b5fc | 59 | DHDR_PWG2 := $(DHDR) |
60 | HDRS_PWG2 := $(HDRS) | |
61 | SRCS_PWG2 := $(SRCS) G__$(PACKAGE).cxx | |
aad44575 | 62 | FSCRS_PWG2 := $(FSRCS) |
63 | OBJS_PWG2 := $(SRCS_PWG2:.cxx=.o) $(FSRCS:.F=.o) | |
deb133c5 | 64 | |
937bb49a | 65 | PARFILE = $(PACKAGE).par |
66 | ||
9c19b5fc | 67 | lib$(PACKAGE).so: $(OBJS_PWG2) |
937bb49a | 68 | @echo "Linking" $@ ... |
69 | @/bin/rm -f $@ | |
10dc066e | 70 | ifeq ($(ARCH),macosx) |
937bb49a | 71 | @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@ |
72 | else | |
deb133c5 | 73 | @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@ |
937bb49a | 74 | endif |
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 | 84 | G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS_PWG2) $(DHDR_PWG2) |
937bb49a | 85 | @echo "Generating dictionary ..." |
378d0357 | 86 | rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^ |
937bb49a | 87 | |
deb133c5 | 88 | clean: |
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 | |
119 | test-%.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)" |