Adding Tasks to create NuclexAOD from MC productions and first Task to read Nuclex AOD
[u/mrichter/AliRoot.git] / PWGLF / Makefile
1 # $Id: Makefile 50266 2011-06-24 09:37:46Z pulvir $
2
3 include $(ROOTSYS)/etc/Makefile.arch
4
5 PACKAGE = PWGLFresonancesdev
6
7 default-target: lib$(PACKAGE).so 
8
9 ALICEINC      = -I.
10
11 ifeq ($(PACKAGE),PWGLFresonances)
12   ALICEINC      += -IRESONANCES
13 endif
14
15 ifeq ($(PACKAGE),PWGLFresonancesdev)
16   ALICEINC      += -IRESONANCES_DEV
17 endif
18
19 ifeq ($(PACKAGE),PWGLFforward2)
20   ALICEINC      += -IFORWARD/analysis2
21 endif
22 ifeq ($(PACKAGE),PWGLFforwardhit)
23   ALICEINC      += -IFORWARD/analysis2
24 endif
25
26 ### define include dir for local case and par case
27 ifneq ($(STEERBase_INCLUDE),)
28    ALICEINC += -I../$(STEERBase_INCLUDE)
29    ALICEINC += -I../$(ESD_INCLUDE)
30    ALICEINC += -I../$(AOD_INCLUDE)
31    ALICEINC += -I../$(ANALYSIS_INCLUDE)
32    ALICEINC += -I../$(ANALYSISalice_INCLUDE)
33 else
34    ifneq ($(ALICE_ROOT),)
35       ALICEINC += -I$(ALICE_ROOT)/include
36    endif
37 endif
38
39 ifneq ($(CORRFW_INCLUDE),)
40    ALICEINC += -I../$(CORRFW_INCLUDE)
41 endif
42
43 ifneq ($(OADB_INCLUDE),)
44    ALICEINC += -I../$(OADB_INCLUDE)
45 endif
46
47 ifneq ($(PWGLFresonances_INCLUDE),)
48    ALICEINC += -I../$(PWGLFresonances_INCLUDE)
49 else
50    ifneq ($(ALICE_ROOT),)
51       ALICEINC += -I$(ALICE_ROOT)/PWGLF -I$(ALICE_ROOT)/PWGLF/RESONANCES
52    endif
53 endif
54
55 ifneq ($(PWGLFresonancesdev_INCLUDE),)
56    ALICEINC += -I../$(PWGLFresonancesdev_INCLUDE)
57 else
58    ifneq ($(ALICE_ROOT),)
59       ALICEINC += -I$(ALICE_ROOT)/PWGLF -I$(ALICE_ROOT)/PWGLF/RESONANCES_DEV
60    endif
61 endif
62
63 # only if no par file was loaded before
64 ifeq ($(ALICEINC),-I.)
65   ifneq ($(ALICE_ROOT),)
66     ALICEINC += -I$(ALICE_ROOT)/include
67   endif
68 endif
69
70 EINCLUDE := 
71 ifneq ($(ALICE_ROOT),)
72   ALICEINC += $(EINCLUDE:%=-I$(ALICE_ROOT)/%)
73 endif
74
75 CXXFLAGS     += $(ALICEINC) -g
76 F77FLAGS     += $(ALICEINC) -g -fPIC
77
78 DHDR = 
79 HDRS = 
80 SRCS = 
81 FSRCS = 
82
83 DHDR_PWG2 := $(DHDR)
84 HDRS_PWG2 := $(HDRS)
85 SRCS_PWG2 := $(SRCS) G__$(PACKAGE).cxx
86 FSCRS_PWG2 := $(FSRCS)
87 OBJS_PWG2 := $(SRCS_PWG2:.cxx=.o) $(FSRCS:.F=.o)
88
89 PARFILE       = $(PACKAGE).par
90
91 lib$(PACKAGE).so: $(OBJS_PWG2)
92         @echo "Linking" $@ ...
93         @/bin/rm -f $@
94 ifeq ($(PLATFORM),macosx)
95 # We need to make both the .dylib and the .so
96                 $(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@
97 ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
98 ifeq ($(MACOSX_MINOR),4)
99                 ln -sf $@ $(subst .$(DllSuf),.so,$@)
100 else
101                 $(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ \
102                    $(OutPutOpt) $(subst .$(DllSuf),.so,$@)
103 endif
104 endif
105 else
106 ifeq ($(PLATFORM),win32)
107                 bindexplib $* $^ > $*.def
108                 lib -nologo -MACHINE:IX86 $^ -def:$*.def \
109                    $(OutPutOpt)$(EVENTLIB)
110                 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \
111                    $(OutPutOpt)$@
112 else
113                 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
114 endif
115 endif
116         @chmod a+x $@
117         @echo "done"
118
119 %.o:    %.cxx %.h
120         $(CXX) $(CXXFLAGS) -c $< -o $@
121
122 %.o:    %.F
123         $(F77) $(F77FLAGS) -c $< -o $@
124
125 G__$(PACKAGE).h:G__$(PACKAGE).cxx
126         @if test -f $@ ; then : ; else rm -f $< ; $(MAKE) $@ ; fi
127
128 G__$(PACKAGE).cxx: $(HDRS_PWG2) $(DHDR_PWG2)
129         @echo "Generating dictionary ..."
130         rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^
131
132 clean:
133         @rm -f $(OBJS_PWG2) *.so G__$(PACKAGE).* $(PARFILE)
134
135 ### CREATE PAR FILE
136
137 $(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG2) $(SRCS_PWG2) $(DHDR_PWG2) Makefile Makefile.arch PROOF-INF))
138         @echo "Creating archive" $@ ...
139         @tar cfzh $@ $(PACKAGE)
140         @rm -rf $(PACKAGE)
141         @echo "done"
142
143 $(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
144         @echo Copying $< to $@ with transformations
145         @[ -d $(dir $@) ] || mkdir -p $(dir $@)
146         @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
147
148 ROOT_MAKEFILE := $(shell root-config --etcdir)/Makefile.arch
149 $(PACKAGE)/Makefile.arch: $(ROOT_MAKEFILE)
150         @echo Copying $< to $@
151         @[ -d $(dir $@) ] || mkdir -p $(dir $@)
152         @cp -a $^ $@
153
154 $(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
155         @echo Copying $< to $@
156         @[ -d $(dir $@) ] || mkdir -p $(dir $@)
157         @cp -a -r $^ $@
158
159 $(PACKAGE)/%: %
160         @echo Copying $< to $@
161         @[ -d $(dir $@) ] || mkdir -p $(dir $@)
162         @cp -a $< $@
163
164 test-%.par: %.par
165         @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
166         @mkdir -p par-tmp
167         @cd par-tmp; tar xfz ../$<;     cd $(subst .par,,$<); PROOF-INF/BUILD.sh
168         @rm -rf par-tmp
169         @echo "INFO: Testing succeeded (already cleaned up)"