Adding a reminder for coders
[u/mrichter/AliRoot.git] / EMCAL / Makefile
CommitLineData
07d5ad6b 1# $Id: Makefile 33076 2009-06-19 16:40:17Z akisiel $
2
3include $(ROOTSYS)/test/Makefile.arch
4
5PACKAGE = EMCAL
6
7default-target: lib$(PACKAGE).so
8
9ALICEINC = -I.
10
11### define include dir for local case and par case
12
6b527f8f 13### in case of Root compilation for ANALYSIS, only load EMCALUtils
14### if modification of EMCAL libraries, include STEER and RAW
45040bd3 15ifneq ($(STEERBase_INCLUDE),)
16 ALICEINC += -I../$(STEERBase_INCLUDE)
bd8c7aef 17 ALICEINC += -I../$(ESD_INCLUDE)
18 ALICEINC += -I../$(AOD_INCLUDE)
6b527f8f 19else
20 ALICEINC += -I$(ALICE_ROOT)/include
21 ALICEINC += -I$(ALICE_ROOT)/STEER
22 ALICEINC += -I$(ALICE_ROOT)/RAW
23 ALICEINC += -I$(ALICE_ROOT)/VZERO
45040bd3 24endif
25
6b527f8f 26### in modification of EMCAL libraries, and not modification of EMCALUtils, include EMCAL from aliroot
07d5ad6b 27ifneq ($(EMCALUtils_INCLUDE),)
28 ALICEINC += -I../$(EMCALUtils_INCLUDE)
6b527f8f 29else
30 ALICEINC += -I$(ALICE_ROOT)/EMCAL
07d5ad6b 31endif
32
33ifneq ($(EMCALbase_INCLUDE),)
34 ALICEINC += -I../$(EMCALbase_INCLUDE)
35endif
36
37ifneq ($(EMCALsim_INCLUDE),)
38 ALICEINC += -I../$(EMCALsim_INCLUDE)
39endif
40
41ifneq ($(EMCALrec_INCLUDE),)
42 ALICEINC += -I../$(EMCALrec_INCLUDE)
43endif
44
45# only if no par file was loaded before
46ifeq ($(ALICEINC),-I.)
47 ifneq ($(ALICE_ROOT),)
48 ALICEINC += -I$(ALICE_ROOT)/include
49 ALICEINC += -I$(ALICE_ROOT)/STEER
50 ALICEINC += -I$(ALICE_ROOT)/RAW
51 ALICEINC += -I$(ALICE_ROOT)/EMCAL
52 endif
53endif
54
55
56CXXFLAGS += $(ALICEINC) -g
57F77FLAGS += $(ALICEINC) -g -fPIC
58
59
958d9d26 60SRCS = $(wildcard *.cxx */*.cxx)
61HDRS = $(SRCS:.cxx=.h)
62DHDR = $(PACKAGE)LinkDef.h
07d5ad6b 63
64DHDR_EMCAL := $(DHDR)
65HDRS_EMCAL := $(HDRS)
66SRCS_EMCAL := $(SRCS) G__$(PACKAGE).cxx
67FSCRS_EMCAL := $(FSRCS)
68OBJS_EMCAL := $(SRCS_EMCAL:.cxx=.o) $(FSRCS:.F=.o)
69
70PARFILE = $(PACKAGE).par
71
72lib$(PACKAGE).so: $(OBJS_EMCAL)
73 @echo "Linking" $@ ...
74 @/bin/rm -f $@
d86acb69 75ifeq ($(PLATFORM),macosx)
76# We need to make both the .dylib and the .so
77 $(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@
78ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
79ifeq ($(MACOSX_MINOR),4)
80 ln -sf $@ $(subst .$(DllSuf),.so,$@)
07d5ad6b 81else
d86acb69 82 $(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ \
83 $(OutPutOpt) $(subst .$(DllSuf),.so,$@)
84endif
85endif
86else
87ifeq ($(PLATFORM),win32)
88 bindexplib $* $^ > $*.def
89 lib -nologo -MACHINE:IX86 $^ -def:$*.def \
90 $(OutPutOpt)$(EVENTLIB)
91 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \
92 $(OutPutOpt)$@
93else
94 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
95endif
07d5ad6b 96endif
97 @chmod a+x $@
98 @echo "done"
99
100%.o: %.cxx %.h
101 $(CXX) $(CXXFLAGS) -c $< -o $@
102
103%.o: %.F
104 $(F77) $(F77FLAGS) -c $< -o $@
105
106G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS_EMCAL) $(DHDR_EMCAL)
107 @echo "Generating dictionary ..."
108 rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^
109
110clean:
111 @rm -f $(OBJS_EMCAL) *.so G__$(PACKAGE).* $(PARFILE)
112
113### CREATE PAR FILE
114
84d4333f 115$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_EMCAL) $(SRCS_EMCAL) $(DHDR_EMCAL) Makefile Makefile.arch PROOF-INF))
07d5ad6b 116 @echo "Creating archive" $@ ...
117 @tar cfzh $@ $(PACKAGE)
118 @rm -rf $(PACKAGE)
119 @echo "done"
120
121$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
122 @echo Copying $< to $@ with transformations
123 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
124 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
125
126$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
127 @echo Copying $< to $@
128 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
129 @cp -a $^ $@
130
131$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
132 @echo Copying $< to $@
133 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
134 @cp -a -r $^ $@
135
136$(PACKAGE)/%: %
137 @echo Copying $< to $@
138 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
139 @cp -a $< $@
140
141test-%.par: %.par
142 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
143 @mkdir -p par-tmp
144 @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
145 @rm -rf par-tmp
146 @echo "INFO: Testing succeeded (already cleaned up)"