]>
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 |
92017a47 | 14 | DirInc := -I$(shell $(ROOTSYS)/bin/root-config --incdir) -I$(ALICE_ROOT)/include |
15 | ||
fe88cf1b | 16 | LibBase :=$(LIB_MY)/lib$(Module)base.so |
17 | LibSim :=$(LIB_MY)/lib$(Module)sim.so | |
18 | LibRec :=$(LIB_MY)/lib$(Module)rec.so | |
19 | ||
20 | ||
21 | HdrBase := $(SrcBase:.cxx=.h) $(Module)baseLinkDef.h | |
22 | HdrSim := $(SrcSim:.cxx=.h) $(Module)simLinkDef.h | |
23 | HdrRec := $(SrcRec:.cxx=.h) $(Module)recLinkDef.h | |
24 | ||
25 | DictSrcBase := $(DirOut)/Dict$(Module)base.cxx | |
26 | DictObjBase := $(DictSrcBase:.cxx=.o) | |
27 | ||
28 | DictSrcSim := $(DirOut)/Dict$(Module)sim.cxx | |
29 | DictObjSim := $(DictSrcSim:.cxx=.o) | |
30 | ||
31 | DictSrcRec := $(DirOut)/Dict$(Module)rec.cxx | |
32 | DictObjRec := $(DictSrcRec:.cxx=.o) | |
33 | ||
34 | ||
35 | ||
36 | ObjBase := $(patsubst %.cxx,$(DirOut)/%.o,$(SrcBase)) $(DictObjBase) | |
37 | ObjSim := $(patsubst %.cxx,$(DirOut)/%.o,$(SrcSim)) $(DictObjSim) | |
38 | ObjRec := $(patsubst %.cxx,$(DirOut)/%.o,$(SrcRec)) $(DictObjRec) | |
39 | ||
92017a47 | 40 | CodeRules := $(patsubst %.cxx,$(DirOut)/%.viol,$(SrcBase) $(SrcSim) $(SrcRec)) |
41 | ||
08801509 | 42 | export IRST_INSTALLDIR=$(HOME)/IRST |
92017a47 | 43 | export IRST_CONFIG_DIR=$(IRST_INSTALLDIR)/userConfig/ALICE |
44 | export CLASSPATH=$(IRST_INSTALLDIR) | |
45 | ||
46 | ||
47 | #------------------------------------------------------------------------------- | |
fe88cf1b | 48 | |
49 | DepFile := $(DirOut)/$(Module).depend | |
50 | ||
92017a47 | 51 | |
52 | ||
fe88cf1b | 53 | ifeq ($(RootTarget),linuxicc) |
54 | Compiler :=icc | |
025aa9c7 | 55 | CompilerOpt :=-fpstkchk -I$(shell $(ROOTSYS)/bin/root-config --incdir) -I$(ALICE_ROOT)/include |
fe88cf1b | 56 | LibOpt :=-g -shared -Wl |
57 | else | |
58 | Compiler :=g++ | |
92017a47 | 59 | CompilerOpt :=-g -W -Wall -Werror -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux -D`uname` $(DirInc) |
fe88cf1b | 60 | LibOpt :=-g -shared -Wl |
61 | endif | |
62 | ||
63 | ifdef ALIVERBOSE | |
64 | Mute := | |
65 | else | |
66 | Mute :=@ | |
67 | endif | |
68 | ||
69 | ##### TARGETS ##### | |
70 | ||
71 | all: $(LibBase) $(LibSim) $(LibRec) | |
72 | $(LibBase): $(ObjBase) | |
73 | @echo "Creating $@" | |
74 | $(Mute)$(Compiler) $(LibOpt) $^ -o $@ | |
75 | ||
76 | $(LibSim): $(ObjSim) | |
77 | @echo "Creating $@" | |
78 | $(Mute)$(Compiler) $(LibOpt) $^ -o $@ | |
79 | ||
80 | $(LibRec): $(ObjRec) | |
81 | @echo "Creating $@" | |
82 | $(Mute)$(Compiler) $(LibOpt) $^ -o $@ | |
83 | ||
84 | $(DepFile): $(HdrBase) $(HdrSim) $(HdrRec) | |
85 | @[ -d $(DirOut) ] || mkdir -p $(DirOut) | |
86 | @[ -d $(LIB_MY) ] || mkdir -p $(LIB_MY) | |
87 | @touch $(DepFile) | |
88 | @echo "Generating dependency $@" | |
025aa9c7 | 89 | $(Mute)$(ROOTSYS)/bin/rmkdepend -f$(DepFile) -p$(DirOut)/ -- $(CompilerOpt) -- $(SrcBase) $(SrcSim) $(SrcRec) 2>/dev/null |
fe88cf1b | 90 | |
91 | $(DictSrcBase): $(HdrBase) | |
92 | @echo "Generating $@" | |
025aa9c7 | 93 | $(Mute)$(ROOTSYS)/bin/rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^ |
fe88cf1b | 94 | |
95 | $(DictSrcSim): $(HdrSim) | |
96 | @echo "Generating $@" | |
025aa9c7 | 97 | $(Mute)$(ROOTSYS)/bin/rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^ |
fe88cf1b | 98 | |
99 | $(DictSrcRec): $(HdrRec) | |
100 | @echo "Generating $@" | |
025aa9c7 | 101 | $(Mute)$(ROOTSYS)/bin/rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^ |
fe88cf1b | 102 | |
103 | $(DictObjBase) : $(DictSrcBase) | |
104 | @echo "Compiling $^" | |
105 | $(Mute)$(Compiler) $(CompilerOpt) -I. -c $^ -o $@ | |
106 | ||
107 | $(DictObjSim) : $(DictSrcSim) | |
108 | @echo "Compiling $^" | |
109 | $(Mute)$(Compiler) $(CompilerOpt) -I. -c $^ -o $@ | |
110 | ||
111 | $(DictObjRec) : $(DictSrcRec) | |
112 | @echo "Compiling $^" | |
113 | $(Mute)$(Compiler) $(CompilerOpt) -I. -c $^ -o $@ | |
114 | ||
92017a47 | 115 | |
116 | rules: $(CodeRules) | |
117 | ||
fe88cf1b | 118 | show: |
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" | |
124 | ||
125 | @echo "Sim Headers: $(HdrSim)" | |
126 | @echo "Sim Sources: $(SrcSim)" | |
127 | @echo "Sim Objects: $(ObjSim)" | |
128 | @echo -e "Sim Library: $(LibSim)\n" | |
129 | ||
130 | @echo "Rec Headers: $(HdrRec)" | |
131 | @echo "Rec Sources: $(SrcRec)" | |
132 | @echo "Rec Objects: $(ObjRec)" | |
133 | @echo -e "Rec Library: $(LibRec)\n" | |
92017a47 | 134 | @echo "Rules check: $(CodeRules)" |
135 | @echo "CompilerOpt: $(CompilerOpt)" | |
136 | ||
fe88cf1b | 137 | spec: $(SrcBase) |
138 | @echo "^ $^" | |
139 | @echo "@ $@" | |
140 | @echo "< $<" | |
141 | ||
142 | clean: | |
143 | @echo "Cleaning..." | |
144 | $(Mute)rm -rf $(DirOut) $(LibBase) $(LibSim) $(LibRec) | |
145 | ||
146 | ############################ cxx rule ######################################### | |
147 | $(DirOut)/%.o : %.cxx | |
148 | @echo $*.cxx | |
149 | $(Mute)$(Compiler) $(CompilerOpt) -c $*.cxx -o $(DirOut)/$*.o | |
92017a47 | 150 | |
151 | $(DirOut)/%.i : %.cxx $(DepFile) | |
152 | $(Mute)$(Compiler) -E -g -pipe -fPIC -Wall $(DirInc) $< > $@ | |
153 | @cd $(dir $@) ; $(IRST_INSTALLDIR)/patch/patch4alice.prl $(notdir $@) | |
154 | ||
155 | $(DirOut)/%.viol : $(DirOut)/%.i | |
156 | @echo $@ ; java rules.ALICE.ALICERuleChecker $< ./ > $@ | |
fe88cf1b | 157 | ############################ Dependencies ##################################### |
158 | ||
159 | -include $(DepFile) | |
92017a47 | 160 |