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