Fix for the problem during PbPb run of Nov 2010 (Indra)
[u/mrichter/AliRoot.git] / PWG4 / Makefile
1 PACKAGE = PWG4JetTasks
2
3 include Makefile.arch
4
5 ifndef PACKCXXFLAGS
6    PACKCXXFLAGS = $(CXXFLAGS)
7 endif
8
9 ALICEINC = -I.
10
11 ### define include dir for local case and par case
12 ifneq ($(STEERBase_INCLUDE),)
13   ALICEINC += -I../$(STEERBase_INCLUDE)
14 endif
15
16 ifneq ($(ESD_INCLUDE),)
17   ALICEINC += -I../$(ESD_INCLUDE)
18 endif
19
20 ifneq ($(AOD_INCLUDE),)
21   ALICEINC += -I../$(AOD_INCLUDE)
22 endif
23
24 ifneq ($(ANALYSIS_INCLUDE),)
25   ALICEINC += -I../$(ANALYSIS_INCLUDE)
26 endif
27
28 ifneq ($(ANALYSISalice_INCLUDE),)
29   ALICEINC += -I../$(ANALYSISalice_INCLUDE)
30 endif
31
32 ifneq ($(EventMixing_INCLUDE),)
33   ALICEINC += -I../$(EventMixing_INCLUDE)
34 endif
35
36 ifneq ($(JETAN_INCLUDE),)
37   ALICEINC += -I../$(JETAN_INCLUDE)
38 endif
39
40 ifneq ($(CORRFW_INCLUDE),)
41   ALICEINC += -I../$(CORRFW_INCLUDE)
42 endif
43
44 ifneq ($(PHOSUtils_INCLUDE),)
45   ALICEINC += -I../$(PHOSUtils_INCLUDE)
46   CXXFLAGS+=-D__PHOSUTIL__
47 endif
48
49 ifneq ($(EMCALUtils_INCLUDE),)
50   ALICEINC += -I../$(EMCALUtils_INCLUDE)
51   CXXFLAGS+=-D__EMCALUTIL__
52 endif
53
54 ifneq ($(PWG4PartCorrBase_INCLUDE),)
55   ALICEINC += -I../$(PWG4PartCorrBase_INCLUDE)
56 endif
57
58 ifneq ($(PWG4PartCorrDep_INCLUDE),)
59  ALICEINC += -I../$(PWG4PartCorrBase_INCLUDE) 
60  ALICEINC += -I../$(PWG4PartCorrDep_INCLUDE)
61 endif
62
63 ifneq ($(PWG4GammaConv_INCLUDE),)
64   ALICEINC += -I../$(PWG4GammaConv_INCLUDE)
65 endif
66
67 ifneq ($(PWG4JetTasks_INCLUDE),)
68   ALICEINC += -I../$(PWG4JetTasks_INCLUDE)
69 endif
70
71 ifneq ($(JETAN_INCLUDE),)
72   ALICEINC += -I../$(JETAN_INCLUDE)
73 endif
74
75 ifneq ($(PWG4JCORRAN_INCLUDE),)
76   ALICEINC += -I../$(PWG4JCORRAN_INCLUDE)
77 endif
78
79 # only if no par file was loaded before
80 #ifeq ($(ALICEINC),-I.)
81   ifneq ($(ALICE_ROOT),)
82     ALICEINC += -I$(ALICE_ROOT)/include
83     ALICEINC += -I$(ALICE_ROOT)/ANALYSIS
84     ALICEINC += -I$(ALICE_ROOT)/JETAN   # some extra includes
85     ALICEINC += -I$(ALICE_ROOT)/PHOS
86     ALICEINC += -I$(ALICE_ROOT)/EMCAL
87     ALICEINC += -I$(ALICE_ROOT)/PWG4/PartCorrBase
88   endif
89 #endif
90
91 CXXFLAGS += $(ALICEINC) -g
92
93 SRCS     = $(wildcard $(subst PWG4,,$(PACKAGE))/*.cxx)
94 HDRS     = $(SRCS:.cxx=.h)
95 DHDR     = $(PACKAGE)LinkDef.h
96
97 DHDR_PWG4 := $(DHDR)
98 HDRS_PWG4 := $(HDRS)
99 SRCS_PWG4 := $(SRCS) G__$(PACKAGE).cxx
100 OBJS_PWG4 := $(SRCS_PWG4:.cxx=.o)
101
102 PARFILE       = $(PACKAGE).par
103
104 lib$(PACKAGE).so: $(OBJS_PWG4)
105         @echo "Linking" $@ ...
106         @/bin/rm -f $@
107 ifeq ($(PLATFORM),macosx)
108 # We need to make both the .dylib and the .so
109                 $(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@
110 ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
111 ifeq ($(MACOSX_MINOR),4)
112                 ln -sf $@ $(subst .$(DllSuf),.so,$@)
113 else
114                 $(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ \
115                    $(OutPutOpt) $(subst .$(DllSuf),.so,$@)
116 endif
117 endif
118 else
119 ifeq ($(PLATFORM),win32)
120                 bindexplib $* $^ > $*.def
121                 lib -nologo -MACHINE:IX86 $^ -def:$*.def \
122                    $(OutPutOpt)$(EVENTLIB)
123                 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \
124                    $(OutPutOpt)$@
125 else
126                 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
127 endif
128 endif
129         @chmod a+x $@
130         @echo "done"
131
132 %.o:    %.cxx %.h
133         $(CXX) $(PACKCXXFLAGS) -c $< -o $@
134
135 clean:
136         @rm -f $(OBJS) *.so G__$(PACKAGE).*
137
138 G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS) $(DHDR)
139         @echo "Generating dictionaries ..." $(ALICEINC)
140         rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^