]>
Commit | Line | Data |
---|---|---|
113279f5 | 1 | Module :=RICH |
2 | ||
a25b3368 | 3 | include lib$(Module)base.pkg |
4 | SrcBase :=$(SRCS) | |
113279f5 | 5 | |
a25b3368 | 6 | include lib$(Module)sim.pkg |
7 | SrcSim :=$(SRCS) | |
8 | ||
9 | include lib$(Module)rec.pkg | |
10 | SrcRec :=$(SRCS) | |
113279f5 | 11 | |
12 | RootTarget :=$(shell root-config --arch) | |
a25b3368 | 13 | DirOut :=$(LIB_MY)/$(Module) |
14 | LibBase :=$(LIB_MY)/lib$(Module)base.so | |
15 | LibSim :=$(LIB_MY)/lib$(Module)sim.so | |
16 | LibRec :=$(LIB_MY)/lib$(Module)rec.so | |
17 | ||
18 | ||
19 | HdrBase := $(SrcBase:.cxx=.h) $(Module)baseLinkDef.h | |
20 | HdrSim := $(SrcSim:.cxx=.h) $(Module)simLinkDef.h | |
21 | HdrRec := $(SrcRec:.cxx=.h) $(Module)recLinkDef.h | |
22 | ||
23 | DictSrcBase := $(DirOut)/Dict$(Module)base.cxx | |
24 | DictObjBase := $(DictSrcBase:.cxx=.o) | |
25 | ||
26 | DictSrcSim := $(DirOut)/Dict$(Module)sim.cxx | |
27 | DictObjSim := $(DictSrcSim:.cxx=.o) | |
28 | ||
29 | DictSrcRec := $(DirOut)/Dict$(Module)rec.cxx | |
30 | DictObjRec := $(DictSrcRec:.cxx=.o) | |
31 | ||
32 | ||
33 | ||
34 | ObjBase := $(patsubst %.cxx,$(DirOut)/%.o,$(SrcBase)) $(DictObjBase) | |
35 | ObjSim := $(patsubst %.cxx,$(DirOut)/%.o,$(SrcSim)) $(DictObjSim) | |
36 | ObjRec := $(patsubst %.cxx,$(DirOut)/%.o,$(SrcRec)) $(DictObjRec) | |
37 | ||
38 | ||
39 | DepFile := $(DirOut)/$(Module).depend | |
113279f5 | 40 | |
41 | ifeq ($(RootTarget),linuxicc) | |
a25b3368 | 42 | Compiler :=icc |
43 | CompilerOpt :=-O0 -fpstkchk -I$(shell root-config --incdir) -I$(ALICE_ROOT)/include | |
44 | LibOpt :=-O -g -shared -Wl | |
113279f5 | 45 | else |
a25b3368 | 46 | Compiler :=g++ |
47 | CompilerOpt :=-g -W -Wall -Werror -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -I$(shell root-config --incdir) -I$(ALICE_ROOT)/include | |
48 | LibOpt :=-O -g -shared -Wl | |
113279f5 | 49 | endif |
50 | ||
51 | ifdef ALIVERBOSE | |
52 | Mute := | |
53 | else | |
54 | Mute :=@ | |
55 | endif | |
56 | ||
113279f5 | 57 | ##### TARGETS ##### |
58 | ||
a25b3368 | 59 | all: $(LibBase) $(LibSim) $(LibRec) |
60 | $(LibBase): $(ObjBase) | |
113279f5 | 61 | @echo "Creating $@" |
a25b3368 | 62 | $(Mute)$(Compiler) $(LibOpt) $^ -o $@ |
113279f5 | 63 | |
a25b3368 | 64 | $(LibSim): $(ObjSim) |
65 | @echo "Creating $@" | |
66 | $(Mute)$(Compiler) $(LibOpt) $^ -o $@ | |
67 | ||
68 | $(LibRec): $(ObjRec) | |
69 | @echo "Creating $@" | |
70 | $(Mute)$(Compiler) $(LibOpt) $^ -o $@ | |
71 | ||
72 | $(DepFile): $(HdrBase) $(HdrSim) $(HdrRec) | |
73 | @[ -d $(DirOut) ] || mkdir -p $(DirOut) | |
113279f5 | 74 | @touch $(DepFile) |
75 | @echo "Generating dependency $@" | |
a25b3368 | 76 | $(Mute)rmkdepend -f$(DepFile) -p$(DirOut)/ -- $(CompilerOpt) -- $(SrcBase) $(SrcSim) $(SrcRec) 2>/dev/null |
113279f5 | 77 | |
a25b3368 | 78 | $(DictSrcBase): $(HdrBase) |
79 | @echo "Generating $@" | |
80 | $(Mute)rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^ | |
81 | ||
82 | $(DictSrcSim): $(HdrSim) | |
83 | @echo "Generating $@" | |
84 | $(Mute)rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^ | |
85 | ||
86 | $(DictSrcRec): $(HdrRec) | |
113279f5 | 87 | @echo "Generating $@" |
a25b3368 | 88 | $(Mute)rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^ |
113279f5 | 89 | |
a25b3368 | 90 | $(DictObjBase) : $(DictSrcBase) |
113279f5 | 91 | @echo "Compiling $^" |
a25b3368 | 92 | $(Mute)$(Compiler) $(CompilerOpt) -I. -c $^ -o $@ |
93 | ||
94 | $(DictObjSim) : $(DictSrcSim) | |
95 | @echo "Compiling $^" | |
96 | $(Mute)$(Compiler) $(CompilerOpt) -I. -c $^ -o $@ | |
97 | ||
98 | $(DictObjRec) : $(DictSrcRec) | |
99 | @echo "Compiling $^" | |
100 | $(Mute)$(Compiler) $(CompilerOpt) -I. -c $^ -o $@ | |
113279f5 | 101 | |
102 | show: | |
a25b3368 | 103 | @echo "Base Headers: $(HdrBase)" |
104 | @echo "Base Sources: $(SrcBase)" | |
105 | @echo "Base Objects: $(ObjBase)" | |
106 | @echo "Base Dict: $(DictSrcBase)" | |
107 | @echo -e "Base Library: $(LibBase)\n" | |
108 | ||
109 | @echo "Sim Headers: $(HdrSim)" | |
110 | @echo "Sim Sources: $(SrcSim)" | |
111 | @echo "Sim Objects: $(ObjSim)" | |
112 | @echo -e "Sim Library: $(LibSim)\n" | |
113 | ||
114 | @echo "Rec Headers: $(HdrRec)" | |
115 | @echo "Rec Sources: $(SrcRec)" | |
116 | @echo "Rec Objects: $(ObjRec)" | |
117 | @echo -e "Rec Library: $(LibRec)\n" | |
118 | ||
119 | spec: $(SrcBase) | |
113279f5 | 120 | @echo $^ |
121 | @echo $@ | |
122 | ||
123 | clean: | |
124 | @echo "Cleaning..." | |
a25b3368 | 125 | $(Mute)rm -rf $(DirOut) $(LibBase) $(LibSim) $(LibRec) |
113279f5 | 126 | |
127 | ############################ cxx rule ######################################### | |
a25b3368 | 128 | $(DirOut)/%.o : %.cxx |
113279f5 | 129 | @echo $*.cxx |
a25b3368 | 130 | $(Mute)$(Compiler) $(CompilerOpt) -c $*.cxx -o $(DirOut)/$*.o |
113279f5 | 131 | ############################ Dependencies ##################################### |
132 | ||
133 | -include $(DepFile) |