ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/toolrules.mk
Revision: 1.13
Committed: Thu Apr 1 08:27:33 1999 UTC (26 years, 1 month ago) by williamc
Branch: MAIN
Changes since 1.12: +1 -1 lines
Log Message:
Fix Insure++ exe target

File Contents

# User Rev Content
1 williamc 1.1 # Some Pre-Defined Rules For Building Stuff
2     #
3 williamc 1.5 #include compilers.mk
4 williamc 1.2 lib : dependencies.mk
5     bin : dependencies.mk
6 williamc 1.1
7     #------------------------------------------------
8     # Default Behaviours - interpreted from makefile
9     #------------------------------------------------
10 williamc 1.6 # -- storage of binaries
11     binarystore:=$(LOCALTOP)/$(INTbin)
12     VPATH+=:$(LOCALTOP)/$(INTbin):$(RELEASETOP)/$(INTbin)
13 williamc 1.1
14     # -- storage of libraries
15     librarystore:=$(LOCALTOP)/$(INTlib)
16     vpath %.$(SharedSuffix) $(librarystore):$(RELEASETOP)/$(INTlib)
17     vpath %.$(ArchiveSuffix) $(librarystore):$(RELEASETOP)/$(INTlib)
18    
19     # -- library names
20    
21     ifdef libname
22     ifndef arlibname
23     arlibname=$(libname)
24     endif
25     ifndef shlibname
26     shlibname=$(libname)
27     endif
28     endif
29    
30     # -- Libray type defaults
31    
32     ifdef DefaultShared
33     lib : $(shlibname).$(SharedSuffix)
34     MakeLib=yes
35     endif
36     ifdef DefaultDebugShared
37     lib : $(shlibname)_d.$(SharedSuffix)
38     MakeLib=yes
39     endif
40 williamc 1.12 ifdef DefaultInsureShared
41     lib : $(shlibname)_Insure.$(SharedSuffix)
42     MakeLib=yes
43     endif
44 williamc 1.1 ifdef DefaultArchive
45     lib : $(arlibname).$(ArchiveSuffix)
46     MakeLib=yes
47     endif
48     ifdef DefaultDebugArchive
49     lib : $(arlibname)_d.$(ArchiveSuffix)
50     MakeLib=yes
51     endif
52 williamc 1.12 ifdef DefaultInsureArchive
53     lib : $(arlibname)_Insure.$(ArchiveSuffix)
54     MakeLib=yes
55     endif
56 williamc 1.1
57     ifdef MakeLib
58     all: lib
59     endif
60    
61     #------------------------------------------------
62     # Set up some system variables
63     # - all begin with S
64     #------------------------------------------------
65    
66     Sarchivelibobjs:=$(addsuffix .o,$(archivefiles))
67     Sarchivelibdebugobjs:=$(addsuffix _d.o,$(archivefiles))
68     Ssharedlibobjs:=$(addsuffix _pic.o,$(sharedfiles))
69     Ssharedlibdebugobjs:=$(addsuffix _picd.o,$(sharedfiles))
70 williamc 1.12 SsharedlibInsureobjs:=$(addsuffix _picInsure.o,$(sharedfiles))
71     SarchivelibInsureobjs:=$(addsuffix _Insure.o,$(archivefiles))
72 williamc 1.7
73 williamc 1.1 #------------------------------------------------
74     # Rules Start Here
75     #------------------------------------------------
76    
77     # Implicit Rules first
78     # -- Standard Shared Objects
79     %_pic.o : %.cpp
80     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SharedCCObjectFlags) $< -o $@
81     %_pic.o : %.C
82     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SharedCCObjectFlags) $< -o $@
83     %_pic.o : %.cc
84     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(SharedCCObjectFlags) $< -o $@
85     %_pic.o : %.F
86     $(FC) -c $(CPPFLAGS) $(FFLAGS) $(SharedFCObjectFlags) $< -o $@
87     %_pic.o : %.f
88     $(FC) -c $(CPPFLAGS) $(FFLAGS) $(SharedFCObjectFlags) $< -o $@
89    
90     # -- Debug Shared Objects
91     %_picd.o : %.cc
92     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
93    
94     %_picd.o : %.C
95     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
96    
97     %_picd.o : %.cpp
98     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
99    
100     %_picd.o : %.F
101     $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $(SharedFCObjectFlags) $< -o $@
102    
103     %_picd.o : %.f
104     $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $(SharedFCObjectFlags) $< -o $@
105 williamc 1.12
106     # -- Debug Shared Objects with Insure
107     %_picInsure.o : %.cc
108     $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
109    
110     %_picInsure.o : %.C
111     $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
112    
113     %_picInsure.o : %.cpp
114     $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@
115    
116 williamc 1.1
117     # -- Debug Archive Libs
118     %_d.o : %.cpp
119     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
120    
121     %_d.o : %.cc
122     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
123    
124     %_d.o : %.C
125     $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
126    
127     %_d.o : %.F
128     $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $< -o $@
129    
130     %_d.o : %.f
131     $(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $< -o $@
132 williamc 1.6
133 williamc 1.12 # -- Debug Archive Libs with Insure
134     %_Insure.o : %.cpp
135     $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
136    
137     %_Insure.o : %.cc
138     $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
139    
140     %_Insure.o : %.C
141     $(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@
142    
143     # -- Standard Archive Libs
144     # Already built in
145    
146     # -------------------------------------------------------------------------
147     # Executables
148 williamc 1.7 # -------------------------------------------------------------------------
149 williamc 1.6
150 williamc 1.12 # -- Debug Executables
151 williamc 1.6
152 williamc 1.12 lib_d=$(shell $(TOOL_HOME)/LibTypeExpand "_d" $(lib))
153 williamc 1.10 LDLIBS_D=$(addprefix -l,$(lib_d))
154    
155 williamc 1.9 %_d.exe :
156 williamc 1.11 $(CXX) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D)
157    
158 williamc 1.12 # -- Insure Executables
159     lib_Insure=$(shell $(TOOL_HOME)/LibTypeExpand "_Insure" $(lib))
160     LDLIBS_I=$(addprefix -l,$(lib_Insure))
161     %_Insure.exe :
162 williamc 1.13 $(Insure) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D)
163 williamc 1.12
164 williamc 1.11 # -- Executables
165     %.exe : %.o
166     $(CXX) $(CXXFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS)
167 williamc 1.6
168 williamc 1.12 # -------------------------------------------------------------------------
169    
170 williamc 1.7 realbins:=$(filter $(bintargets),$(notdir $(wildcard $(LOCALTOP)/$(INTbin)/*)))
171     clean ::
172     @if [ "$(realbins)" != "" ] ; then \
173     echo Removing executables : $(realbins); \
174     rm $(LOCALTOP)/$(INTbin)/$(realbins); \
175     fi;
176 williamc 1.6
177 williamc 1.7 # -------------------------------------------------------------------------
178 williamc 1.1
179     # Some nice generic target names for the user
180    
181     shared : $(shlibname).$(SharedSuffix)
182     shared_debug : $(shlibname)_d.$(SharedSuffix)
183     archive : $(arlibname).$(ArchiveSuffix)
184     archive_debug : $(arlibname)_d.$(ArchiveSuffix)
185    
186     # Now more specific rules
187    
188     # -- Standard Shared Objects Libs
189 williamc 1.3 $(shlibname)_pic.$(SharedSuffix) : $(Ssharedlibobjs)
190 williamc 1.1 $(SharedCCTool)
191 williamc 1.3
192     $(shlibname).$(SharedSuffix) : $(shlibname)_pic.$(SharedSuffix)
193     @mv $< $(librarystore)/$@
194 williamc 1.1
195     # -- Debug Shared Objects Libs
196 williamc 1.3 $(shlibname)_picd.$(SharedSuffix) : $(Ssharedlibdebugobjs)
197 williamc 1.1 $(SharedCCTool)
198 williamc 1.3
199 williamc 1.4 $(shlibname)_d.$(SharedSuffix) : $(Ssharedlibdebugobjs)
200 williamc 1.3 @mv $< $(librarystore)/$@
201 williamc 1.1
202 williamc 1.12 # -- Insure Shared Objects Libs
203     $(shlibname)_picInsure.$(SharedSuffix) : $(SsharedlibInsureobjs)
204     $(SharedCCTool)
205    
206     $(shlibname)_Insure.$(SharedSuffix) : $(SsharedlibInsureobjs)
207     @mv $< $(librarystore)/$@
208    
209 williamc 1.1 # -- Standard Archive Libs
210     $(arlibname).$(ArchiveSuffix) : $(Sarchivelibobjs)
211     $(ArchiveCCTool)
212 williamc 1.8 @mv $@ $(librarystore)/$@
213 williamc 1.1
214     # -- Debug Archive Libs
215     $(arlibname)_d.$(ArchiveSuffix) : $(Sarchivelibdebugobjs)
216 williamc 1.12 $(ArchiveCCTool)
217     @mv $@ $(librarystore)/$@
218    
219     # -- Insure Archive libs
220     $(arlibname)_Insure.$(ArchiveSuffix) : $(SarchivelibInsureobjs)
221 williamc 1.1 $(ArchiveCCTool)
222 williamc 1.7 @mv $@ $(librarystore)/$@
223 williamc 1.2
224     # -- Dependencies
225     dependencies.mk: $(files)
226     @$(DependencyCCTool)
227     @$(TOOL_HOME)/DependencyMangler $@