New data member (Renaud)
[u/mrichter/AliRoot.git] / ANALYSIS / Makefile
CommitLineData
379c06ec 1
dd4f0396 2include Makefile.arch
b7c8eec1 3
dd4f0396 4PACKAGE = ANALYSISalice
9af2beba 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
a18817ac 27ifneq ($(OADB_INCLUDE),)
28 ALICEINC += -I../$(OADB_INCLUDE)
29endif
30
02fc82ff 31ifneq ($(ANALYSISalice_INCLUDE),)
32 ALICEINC += -I../$(ANALYSISalice_INCLUDE)
33endif
34
3e228187 35# only if no par file was loaded before
36ifeq ($(ALICEINC),-I.)
37 ifneq ($(ALICE_ROOT),)
958d9d26 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
3e228187 39 endif
b7c8eec1 40endif
41
e9e06a24 42CHECKXML := $(shell root-config --has-xml)
84d4333f 43
dd4f0396 44ifeq ($(CHECKXML),yes)
45 CXXFLAGS += -DWITHXML
46 CINTFLAGS += -DWITHXML
47endif
48
49CXXFLAGS += $(ALICEINC) -g
50
958d9d26 51SRCS = $(wildcard *.cxx)
52HDRS = $(SRCS:.cxx=.h)
53DHDR = $(PACKAGE)LinkDef.h
379c06ec 54
c52c2132 55DHDR_ANALYSIS := $(DHDR)
56HDRS_ANALYSIS := $(HDRS)
57SRCS_ANALYSIS := $(SRCS) G__$(PACKAGE).cxx
58OBJS_ANALYSIS := $(SRCS_ANALYSIS:.cxx=.o)
b7c8eec1 59
60PARFILE = $(PACKAGE).par
61
379c06ec 62
c52c2132 63lib$(PACKAGE).so: $(OBJS_ANALYSIS)
379c06ec 64 @echo "Linking" $@ ...
65 @/bin/rm -f $@
10dc066e 66ifeq ($(ARCH),macosx)
379c06ec 67 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
68else
69 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
70endif
71 @chmod a+x $@
72 @echo "done"
73
74%.o: %.cxx %.h
c16bb9ed 75 $(CXX) $(CXXFLAGS) $(PACKCXXFLAGS) -c $< -o $@
379c06ec 76
77clean:
c52c2132 78 @rm -f $(OBJS_ANALYSIS) *.so G__$(PACKAGE).* $(PARFILE)
379c06ec 79
80G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS) $(DHDR)
81 @echo "Generating dictionary ..."
3f4f3116 82 rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^
379c06ec 83
b7c8eec1 84### CREATE PAR FILE
85
84d4333f 86$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_ANALYSIS) $(SRCS_ANALYSIS) $(DHDR_ANALYSIS) Makefile Makefile.arch PROOF-INF))
b7c8eec1 87 @echo "Creating archive" $@ ...
88 @tar cfzh $@ $(PACKAGE)
89 @rm -rf $(PACKAGE)
90 @echo "done"
91
92$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
93 @echo Copying $< to $@ with transformations
94 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
95 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
96
97$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
98 @echo Copying $< to $@
99 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
100 @cp -a $^ $@
101
102$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
103 @echo Copying $< to $@
104 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
105 @cp -a -r $^ $@
106
107$(PACKAGE)/%: %
108 @echo Copying $< to $@
109 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
110 @cp -a $< $@
111
112test-%.par: %.par
113 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
114 @mkdir -p par-tmp
115 @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
116 @rm -rf par-tmp
117 @echo "INFO: Testing succeeded (already cleaned up)"