]>
Commit | Line | Data |
---|---|---|
937bb49a | 1 | # $Id$ |
2 | ||
937bb49a | 3 | include $(ROOTSYS)/test/Makefile.arch |
937bb49a | 4 | |
9c19b5fc | 5 | default-target: libPWG2.so libPWG2ebye.so libPWG0flow.so |
deb133c5 | 6 | |
7 | ALICEINC = -I. | |
937bb49a | 8 | |
9 | ### define include dir for local case and par case | |
10 | ifneq ($(ALICE_ROOT),) | |
9c19b5fc | 11 | ALICEINC += -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/PYTHIA6 -I$(ALICE_ROOT)/EVGEN -I$(ALICE_ROOT)/RAW -I$(ALICE_ROOT)/TPC |
937bb49a | 12 | else |
937bb49a | 13 | ifneq ($(ESD_INCLUDE),) |
14 | ALICEINC += -I../$(ESD_INCLUDE) | |
15 | endif | |
16 | endif | |
17 | ||
9c19b5fc | 18 | # for building of PWG0dep.par |
19 | #ifneq ($(PWG0base_INCLUDE),) | |
20 | # ALICEINC += -I../$(PWG0base_INCLUDE) | |
21 | #endif | |
22 | ||
deb133c5 | 23 | CXXFLAGS += $(ALICEINC) -g |
24 | ||
9c19b5fc | 25 | PACKAGE = PWG2 |
deb133c5 | 26 | include lib$(PACKAGE).pkg |
27 | ||
9c19b5fc | 28 | DHDR_PWG2 := $(DHDR) |
29 | HDRS_PWG2 := $(HDRS) | |
30 | SRCS_PWG2 := $(SRCS) G__$(PACKAGE).cxx | |
31 | OBJS_PWG2 := $(SRCS_PWG2:.cxx=.o) | |
deb133c5 | 32 | |
937bb49a | 33 | PARFILE = $(PACKAGE).par |
34 | ||
9c19b5fc | 35 | lib$(PACKAGE).so: $(OBJS_PWG2) |
937bb49a | 36 | @echo "Linking" $@ ... |
37 | @/bin/rm -f $@ | |
38 | ifeq ($(PLATFORM),macosx) | |
39 | @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@ | |
40 | else | |
deb133c5 | 41 | @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@ |
937bb49a | 42 | endif |
43 | @chmod a+x $@ | |
44 | @echo "done" | |
45 | ||
46 | %.o: %.cxx %.h | |
47 | $(CXX) $(CXXFLAGS) -c $< -o $@ | |
48 | ||
9c19b5fc | 49 | G__PWG2.cxx G__PWG2.h: $(HDRS_PWG2) $(DHDR_PWG2) |
937bb49a | 50 | @echo "Generating dictionary ..." |
937bb49a | 51 | rootcint -f $@ -c $(ALICEINC) $^ |
52 | ||
deb133c5 | 53 | clean: |
9c19b5fc | 54 | @rm -f $(OBJS_PWG2) $(OBJS_PWG2ebye) $(OBJS_PWG2flow) *.so G__PWG2.* G__PWG2ebye.* G__PWG2flow.* $(PARFILE) |
deb133c5 | 55 | |
937bb49a | 56 | ### CREATE PAR FILE |
57 | ||
9c19b5fc | 58 | $(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG2) $(SRCS_PWG2) $(DHDR_PWG2) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF)) |
937bb49a | 59 | @echo "Creating archive" $@ ... |
60 | @tar cfzh $@ $(PACKAGE) | |
61 | @rm -rf $(PACKAGE) | |
62 | @echo "done" | |
63 | ||
64 | $(PACKAGE)/Makefile: Makefile #.$(PACKAGE) | |
65 | @echo Copying $< to $@ with transformations | |
66 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) | |
67 | @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@ | |
68 | ||
69 | $(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch | |
70 | @echo Copying $< to $@ | |
71 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) | |
deb133c5 | 72 | @cp -a $^ $@ |
937bb49a | 73 | |
74 | $(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE) | |
75 | @echo Copying $< to $@ | |
76 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) | |
deb133c5 | 77 | @cp -a -r $^ $@ |
937bb49a | 78 | |
79 | $(PACKAGE)/%: % | |
80 | @echo Copying $< to $@ | |
81 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) | |
deb133c5 | 82 | @cp -a $< $@ |
937bb49a | 83 | |
84 | test-%.par: %.par | |
85 | @echo "INFO: The file $< is now tested, in case of an error check in par-tmp." | |
86 | @mkdir -p par-tmp | |
87 | @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh | |
88 | @rm -rf par-tmp | |
89 | @echo "INFO: Testing succeeded (already cleaned up)" | |
deb133c5 | 90 | |
9c19b5fc | 91 | ## libPWG0ebye part |
92 | include libPWG2ebye.pkg | |
93 | ||
94 | DHDR_PWG2ebye := $(DHDR) | |
95 | HDRS_PWG2ebye := $(HDRS) | |
96 | SRCS_PWG2ebye := $(SRCS) G__PWG2ebye.cxx | |
97 | OBJS_PWG2ebye := $(SRCS_PWG2ebye:.cxx=.o) | |
98 | ||
99 | libPWG2ebye.so: $(OBJS_PWG2ebye) | |
100 | @echo "Linking" $@ ... | |
101 | @/bin/rm -f $@ | |
102 | ifeq ($(PLATFORM),macosx) | |
103 | @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@ | |
104 | else | |
105 | @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@ | |
106 | endif | |
107 | @chmod a+x $@ | |
108 | @echo "done" | |
109 | ||
110 | G__PWG2ebye.cxx G__PWG2ebye.h: $(HDRS_PWG2ebye) $(DHDR_PWG2ebye) | |
111 | @echo "Generating dictionary ..." | |
112 | rootcint -f $@ -c $(ALICEINC) $^ | |
113 | ||
114 | ## libPWG2flow part | |
115 | include libPWG2flow.pkg | |
116 | ||
117 | DHDR_PWG2flow := $(DHDR) | |
118 | HDRS_PWG2flow := $(HDRS) | |
119 | SRCS_PWG2flow := $(SRCS) G__PWG2flow.cxx | |
120 | OBJS_PWG2flow := $(SRCS_PWG2flow:.cxx=.o) | |
121 | ||
122 | libPWG2flow.so: $(OBJS_PWG2flow) | |
123 | @echo "Linking" $@ ... | |
124 | @/bin/rm -f $@ | |
125 | ifeq ($(PLATFORM),macosx) | |
126 | @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@ | |
127 | else | |
128 | @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@ | |
129 | endif | |
130 | @chmod a+x $@ | |
131 | @echo "done" | |
132 | ||
133 | G__PWG2flow.cxx G__PWG2flow.h: $(HDRS_PWG2flow) $(DHDR_PWG2flow) | |
134 | @echo "Generating dictionary ..." | |
135 | rootcint -f $@ -c $(ALICEINC) $^ | |
136 |