updates in dNdPt analysis classes
[u/mrichter/AliRoot.git] / PWG0 / Makefile
CommitLineData
dc740de4 1# $Id$
2
f7a4a0ca 3include Makefile.arch
99326024 4
958d9d26 5PACKAGE = PWG0base
6default-target: lib$(PACKAGE).so
f2f977f4 7
8ALICEINC = -I.
99326024 9
d4fe2555 10### define include dir for local case and par case
f7a4a0ca 11ifneq ($(ESD_INCLUDE),)
12 ALICEINC += -I../$(ESD_INCLUDE)
13 ifneq ($(STEERBase_INCLUDE),)
14 ALICEINC += -I../$(STEERBase_INCLUDE)
15 endif
16 ifneq ($(AOD_INCLUDE),)
17 ALICEINC += -I../$(AOD_INCLUDE)
18 endif
19 ifneq ($(ANALYSIS_INCLUDE),)
20 ALICEINC += -I../$(ANALYSIS_INCLUDE)
21 endif
bb87cd4b 22 ifneq ($(ANALYSISalice_INCLUDE),)
23 ALICEINC += -I../$(ANALYSISalice_INCLUDE)
24 endif
f7a4a0ca 25else
26 ifneq ($(ALICE_ROOT),)
958d9d26 27 ALICEINC += -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/PYTHIA6 -I$(ALICE_ROOT)/EVGEN -I$(ALICE_ROOT)/RAW -I$(ALICE_ROOT)/TPC -I$(ALICE_ROOT)/PWG0
d4fe2555 28else
d4fe2555 29 endif
30endif
99326024 31
7229e085 32# for building of PWG0dep.par
33ifneq ($(PWG0base_INCLUDE),)
34 ALICEINC += -I../$(PWG0base_INCLUDE)
35endif
36
16e24ca3 37CXXFLAGS += $(ALICEINC) -g
f2f977f4 38
958d9d26 39SRCS = $(wildcard *.cxx */*.cxx)
40HDRS = $(SRCS:.cxx=.h)
41DHDR = $(PACKAGE)LinkDef.h
f2f977f4 42
43DHDR_PWG0base := $(DHDR)
44HDRS_PWG0base := $(HDRS)
45SRCS_PWG0base := $(SRCS) G__$(PACKAGE).cxx
46OBJS_PWG0base := $(SRCS_PWG0base:.cxx=.o)
47
d4fe2555 48PARFILE = $(PACKAGE).par
49
f2f977f4 50lib$(PACKAGE).so: $(OBJS_PWG0base)
d4fe2555 51 @echo "Linking" $@ ...
52 @/bin/rm -f $@
d86acb69 53ifeq ($(PLATFORM),macosx)
54# We need to make both the .dylib and the .so
55 $(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@
56ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
57ifeq ($(MACOSX_MINOR),4)
58 ln -sf $@ $(subst .$(DllSuf),.so,$@)
99326024 59else
d86acb69 60 $(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ \
61 $(OutPutOpt) $(subst .$(DllSuf),.so,$@)
62endif
63endif
64else
65ifeq ($(PLATFORM),win32)
66 bindexplib $* $^ > $*.def
67 lib -nologo -MACHINE:IX86 $^ -def:$*.def \
68 $(OutPutOpt)$(EVENTLIB)
69 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \
70 $(OutPutOpt)$@
71else
72 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
73endif
99326024 74endif
d4fe2555 75 @chmod a+x $@
99326024 76 @echo "done"
77
78%.o: %.cxx %.h
79 $(CXX) $(CXXFLAGS) -c $< -o $@
80
958d9d26 81G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS_PWG0base) $(DHDR_PWG0base)
99326024 82 @echo "Generating dictionary ..."
99326024 83 rootcint -f $@ -c $(ALICEINC) $^
d4fe2555 84
f2f977f4 85clean:
86 @rm -f $(OBJS_PWG0base) $(OBJS_PWG0dep) $(OBJS_PWG0selectors) *.so G__PWG0base.* G__PWG0dep.* G__PWG0selectors.* $(PARFILE)
87
d4fe2555 88### CREATE PAR FILE
89
84d4333f 90$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG0base) $(SRCS_PWG0base) $(DHDR_PWG0base) Makefile Makefile.arch PROOF-INF))
d4fe2555 91 @echo "Creating archive" $@ ...
92 @tar cfzh $@ $(PACKAGE)
93 @rm -rf $(PACKAGE)
94 @echo "done"
95
96$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
97 @echo Copying $< to $@ with transformations
98 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
99 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
100
101$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
102 @echo Copying $< to $@
103 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
0ab29cfa 104 @cp -a $^ $@
d4fe2555 105
106$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
107 @echo Copying $< to $@
108 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
0ab29cfa 109 @cp -a -r $^ $@
d4fe2555 110
111$(PACKAGE)/%: %
112 @echo Copying $< to $@
113 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
0ab29cfa 114 @cp -a $< $@
d4fe2555 115
116test-%.par: %.par
117 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
118 @mkdir -p par-tmp
119 @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
120 @rm -rf par-tmp
121 @echo "INFO: Testing succeeded (already cleaned up)"