]>
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 | ||
28 | ifneq ($(PWG2AOD_INCLUDE),) | |
29 | ALICEINC += -I../$(PWG2AOD_INCLUDE) | |
30 | endif | |
31 | ||
32 | ifneq ($(PWG2femtoscopy_INCLUDE),) | |
33 | ALICEINC += -I../$(PWG2femtoscopy_INCLUDE) | |
34 | endif | |
35 | ||
378d0357 | 36 | # only if no par file was loaded before |
37 | ifeq ($(ALICEINC),-I.) | |
38 | ifneq ($(ALICE_ROOT),) | |
39 | ALICEINC += -I$(ALICE_ROOT)/include | |
937bb49a | 40 | endif |
41 | endif | |
42 | ||
9c19b5fc | 43 | # for building of PWG0dep.par |
44 | #ifneq ($(PWG0base_INCLUDE),) | |
45 | # ALICEINC += -I../$(PWG0base_INCLUDE) | |
46 | #endif | |
47 | ||
378d0357 | 48 | CXXFLAGS += $(ALICEINC) -g |
aad44575 | 49 | F77FLAGS += $(ALICEINC) -g -fPIC |
4c166e18 | 50 | |
378d0357 | 51 | #ALICEINC += -IFEMTOSCOPY/AliFemto -IANALYSIS -IFEMTOSCOPY/AliFemtoUser |
deb133c5 | 52 | |
deb133c5 | 53 | include lib$(PACKAGE).pkg |
54 | ||
9c19b5fc | 55 | DHDR_PWG2 := $(DHDR) |
56 | HDRS_PWG2 := $(HDRS) | |
57 | SRCS_PWG2 := $(SRCS) G__$(PACKAGE).cxx | |
aad44575 | 58 | FSCRS_PWG2 := $(FSRCS) |
59 | OBJS_PWG2 := $(SRCS_PWG2:.cxx=.o) $(FSRCS:.F=.o) | |
deb133c5 | 60 | |
937bb49a | 61 | PARFILE = $(PACKAGE).par |
62 | ||
9c19b5fc | 63 | lib$(PACKAGE).so: $(OBJS_PWG2) |
937bb49a | 64 | @echo "Linking" $@ ... |
65 | @/bin/rm -f $@ | |
10dc066e | 66 | ifeq ($(ARCH),macosx) |
937bb49a | 67 | @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@ |
68 | else | |
deb133c5 | 69 | @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@ |
937bb49a | 70 | endif |
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 | 80 | G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS_PWG2) $(DHDR_PWG2) |
937bb49a | 81 | @echo "Generating dictionary ..." |
378d0357 | 82 | rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^ |
937bb49a | 83 | |
deb133c5 | 84 | clean: |
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 | |
115 | test-%.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)" |