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