Correction for bug #77355: Generation of PARs
[u/mrichter/AliRoot.git] / CORRFW / Makefile
CommitLineData
563113d0 1
2include Makefile.arch
3
4default-target: libCORRFW.so
5
6ALICEINC = -I.
7
8# add include paths from other par files
9ifneq ($(STEERBase_INCLUDE),)
10 ALICEINC += -I../$(STEERBase_INCLUDE)
11endif
12
13ifneq ($(ESD_INCLUDE),)
14 ALICEINC += -I../$(ESD_INCLUDE)
15endif
16
17ifneq ($(AOD_INCLUDE),)
18 ALICEINC += -I../$(AOD_INCLUDE)
19endif
20
21ifneq ($(ANALYSIS_INCLUDE),)
22 ALICEINC += -I../$(ANALYSIS_INCLUDE)
23endif
24
ac8a9aba 25ifneq ($(ANALYSISalice_INCLUDE),)
26ALICEINC += -I../$(ANALYSISalice_INCLUDE)
27endif
563113d0 28
29# only if no par file was loaded before
30ifeq ($(ALICEINC),-I.)
31 ifneq ($(ALICE_ROOT),)
32 ALICEINC += -I$(ALICE_ROOT)/include
33 endif
34endif
35
36CXXFLAGS += $(ALICEINC) -g
37
38PACKAGE = CORRFW
84d4333f 39
958d9d26 40SRCS = $(wildcard *.cxx)
41HDRS = $(SRCS:.cxx=.h)
42DHDR = $(PACKAGE)LinkDef.h
563113d0 43
44DHDR_CORRFW := $(DHDR)
45HDRS_CORRFW := $(HDRS)
46SRCS_CORRFW := $(SRCS) G__$(PACKAGE).cxx
47OBJS_CORRFW := $(SRCS_CORRFW:.cxx=.o)
48
49PARFILE = $(PACKAGE).par
50
51
52lib$(PACKAGE).so: $(OBJS_CORRFW)
53 @echo "Linking" $@ ...
54 @/bin/rm -f $@
10dc066e 55ifeq ($(ARCH),macosx)
563113d0 56 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
57else
58 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
59endif
60 @chmod a+x $@
61 @echo "done"
62
63%.o: %.cxx %.h
64 $(CXX) $(CXXFLAGS) $(PACKCXXFLAGS) -c $< -o $@
65
66clean:
67 @rm -f $(OBJS_CORRFW) *.so G__$(PACKAGE).* $(PARFILE)
68
69G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS) $(DHDR)
70 @echo "Generating dictionary ..."
71 rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^
72
73### CREATE PAR FILE
74
84d4333f 75$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_CORRFW) $(SRCS_CORRFW) $(DHDR_CORRFW) Makefile Makefile.arch PROOF-INF))
563113d0 76 @echo "Creating archive" $@ ...
77 @tar cfzh $@ $(PACKAGE)
78 @rm -rf $(PACKAGE)
79 @echo "done"
80
81$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
82 @echo Copying $< to $@ with transformations
83 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
84 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
85
86$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
87 @echo Copying $< to $@
88 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
89 @cp -a $^ $@
90
91$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
92 @echo Copying $< to $@
93 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
94 @cp -a -r $^ $@
95
96$(PACKAGE)/%: %
97 @echo Copying $< to $@
98 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
99 @cp -a $< $@
100
101test-%.par: %.par
102 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
103 @mkdir -p par-tmp
104 @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
105 @rm -rf par-tmp
106 @echo "INFO: Testing succeeded (already cleaned up)"