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