]>
Commit | Line | Data |
---|---|---|
fe88cf1b | 1 | Module :=HMPID |
2 | ||
3 | include lib$(Module)base.pkg | |
4 | SrcBase :=$(SRCS) | |
5 | ||
6 | include lib$(Module)sim.pkg | |
7 | SrcSim :=$(SRCS) | |
8 | ||
9 | include lib$(Module)rec.pkg | |
10 | SrcRec :=$(SRCS) | |
11 | ||
025aa9c7 | 12 | RootTarget :=$(shell $(ROOTSYS)/bin/root-config --arch) |
fe88cf1b | 13 | DirOut :=/tmp/$(USER)_$(Module)_obj |
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 | |
40 | ||
41 | ifeq ($(RootTarget),linuxicc) | |
42 | Compiler :=icc | |
025aa9c7 | 43 | CompilerOpt :=-fpstkchk -I$(shell $(ROOTSYS)/bin/root-config --incdir) -I$(ALICE_ROOT)/include |
fe88cf1b | 44 | LibOpt :=-g -shared -Wl |
45 | else | |
46 | Compiler :=g++ | |
025aa9c7 | 47 | CompilerOpt :=-g -W -Wall -Werror -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux -D`uname` -I$(shell $(ROOTSYS)/bin/root-config --incdir) -I$(ALICE_ROOT)/include |
fe88cf1b | 48 | LibOpt :=-g -shared -Wl |
49 | endif | |
50 | ||
51 | ifdef ALIVERBOSE | |
52 | Mute := | |
53 | else | |
54 | Mute :=@ | |
55 | endif | |
56 | ||
57 | ##### TARGETS ##### | |
58 | ||
59 | all: $(LibBase) $(LibSim) $(LibRec) | |
60 | $(LibBase): $(ObjBase) | |
61 | @echo "Creating $@" | |
62 | $(Mute)$(Compiler) $(LibOpt) $^ -o $@ | |
63 | ||
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) | |
74 | @[ -d $(LIB_MY) ] || mkdir -p $(LIB_MY) | |
75 | @touch $(DepFile) | |
76 | @echo "Generating dependency $@" | |
025aa9c7 | 77 | $(Mute)$(ROOTSYS)/bin/rmkdepend -f$(DepFile) -p$(DirOut)/ -- $(CompilerOpt) -- $(SrcBase) $(SrcSim) $(SrcRec) 2>/dev/null |
fe88cf1b | 78 | |
79 | $(DictSrcBase): $(HdrBase) | |
80 | @echo "Generating $@" | |
025aa9c7 | 81 | $(Mute)$(ROOTSYS)/bin/rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^ |
fe88cf1b | 82 | |
83 | $(DictSrcSim): $(HdrSim) | |
84 | @echo "Generating $@" | |
025aa9c7 | 85 | $(Mute)$(ROOTSYS)/bin/rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^ |
fe88cf1b | 86 | |
87 | $(DictSrcRec): $(HdrRec) | |
88 | @echo "Generating $@" | |
025aa9c7 | 89 | $(Mute)$(ROOTSYS)/bin/rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^ |
fe88cf1b | 90 | |
91 | $(DictObjBase) : $(DictSrcBase) | |
92 | @echo "Compiling $^" | |
93 | $(Mute)$(Compiler) $(CompilerOpt) -I. -c $^ -o $@ | |
94 | ||
95 | $(DictObjSim) : $(DictSrcSim) | |
96 | @echo "Compiling $^" | |
97 | $(Mute)$(Compiler) $(CompilerOpt) -I. -c $^ -o $@ | |
98 | ||
99 | $(DictObjRec) : $(DictSrcRec) | |
100 | @echo "Compiling $^" | |
101 | $(Mute)$(Compiler) $(CompilerOpt) -I. -c $^ -o $@ | |
102 | ||
103 | show: | |
104 | @echo "Base Headers: $(HdrBase)" | |
105 | @echo "Base Sources: $(SrcBase)" | |
106 | @echo "Base Objects: $(ObjBase)" | |
107 | @echo "Base Dict: $(DictSrcBase)" | |
108 | @echo -e "Base Library: $(LibBase)\n" | |
109 | ||
110 | @echo "Sim Headers: $(HdrSim)" | |
111 | @echo "Sim Sources: $(SrcSim)" | |
112 | @echo "Sim Objects: $(ObjSim)" | |
113 | @echo -e "Sim Library: $(LibSim)\n" | |
114 | ||
115 | @echo "Rec Headers: $(HdrRec)" | |
116 | @echo "Rec Sources: $(SrcRec)" | |
117 | @echo "Rec Objects: $(ObjRec)" | |
118 | @echo -e "Rec Library: $(LibRec)\n" | |
119 | ||
120 | spec: $(SrcBase) | |
121 | @echo "^ $^" | |
122 | @echo "@ $@" | |
123 | @echo "< $<" | |
124 | ||
125 | clean: | |
126 | @echo "Cleaning..." | |
127 | $(Mute)rm -rf $(DirOut) $(LibBase) $(LibSim) $(LibRec) | |
128 | ||
129 | ############################ cxx rule ######################################### | |
130 | $(DirOut)/%.o : %.cxx | |
131 | @echo $*.cxx | |
132 | $(Mute)$(Compiler) $(CompilerOpt) -c $*.cxx -o $(DirOut)/$*.o | |
133 | ############################ Dependencies ##################################### | |
134 | ||
135 | -include $(DepFile) |