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