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.14 by williamc, Thu Apr 1 09:55:00 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 < lib : $(shlibname)_Insure.$(SharedSuffix)
42 < MakeLib=yes
40 > LibInsureShared=true
41   endif
42   ifdef DefaultArchive
43 < lib : $(arlibname).$(ArchiveSuffix)
46 < MakeLib=yes
43 > LibArchive=true
44   endif
45   ifdef DefaultDebugArchive
46 < lib : $(arlibname)_d.$(ArchiveSuffix)
50 < MakeLib=yes
46 > LibDebugArchive=true
47   endif
48   ifdef DefaultInsureArchive
49 < lib : $(arlibname)_Insure.$(ArchiveSuffix)
50 < MakeLib=yes
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 77 | Line 92 | SarchivelibInsureobjs:=$(addsuffix _Insu
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 97 | Line 116 | SarchivelibInsureobjs:=$(addsuffix _Insu
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  
# Line 113 | Line 136 | SarchivelibInsureobjs:=$(addsuffix _Insu
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 134 | Line 168 | SarchivelibInsureobjs:=$(addsuffix _Insu
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  
# Line 141 | Line 181 | SarchivelibInsureobjs:=$(addsuffix _Insu
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   # -------------------------------------------------------------------------
# Line 150 | Line 211 | SarchivelibInsureobjs:=$(addsuffix _Insu
211   # -- Debug Executables
212  
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)
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 < LDLIBS_I=$(addprefix -l,$(lib_Insure))
224 < %_Insure.exe :
225 <        $(Insure) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D)
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   # -- Executables
229 < %.exe :
230 <        $(CXX) $(CXXFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS)
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 182 | 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 <
192 < $(shlibname).$(SharedSuffix) : $(shlibname)_pic.$(SharedSuffix)
193 <        @mv $< $(librarystore)/$@
258 >        @mv $@ $(librarystore)/$@
259  
260   # -- Debug Shared Objects Libs
196 $(shlibname)_picd.$(SharedSuffix) : $(Ssharedlibdebugobjs)
197        $(SharedCCTool)
198
261   $(shlibname)_d.$(SharedSuffix) : $(Ssharedlibdebugobjs)
262 <        @mv $< $(librarystore)/$@
262 >        $(DebugSharedCCTool)
263 >        @mv $@ $(librarystore)/$@
264  
265   # -- Insure Shared Objects Libs
203 $(shlibname)_picInsure.$(SharedSuffix) : $(SsharedlibInsureobjs)
204        $(SharedCCTool)
205
266   $(shlibname)_Insure.$(SharedSuffix) : $(SsharedlibInsureobjs)
267 <        @mv $< $(librarystore)/$@
267 >        $(InsureSharedCCTool)
268 >        @mv $@ $(librarystore)/$@
269  
270   # -- Standard Archive Libs
271   $(arlibname).$(ArchiveSuffix) : $(Sarchivelibobjs)
# Line 223 | Line 284 | $(arlibname)_Insure.$(ArchiveSuffix) : $
284  
285   # -- Dependencies
286   dependencies.mk: $(files)
287 <        @$(DependencyCCTool)
288 <        @$(TOOL_HOME)/DependencyMangler $@
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