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