provide adress of the pointer to new AOD branch, not the pointer itself Mihaela G.
[u/mrichter/AliRoot.git] / PWG4 / Makefile
1
2 include Makefile.arch
3
4 default-target: libPWG4PartCorr.so
5
6 ALICEINC      = -I.
7
8 ### define include dir for local case and par case
9 ifneq ($(ANALYSIS_INCLUDE),)
10   ALICEINC += -I../$(ESD_INCLUDE) -I../$(AOD_INCLUDE) -I../$(ANALYSIS_INCLUDE) -I../$(STEERBase_INCLUDE) -I../$(ANALYSISalice_INCLUDE)
11 else
12   ifneq ($(ALICE_ROOT),)
13     ALICEINC += -I$(ALICE_ROOT)/include
14   endif
15 endif
16
17 # for building of PWG4PartCorr.par
18 ifneq ($(GAMMA_INCLUDE),)
19   ALICEINC += -I../$(GAMMA_INCLUDE)
20 endif
21
22 CXXFLAGS     += $(ALICEINC) -g
23
24 PACKAGE = PWG4PartCorr
25 include lib$(PACKAGE).pkg
26
27 DHDR_PWG4PartCorr := $(DHDR)
28 HDRS_PWG4PartCorr := $(HDRS)
29 SRCS_PWG4PartCorr := $(SRCS) G__$(PACKAGE).cxx
30 OBJS_PWG4PartCorr := $(SRCS_PWG4PartCorr:.cxx=.o)
31
32 PARFILE       = $(PACKAGE).par
33
34
35 lib$(PACKAGE).so: $(OBJS_PWG4PartCorr)
36         @echo "Linking" $@ ...
37         @/bin/rm -f $@
38 ifeq ($(ARCH),macosx)
39         @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
40 else
41         @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
42 endif
43         @chmod a+x $@
44         @echo "done"
45
46 %.o:    %.cxx %.h
47         $(CXX) $(CXXFLAGS) -c $< -o $@
48
49 clean:
50         @rm -f $(OBJS_PWG4PartCorr) *.so G__$(PACKAGE).* $(PARFILE)
51
52 G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS) $(DHDR)
53         @echo "Generating dictionary ..."
54         rootcint -f $@ -c $(ALICEINC) $^
55
56 ### CREATE PAR FILE
57
58 $(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG4PartCorr) $(SRCS_PWG4PartCorr) $(DHDR_PWG4PartCorr) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF))
59         @echo "Creating archive" $@ ...
60         @tar cfzh $@ $(PACKAGE)
61         @rm -rf $(PACKAGE)
62         @echo "done"
63
64 $(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
65         @echo Copying $< to $@ with transformations
66         @[ -d $(dir $@) ] || mkdir -p $(dir $@)
67         @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
68
69 $(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
70         @echo Copying $< to $@
71         @[ -d $(dir $@) ] || mkdir -p $(dir $@)
72         @cp -a $^ $@
73
74 $(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
75         @echo Copying $< to $@
76         @[ -d $(dir $@) ] || mkdir -p $(dir $@)
77         @cp -a -r $^ $@
78
79 $(PACKAGE)/%: %
80         @echo Copying $< to $@
81         @[ -d $(dir $@) ] || mkdir -p $(dir $@)
82         @cp -a $< $@
83
84 test-%.par: %.par
85         @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
86         @mkdir -p par-tmp
87         @cd par-tmp; tar xfz ../$<;     cd $(subst .par,,$<); PROOF-INF/BUILD.sh
88         @rm -rf par-tmp
89         @echo "INFO: Testing succeeded (already cleaned up)"