Added AliRsnAction, fix for AliRsnPIDRange, lego_train macros updated
[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 ### define include dir for local case and par case
20 ifneq ($(STEERBase_INCLUDE),)
21    ALICEINC += -I../$(STEERBase_INCLUDE)
22    ALICEINC += -I../$(ESD_INCLUDE)
23    ALICEINC += -I../$(AOD_INCLUDE)
24    ALICEINC += -I../$(ANALYSIS_INCLUDE)
25    ALICEINC += -I../$(ANALYSISalice_INCLUDE)
26 else
27    ifneq ($(ALICE_ROOT),)
28       ALICEINC += -I$(ALICE_ROOT)/include
29    endif
30 endif
31
32 ifneq ($(CORRFW_INCLUDE),)
33    ALICEINC += -I../$(CORRFW_INCLUDE)
34 endif
35
36 ifneq ($(PWGLFresonances_INCLUDE),)
37    ALICEINC += -I../$(PWGLFresonances_INCLUDE)
38 else
39    ifneq ($(ALICE_ROOT),)
40       ALICEINC += -I$(ALICE_ROOT)/PWGLF -I$(ALICE_ROOT)/PWGLF/RESONANCES
41    endif
42 endif
43
44 ifneq ($(PWGLFresonancesdev_INCLUDE),)
45    ALICEINC += -I../$(PWGLFresonancesdev_INCLUDE)
46 else
47    ifneq ($(ALICE_ROOT),)
48       ALICEINC += -I$(ALICE_ROOT)/PWGLF -I$(ALICE_ROOT)/PWGLF/RESONANCES_DEV
49    endif
50 endif
51
52 # only if no par file was loaded before
53 ifeq ($(ALICEINC),-I.)
54   ifneq ($(ALICE_ROOT),)
55     ALICEINC += -I$(ALICE_ROOT)/include
56   endif
57 endif
58
59 ifneq ($(EINCLUDE),)
60   ALICEINC += $(EINCLUDE:%=-I$(ALICE_ROOT)/%)
61 endif
62
63 CXXFLAGS     += $(ALICEINC) -g
64 F77FLAGS     += $(ALICEINC) -g -fPIC
65
66 DHDR = 
67 HDRS = 
68 SRCS = 
69 FSRCS = 
70
71 DHDR_PWG2 := $(DHDR)
72 HDRS_PWG2 := $(HDRS)
73 SRCS_PWG2 := $(SRCS) G__$(PACKAGE).cxx
74 FSCRS_PWG2 := $(FSRCS)
75 OBJS_PWG2 := $(SRCS_PWG2:.cxx=.o) $(FSRCS:.F=.o)
76
77 PARFILE       = $(PACKAGE).par
78
79 lib$(PACKAGE).so: $(OBJS_PWG2)
80         @echo "Linking" $@ ...
81         @/bin/rm -f $@
82 ifeq ($(PLATFORM),macosx)
83 # We need to make both the .dylib and the .so
84                 $(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@
85 ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
86 ifeq ($(MACOSX_MINOR),4)
87                 ln -sf $@ $(subst .$(DllSuf),.so,$@)
88 else
89                 $(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ \
90                    $(OutPutOpt) $(subst .$(DllSuf),.so,$@)
91 endif
92 endif
93 else
94 ifeq ($(PLATFORM),win32)
95                 bindexplib $* $^ > $*.def
96                 lib -nologo -MACHINE:IX86 $^ -def:$*.def \
97                    $(OutPutOpt)$(EVENTLIB)
98                 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \
99                    $(OutPutOpt)$@
100 else
101                 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
102 endif
103 endif
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_PWG2) $(DHDR_PWG2)
117         @echo "Generating dictionary ..."
118         rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^
119
120 clean:
121         @rm -f $(OBJS_PWG2) *.so G__$(PACKAGE).* $(PARFILE)
122
123 ### CREATE PAR FILE
124
125 $(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG2) $(SRCS_PWG2) $(DHDR_PWG2) Makefile Makefile.arch 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)"