update of LED DA execute macro
[u/mrichter/AliRoot.git] / EMCAL / Makefile
CommitLineData
07d5ad6b 1# $Id: Makefile 33076 2009-06-19 16:40:17Z akisiel $
2
41f671ab 3include Makefile.arch
07d5ad6b 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
41f671ab 46#ifeq ($(ALICEINC),-I.)
07d5ad6b 47 ifneq ($(ALICE_ROOT),)
48 ALICEINC += -I$(ALICE_ROOT)/include
41f671ab 49# ALICEINC += -I$(ALICE_ROOT)/RAW
50# ALICEINC += -I$(ALICE_ROOT)/EMCAL
07d5ad6b 51 endif
41f671ab 52#endif
07d5ad6b 53
54
55CXXFLAGS += $(ALICEINC) -g
56F77FLAGS += $(ALICEINC) -g -fPIC
57
58
958d9d26 59SRCS = $(wildcard *.cxx */*.cxx)
60HDRS = $(SRCS:.cxx=.h)
61DHDR = $(PACKAGE)LinkDef.h
07d5ad6b 62
63DHDR_EMCAL := $(DHDR)
64HDRS_EMCAL := $(HDRS)
65SRCS_EMCAL := $(SRCS) G__$(PACKAGE).cxx
66FSCRS_EMCAL := $(FSRCS)
67OBJS_EMCAL := $(SRCS_EMCAL:.cxx=.o) $(FSRCS:.F=.o)
68
69PARFILE = $(PACKAGE).par
70
71lib$(PACKAGE).so: $(OBJS_EMCAL)
72 @echo "Linking" $@ ...
73 @/bin/rm -f $@
41f671ab 74 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
07d5ad6b 75 @chmod a+x $@
76 @echo "done"
77
78%.o: %.cxx %.h
79 $(CXX) $(CXXFLAGS) -c $< -o $@
80
81%.o: %.F
82 $(F77) $(F77FLAGS) -c $< -o $@
83
84G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS_EMCAL) $(DHDR_EMCAL)
85 @echo "Generating dictionary ..."
86 rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^
87
88clean:
89 @rm -f $(OBJS_EMCAL) *.so G__$(PACKAGE).* $(PARFILE)
90
91### CREATE PAR FILE
92
84d4333f 93$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_EMCAL) $(SRCS_EMCAL) $(DHDR_EMCAL) Makefile Makefile.arch PROOF-INF))
07d5ad6b 94 @echo "Creating archive" $@ ...
95 @tar cfzh $@ $(PACKAGE)
96 @rm -rf $(PACKAGE)
97 @echo "done"
98
99$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
100 @echo Copying $< to $@ with transformations
101 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
102 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
103
104$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
105 @echo Copying $< to $@
106 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
107 @cp -a $^ $@
108
109$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
110 @echo Copying $< to $@
111 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
112 @cp -a -r $^ $@
113
114$(PACKAGE)/%: %
115 @echo Copying $< to $@
116 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
117 @cp -a $< $@
118
119test-%.par: %.par
120 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
121 @mkdir -p par-tmp
122 @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
123 @rm -rf par-tmp
124 @echo "INFO: Testing succeeded (already cleaned up)"