]>
Commit | Line | Data |
---|---|---|
937bb49a | 1 | # $Id$ |
2 | ||
937bb49a | 3 | include $(ROOTSYS)/test/Makefile.arch |
937bb49a | 4 | |
deb133c5 | 5 | default-target: libPWG2ebye.so |
6 | ||
7 | ALICEINC = -I. | |
937bb49a | 8 | |
9 | ### define include dir for local case and par case | |
10 | ifneq ($(ALICE_ROOT),) | |
deb133c5 | 11 | ALICEINC += -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/PYTHIA6 -I$(ALICE_ROOT)/EVGEN |
937bb49a | 12 | else |
937bb49a | 13 | ifneq ($(ESD_INCLUDE),) |
14 | ALICEINC += -I../$(ESD_INCLUDE) | |
15 | endif | |
16 | endif | |
17 | ||
deb133c5 | 18 | CXXFLAGS += $(ALICEINC) -g |
19 | ||
20 | PACKAGE = PWG2ebye | |
21 | include lib$(PACKAGE).pkg | |
22 | ||
23 | DHDR_PWG2ebye := $(DHDR) | |
24 | HDRS_PWG2ebye := $(HDRS) | |
25 | SRCS_PWG2ebye := $(SRCS) G__$(PACKAGE).cxx | |
26 | OBJS_PWG2ebye := $(SRCS_PWG2ebye:.cxx=.o) | |
27 | ||
937bb49a | 28 | PARFILE = $(PACKAGE).par |
29 | ||
deb133c5 | 30 | lib$(PACKAGE).so: $(OBJS_PWG2ebye) |
937bb49a | 31 | @echo "Linking" $@ ... |
32 | @/bin/rm -f $@ | |
33 | ifeq ($(PLATFORM),macosx) | |
34 | @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@ | |
35 | else | |
deb133c5 | 36 | @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@ |
937bb49a | 37 | endif |
38 | @chmod a+x $@ | |
39 | @echo "done" | |
40 | ||
41 | %.o: %.cxx %.h | |
42 | $(CXX) $(CXXFLAGS) -c $< -o $@ | |
43 | ||
deb133c5 | 44 | G__PWG2ebye.cxx G__PWG2ebye.h: $(HDRS_PWG2ebye) $(DHDR_PWG2ebye) |
937bb49a | 45 | @echo "Generating dictionary ..." |
937bb49a | 46 | rootcint -f $@ -c $(ALICEINC) $^ |
47 | ||
deb133c5 | 48 | clean: |
49 | @rm -f $(OBJS_PWG2ebye) *.so G__PWG2ebye.* $(PARFILE) | |
50 | ||
937bb49a | 51 | ### CREATE PAR FILE |
52 | ||
deb133c5 | 53 | $(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG2ebye) $(SRCS_PWG2ebye) $(DHDR_PWG2ebye) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF)) |
937bb49a | 54 | @echo "Creating archive" $@ ... |
55 | @tar cfzh $@ $(PACKAGE) | |
56 | @rm -rf $(PACKAGE) | |
57 | @echo "done" | |
58 | ||
59 | $(PACKAGE)/Makefile: Makefile #.$(PACKAGE) | |
60 | @echo Copying $< to $@ with transformations | |
61 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) | |
62 | @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@ | |
63 | ||
64 | $(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch | |
65 | @echo Copying $< to $@ | |
66 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) | |
deb133c5 | 67 | @cp -a $^ $@ |
937bb49a | 68 | |
69 | $(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE) | |
70 | @echo Copying $< to $@ | |
71 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) | |
deb133c5 | 72 | @cp -a -r $^ $@ |
937bb49a | 73 | |
74 | $(PACKAGE)/%: % | |
75 | @echo Copying $< to $@ | |
76 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) | |
deb133c5 | 77 | @cp -a $< $@ |
937bb49a | 78 | |
79 | test-%.par: %.par | |
80 | @echo "INFO: The file $< is now tested, in case of an error check in par-tmp." | |
81 | @mkdir -p par-tmp | |
82 | @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh | |
83 | @rm -rf par-tmp | |
84 | @echo "INFO: Testing succeeded (already cleaned up)" | |
deb133c5 | 85 |