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 |
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 |
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 |
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 |
100 |
|
|
101 |
|
%_picd.o : %.f |
102 |
|
$(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $(SharedFCObjectFlags) $< -o $@ |
103 |
< |
# -- Standard Archive Libs |
104 |
< |
# Already built in |
103 |
> |
|
104 |
> |
# -- Debug Shared Objects with Insure |
105 |
> |
%_picInsure.o : %.cc |
106 |
> |
$(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@ |
107 |
> |
|
108 |
> |
%_picInsure.o : %.C |
109 |
> |
$(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@ |
110 |
> |
|
111 |
> |
%_picInsure.o : %.cpp |
112 |
> |
$(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(SharedCCObjectFlags) $< -o $@ |
113 |
> |
|
114 |
|
|
115 |
|
# -- Debug Archive Libs |
116 |
|
%_d.o : %.cpp |
128 |
|
%_d.o : %.f |
129 |
|
$(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $< -o $@ |
130 |
|
|
131 |
< |
# -- Executables |
132 |
< |
%.exe : %.cpp |
133 |
< |
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) |
131 |
> |
# -- Debug Archive Libs with Insure |
132 |
> |
%_Insure.o : %.cpp |
133 |
> |
$(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@ |
134 |
|
|
135 |
< |
%.exe : %.cc |
136 |
< |
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) |
135 |
> |
%_Insure.o : %.cc |
136 |
> |
$(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@ |
137 |
|
|
138 |
< |
%.exe : %.C |
139 |
< |
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) |
138 |
> |
%_Insure.o : %.C |
139 |
> |
$(Insure) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $< -o $@ |
140 |
|
|
141 |
< |
%.exe : %.F |
142 |
< |
$(FC) $(CPPFLAGS) $(FFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) |
141 |
> |
# -- Standard Archive Libs |
142 |
> |
%.o : %.cpp |
143 |
> |
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ |
144 |
> |
|
145 |
> |
%.o : %.cc |
146 |
> |
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ |
147 |
> |
|
148 |
> |
%.o : %.C |
149 |
> |
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ |
150 |
> |
|
151 |
> |
%.o : %.F |
152 |
> |
$(FC) -c $(CPPFLAGS) $(FFLAGS) $< -o $@ |
153 |
|
|
154 |
< |
%.exe : %.f |
155 |
< |
$(FC) $(CPPFLAGS) $(FFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) |
154 |
> |
%.o : %.f |
155 |
> |
$(FC) -c $(CPPFLAGS) $(FFLAGS) $< -o $@ |
156 |
|
|
157 |
< |
# -- Debug Exexcutables |
131 |
< |
#LDLIBS_D:=$(shell $(TOOL_HOME)/LibTypeExpand $(LDLIBS) "_d") |
132 |
< |
%_d.exe : %.cpp |
133 |
< |
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ \ $(LDLIBS_D) |
157 |
> |
# Already built in |
158 |
|
|
159 |
< |
%_d.exe : %.cc |
160 |
< |
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D) |
159 |
> |
# ------------------------------------------------------------------------- |
160 |
> |
# Executables |
161 |
> |
# ------------------------------------------------------------------------- |
162 |
> |
|
163 |
> |
# -- Debug Executables |
164 |
> |
|
165 |
> |
lib_d=$(shell $(TOOL_HOME)/LibTypeExpand "_d" $(lib)) |
166 |
> |
LDLIBS_D=$(addprefix -l,$(lib_d)) |
167 |
> |
|
168 |
> |
#%_d.exe : |
169 |
> |
# $(CXX) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D) |
170 |
> |
|
171 |
> |
# -- Insure Executables |
172 |
> |
lib_Insure=$(shell $(TOOL_HOME)/LibTypeExpand "_Insure" $(lib)) |
173 |
> |
LDLIBS_I=$(addprefix -l,$(lib_Insure)) |
174 |
> |
#%_Insure.exe : |
175 |
> |
# $(Insure) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D) |
176 |
|
|
177 |
< |
%_d.exe : %.C |
178 |
< |
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D) |
177 |
> |
# -- Executables |
178 |
> |
#%.exe : |
179 |
> |
# $(CXX) $(CXXFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) |
180 |
|
|
181 |
< |
%_d.exe : %.F |
142 |
< |
$(FC) $(CPPFLAGS) $(FFLAGS_D) $(FCDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D) |
181 |
> |
# ------------------------------------------------------------------------- |
182 |
|
|
183 |
< |
%_d.exe : %.f |
184 |
< |
$(FC) $(CPPFLAGS) $(FFLAGS_D) $(FCDebugFlag) $(LDFLAGS) $< -o $@ $(LDLIBS_D) |
183 |
> |
realbins:=$(filter $(bintargets),$(notdir $(wildcard $(LOCALTOP)/$(INTbin)/*))) |
184 |
> |
clean :: |
185 |
> |
@if [ "$(realbins)" != "" ] ; then \ |
186 |
> |
echo Removing executables : $(realbins); \ |
187 |
> |
rm $(LOCALTOP)/$(INTbin)/$(realbins); \ |
188 |
> |
fi; |
189 |
|
|
190 |
+ |
# ------------------------------------------------------------------------- |
191 |
|
|
192 |
|
# Some nice generic target names for the user |
193 |
|
|
212 |
|
$(shlibname)_d.$(SharedSuffix) : $(Ssharedlibdebugobjs) |
213 |
|
@mv $< $(librarystore)/$@ |
214 |
|
|
215 |
+ |
# -- Insure Shared Objects Libs |
216 |
+ |
$(shlibname)_picInsure.$(SharedSuffix) : $(SsharedlibInsureobjs) |
217 |
+ |
$(SharedCCTool) |
218 |
+ |
|
219 |
+ |
$(shlibname)_Insure.$(SharedSuffix) : $(SsharedlibInsureobjs) |
220 |
+ |
@mv $< $(librarystore)/$@ |
221 |
+ |
|
222 |
|
# -- Standard Archive Libs |
223 |
|
$(arlibname).$(ArchiveSuffix) : $(Sarchivelibobjs) |
224 |
|
$(ArchiveCCTool) |
225 |
< |
@mv $@ $(librarystore) |
225 |
> |
@mv $@ $(librarystore)/$@ |
226 |
|
|
227 |
|
# -- Debug Archive Libs |
228 |
|
$(arlibname)_d.$(ArchiveSuffix) : $(Sarchivelibdebugobjs) |
229 |
|
$(ArchiveCCTool) |
230 |
< |
@mv $@ $(librarystore) |
230 |
> |
@mv $@ $(librarystore)/$@ |
231 |
> |
|
232 |
> |
# -- Insure Archive libs |
233 |
> |
$(arlibname)_Insure.$(ArchiveSuffix) : $(SarchivelibInsureobjs) |
234 |
> |
$(ArchiveCCTool) |
235 |
> |
@mv $@ $(librarystore)/$@ |
236 |
|
|
237 |
|
# -- Dependencies |
238 |
|
dependencies.mk: $(files) |
239 |
|
@$(DependencyCCTool) |
240 |
|
@$(TOOL_HOME)/DependencyMangler $@ |
241 |
+ |
|
242 |
+ |
%.dep: |
243 |
+ |
@$(DependencyCCTool) |
244 |
+ |
@$(TOOL_HOME)/DependencyMangler $@ |
245 |
+ |
|