Fix Coverity reports
[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 $@
10dc066e 53ifeq ($(ARCH),macosx)
d4fe2555 54 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
99326024 55else
f2f977f4 56 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
99326024 57endif
d4fe2555 58 @chmod a+x $@
99326024 59 @echo "done"
60
61%.o: %.cxx %.h
62 $(CXX) $(CXXFLAGS) -c $< -o $@
63
958d9d26 64G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS_PWG0base) $(DHDR_PWG0base)
99326024 65 @echo "Generating dictionary ..."
99326024 66 rootcint -f $@ -c $(ALICEINC) $^
d4fe2555 67
f2f977f4 68clean:
69 @rm -f $(OBJS_PWG0base) $(OBJS_PWG0dep) $(OBJS_PWG0selectors) *.so G__PWG0base.* G__PWG0dep.* G__PWG0selectors.* $(PARFILE)
70
d4fe2555 71### CREATE PAR FILE
72
84d4333f 73$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG0base) $(SRCS_PWG0base) $(DHDR_PWG0base) Makefile Makefile.arch PROOF-INF))
d4fe2555 74 @echo "Creating archive" $@ ...
75 @tar cfzh $@ $(PACKAGE)
76 @rm -rf $(PACKAGE)
77 @echo "done"
78
79$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
80 @echo Copying $< to $@ with transformations
81 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
82 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
83
84$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
85 @echo Copying $< to $@
86 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
0ab29cfa 87 @cp -a $^ $@
d4fe2555 88
89$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
90 @echo Copying $< to $@
91 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
0ab29cfa 92 @cp -a -r $^ $@
d4fe2555 93
94$(PACKAGE)/%: %
95 @echo Copying $< to $@
96 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
0ab29cfa 97 @cp -a $< $@
d4fe2555 98
99test-%.par: %.par
100 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
101 @mkdir -p par-tmp
102 @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
103 @rm -rf par-tmp
104 @echo "INFO: Testing succeeded (already cleaned up)"