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.6 by williamc, Fri Mar 26 15:14:37 1999 UTC vs.
Revision 1.19.2.3 by williamc, Tue May 25 15:03:37 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 37 | Line 35 | ifdef DefaultDebugShared
35   lib : $(shlibname)_d.$(SharedSuffix)
36   MakeLib=yes
37   endif
38 + ifdef DefaultInsureShared
39 + lib : $(shlibname)_Insure.$(SharedSuffix)
40 + MakeLib=yes
41 + endif
42   ifdef DefaultArchive
43   lib : $(arlibname).$(ArchiveSuffix)
44   MakeLib=yes
# Line 45 | Line 47 | ifdef DefaultDebugArchive
47   lib : $(arlibname)_d.$(ArchiveSuffix)
48   MakeLib=yes
49   endif
50 + ifdef DefaultInsureArchive
51 + lib : $(arlibname)_Insure.$(ArchiveSuffix)
52 + MakeLib=yes
53 + endif
54  
55   ifdef MakeLib
56   all: lib
# Line 59 | Line 65 | Sarchivelibobjs:=$(addsuffix .o,$(archiv
65   Sarchivelibdebugobjs:=$(addsuffix _d.o,$(archivefiles))
66   Ssharedlibobjs:=$(addsuffix _pic.o,$(sharedfiles))
67   Ssharedlibdebugobjs:=$(addsuffix _picd.o,$(sharedfiles))
68 + SsharedlibInsureobjs:=$(addsuffix _picInsure.o,$(sharedfiles))
69 + SarchivelibInsureobjs:=$(addsuffix _Insure.o,$(archivefiles))
70  
71   #------------------------------------------------
72   # Rules Start Here
# Line 68 | Line 76 | Ssharedlibdebugobjs:=$(addsuffix _picd.o
76   # -- Standard Shared Objects
77   %_pic.o : %.cpp
78          $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SharedCCObjectFlags) $< -o $@
79 + %_pic.o : %.cxx
80 +        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SharedCCObjectFlags) $< -o $@
81 + %_pic.o : %.c
82 +        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SharedCCObjectFlags) $< -o $@
83   %_pic.o : %.C
84          $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SharedCCObjectFlags) $< -o $@
85   %_pic.o : %.cc
# Line 87 | Line 99 | Ssharedlibdebugobjs:=$(addsuffix _picd.o
99   %_picd.o : %.cpp
100          $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
101  
102 + %_picd.o : %.cxx
103 +        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
104 + %_picd.o : %.c
105 +        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
106   %_picd.o : %.F
107          $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $(SharedFCObjectFlags) $< -o $@
108  
109   %_picd.o : %.f
110          $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $(SharedFCObjectFlags) $< -o $@
111 < # -- Standard Archive Libs
112 < # Already built in
111 >
112 > # -- Debug Shared Objects with Insure
113 > %_picInsure.o : %.cc
114 >        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
115 >
116 > %_picInsure.o : %.C
117 >        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
118 >
119 > %_picInsure.o : %.cpp
120 >        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
121 >
122 > %_picInsure.o : %.cxx
123 >        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
124 >
125 > %_picInsure.o : %.c
126 >        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
127  
128   # -- Debug Archive Libs
129   %_d.o : %.cpp
130          $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
131  
132 + %_d.o : %.cxx
133 +        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
134 +
135 + %_d.o : %.c
136 +        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
137 +
138   %_d.o : %.cc
139          $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
140  
# Line 111 | Line 147 | Ssharedlibdebugobjs:=$(addsuffix _picd.o
147   %_d.o : %.f
148          $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $< -o $@
149  
150 < # -- Executables
151 < %.exe : %.cpp
152 <        $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS)
150 > # -- Debug Archive Libs with Insure
151 > %_Insure.o : %.cpp
152 >        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
153  
154 < %.exe : %.cc
155 <        $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS)
154 > %_Insure.o : %.cxx
155 >        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
156  
157 < %.exe : %.C
158 <        $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS)
157 > %_Insure.o : %.c
158 >        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
159  
160 < %.exe : %.F
161 <        $(FC) $(CPPFLAGS) $(FFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS)
160 > %_Insure.o : %.cc
161 >        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
162 >
163 > %_Insure.o : %.C
164 >        $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
165 >
166 > # -- Standard Archive Libs
167 > %.o : %.cpp
168 >        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
169  
170 < %.exe : %.f
171 <        $(FC) $(CPPFLAGS) $(FFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS)
170 > %.o : %.cxx
171 >        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
172  
173 < # -- Debug Exexcutables
174 < #LDLIBS_D:=$(shell $(TOOL_HOME)/LibTypeExpand $(LDLIBS) "_d")
132 < %_d.exe : %.cpp
133 <        $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ \                    $(LDLIBS_D)
173 > %.o : %.c
174 >        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
175  
176 < %_d.exe : %.cc
177 <        $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D)
176 > %.o : %.cc
177 >        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
178  
179 < %_d.exe : %.C
180 <        $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D)
179 > %.o : %.C
180 >        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
181  
182 < %_d.exe : %.F
183 <        $(FC) $(CPPFLAGS) $(FFLAGS_D) $(FCDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D)
182 > %.o : %.F
183 >        $(FC) -c $(CPPFLAGS) $(FFLAGS) $< -o $@
184  
185 < %_d.exe : %.f
186 <        $(FC) $(CPPFLAGS) $(FFLAGS_D) $(FCDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D)
185 > %.o : %.f
186 >        $(FC) -c $(CPPFLAGS) $(FFLAGS) $< -o $@
187 >
188 > # Already built in
189 >
190 > # -------------------------------------------------------------------------
191 > # Executables
192 > # -------------------------------------------------------------------------
193 >
194 > # -- Debug Executables
195 >
196 > lib_d=$(shell $(TOOL_HOME)/LibTypeExpand "_d" $(lib))
197 > LDLIBS_D=$(addprefix -l,$(lib_d))
198 >
199 > #%_d.exe :
200 > #       $(CXX) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D)
201 >
202 > # -- Insure Executables
203 > lib_Insure=$(shell $(TOOL_HOME)/LibTypeExpand "_Insure" $(lib))
204 > LDLIBS_I=$(addprefix -l,$(lib_Insure))
205 > #%_Insure.exe :
206 > #       $(Insure) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D)
207 >
208 > # -- Executables
209 > #%.exe :
210 > #       $(CXX) $(CXXFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS)
211  
212 + # -------------------------------------------------------------------------
213 +
214 + realbins:=$(filter $(bintargets),$(notdir $(wildcard $(LOCALTOP)/$(INTbin)/*)))
215 + frealbins=$(addprefix $(LOCALTOP)/$(INTbin)/,$(realbins))
216 + clean ::
217 +        @if [ "$(realbins)" != "" ] ; then \
218 +        echo Removing executables : $(realbins); \
219 +        rm $(frealbins); \
220 +        fi;
221 +
222 + # -------------------------------------------------------------------------
223  
224   # Some nice generic target names for the user
225  
# Line 168 | Line 244 | $(shlibname)_picd.$(SharedSuffix) : $(Ss
244   $(shlibname)_d.$(SharedSuffix) : $(Ssharedlibdebugobjs)
245          @mv $< $(librarystore)/$@
246  
247 + # -- Insure Shared Objects Libs
248 + $(shlibname)_picInsure.$(SharedSuffix) : $(SsharedlibInsureobjs)
249 +        $(SharedCCTool)
250 +
251 + $(shlibname)_Insure.$(SharedSuffix) : $(SsharedlibInsureobjs)
252 +        @mv $< $(librarystore)/$@
253 +
254   # -- Standard Archive Libs
255   $(arlibname).$(ArchiveSuffix) : $(Sarchivelibobjs)
256          $(ArchiveCCTool)
257 <        @mv $@ $(librarystore)
257 >        @mv $@ $(librarystore)/$@
258  
259   # -- Debug Archive Libs
260   $(arlibname)_d.$(ArchiveSuffix) : $(Sarchivelibdebugobjs)
261          $(ArchiveCCTool)
262 <        @mv $@ $(librarystore)
262 >        @mv $@ $(librarystore)/$@
263 >
264 > # -- Insure Archive libs
265 > $(arlibname)_Insure.$(ArchiveSuffix) : $(SarchivelibInsureobjs)
266 >        $(ArchiveCCTool)
267 >        @mv $@ $(librarystore)/$@
268  
269   # -- Dependencies
270   dependencies.mk: $(files)
271 +        @if [ "$<" != "" ]; then \
272 +        echo Generating Dependencies; \
273 +        $(DependencyCCTool); \
274 +        $(TOOL_HOME)/DependencyMangler $@; \
275 +        fi
276 +
277 + %.dep:
278          @$(DependencyCCTool)
279          @$(TOOL_HOME)/DependencyMangler $@
280 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines