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