Restored PAR file functionallity: make test-par-all works
[u/mrichter/AliRoot.git] / PWGLF / Makefile
CommitLineData
0a0f6d45 1# $Id: Makefile 53653 2011-12-16 10:05:45Z cholm $
2
41f671ab 3include Makefile.arch
0a0f6d45 4
5PACKAGE = PWGLFresonances
6
7default-target: lib$(PACKAGE).so
8
f4545ac7 9ALICEINC = -I. -I$(ALICE_ROOT)/TOF -I$(ALICE_ROOT)/ANALYSIS/EventMixing -I$(ALICE_ROOT)/PWGUD/base
0a0f6d45 10
11### define include dir for local case and par case
12ifneq ($(ESD_INCLUDE),)
13 ALICEINC += -I../$(ESD_INCLUDE)
14 ALICEINC += -I../$(AOD_INCLUDE)
15 ALICEINC += -I../$(STEERBase_INCLUDE)
16 ALICEINC += -I../$(OADB_INCLUDE)
17 ALICEINC += -I../$(ANALYSIS_INCLUDE)
18 ALICEINC += -I../$(ANALYSISalice_INCLUDE)
19 else
20 ifneq ($(ALICE_ROOT),)
21 ALICEINC += -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/PWGLF
22 endif
23endif
24
25ifneq ($(PWGLFresonances_INCLUDE),)
26 ALICEINC += -I../$(PWGLFresonances_INCLUDE)
27 else
28 ifneq ($(ALICE_ROOT),)
29 ALICEINC += -I$(ALICE_ROOT)/PWGLF/RESONANCES
30 endif
31endif
32
33ifneq ($(PWGLFSTRANGENESS_INCLUDE),)
34 ALICEINC += -I../$(PWGLFSTRANGENESS_INCLUDE)
35 else
36 ifneq ($(ALICE_ROOT),)
37 ALICEINC += -I$(ALICE_ROOT)/PWGLF/STRANGENESS
38 endif
39endif
40
41ifneq ($(PWGLFtotEt_INCLUDE),)
42 ALICEINC += -I../$(PWGLFtotEt_INCLUDE)
43 else
44 ifneq ($(ALICE_ROOT),)
45 ALICEINC += -I$(ALICE_ROOT)/PWGLF/totEt
46 endif
47endif
48
49ifneq ($(PWGLFforward_INCLUDE),)
50 ALICEINC += -I../$(PWGLFforward_INCLUDE)
51 else
52 ifneq ($(ALICE_ROOT),)
53 ALICEINC += -I$(ALICE_ROOT)/PWGLF/FORWARD/analysis
54 endif
55endif
56
57ifneq ($(PWGLFforward2_INCLUDE),)
58 ALICEINC += -I../$(PWGLFforward2_INCLUDE)
59 else
60 ifneq ($(ALICE_ROOT),)
61 ALICEINC += -I$(ALICE_ROOT)/PWGLF/FORWARD/analysis2
62 endif
63endif
64
65ifneq ($(OADB_INCLUDE), )
66 ALICEINC += -I../$(OADB_INCLUDE)
67else
68 ifneq ($(ALICE_ROOT),)
69 ALICEINC += -I$(ALICE_ROOT)/OADB
70 endif
71endif
72
73# only if no par file was loaded before
41f671ab 74#ifeq ($(ALICEINC),-I.)
0a0f6d45 75 ifneq ($(ALICE_ROOT),)
76 ALICEINC += -I$(ALICE_ROOT)/include
77 endif
41f671ab 78#endif
0a0f6d45 79
80ifneq ($(EINCLUDE),)
81 ALICEINC += $(EINCLUDE:%=-I$(ALICE_ROOT)/%)
82endif
83
84CXXFLAGS += $(ALICEINC) -g
85F77FLAGS += $(ALICEINC) -g -fPIC
86
87DHDR =
88HDRS =
89SRCS =
90FSRCS =
91
92DHDR_PWGLF := $(DHDR)
93HDRS_PWGLF := $(HDRS)
94SRCS_PWGLF := $(SRCS) G__$(PACKAGE).cxx
95FSCRS_PWGLF := $(FSRCS)
96OBJS_PWGLF := $(SRCS_PWGLF:.cxx=.o) $(FSRCS:.F=.o)
97
98PARFILE = $(PACKAGE).par
99
100lib$(PACKAGE).so: $(OBJS_PWGLF)
101 @echo "Linking" $@ ...
102 @/bin/rm -f $@
41f671ab 103 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
0a0f6d45 104 @chmod a+x $@
105 @echo "done"
106
107%.o: %.cxx %.h
108 $(CXX) $(CXXFLAGS) -c $< -o $@
109
110%.o: %.F
111 $(F77) $(F77FLAGS) -c $< -o $@
112
113G__$(PACKAGE).h:G__$(PACKAGE).cxx
114 @if test -f $@ ; then : ; else rm -f $< ; $(MAKE) $@ ; fi
115
116G__$(PACKAGE).cxx: $(HDRS_PWGLF) $(DHDR_PWGLF)
117 @echo "Generating dictionary ..."
118 rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^
119
120clean:
121 @rm -f $(OBJS_PWGLF) *.so G__$(PACKAGE).* $(PARFILE)
122
123### CREATE PAR FILE
124
125$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWGLF) $(SRCS_PWGLF) $(DHDR_PWGLF) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF))
126 @echo "Creating archive" $@ ...
127 @tar cfzh $@ $(PACKAGE)
128 @rm -rf $(PACKAGE)
129 @echo "done"
130
131$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
132 @echo Copying $< to $@ with transformations
133 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
134 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
135
136$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
137 @echo Copying $< to $@
138 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
139 @cp -a $^ $@
140
141$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
142 @echo Copying $< to $@
143 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
144 @cp -a -r $^ $@
145
146$(PACKAGE)/%: %
147 @echo Copying $< to $@
148 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
149 @cp -a $< $@
150
151test-%.par: %.par
152 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
153 @mkdir -p par-tmp
154 @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
155 @rm -rf par-tmp
156 @echo "INFO: Testing succeeded (already cleaned up)"