updated macros for Kaon Femto analysis
[u/mrichter/AliRoot.git] / CORRFW / Makefile
1
2 include Makefile.arch
3
4 PACKAGE = CORRFW
5
6 default-target: lib$(PACKAGE).so
7
8 ALICEINC      = -I.
9
10 # add include paths from other par files
11 ifneq ($(STEERBase_INCLUDE),)
12    ALICEINC += -I../$(STEERBase_INCLUDE)
13 endif
14
15 ifneq ($(ESD_INCLUDE),)
16    ALICEINC += -I../$(ESD_INCLUDE)
17 endif
18
19 ifneq ($(AOD_INCLUDE),)
20    ALICEINC += -I../$(AOD_INCLUDE)
21 endif
22
23 ifneq ($(ANALYSIS_INCLUDE),)
24    ALICEINC += -I../$(ANALYSIS_INCLUDE)
25 endif
26
27 ifneq ($(ANALYSISalice_INCLUDE),)
28 ALICEINC += -I../$(ANALYSISalice_INCLUDE)
29 endif
30
31 # only if no par file was loaded before
32 #ifeq ($(ALICEINC),-I.)
33   ifneq ($(ALICE_ROOT),)
34     ALICEINC += -I$(ALICE_ROOT)/include
35   endif
36 #endif
37
38 ifeq ($(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
41 endif
42
43 CXXFLAGS     += $(ALICEINC) -g
44
45 SRCS     = $(wildcard *.cxx)
46 HDRS     = $(SRCS:.cxx=.h)
47 DHDR     = $(PACKAGE)LinkDef.h
48
49 DHDR_CORRFW := $(DHDR)
50 HDRS_CORRFW := $(HDRS)
51 SRCS_CORRFW := $(SRCS) G__$(PACKAGE).cxx
52 OBJS_CORRFW := $(SRCS_CORRFW:.cxx=.o)
53
54 PARFILE       = $(PACKAGE).par
55
56
57 lib$(PACKAGE).so: $(OBJS_CORRFW)
58         @echo "Linking" $@ ...
59         @/bin/rm -f $@
60 ifeq ($(PLATFORM),macosx)
61         $(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@ $(PACKLDFLAGS) $(EXPLLINKLIBS)
62 else
63         $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(PACKLDFLAGS) $(EXPLLINKLIBS)
64 endif
65         @chmod a+x $@
66         @echo "done"
67
68 %.o:    %.cxx %.h
69         $(CXX) $(CXXFLAGS) $(PACKCXXFLAGS) -c $< -o $@
70
71 clean:
72         @rm -f $(OBJS_CORRFW) *.so G__$(PACKAGE).* $(PARFILE)
73
74 G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS) $(DHDR)
75         @echo "Generating dictionary ..."
76         rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^
77
78 ### CREATE PAR FILE
79
80 $(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_CORRFW) $(SRCS_CORRFW) $(DHDR_CORRFW) Makefile Makefile.arch PROOF-INF))
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
106 test-%.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)"