Disable caching for async prefetching
[u/mrichter/AliRoot.git] / ANALYSIS / Makefile
1
2 include Makefile.arch
3
4 PACKAGE = ANALYSISalice
5
6 default-target: lib$(PACKAGE).so
7
8 ALICEINC      = -I.
9
10 # add include paths from other par files
11 ifneq ($(ESD_INCLUDE),)
12    ALICEINC += -I../$(ESD_INCLUDE)
13 endif
14
15 ifneq ($(AOD_INCLUDE),)
16    ALICEINC += -I../$(AOD_INCLUDE)
17 endif
18
19 ifneq ($(STEERBase_INCLUDE),)
20    ALICEINC += -I../$(STEERBase_INCLUDE)
21 endif
22
23 ifneq ($(ANALYSIS_INCLUDE),)
24    ALICEINC += -I../$(ANALYSIS_INCLUDE)
25 endif
26
27 ifneq ($(OADB_INCLUDE),)
28    ALICEINC += -I../$(OADB_INCLUDE)
29 endif
30
31 ifneq ($(ANALYSISalice_INCLUDE),)
32    ALICEINC += -I../$(ANALYSISalice_INCLUDE)
33 endif
34
35 # only if no par file was loaded before
36 #ifeq ($(ALICEINC),-I.)
37   ifneq ($(ALICE_ROOT),)
38     ALICEINC += -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/ANALYSIS/Tender -I$(ALICE_ROOT)/TOF -I$(ALICE_ROOT)/TRD/Cal -I$(ALICE_ROOT)/VZERO -I$(ALICE_ROOT)/TPC -I$(ALICE_ROOT)/T0 -I$(ALICE_ROOT)/EMCAL
39   endif
40 #endif
41
42 ifeq ($(PLATFORM),macosx)
43 ROOTLIBDIR     := $(shell $(RC) --libdir)
44 ifeq ($(PACKAGE),ANALYSIS)
45    PACKLDFLAGS = $(STEERBase_LIBS) $(ESD_LIBS) $(AOD_LIBS) -L$(ROOTLIBDIR) -lXMLParser
46 endif
47 ifeq ($(PACKAGE),ANALYSISalice) 
48    PACKLDFLAGS = $(STEERBase_LIBS) $(ESD_LIBS) $(AOD_LIBS) $(ANALYSIS_LIBS) $(OADB_LIBS) -L$(ROOTLIBDIR) -lXMLIO -lEG -lTreePlayer
49 endif
50 endif
51
52 CHECKXML      := $(shell root-config --has-xml)
53
54 ifeq ($(CHECKXML),yes)
55   CXXFLAGS += -DWITHXML
56   CINTFLAGS += -DWITHXML
57 endif
58
59 CXXFLAGS += $(ALICEINC) -g
60
61 SRCS     = $(wildcard *.cxx)
62 HDRS     = $(SRCS:.cxx=.h)
63 DHDR     = $(PACKAGE)LinkDef.h
64
65 DHDR_ANALYSIS := $(DHDR)
66 HDRS_ANALYSIS := $(HDRS)
67 SRCS_ANALYSIS := $(SRCS) G__$(PACKAGE).cxx
68 OBJS_ANALYSIS := $(SRCS_ANALYSIS:.cxx=.o)
69
70 PARFILE       = $(PACKAGE).par
71
72
73 lib$(PACKAGE).so: $(OBJS_ANALYSIS)
74         @echo "Linking" $@ ...
75         @/bin/rm -f $@
76 ifeq ($(PLATFORM),macosx)
77         $(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@ $(PACKLDFLAGS) $(EXPLLINKLIBS)
78 else
79         $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(PACKLDFLAGS) $(EXPLLINKLIBS)
80 endif
81         @chmod a+x $@
82         @echo "done"
83
84 %.o:    %.cxx %.h
85         $(CXX) $(CXXFLAGS) $(PACKCXXFLAGS) -c $< -o $@
86
87 clean:
88         @rm -f $(OBJS_ANALYSIS) *.so G__$(PACKAGE).* $(PARFILE)
89
90 G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS) $(DHDR)
91         @echo "Generating dictionary ..."
92         rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^
93
94 ### CREATE PAR FILE
95
96 $(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_ANALYSIS) $(SRCS_ANALYSIS) $(DHDR_ANALYSIS) Makefile Makefile.arch PROOF-INF))
97         @echo "Creating archive" $@ ...
98         @tar cfzh $@ $(PACKAGE)
99         @rm -rf $(PACKAGE)
100         @echo "done"
101
102 $(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
103         @echo Copying $< to $@ with transformations
104         @[ -d $(dir $@) ] || mkdir -p $(dir $@)
105         @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
106
107 $(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
108         @echo Copying $< to $@
109         @[ -d $(dir $@) ] || mkdir -p $(dir $@)
110         @cp -a $^ $@
111
112 $(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
113         @echo Copying $< to $@
114         @[ -d $(dir $@) ] || mkdir -p $(dir $@)
115         @cp -a -r $^ $@
116
117 $(PACKAGE)/%: %
118         @echo Copying $< to $@
119         @[ -d $(dir $@) ] || mkdir -p $(dir $@)
120         @cp -a $< $@
121
122 test-%.par: %.par
123         @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
124         @mkdir -p par-tmp
125         @cd par-tmp; tar xfz ../$<;     cd $(subst .par,,$<); PROOF-INF/BUILD.sh
126         @rm -rf par-tmp
127         @echo "INFO: Testing succeeded (already cleaned up)"