ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/toolrules.mk
(Generate patch)

Comparing COMP/SCRAM/src/toolrules.mk (file contents):
Revision 1.8 by williamc, Fri Mar 26 18:17:51 1999 UTC vs.
Revision 1.19.2.14 by williamc, Tue Sep 21 08:48:40 1999 UTC

# Line 1 | Line 1
1   # Some Pre-Defined Rules For Building Stuff
2   #
3 < #include compilers.mk
3 > .PHONY:bin lib
4   lib : dependencies.mk
5   bin : dependencies.mk
6  
7   #------------------------------------------------
8   # Default Behaviours - interpreted from makefile
9   #------------------------------------------------
10 + # -- Set the library vapths
11 + vpath %.$(SharedSuffix) $(librarystore):$(RELEASETOP)/$(INTlib)
12 + vpath %.$(ArchiveSuffix) $(librarystore):$(RELEASETOP)/$(INTlib)
13   # -- storage of binaries
14   binarystore:=$(LOCALTOP)/$(INTbin)
15   VPATH+=:$(LOCALTOP)/$(INTbin):$(RELEASETOP)/$(INTbin)
16  
14 # -- storage of libraries
15 librarystore:=$(LOCALTOP)/$(INTlib)
16 vpath %.$(SharedSuffix) $(librarystore):$(RELEASETOP)/$(INTlib)
17 vpath %.$(ArchiveSuffix) $(librarystore):$(RELEASETOP)/$(INTlib)
18
17   # -- library names
18  
19   ifdef libname
# Line 27 | Line 25 | shlibname=$(libname)
25   endif
26   endif
27  
28 + libmsg::
29 +        @echo --------------- $(libname) --------------
30   # -- Libray type defaults
31  
32 + ifndef DefaultLibsOff
33   ifdef DefaultShared
34 < lib : $(shlibname).$(SharedSuffix)
34 < MakeLib=yes
34 > LibShared=true
35   endif
36   ifdef DefaultDebugShared
37 < lib : $(shlibname)_d.$(SharedSuffix)
38 < MakeLib=yes
37 > LibDebugShared=true
38 > endif
39 > ifdef DefaultInsureShared
40 > LibInsureShared=true
41   endif
42   ifdef DefaultArchive
43 < lib : $(arlibname).$(ArchiveSuffix)
42 < MakeLib=yes
43 > LibArchive=true
44   endif
45   ifdef DefaultDebugArchive
46 < lib : $(arlibname)_d.$(ArchiveSuffix)
47 < MakeLib=yes
46 > LibDebugArchive=true
47 > endif
48 > ifdef DefaultInsureArchive
49 > LibInsureArchive=true
50 > endif
51   endif
52  
53 < ifdef MakeLib
54 < all: lib
53 > # -- Library types
54 > ifneq ($(strip $(files)),)
55 > lib : libmsg
56 > ifdef LibShared
57 > lib : $(shlibname).$(SharedSuffix)
58 > endif
59 > ifdef LibDebugShared
60 > lib : $(shlibname)_d.$(SharedSuffix)
61 > endif
62 > ifdef LibInsureShared
63 > lib : $(shlibname)_Insure.$(SharedSuffix)
64 > endif
65 > ifdef LibArchive
66 > lib : $(arlibname).$(ArchiveSuffix)
67 > endif
68 > ifdef LibDebugArchive
69 > lib : $(arlibname)_d.$(ArchiveSuffix)
70 > endif
71 > ifdef LibInsureArchive
72 > lib : $(arlibname)_Insure.$(ArchiveSuffix)
73 > endif
74   endif
75  
76   #------------------------------------------------
# Line 59 | Line 82 | Sarchivelibobjs:=$(addsuffix .o,$(archiv
82   Sarchivelibdebugobjs:=$(addsuffix _d.o,$(archivefiles))
83   Ssharedlibobjs:=$(addsuffix _pic.o,$(sharedfiles))
84   Ssharedlibdebugobjs:=$(addsuffix _picd.o,$(sharedfiles))
85 <
86 < # binary target files
64 < Sbinaryobjects:=$(addsuffix .o,$(binfiles))
85 > SsharedlibInsureobjs:=$(addsuffix _picInsure.o,$(sharedfiles))
86 > SarchivelibInsureobjs:=$(addsuffix _Insure.o,$(archivefiles))
87  
88   #------------------------------------------------
89   # Rules Start Here
# Line 70 | Line 92 | Sbinaryobjects:=$(addsuffix .o,$(binfile
92   # Implicit Rules first
93   # -- Standard Shared Objects
94   %_pic.o : %.cpp
95 <        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SharedCCObjectFlags) $< -o $@
95 >        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXOptimised) $(SharedCCObjectFlags) $< -o $@
96 > %_pic.o : %.cxx
97 >        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXOptimised) $(SharedCCObjectFlags) $< -o $@
98 > %_pic.o : %.c
99 >        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXOptimised) $(SharedCCObjectFlags) $< -o $@
100   %_pic.o : %.C
101 <        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SharedCCObjectFlags) $< -o $@
101 >        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXOptimised) $(SharedCCObjectFlags) $< -o $@
102   %_pic.o : %.cc
103 <        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SharedCCObjectFlags) $< -o $@
103 >        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXOptimised) $(SharedCCObjectFlags) $< -o $@
104   %_pic.o : %.F
105 <        $(FC) -c $(CPPFLAGS) $(FFLAGS) $(SharedFCObjectFlags) $< -o $@
105 >        $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCOptimised) $(SharedFCObjectFlags) $< -o $@
106   %_pic.o : %.f
107 <        $(FC) -c $(CPPFLAGS) $(FFLAGS) $(SharedFCObjectFlags) $< -o $@
107 >        $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCOptimised) $(SharedFCObjectFlags) $< -o $@
108  
109   # -- Debug Shared Objects
110   %_picd.o : %.cc
# Line 90 | Line 116 | Sbinaryobjects:=$(addsuffix .o,$(binfile
116   %_picd.o : %.cpp
117          $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
118  
119 + %_picd.o : %.cxx
120 +        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
121 + %_picd.o : %.c
122 +        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
123   %_picd.o : %.F
124          $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $(SharedFCObjectFlags) $< -o $@
125  
126   %_picd.o : %.f
127          $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $(SharedFCObjectFlags) $< -o $@
128 < # -- Standard Archive Libs
129 < # Already built in
128 >
129 > # -- Debug Shared Objects with Insure
130 > %_picInsure.o : %.cc
131 >        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
132 >
133 > %_picInsure.o : %.C
134 >        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
135 >
136 > %_picInsure.o : %.cpp
137 >        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
138 >
139 > %_picInsure.o : %.cxx
140 >        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
141 >
142 > %_picInsure.o : %.c
143 >        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
144  
145   # -- Debug Archive Libs
146   %_d.o : %.cpp
147          $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
148  
149 + %_d.o : %.cxx
150 +        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
151 +
152 + %_d.o : %.c
153 +        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
154 +
155   %_d.o : %.cc
156          $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
157  
# Line 114 | Line 164 | Sbinaryobjects:=$(addsuffix .o,$(binfile
164   %_d.o : %.f
165          $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $< -o $@
166  
167 + # -- Debug Archive Libs with Insure
168 + %_Insure.o : %.cpp
169 +        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
170 +
171 + %_Insure.o : %.cxx
172 +        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
173 +
174 + %_Insure.o : %.c
175 +        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
176 +
177 + %_Insure.o : %.cc
178 +        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
179 +
180 + %_Insure.o : %.C
181 +        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
182 +
183 + # -- Standard Archive Libs
184 + %.o : %.cpp
185 +        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXOptimised) $< -o $@
186 +
187 + %.o : %.cxx
188 +        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXOptimised) $< -o $@
189 +
190 + %.o : %.c
191 +        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXOptimised) $< -o $@
192 +
193 + %.o : %.cc
194 +        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXOptimised) $< -o $@
195 +
196 + %.o : %.C
197 +        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXOptimised) $< -o $@
198 +
199 + %.o : %.F
200 +        $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCOptimised) $< -o $@
201 +
202 + %.o : %.f
203 +        $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCOptimised) $< -o $@
204 +
205 + # Already built in
206 +
207   # -------------------------------------------------------------------------
208 < # -- Executables
209 < %.exe : $(Sbinaryobjects)
210 <        $(CXX) $(CXXFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS)
208 > # Executables
209 > # -------------------------------------------------------------------------
210 >
211 > # -- Debug Executables
212  
213 < # -- Debug Exexcutables
213 > lib_d=$(shell $(TOOL_HOME)/LibTypeExpand "_d" $(lib))
214 > lib_d_l=$(shell $(TOOL_HOME)/LibTypeExpandLocal "_d" $(lib))
215 > LDLIBS_D=$(addprefix -l,$(lib_d))
216 > LDLIBS_D_L=$(addprefix -l,$(lib_d_l))
217 >
218 > #%_d.exe :
219 > #       $(CXX) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D)
220 >
221 > # -- Insure Executables
222 > lib_Insure=$(shell $(TOOL_HOME)/LibTypeExpand "_Insure" $(lib))
223 > lib_Insure_l=$(shell $(TOOL_HOME)/LibTypeExpandLocal "_Insure" $(lib))
224 > LDLIBS_Insure=$(addprefix -l,$(lib_Insure))
225 > #%_Insure.exe :
226 > #       $(Insure) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D)
227  
228 < #LDLIBS_D:=$(shell $(TOOL_HOME)/LibTypeExpand $(LDLIBS) "_d")
229 < %_d.exe : $(Sbinaryobjects)
230 <        $(CXX) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ \                        $(LDLIBS_D)
228 > # -- Executables
229 > #%.exe :
230 > #       $(CXX) $(CXXFLAGS) $(CXXOptimised) $(LDFLAGS) $< -o $@ $(LDLIBS)
231 >
232 > # -------------------------------------------------------------------------
233  
234   realbins:=$(filter $(bintargets),$(notdir $(wildcard $(LOCALTOP)/$(INTbin)/*)))
235 + frealbins=$(addprefix $(LOCALTOP)/$(INTbin)/,$(realbins))
236   clean ::
237          @if [ "$(realbins)" != "" ] ; then \
238          echo Removing executables : $(realbins); \
239 <        rm $(LOCALTOP)/$(INTbin)/$(realbins); \
239 >        rm $(frealbins); \
240          fi;
241  
242   # -------------------------------------------------------------------------
# Line 140 | Line 247 | shared : $(shlibname).$(SharedSuffix)
247   shared_debug : $(shlibname)_d.$(SharedSuffix)
248   archive : $(arlibname).$(ArchiveSuffix)
249   archive_debug : $(arlibname)_d.$(ArchiveSuffix)
250 + archive_Insure : $(arlibname)_Insure.$(ArchiveSuffix)
251 + shared_Insure : $(shlibname)_Insure.$(SharedSuffix)
252  
253   # Now more specific rules
254  
255   # -- Standard Shared Objects Libs
256 < $(shlibname)_pic.$(SharedSuffix) : $(Ssharedlibobjs)
256 > $(shlibname).$(SharedSuffix) : $(Ssharedlibobjs)
257          $(SharedCCTool)
258 <
150 < $(shlibname).$(SharedSuffix) : $(shlibname)_pic.$(SharedSuffix)
151 <        @mv $< $(librarystore)/$@
258 >        @mv $@ $(librarystore)/$@
259  
260   # -- Debug Shared Objects Libs
154 $(shlibname)_picd.$(SharedSuffix) : $(Ssharedlibdebugobjs)
155        $(SharedCCTool)
156
261   $(shlibname)_d.$(SharedSuffix) : $(Ssharedlibdebugobjs)
262 <        @mv $< $(librarystore)/$@
262 >        $(DebugSharedCCTool)
263 >        @mv $@ $(librarystore)/$@
264 >
265 > # -- Insure Shared Objects Libs
266 > $(shlibname)_Insure.$(SharedSuffix) : $(SsharedlibInsureobjs)
267 >        $(InsureSharedCCTool)
268 >        @mv $@ $(librarystore)/$@
269  
270   # -- Standard Archive Libs
271   $(arlibname).$(ArchiveSuffix) : $(Sarchivelibobjs)
# Line 167 | Line 277 | $(arlibname)_d.$(ArchiveSuffix) : $(Sarc
277          $(ArchiveCCTool)
278          @mv $@ $(librarystore)/$@
279  
280 + # -- Insure Archive libs
281 + $(arlibname)_Insure.$(ArchiveSuffix) : $(SarchivelibInsureobjs)
282 +        $(ArchiveCCTool)
283 +        @mv $@ $(librarystore)/$@
284 +
285   # -- Dependencies
286   dependencies.mk: $(files)
287 +        @if [ "$<" != "" ]; then \
288 +        echo Generating Dependencies; \
289 +        $(DependencyCCTool); \
290 +        $(TOOL_HOME)/DependencyMangler $@; \
291 +        fi
292 +
293 + %.dep:
294          @$(DependencyCCTool)
295          @$(TOOL_HOME)/DependencyMangler $@
296 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines