]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HMPID/Hmake
Added const members to contain the IDs of FMD files used by the preprocessor and...
[u/mrichter/AliRoot.git] / HMPID / Hmake
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
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
15
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
40 CodeRules     := $(patsubst %.cxx,$(DirOut)/%.viol,$(SrcBase) $(SrcSim) $(SrcRec))
41
42 export IRST_INSTALLDIR=$(HOME)/IRST
43 export IRST_CONFIG_DIR=$(IRST_INSTALLDIR)/userConfig/ALICE
44 export CLASSPATH=$(IRST_INSTALLDIR)
45
46
47 #-------------------------------------------------------------------------------
48
49 DepFile       := $(DirOut)/$(Module).depend
50
51
52
53 ifeq ($(RootTarget),linuxicc)
54  Compiler    :=icc
55  CompilerOpt :=-fpstkchk -I$(shell $(ROOTSYS)/bin/root-config --incdir) -I$(ALICE_ROOT)/include
56  LibOpt      :=-g -shared -Wl
57 else
58  Compiler    :=g++
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
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 $@"
89         $(Mute)$(ROOTSYS)/bin/rmkdepend -f$(DepFile) -p$(DirOut)/ -- $(CompilerOpt) -- $(SrcBase) $(SrcSim) $(SrcRec) 2>/dev/null
90
91 $(DictSrcBase):  $(HdrBase)
92         @echo "Generating $@"
93         $(Mute)$(ROOTSYS)/bin/rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^
94         
95 $(DictSrcSim):  $(HdrSim)
96         @echo "Generating $@"
97         $(Mute)$(ROOTSYS)/bin/rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^
98         
99 $(DictSrcRec):  $(HdrRec)
100         @echo "Generating $@"
101         $(Mute)$(ROOTSYS)/bin/rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^
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
115
116 rules: $(CodeRules)
117
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"
134         @echo    "Rules check: $(CodeRules)"
135         @echo    "CompilerOpt: $(CompilerOpt)"
136         
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
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 $< ./ > $@
157 ############################ Dependencies #####################################
158
159 -include $(DepFile) 
160