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