]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/Makefile
analysis train updates
[u/mrichter/AliRoot.git] / PWGLF / Makefile
1 # $Id: Makefile 53653 2011-12-16 10:05:45Z cholm $
2
3 include Makefile.arch
4
5 PACKAGE = PWGLFresonances
6
7 default-target: lib$(PACKAGE).so 
8
9 ALICEINC      = -I. -I$(ALICE_ROOT)/TOF -I$(ALICE_ROOT)/ANALYSIS/EventMixing -I$(ALICE_ROOT)/PWGUD/base
10
11 ### define include dir for local case and par case
12 ifneq ($(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
23 endif
24
25 ifneq ($(PWGLFresonances_INCLUDE),)
26   ALICEINC += -I../$(PWGLFresonances_INCLUDE)
27  else
28     ifneq ($(ALICE_ROOT),)
29        ALICEINC += -I$(ALICE_ROOT)/PWGLF/RESONANCES
30      endif
31 endif
32
33 ifneq ($(PWGLFSTRANGENESS_INCLUDE),)
34   ALICEINC += -I../$(PWGLFSTRANGENESS_INCLUDE)
35  else
36     ifneq ($(ALICE_ROOT),)
37        ALICEINC += -I$(ALICE_ROOT)/PWGLF/STRANGENESS
38      endif
39 endif
40
41 ifneq ($(PWGLFtotEt_INCLUDE),)
42   ALICEINC += -I../$(PWGLFtotEt_INCLUDE)
43  else
44     ifneq ($(ALICE_ROOT),)
45        ALICEINC += -I$(ALICE_ROOT)/PWGLF/totEt
46      endif
47 endif
48
49 ifneq ($(PWGLFforward_INCLUDE),)
50   ALICEINC += -I../$(PWGLFforward_INCLUDE)
51  else
52     ifneq ($(ALICE_ROOT),)
53        ALICEINC += -I$(ALICE_ROOT)/PWGLF/FORWARD/analysis
54      endif
55 endif
56
57 ifneq ($(PWGLFforward2_INCLUDE),)
58   ALICEINC += -I../$(PWGLFforward2_INCLUDE)
59  else
60     ifneq ($(ALICE_ROOT),)
61        ALICEINC += -I$(ALICE_ROOT)/PWGLF/FORWARD/analysis2
62      endif
63 endif
64
65 ifneq ($(OADB_INCLUDE), )
66   ALICEINC += -I../$(OADB_INCLUDE)
67 else
68   ifneq ($(ALICE_ROOT),)
69     ALICEINC += -I$(ALICE_ROOT)/OADB
70   endif
71 endif
72
73 # only if no par file was loaded before
74 #ifeq ($(ALICEINC),-I.)
75   ifneq ($(ALICE_ROOT),)
76     ALICEINC += -I$(ALICE_ROOT)/include
77   endif
78 #endif
79
80 ifneq ($(EINCLUDE),)
81   ALICEINC += $(EINCLUDE:%=-I$(ALICE_ROOT)/%)
82 endif
83
84 CXXFLAGS     += $(ALICEINC) -g
85 F77FLAGS     += $(ALICEINC) -g -fPIC
86
87 DHDR =
88 HDRS =
89 SRCS =
90 FSRCS =
91
92 DHDR_PWGLF := $(DHDR)
93 HDRS_PWGLF := $(HDRS)
94 SRCS_PWGLF := $(SRCS) G__$(PACKAGE).cxx
95 FSCRS_PWGLF := $(FSRCS)
96 OBJS_PWGLF := $(SRCS_PWGLF:.cxx=.o) $(FSRCS:.F=.o)
97
98 PARFILE       = $(PACKAGE).par
99
100 lib$(PACKAGE).so: $(OBJS_PWGLF)
101         @echo "Linking" $@ ...
102         @/bin/rm -f $@
103         $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
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
113 G__$(PACKAGE).h:G__$(PACKAGE).cxx
114         @if test -f $@ ; then : ; else rm -f $< ; $(MAKE) $@ ; fi
115
116 G__$(PACKAGE).cxx: $(HDRS_PWGLF) $(DHDR_PWGLF)
117         @echo "Generating dictionary ..."
118         rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^
119
120 clean:
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
151 test-%.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)"