]>
Commit | Line | Data |
---|---|---|
0a0f6d45 | 1 | # $Id: Makefile 53653 2011-12-16 10:05:45Z cholm $ |
2 | ||
3 | include $(ROOTSYS)/etc/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 | |
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 | ifeq ($(PLATFORM),macosx) | |
104 | # We need to make both the .dylib and the .so | |
105 | $(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@ | |
106 | ifneq ($(subst $(MACOSX_MINOR),,1234),1234) | |
107 | ifeq ($(MACOSX_MINOR),4) | |
108 | ln -sf $@ $(subst .$(DllSuf),.so,$@) | |
109 | else | |
110 | $(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ \ | |
111 | $(OutPutOpt) $(subst .$(DllSuf),.so,$@) | |
112 | endif | |
113 | endif | |
114 | else | |
115 | ifeq ($(PLATFORM),win32) | |
116 | bindexplib $* $^ > $*.def | |
117 | lib -nologo -MACHINE:IX86 $^ -def:$*.def \ | |
118 | $(OutPutOpt)$(EVENTLIB) | |
119 | $(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \ | |
120 | $(OutPutOpt)$@ | |
121 | else | |
122 | $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS) | |
123 | endif | |
124 | endif | |
125 | @chmod a+x $@ | |
126 | @echo "done" | |
127 | ||
128 | %.o: %.cxx %.h | |
129 | $(CXX) $(CXXFLAGS) -c $< -o $@ | |
130 | ||
131 | %.o: %.F | |
132 | $(F77) $(F77FLAGS) -c $< -o $@ | |
133 | ||
134 | G__$(PACKAGE).h:G__$(PACKAGE).cxx | |
135 | @if test -f $@ ; then : ; else rm -f $< ; $(MAKE) $@ ; fi | |
136 | ||
137 | G__$(PACKAGE).cxx: $(HDRS_PWGLF) $(DHDR_PWGLF) | |
138 | @echo "Generating dictionary ..." | |
139 | rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^ | |
140 | ||
141 | clean: | |
142 | @rm -f $(OBJS_PWGLF) *.so G__$(PACKAGE).* $(PARFILE) | |
143 | ||
144 | ### CREATE PAR FILE | |
145 | ||
146 | $(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWGLF) $(SRCS_PWGLF) $(DHDR_PWGLF) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF)) | |
147 | @echo "Creating archive" $@ ... | |
148 | @tar cfzh $@ $(PACKAGE) | |
149 | @rm -rf $(PACKAGE) | |
150 | @echo "done" | |
151 | ||
152 | $(PACKAGE)/Makefile: Makefile #.$(PACKAGE) | |
153 | @echo Copying $< to $@ with transformations | |
154 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) | |
155 | @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@ | |
156 | ||
157 | $(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch | |
158 | @echo Copying $< to $@ | |
159 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) | |
160 | @cp -a $^ $@ | |
161 | ||
162 | $(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE) | |
163 | @echo Copying $< to $@ | |
164 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) | |
165 | @cp -a -r $^ $@ | |
166 | ||
167 | $(PACKAGE)/%: % | |
168 | @echo Copying $< to $@ | |
169 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) | |
170 | @cp -a $< $@ | |
171 | ||
172 | test-%.par: %.par | |
173 | @echo "INFO: The file $< is now tested, in case of an error check in par-tmp." | |
174 | @mkdir -p par-tmp | |
175 | @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh | |
176 | @rm -rf par-tmp | |
177 | @echo "INFO: Testing succeeded (already cleaned up)" |