3 include lib$(Module)base.pkg
6 include lib$(Module)sim.pkg
9 include lib$(Module)rec.pkg
12 RootTarget :=$(shell $(ROOTSYS)/bin/root-config --arch)
13 DirOut :=/tmp/$(USER)_$(Module)_obj
14 DirInc := -I$(shell $(ROOTSYS)/bin/root-config --incdir) -I$(ALICE_ROOT)/include
16 LibBase :=$(LIB_MY)/lib$(Module)base.so
17 LibSim :=$(LIB_MY)/lib$(Module)sim.so
18 LibRec :=$(LIB_MY)/lib$(Module)rec.so
21 HdrBase := $(SrcBase:.cxx=.h) $(Module)baseLinkDef.h
22 HdrSim := $(SrcSim:.cxx=.h) $(Module)simLinkDef.h
23 HdrRec := $(SrcRec:.cxx=.h) $(Module)recLinkDef.h
25 DictSrcBase := $(DirOut)/Dict$(Module)base.cxx
26 DictObjBase := $(DictSrcBase:.cxx=.o)
28 DictSrcSim := $(DirOut)/Dict$(Module)sim.cxx
29 DictObjSim := $(DictSrcSim:.cxx=.o)
31 DictSrcRec := $(DirOut)/Dict$(Module)rec.cxx
32 DictObjRec := $(DictSrcRec:.cxx=.o)
36 ObjBase := $(patsubst %.cxx,$(DirOut)/%.o,$(SrcBase)) $(DictObjBase)
37 ObjSim := $(patsubst %.cxx,$(DirOut)/%.o,$(SrcSim)) $(DictObjSim)
38 ObjRec := $(patsubst %.cxx,$(DirOut)/%.o,$(SrcRec)) $(DictObjRec)
40 CodeRules := $(patsubst %.cxx,$(DirOut)/%.viol,$(SrcBase) $(SrcSim) $(SrcRec))
42 export IRST_INSTALLDIR=$(HOME)/IRST
43 export IRST_CONFIG_DIR=$(IRST_INSTALLDIR)/userConfig/ALICE
44 export CLASSPATH=$(IRST_INSTALLDIR)
47 #-------------------------------------------------------------------------------
49 DepFile := $(DirOut)/$(Module).depend
53 ifeq ($(RootTarget),linuxicc)
55 CompilerOpt :=-fpstkchk -I$(shell $(ROOTSYS)/bin/root-config --incdir) -I$(ALICE_ROOT)/include
56 LibOpt :=-g -shared -Wl
59 CompilerOpt :=-g -W -Wall -Werror -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux -D`uname` $(DirInc)
60 LibOpt :=-g -shared -Wl
71 all: $(LibBase) $(LibSim) $(LibRec)
72 $(LibBase): $(ObjBase)
74 $(Mute)$(Compiler) $(LibOpt) $^ -o $@
78 $(Mute)$(Compiler) $(LibOpt) $^ -o $@
82 $(Mute)$(Compiler) $(LibOpt) $^ -o $@
84 $(DepFile): $(HdrBase) $(HdrSim) $(HdrRec)
85 @[ -d $(DirOut) ] || mkdir -p $(DirOut)
86 @[ -d $(LIB_MY) ] || mkdir -p $(LIB_MY)
88 @echo "Generating dependency $@"
89 $(Mute)$(ROOTSYS)/bin/rmkdepend -f$(DepFile) -p$(DirOut)/ -- $(CompilerOpt) -- $(SrcBase) $(SrcSim) $(SrcRec) 2>/dev/null
91 $(DictSrcBase): $(HdrBase)
93 $(Mute)$(ROOTSYS)/bin/rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^
95 $(DictSrcSim): $(HdrSim)
97 $(Mute)$(ROOTSYS)/bin/rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^
99 $(DictSrcRec): $(HdrRec)
100 @echo "Generating $@"
101 $(Mute)$(ROOTSYS)/bin/rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^
103 $(DictObjBase) : $(DictSrcBase)
105 $(Mute)$(Compiler) $(CompilerOpt) -I. -c $^ -o $@
107 $(DictObjSim) : $(DictSrcSim)
109 $(Mute)$(Compiler) $(CompilerOpt) -I. -c $^ -o $@
111 $(DictObjRec) : $(DictSrcRec)
113 $(Mute)$(Compiler) $(CompilerOpt) -I. -c $^ -o $@
119 @echo "Base Headers: $(HdrBase)"
120 @echo "Base Sources: $(SrcBase)"
121 @echo "Base Objects: $(ObjBase)"
122 @echo "Base Dict: $(DictSrcBase)"
123 @echo -e "Base Library: $(LibBase)\n"
125 @echo "Sim Headers: $(HdrSim)"
126 @echo "Sim Sources: $(SrcSim)"
127 @echo "Sim Objects: $(ObjSim)"
128 @echo -e "Sim Library: $(LibSim)\n"
130 @echo "Rec Headers: $(HdrRec)"
131 @echo "Rec Sources: $(SrcRec)"
132 @echo "Rec Objects: $(ObjRec)"
133 @echo -e "Rec Library: $(LibRec)\n"
134 @echo "Rules check: $(CodeRules)"
135 @echo "CompilerOpt: $(CompilerOpt)"
144 $(Mute)rm -rf $(DirOut) $(LibBase) $(LibSim) $(LibRec)
146 ############################ cxx rule #########################################
147 $(DirOut)/%.o : %.cxx
149 $(Mute)$(Compiler) $(CompilerOpt) -c $*.cxx -o $(DirOut)/$*.o
151 $(DirOut)/%.i : %.cxx $(DepFile)
152 $(Mute)$(Compiler) -E -g -pipe -fPIC -Wall $(DirInc) $< > $@
153 @cd $(dir $@) ; $(IRST_INSTALLDIR)/patch/patch4alice.prl $(notdir $@)
155 $(DirOut)/%.viol : $(DirOut)/%.i
156 @echo $@ ; java rules.ALICE.ALICERuleChecker $< ./ > $@
157 ############################ Dependencies #####################################