Coveriry
[u/mrichter/AliRoot.git] / PWG3 / Makefile
1 # $Id$
2
3 PACKAGE = PWG3
4
5 include Makefile.arch
6
7 ALICEINC      = -I.
8
9 ### define include dir for local case and par case
10 ifneq ($(ESD_INCLUDE),)
11    ALICEINC += -I../$(ESD_INCLUDE)
12         ifneq ($(STEERBase_INCLUDE),)
13                 ALICEINC += -I../$(STEERBase_INCLUDE)
14         endif                           
15         ifneq ($(CDB_INCLUDE),)
16                 ALICEINC += -I../$(CDB_INCLUDE)
17         endif                           
18         ifneq ($(AOD_INCLUDE),)
19                 ALICEINC += -I../$(AOD_INCLUDE)
20         endif
21         ifneq ($(ANALYSIS_INCLUDE),)
22                 ALICEINC += -I../$(ANALYSIS_INCLUDE)
23         endif
24         ifneq ($(ANALYSISalice_INCLUDE),)
25                 ALICEINC += -I../$(ANALYSISalice_INCLUDE)
26         endif
27         ifneq ($(CORRFW_INCLUDE),)
28                 ALICEINC += -I../$(CORRFW_INCLUDE)
29         endif
30         ifneq ($(PWG3base_INCLUDE),)
31                 ALICEINC += -I../$(PWG3base_INCLUDE)
32         endif
33 else
34   ifneq ($(ALICE_ROOT),)
35     ALICEINC += -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/PWG3/base -I$(ALICE_ROOT)/MUON -I$(ALICE_ROOT)/MUON/mapping
36 else
37   endif
38 endif
39
40 SRCS     = $(wildcard $(subst PWG3,,$(PACKAGE))/*.cxx)
41 HDRS     = $(SRCS:.cxx=.h)
42 DHDR     = $(PACKAGE)LinkDef.h
43 CXXFLAGS     += $(ALICEINC) -g
44
45 DHDR_PWG3 := $(DHDR)
46 HDRS_PWG3 := $(HDRS)
47 SRCS_PWG3 := $(SRCS) G__$(PACKAGE).cxx
48 OBJS_PWG3 := $(SRCS_PWG3:.cxx=.o)
49
50 PARFILE       = $(PACKAGE).par
51
52 lib$(PACKAGE).so: $(OBJS_PWG3)
53         @echo "Linking" $@ ...
54         @/bin/rm -f $@
55 ifeq ($(PLATFORM),macosx)
56 # We need to make both the .dylib and the .so
57                 $(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@
58 ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
59 ifeq ($(MACOSX_MINOR),4)
60                 ln -sf $@ $(subst .$(DllSuf),.so,$@)
61 else
62                 $(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ \
63                    $(OutPutOpt) $(subst .$(DllSuf),.so,$@)
64 endif
65 endif
66 else
67 ifeq ($(PLATFORM),win32)
68                 bindexplib $* $^ > $*.def
69                 lib -nologo -MACHINE:IX86 $^ -def:$*.def \
70                    $(OutPutOpt)$(EVENTLIB)
71                 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \
72                    $(OutPutOpt)$@
73 else
74                 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
75 endif
76 endif
77         @chmod a+x $@
78         @echo "done"
79
80 %.o:    %.cxx %.h
81         $(CXX) $(CXXFLAGS) -c $< -o $@
82
83 G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS) $(DHDR)
84         @echo "Generating dictionary ..."
85         rootcint -f $@ -c $(ALICEINC) $^
86
87 clean:
88         @rm -f $(OBJS)  *.so G__$(PACKAGE).*  $(PARFILE)