fix typo and MC in Add Flavour tasks
[u/mrichter/AliRoot.git] / PWGLF / Makefile
CommitLineData
b63dbf69 1# $Id: Makefile 50266 2011-06-24 09:37:46Z pulvir $
0a0f6d45 2
b63dbf69 3include $(ROOTSYS)/etc/Makefile.arch
0a0f6d45 4
b63dbf69 5PACKAGE = PWGLFresonancesdev
0a0f6d45 6
7default-target: lib$(PACKAGE).so
8
b63dbf69 9ALICEINC = -I.
10
11ifeq ($(PACKAGE),PWGLFresonances)
12 ALICEINC += -IRESONANCES
13endif
14
15ifeq ($(PACKAGE),PWGLFresonancesdev)
16 ALICEINC += -IRESONANCES_DEV
17endif
0a0f6d45 18
483c140c 19ifeq ($(PACKAGE),PWGLFforward2)
20 ALICEINC += -IFORWARD/analysis2
21endif
66ee9f2f 22ifeq ($(PACKAGE),PWGLFforwardhit)
23 ALICEINC += -IFORWARD/analysis2
24endif
483c140c 25
0a0f6d45 26### define include dir for local case and par case
b63dbf69 27ifneq ($(STEERBase_INCLUDE),)
28 ALICEINC += -I../$(STEERBase_INCLUDE)
0a0f6d45 29 ALICEINC += -I../$(ESD_INCLUDE)
30 ALICEINC += -I../$(AOD_INCLUDE)
0a0f6d45 31 ALICEINC += -I../$(ANALYSIS_INCLUDE)
32 ALICEINC += -I../$(ANALYSISalice_INCLUDE)
b63dbf69 33else
34 ifneq ($(ALICE_ROOT),)
35 ALICEINC += -I$(ALICE_ROOT)/include
36 endif
0a0f6d45 37endif
38
b63dbf69 39ifneq ($(CORRFW_INCLUDE),)
40 ALICEINC += -I../$(CORRFW_INCLUDE)
0a0f6d45 41endif
42
07c50b03 43ifneq ($(OADB_INCLUDE),)
44 ALICEINC += -I../$(OADB_INCLUDE)
45endif
46
b63dbf69 47ifneq ($(PWGLFresonances_INCLUDE),)
48 ALICEINC += -I../$(PWGLFresonances_INCLUDE)
49else
50 ifneq ($(ALICE_ROOT),)
51 ALICEINC += -I$(ALICE_ROOT)/PWGLF -I$(ALICE_ROOT)/PWGLF/RESONANCES
52 endif
0a0f6d45 53endif
54
b63dbf69 55ifneq ($(PWGLFresonancesdev_INCLUDE),)
56 ALICEINC += -I../$(PWGLFresonancesdev_INCLUDE)
0a0f6d45 57else
b63dbf69 58 ifneq ($(ALICE_ROOT),)
59 ALICEINC += -I$(ALICE_ROOT)/PWGLF -I$(ALICE_ROOT)/PWGLF/RESONANCES_DEV
60 endif
0a0f6d45 61endif
62
63# only if no par file was loaded before
b63dbf69 64ifeq ($(ALICEINC),-I.)
0a0f6d45 65 ifneq ($(ALICE_ROOT),)
66 ALICEINC += -I$(ALICE_ROOT)/include
67 endif
b63dbf69 68endif
0a0f6d45 69
66ee9f2f 70EINCLUDE :=
71ifneq ($(ALICE_ROOT),)
0a0f6d45 72 ALICEINC += $(EINCLUDE:%=-I$(ALICE_ROOT)/%)
73endif
74
75CXXFLAGS += $(ALICEINC) -g
76F77FLAGS += $(ALICEINC) -g -fPIC
77
b63dbf69 78DHDR =
79HDRS =
80SRCS =
81FSRCS =
0a0f6d45 82
b63dbf69 83DHDR_PWG2 := $(DHDR)
84HDRS_PWG2 := $(HDRS)
85SRCS_PWG2 := $(SRCS) G__$(PACKAGE).cxx
86FSCRS_PWG2 := $(FSRCS)
87OBJS_PWG2 := $(SRCS_PWG2:.cxx=.o) $(FSRCS:.F=.o)
0a0f6d45 88
89PARFILE = $(PACKAGE).par
90
b63dbf69 91lib$(PACKAGE).so: $(OBJS_PWG2)
0a0f6d45 92 @echo "Linking" $@ ...
93 @/bin/rm -f $@
b63dbf69 94ifeq ($(PLATFORM),macosx)
95# We need to make both the .dylib and the .so
96 $(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@
97ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
98ifeq ($(MACOSX_MINOR),4)
99 ln -sf $@ $(subst .$(DllSuf),.so,$@)
100else
101 $(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ \
102 $(OutPutOpt) $(subst .$(DllSuf),.so,$@)
103endif
104endif
105else
106ifeq ($(PLATFORM),win32)
107 bindexplib $* $^ > $*.def
108 lib -nologo -MACHINE:IX86 $^ -def:$*.def \
109 $(OutPutOpt)$(EVENTLIB)
110 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \
111 $(OutPutOpt)$@
112else
113 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
114endif
115endif
0a0f6d45 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
125G__$(PACKAGE).h:G__$(PACKAGE).cxx
126 @if test -f $@ ; then : ; else rm -f $< ; $(MAKE) $@ ; fi
127
b63dbf69 128G__$(PACKAGE).cxx: $(HDRS_PWG2) $(DHDR_PWG2)
0a0f6d45 129 @echo "Generating dictionary ..."
130 rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^
131
132clean:
b63dbf69 133 @rm -f $(OBJS_PWG2) *.so G__$(PACKAGE).* $(PARFILE)
0a0f6d45 134
135### CREATE PAR FILE
136
b63dbf69 137$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG2) $(SRCS_PWG2) $(DHDR_PWG2) Makefile Makefile.arch PROOF-INF))
0a0f6d45 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
66ee9f2f 148ROOT_MAKEFILE := $(shell root-config --etcdir)/Makefile.arch
149$(PACKAGE)/Makefile.arch: $(ROOT_MAKEFILE)
0a0f6d45 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
164test-%.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)"