author | Richard Taylor <richard.i.taylor@nokia.com> |
Thu, 18 Mar 2010 15:12:39 +0000 | |
branch | wip |
changeset 381 | 8052c8afe93e |
parent 226 | 59f343577f92 |
child 511 | 7581d432643a |
permissions | -rw-r--r-- |
185
69334660be7a
Fixing Bug 1569 - excessive recompilation in incremental tracecompiler builds
Iain Williamson <iain.williamson@nokia.com>
parents:
169
diff
changeset
|
1 |
# Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 | 2 |
# All rights reserved. |
3 |
# This component and the accompanying materials are made available |
|
4 |
# under the terms of the License "Eclipse Public License v1.0" |
|
5 |
# which accompanies this distribution, and is available |
|
6 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
# |
|
8 |
# Initial Contributors: |
|
9 |
# Nokia Corporation - initial contribution. |
|
10 |
# |
|
11 |
# Contributors: |
|
12 |
# |
|
13 |
# Description: |
|
14 |
# WINSCW EXE/DLL/IMPLIB/LIB Function Like Makefile (FLM) |
|
15 |
# Knows how to build all possible executables for the WINSCW emulator build |
|
16 |
# |
|
17 |
# |
|
18 |
||
19 |
# passed in values, stripped of whitespace |
|
20 |
COPY_FOR_STATIC_LINKAGE:=$(strip $(COPY_FOR_STATIC_LINKAGE)) |
|
21 |
DEFFILE:=$(strip $(DEFFILE)) |
|
22 |
DEFFILEKEYWORD:=$(strip $(DEFFILEKEYWORD)) |
|
23 |
EPOCALLOWDLLDATA:=$(strip $(EPOCALLOWDLLDATA)) |
|
24 |
EXPORTLIBRARY:=$(strip $(EXPORTLIBRARY)) |
|
25 |
BASEADDRESS:=$(strip $(BASEADDRESS)) |
|
26 |
LINKAS:=$(strip $(LINKAS)) |
|
27 |
NOEXPORTLIBRARY:=$(strip $(NOEXPORTLIBRARY)) |
|
28 |
SECUREID:=$(strip $(SECUREID)) |
|
29 |
UID2:=$(strip $(UID2)) |
|
30 |
UID3:=$(strip $(UID3)) |
|
31 |
VENDORID:=$(strip $(VENDORID)) |
|
32 |
VID:=$(strip $(VID)) |
|
33 |
WIN32_HEADERS:=$(strip $(WIN32_HEADERS)) |
|
34 |
||
35 |
# local variables |
|
36 |
BINDIR:= |
|
37 |
BINDIRSTATICLINK:= |
|
38 |
BINTARGET:= |
|
39 |
BINTARGETSTATICLINK:= |
|
40 |
BLDDIR:= |
|
41 |
CHECKLIB_TYPE:= |
|
42 |
CREATABLEPATHS:= |
|
43 |
CLEANTARGETS:= |
|
44 |
CW_RUNTIME:= |
|
45 |
ENTRYSYMBOL:= |
|
46 |
IMPORTLIBLINKAS:= |
|
47 |
IMPORTLIBTARGET:= |
|
48 |
LIBDIR:= |
|
49 |
LINKER_FIRSTSTATLIB:= |
|
50 |
MAINLINKAS:= |
|
51 |
NEWLIBFILE:= |
|
168
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
52 |
RELEASABLES:= |
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
53 |
TC_RELEASABLES:= |
3 | 54 |
STATLIBDIR:= |
55 |
STDCPP_BUILD:= |
|
56 |
STDCPPTAGFILE:= |
|
57 |
UID1:= |
|
58 |
WIN32_LIBRARIES:= |
|
59 |
||
60 |
# FIVESPACES variable created to ensure that a suitable gap of space characters can |
|
61 |
# be placed between the separate arguments in the call to a tool (if required). |
|
62 |
# This is a workaround for a problem in Cygwin, where separate arguments are interpreted |
|
63 |
# as a single argument when passed to bash. |
|
64 |
FIVESPACES=$(BLANK) $(BLANK) |
|
65 |
||
66 |
# CW runtime varies based on TARGETTYPE requirements, with wrapper FLMs dictating the choice |
|
67 |
# We override a CW-specific environment variable to do this, in common with ABLD |
|
68 |
ifeq ($(CW_STATIC_RUNTIME),1) |
|
69 |
CW_RUNTIME:=$(CW_RUNTIME_STATIC) |
|
70 |
CFLAGS:=$(CFLAGS) $(OPT.RUNTIME)staticmulti |
|
71 |
else |
|
72 |
CW_RUNTIME:=$(CW_RUNTIME_NONSTATIC) |
|
73 |
CFLAGS:=$(CFLAGS) $(OPT.RUNTIME)dllmulti |
|
74 |
endif |
|
75 |
MWSym2LibraryFiles:=$(subst $(CHAR_SPACE),$(DIRSEP),$(CW_RUNTIME) $(CW_DEFAULT_LIBS)) |
|
76 |
ifneq ($(WIN32_LIBRARY),) |
|
77 |
WIN32_HEADERS:=1 |
|
78 |
WIN32_LIBRARIES:=$(addprefix $(OPT.LIBFILE),$(WIN32_LIBRARY)) |
|
79 |
endif |
|
80 |
||
81 |
# top-level definitions |
|
82 |
BINDIR:=$(RELEASEPATH)/$(FULLVARIANTPATH) |
|
83 |
||
84 |
# TARGETPATH and COPY_FOR_STATIC_LINKAGE only apply when TARGETPATH is a sub-directory of /sys/bin |
|
85 |
TARGETPATH_APPEND:=$(subst \,/,$(TARGETPATH)) |
|
86 |
ifneq ($(findstring /sys/bin/,$(TARGETPATH_APPEND)),) |
|
87 |
ifeq ($(COPY_FOR_STATIC_LINKAGE),1) |
|
88 |
BINDIRSTATICLINK:=$(BINDIR) |
|
89 |
endif |
|
90 |
BINDIR:=$(BINDIR)/z$(TARGETPATH_APPEND) |
|
91 |
else |
|
92 |
COPY_FOR_STATIC_LINKAGE:=0 |
|
93 |
endif |
|
94 |
||
95 |
BLDDIR:=$(OUTPUTPATH)/$(FULLVARIANTPATH) |
|
96 |
LIBDIR:=$(RELEASEPATH)/$(LINKPATH) |
|
97 |
STATLIBDIR:=$(RELEASEPATH)/$(FULLVARIANTPATH) |
|
98 |
CREATABLEPATHS:=$(BLDDIR) $(BINDIR) $(BINDIRSTATICLINK) |
|
99 |
||
100 |
# Deduce whether we should be performing a build with standard CPP characteristics |
|
101 |
# This operates differently per-OS release, although OE TARGETTYPEs always build with standard CPP traits |
|
102 |
ifeq ($(OPEN_ENVIRONMENT),1) |
|
103 |
STDCPP_BUILD:=1 |
|
104 |
endif |
|
105 |
||
106 |
ifeq ($(SUPPORTS_STDCPP_NEWLIB),1) |
|
107 |
ifeq ($(NOSTDCPP),1) |
|
108 |
STDCPP_BUILD:= |
|
109 |
else |
|
110 |
ifeq ($(STDCPP),1) |
|
111 |
STDCPP_BUILD:=1 |
|
112 |
endif |
|
113 |
endif |
|
114 |
||
40
afaf81347e0a
DPDEF143176 raptor does not respect STDCPP mmp file keyword
jchatten
parents:
9
diff
changeset
|
115 |
# Operator new linking depends on both the use of the NEWLIB keyword and whether a component supports a standard |
afaf81347e0a
DPDEF143176 raptor does not respect STDCPP mmp file keyword
jchatten
parents:
9
diff
changeset
|
116 |
# CPP build. |
3 | 117 |
ifneq ($(NEWLIB),) |
40
afaf81347e0a
DPDEF143176 raptor does not respect STDCPP mmp file keyword
jchatten
parents:
9
diff
changeset
|
118 |
# If specified, always use the NEWLIB keyword value for operator new library linking |
3 | 119 |
NEWLIBFILE:=$(STATLIBDIR)/$(NEWLIB) |
120 |
else |
|
40
afaf81347e0a
DPDEF143176 raptor does not respect STDCPP mmp file keyword
jchatten
parents:
9
diff
changeset
|
121 |
# If not performing a standard CPP build, link to an appropriate default Symbian new library. |
afaf81347e0a
DPDEF143176 raptor does not respect STDCPP mmp file keyword
jchatten
parents:
9
diff
changeset
|
122 |
# Standard CPP components defer to the toolchain supplied libraries. |
afaf81347e0a
DPDEF143176 raptor does not respect STDCPP mmp file keyword
jchatten
parents:
9
diff
changeset
|
123 |
ifneq ($(STDCPP_BUILD),1) |
afaf81347e0a
DPDEF143176 raptor does not respect STDCPP mmp file keyword
jchatten
parents:
9
diff
changeset
|
124 |
ifeq ($(SYSTEM_TARGET),1) |
afaf81347e0a
DPDEF143176 raptor does not respect STDCPP mmp file keyword
jchatten
parents:
9
diff
changeset
|
125 |
NEWLIBFILE:=$(STATLIBDIR)/$(DEFAULT_SYSTEM_NEWLIB) |
afaf81347e0a
DPDEF143176 raptor does not respect STDCPP mmp file keyword
jchatten
parents:
9
diff
changeset
|
126 |
else |
afaf81347e0a
DPDEF143176 raptor does not respect STDCPP mmp file keyword
jchatten
parents:
9
diff
changeset
|
127 |
NEWLIBFILE:=$(STATLIBDIR)/$(DEFAULT_NORMAL_NEWLIB) |
afaf81347e0a
DPDEF143176 raptor does not respect STDCPP mmp file keyword
jchatten
parents:
9
diff
changeset
|
128 |
endif |
3 | 129 |
endif |
130 |
endif |
|
131 |
endif |
|
132 |
||
133 |
ifeq ($(STDCPP_BUILD),1) |
|
134 |
CDEFS:=$(CDEFS) $(STDCPP_DEF) |
|
135 |
SYSTEMINCLUDE:=$(SYSTEMINCLUDE) $(STDCPP_INCLUDE) |
|
136 |
CFLAGS:=$(CFLAGS) $(OPT.WCHAR) on |
|
137 |
CHECKLIB_TYPE:=$(OPT.CHECKLIB.STDCPP) |
|
138 |
STDCPPTAGFILE:=$(OPT.LIBPATH)$(EPOCROOT)/epoc32/tools/tag $(OPT.SEARCH) tag_coff |
|
139 |
else |
|
140 |
CFLAGS:=$(CFLAGS) $(OPT.WCHAR) off |
|
141 |
CHECKLIB_TYPE:=$(OPT.CHECKLIB.SYMCPP) |
|
142 |
endif |
|
143 |
||
144 |
ifeq ($(WIN32_HEADERS),1) |
|
145 |
CDEFS:=$(CDEFS) WIN32 |
|
146 |
CDEFS:=$(CDEFS) _WINDOWS |
|
147 |
CFLAGS:=$(CFLAGS) $(OPT.STDINC) |
|
148 |
else |
|
149 |
CFLAGS:=$(CFLAGS) $(OPT.NOSTDINC) |
|
150 |
endif |
|
151 |
||
152 |
# get the compiler to generate dependencies for us? |
|
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
153 |
ifeq ($(NO_DEPEND_GENERATE),) |
3 | 154 |
CFLAGS:=$(CFLAGS) $(OPT.DEPEND) |
155 |
endif |
|
156 |
||
157 |
# specifics relating to the base type of the target being processed |
|
158 |
ifeq ($(BASE_TYPE),dll) |
|
159 |
# Special case, although this should be dealt with in the wrapper FLM in a better way |
|
160 |
ifeq ($(TARGETTYPE),exexp) |
|
161 |
CDEFS:=$(CDEFS) __EXE__ |
|
162 |
ENTRYSYMBOL:=__E32Startup |
|
163 |
LFLAGS:=$(LFLAGS) $(OPT.NOENTRY) |
|
164 |
UID1:=1000007a |
|
165 |
else |
|
166 |
CDEFS:=$(CDEFS) __DLL__ |
|
167 |
ENTRYSYMBOL:=__E32Dll |
|
168 |
LFLAGS:=$(LFLAGS) $(OPT.MAINENTRYPOINT)__Win32DllMain@12 |
|
169 |
UID1:=10000079 |
|
170 |
endif |
|
171 |
LFLAGS:=$(LFLAGS) $(OPT.SHARED) |
|
172 |
||
173 |
ifneq ($(BASEADDRESS),) |
|
174 |
LFLAGS:=$(LFLAGS) $(OPT.IMAGEBASE)$(BASEADDRESS) |
|
175 |
endif |
|
176 |
||
177 |
ifeq ($(FIRST_STATLIB),) |
|
178 |
BASE_TYPE_STATLIB:=edll.lib |
|
179 |
else |
|
180 |
BASE_TYPE_STATLIB:=$(FIRST_STATLIB) |
|
181 |
endif |
|
182 |
endif |
|
183 |
ifeq ($(BASE_TYPE),exe) |
|
184 |
CDEFS:=$(CDEFS) __EXE__ |
|
185 |
ENTRYSYMBOL:=?_E32Bootstrap@@YGXXZ |
|
186 |
UID1:=1000007a |
|
187 |
||
188 |
ifeq ($(FIRST_STATLIB),) |
|
189 |
BASE_TYPE_STATLIB:=eexe.lib |
|
190 |
else |
|
191 |
BASE_TYPE_STATLIB:=$(FIRST_STATLIB) |
|
192 |
endif |
|
193 |
endif |
|
194 |
||
195 |
ifeq ($(FIRSTLIB),) |
|
196 |
LINKER_FIRSTSTATLIB:=$(BASE_TYPE_STATLIB) |
|
197 |
else |
|
198 |
LINKER_FIRSTSTATLIB:=$(FIRSTLIB) |
|
199 |
endif |
|
200 |
||
201 |
||
202 |
BINTARGET:=$(BINDIR)/$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(TARGETTYPE)) |
|
203 |
||
204 |
||
205 |
# Run trace compiler ##################################### |
|
206 |
TRACE_MARKER_PATH:=$(OUTPUTPATH) |
|
207 |
||
169
a803b4fa1dd7
Fix winscw trace compile to not use the default UID3 if unspecified
Iain Williamson <iain.williamson@nokia.com>
parents:
168
diff
changeset
|
208 |
ifeq ($(subst 0,,$(UID3)),) |
3 | 209 |
ifeq ($(UID2),) |
210 |
USE_TRACE_COMPILER:= |
|
211 |
else |
|
212 |
UID_TC:=$(UID2) |
|
213 |
endif |
|
214 |
else |
|
215 |
UID_TC:=$(UID3) |
|
216 |
endif |
|
217 |
||
218 |
# USE_TRACE_COMPILER defaults to blank in Raptor config. |
|
219 |
# Users can turn TC on by setting it to 1 in user config. |
|
220 |
ifneq ($(USE_TRACE_COMPILER),) |
|
221 |
include $(FLMHOME)/tracecompiler.mk |
|
168
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
222 |
TC_RELEASABLES:=$(TRACE_DICTIONARY) $(AUTOGEN_HEADER) |
3 | 223 |
endif |
224 |
||
225 |
||
226 |
#################### |
|
227 |
## IMPORT LIBRARY ## |
|
228 |
#################### |
|
229 |
||
230 |
IMPORTLIBLINKAS:=$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(TARGETTYPE)) |
|
231 |
# LINKAS, if supplied, only applies to IMPLIB TARGETTYPEs |
|
232 |
ifeq ($(BASE_TYPE),importlib) |
|
233 |
ifneq ($(LINKAS),) |
|
234 |
IMPORTLIBLINKAS:=$(LINKAS) |
|
235 |
else |
|
236 |
IMPORTLIBLINKAS:=$(TARGET).dll |
|
237 |
endif |
|
238 |
endif |
|
239 |
||
240 |
ifneq ($(EXPORTLIBRARY),) |
|
241 |
IMPORTLIBTARGET:=$(LIBDIR)/$(EXPORTLIBRARY).lib |
|
242 |
else |
|
243 |
IMPORTLIBTARGET:=$(LIBDIR)/$(TARGET).lib |
|
244 |
endif |
|
245 |
||
246 |
# Regardless of whether a TARGETTYPE normally supports an import library, always attempt |
|
247 |
# to generate one if an explicit DEFFILE keyword was listed |
|
248 |
ifeq ($(DEFFILEKEYWORD),1) |
|
249 |
SUPPORTS_IMPORT_LIBRARY:=1 |
|
250 |
endif |
|
251 |
||
252 |
ifeq ($(SUPPORTS_IMPORT_LIBRARY),1) |
|
253 |
ifneq ($(NOEXPORTLIBRARY),1) |
|
254 |
ifneq ($(TARGET_$(call sanitise,$(IMPORTLIBTARGET))),1) |
|
168
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
255 |
RELEASABLES:=$(RELEASABLES) $(if $(or $(EXPORTUNFROZEN),$(DEFFILE)),$(IMPORTLIBTARGET)) |
3 | 256 |
|
257 |
# import libraries are generated to the UDEB release directory |
|
258 |
ifneq ($(VARIANTTYPE),udeb) |
|
259 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(if $(or $(EXPORTUNFROZEN),$(DEFFILE)),$(LIBDIR)) |
|
260 |
endif |
|
261 |
||
262 |
ifneq ($(EXPORTUNFROZEN),) |
|
263 |
# EXPORTUNFROZEN amounts to doing the stage-two link with the makedef generated temporary .def file but creating a .lib |
|
264 |
# file as a side-effect of linking. The import library is therefore dependent on the final binary in this instance. |
|
265 |
$(info <warning project='$(PROJECT_META)' component='$(COMPONENT_META)'>EXPORTUNFROZEN present in $(PROJECT_META) - unfrozen exports will be represented in import library.</warning> ) |
|
266 |
$(IMPORTLIBTARGET): $(BINTARGET) |
|
267 |
$(eval TARGET_$(call sanitise,$(IMPORTLIBTARGET)):=1) |
|
268 |
else |
|
269 |
ifneq ($(DEFFILE),) |
|
270 |
# If a .def file physically exists (either explicitly via DEFFILE or implicitly in the correct place) then we |
|
271 |
# generate an import library with reference to it |
|
272 |
PREPPEDDEFFILE:=$(BLDDIR)/$(TARGET).prep.def |
|
273 |
CLEANTARGETS:=$(CLEANTARGETS) $(PREPPEDDEFFILE) |
|
274 |
||
275 |
define win32def2lib |
|
276 |
$(IMPORTLIBTARGET): $(DEFFILE) |
|
277 |
$(call startrule,win32def2lib) \ |
|
278 |
$(PREPDEF) "$(DEFFILE)" "$(PREPPEDDEFFILE)" && \ |
|
279 |
$(LD) $(PREPPEDDEFFILE) $(OPT.IMPORTLIB) -o "$$@" $(OPT.ADDCOMMAND) "out:$(IMPORTLIBLINKAS)" $(OPT.WARNINGS) off \ |
|
280 |
$(call endrule,win32def2lib) |
|
281 |
endef |
|
282 |
$(eval $(win32def2lib)) |
|
283 |
$(eval TARGET_$(call sanitise,$(IMPORTLIBTARGET)):=1) |
|
284 |
endif |
|
285 |
endif |
|
286 |
endif |
|
287 |
endif |
|
288 |
endif |
|
289 |
||
290 |
||
291 |
ifneq ($(BASE_TYPE),importlib) |
|
292 |
||
293 |
############# |
|
294 |
## COMPILE ## |
|
295 |
############# |
|
296 |
||
297 |
ifeq ($(COPY_FOR_STATIC_LINKAGE),1) |
|
298 |
BINTARGETSTATICLINK:=$(BINDIRSTATICLINK)/$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(TARGETTYPE)) |
|
299 |
endif |
|
300 |
||
168
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
301 |
RELEASABLES:=$(RELEASABLES) $(BINTARGET) $(BINTARGETSTATICLINK) |
3 | 302 |
|
303 |
# work on a local source files list |
|
304 |
SRCFILES:=$(SOURCE) |
|
305 |
# and there may be more source for stage 2 in OE builds |
|
306 |
SRCFILES_OE:= |
|
307 |
||
308 |
ifneq ($(BASE_TYPE),staticlib) |
|
309 |
# add the generated UID source file |
|
310 |
GENSOURCE:=$(BLDDIR)/$(TARGET).UID.CPP |
|
311 |
SRCFILES:=$(SRCFILES) $(GENSOURCE) |
|
312 |
||
313 |
# the generated symbol lookup source file for Open Environment. |
|
314 |
# this only gets linked in at stage 2 |
|
315 |
SYMSOURCE:=$(if $(OPEN_ENVIRONMENT),$(BLDDIR)/$(TARGET)_SYM_.cpp,) |
|
316 |
SRCFILES_OE:=$(SYMSOURCE) |
|
317 |
||
318 |
CLEANTARGETS:=$(CLEANTARGETS) $(GENSOURCE) $(SYMSOURCE) |
|
319 |
||
320 |
ifeq ($(UID2),00000000) |
|
321 |
ifneq ($(UID2_DEFAULT),) |
|
322 |
UID2:=$(UID2_DEFAULT) |
|
323 |
endif |
|
324 |
endif |
|
325 |
||
326 |
ifeq ($(SECUREID),) |
|
327 |
SECUREID:=$(UID3) |
|
328 |
endif |
|
329 |
||
330 |
define win32generateUIDcpp |
|
331 |
$(GENSOURCE): $(PROJECT_META) |
|
332 |
$(call startrule,win32generateUIDcpp,,) \ |
|
333 |
echo "// SBS-generated uid source file" > $$@ && \ |
|
334 |
echo "#include <e32cmn.h>" >> $$@ && \ |
|
335 |
echo "#pragma data_seg(\".SYMBIAN\")" >> $$@ && \ |
|
336 |
echo "__EMULATOR_IMAGE_HEADER2(0x$(UID1),0x$(UID2),0x$(UID3),EPriority$(EPOCPROCESSPRIORITY),0x$(CAPABILITYFLAG1),0x$(CAPABILITYFLAG2),0x$(SECUREID),0x$(VENDORID),0x$(VERSIONHEX),$(EPOCALLOWDLLDATA))" >> $$@ && \ |
|
337 |
echo "#pragma data_seg()" >> $$@ \ |
|
338 |
$(call endrule,win32generateUIDcpp) |
|
339 |
endef |
|
340 |
$(eval $(win32generateUIDcpp)) |
|
341 |
endif # neq $(BASE_TYPE),staticlib |
|
342 |
||
343 |
# object files |
|
344 |
OBJECTFILES:=$(patsubst %,$(BLDDIR)/%,$(addsuffix .o,$(basename $(notdir $(call allsuffixsubst,.cia .CIA .Cia,_.cia,$(SRCFILES)))))) |
|
345 |
OBJECTFILES:=$(patsubst %.UID.o,%_UID_.o,$(OBJECTFILES)) |
|
346 |
||
347 |
# object file extras for stage 2 |
|
348 |
OBJECTFILES_OE:=$(patsubst %,$(BLDDIR)/%,$(addsuffix .o,$(basename $(notdir $(SRCFILES_OE))))) |
|
349 |
||
350 |
CLEANTARGETS:=$(CLEANTARGETS) $(OBJECTFILES) $(OBJECTFILES_OE) |
|
351 |
||
352 |
# include paths and preinclude file |
|
353 |
UINCLUDE:=$(patsubst %,$(OPT.USERINCLUDE)%,$(USERINCLUDE)) |
|
354 |
SINCLUDE:=$(patsubst %,$(OPT.SYSINCLUDE)%,$(SYSTEMINCLUDE)) |
|
355 |
PINCLUDE:=$(OPT.PREINCLUDE)$(notdir $(PRODUCT_INCLUDE)) |
|
356 |
||
357 |
#INCLUDES:=$(UINCLUDE) $(OPT.SPLITINCLUDE) $(SINCLUDE) $(PINCLUDE) |
|
358 |
INCLUDES:=$(OPT.SPLITINCLUDE) $(UINCLUDE) $(SINCLUDE) $(PINCLUDE) |
|
359 |
||
360 |
# macro definitions |
|
361 |
DEFINES:=$(call makemacrodef,$(OPT.DEFINE),$(CDEFS) $(TARGET_MACRO)) |
|
362 |
||
363 |
||
364 |
# $(1) is the name of the source file, $(2) is the extension to map it to e.g. .o |
|
365 |
# no space in front of function body |
|
366 |
define mapwin32file |
|
367 |
$(patsubst %.UID$(2),%_UID_$(2),$(BLDDIR)/$(addsuffix $2,$(basename $(notdir $(call allsuffixsubst,.cia .CIA .Cia,_.cia,$(1)))))) |
|
368 |
endef |
|
369 |
||
370 |
# compile all source files, creating and including compiler generated dependency files along the way |
|
371 |
# SED is used to (a) remove relatively pathed "object_file: source_file" references that can appear |
|
372 |
# with some versions of mwccsym2 and (b) convert slashes |
|
373 |
define win32compile2object |
|
374 |
||
375 |
$(eval DEPENDFILENAME:=$(call mapwin32file,$(1),.o.d)) |
|
376 |
$(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME))) |
|
377 |
||
185
69334660be7a
Fixing Bug 1569 - excessive recompilation in incremental tracecompiler builds
Iain Williamson <iain.williamson@nokia.com>
parents:
169
diff
changeset
|
378 |
$(call mapwin32file,$(1),.o): $(1) $(PROJECT_META) $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT) | $(if $(USE_TRACE_COMPILER),$(TRACE_MARKER)) |
3 | 379 |
$(call startrule,win32compile2object,,$(1)) \ |
380 |
$(CC) $$(if $$(filter %.C,$(1)),-lang c) $(CFLAGS) $(OPTION_CW) \ |
|
381 |
$(if $(STDCPP_BUILD),$$(if $$(filter %.c %.C,$(1)),,$$(call makemacrodef,$(OPT.DEFINE),$(STDCPP_WCHAR_DEF))),) \ |
|
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
382 |
$(DEFINES) $(INCLUDES) $(OPT.OUT)"$$@" "$(1)" \ |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
383 |
$(if $(NO_DEPEND_GENERATE),,&& $(GNUSED) 's#\\\\\(.\)#/\1#g;s#/ #\\\ #g;s#\([A-Za-z]:\)\\\\#\1/#g;1,1s#.*: .* \(.\)\?$$$$#$(call mapwin32file,$(1),.o): $1 \1#' $(call mapwin32file,$(1),.dep) > $(call mapwin32file,$(1),.o.d)) \ |
3 | 384 |
$(call endrule,win32compile2object) |
385 |
||
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
386 |
ifeq ($(NO_DEPEND_GENERATE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
387 |
CLEANTARGETS:=$$(CLEANTARGETS) $(call mapwin32file,$(1),.dep) $(DEPENDFILENAME) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
388 |
endif |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
389 |
|
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
390 |
ifneq ($(DEPENDFILE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
391 |
ifeq ($(NO_DEPEND_INCLUDE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
392 |
ifeq ($(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS))),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
393 |
-include $(DEPENDFILE) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
394 |
endif |
3 | 395 |
endif |
396 |
endif |
|
397 |
||
398 |
# individual source file compilation |
|
399 |
SOURCETARGET_$(call sanitise,$(1)): $(call mapwin32file,$(1),.o) |
|
400 |
||
401 |
endef |
|
402 |
||
403 |
# List target, depends on object file |
|
404 |
define win32list |
|
405 |
LISTING:: $(OBJECTFILES) $(OBJECTFILES_OE) |
|
406 |
$(call startrule,win32listing) \ |
|
407 |
$(CC) $(OPT.LISTING) $(patsubst %.UID.o,%_UID_.o,$(BLDDIR)/$(addsuffix .o,$(basename $(notdir $(1))))) -o $(basename $1).WINSCW.lst \ |
|
408 |
$(call endrule,win32listing) |
|
409 |
endef |
|
410 |
||
411 |
$(foreach SRCFILE,$(SRCFILES) $(SRCFILES_OE),$(eval $(call win32compile2object,$(SRCFILE)))) |
|
412 |
$(foreach SRCFILE,$(SRCFILES) $(SRCFILES_OE),$(eval $(call win32list,$(SRCFILE)))) |
|
413 |
||
414 |
###################### |
|
415 |
## RESOURCE COMPILE ## |
|
416 |
###################### |
|
417 |
||
418 |
# If Python has been used to construct the environment on Windows then the standard MW include path environment |
|
419 |
# variable will have been munged to UPPERCASE. |
|
420 |
STDMWCINCLUDEPATHS:=$(if $(MWCSym2Includes),$(MWCSym2Includes),$(MWCSYM2INCLUDES)) |
|
421 |
||
422 |
define win32resourcecompile |
|
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
423 |
# Note that, if dependency files are required, two calls are made to the resource compiler here. |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
424 |
# There seems to be no means to override the default behaviour of dumping dependency files into the CWD when using -MD. |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
425 |
# So - we compile once for real, and then pipe dependency output through SED afterwards to create the dependency file where we want it |
3 | 426 |
|
427 |
$(eval DEPENDFILENAME:=$(call mapwin32file,$(1),.res.d)) |
|
428 |
$(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME))) |
|
429 |
||
430 |
$(call mapwin32file,$(1),.res): $(1) $(PROJECT_META) $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT) |
|
431 |
$(call startrule,win32resourcecompile,,$(1)) \ |
|
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
432 |
MWCIncludes='$(STDMWCINCLUDEPATHS)' $(RC) $(OPT.OUT)"$$@" "$(1)" \ |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
433 |
$(if $(NO_DEPEND_GENERATE),,&& \ |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
434 |
MWCIncludes='$(STDMWCINCLUDEPATHS)' $(RC) -make $(OPT.OUT)"$$@" "$(1)" | \ |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
435 |
$(GNUSED) 's#\\\\\(.\)#/\1#g;s#/ #\\\ #g;s#\([A-Za-z]:\)\\\\#\1/#g;1,1s#.*: .* \(.\)\?$$$$#$(call mapwin32file,$(1),.res): $1 \1#' > $(call mapwin32file,$(1),.res.d)) \ |
3 | 436 |
$(call endrule,win32resourcecompile) |
437 |
||
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
438 |
ifeq ($(NO_DEPEND_GENERATE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
439 |
CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
440 |
endif |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
441 |
|
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
442 |
ifneq ($(DEPENDFILE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
443 |
ifeq ($(NO_DEPEND_INCLUDE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
444 |
ifeq ($(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS))),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
445 |
-include $(DEPENDFILE) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
446 |
endif |
3 | 447 |
endif |
448 |
endif |
|
449 |
||
450 |
endef |
|
451 |
||
452 |
$(foreach WIN32RESOURCEFILE,$(WIN32_RESOURCE),$(eval $(call win32resourcecompile,$(WIN32RESOURCEFILE)))) |
|
453 |
OBJECTFILES:=$(OBJECTFILES) $(patsubst %,$(BLDDIR)/%,$(addsuffix .res,$(basename $(notdir $(WIN32_RESOURCE))))) |
|
454 |
||
455 |
################## |
|
456 |
## LINK/ARCHIVE ## |
|
457 |
################## |
|
458 |
||
459 |
# libraries |
|
460 |
STATICLIBS:=$(patsubst %,%.lib,$(STATICLIBRARY)) |
|
461 |
STATICLIBFILES:=$(patsubst %,$(STATLIBDIR)/%,$(STATICLIBS)) |
|
462 |
LINKER_FIRSTSTATLIBFILE:=$(STATLIBDIR)/$(LINKER_FIRSTSTATLIB) |
|
463 |
||
464 |
ifeq ($(VARIANTTYPE),urel) |
|
465 |
LINKLIBS:=$(patsubst %.dso,%.lib,$(LIBRARY)) |
|
466 |
else |
|
467 |
LINKLIBS:=$(patsubst %.dso,%.lib,$(LIBRARY_DEBUG)) |
|
468 |
endif |
|
469 |
||
470 |
LINKLIBFILES:=$(patsubst %,$(LIBDIR)/%,$(LINKLIBS)) |
|
471 |
||
472 |
MAP:= |
|
473 |
ifneq ($(BASE_TYPE),staticlib) |
|
474 |
ifneq ($(BASE_TYPE),importlib) |
|
475 |
# link map file (urel only) |
|
476 |
ifeq ($(VARIANTTYPE),urel) |
|
477 |
MAP:=$(OPT.MAP)$(BINTARGET).map |
|
168
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
478 |
RELEASABLES:=$(RELEASABLES) $(BINTARGET).map |
3 | 479 |
endif |
480 |
endif |
|
481 |
endif |
|
482 |
||
483 |
# all object files are listed in a response file to minimise the length of linker calls |
|
484 |
OBJECTFILES_LRF:=$(BLDDIR)/$(TARGET)_$(VARIANTTYPE)_objects.lrf |
|
485 |
CLEANTARGET:=$(CLEANTARGETS) $(OBJECTFILES_LRF) |
|
486 |
||
487 |
define groupin10 |
|
488 |
$(if $1,@echo -e $(foreach L,$(wordlist 1,10,$1),"$(L)\\n") >> $(OBJECTFILES_LRF),) |
|
489 |
$(if $1,$(call groupin10,$(wordlist 11,$(words $1),$1)),@true) |
|
490 |
endef |
|
491 |
||
492 |
# |
|
493 |
# Archive |
|
494 |
# |
|
495 |
ifeq ($(BASE_TYPE),staticlib) |
|
496 |
define win32archive |
|
497 |
$(BINTARGET): $(OBJECTFILES) |
|
498 |
@echo "" > $(OBJECTFILES_LRF); |
|
499 |
$(call groupin10,$(notdir $(OBJECTFILES))) ; |
|
500 |
$(call startrule,win32archive) \ |
|
501 |
$(LD) $(OPT.STATICLIBRARY) $(LFLAGS) $(OPT.NOIMPLIB) $(WIN32_LIBRARIES) $(OPT.OUT)"$$@" $(STDCPPTAGFILE) $(OPT.LIBPATH)$(BLDDIR) $(OPT.SEARCH) @$(OBJECTFILES_LRF) \ |
|
502 |
$(if $(SAVESPACE),; $(GNURM) -rf $(BLDDIR); true,) \ |
|
503 |
$(call endrule,win32archive) |
|
504 |
endef |
|
505 |
$(eval $(win32archive)) |
|
506 |
endif |
|
507 |
||
508 |
ifneq ($(EPOCHEAPSIZEMIN_DEC_KB),) |
|
509 |
LFLAGS:=$(LFLAGS) $(OPT.HEAPRESERVE)$(EPOCHEAPSIZEMAX_DEC_KB) $(OPT.HEAPCOMMIT)$(EPOCHEAPSIZEMIN_DEC_KB) |
|
510 |
endif |
|
511 |
||
512 |
# |
|
513 |
# Simple link |
|
514 |
# |
|
515 |
ifeq ($(BASE_TYPE),exe) |
|
516 |
define win32simplelink |
|
517 |
$(BINTARGET).map: $(BINTARGET) |
|
518 |
||
519 |
$(BINTARGET): $(OBJECTFILES) $(LINKER_FIRSTSTATLIBFILE) $(NEWLIBFILE) $(STATICLIBFILES) $(LINKLIBFILES) |
|
520 |
@echo "" > $(OBJECTFILES_LRF); |
|
521 |
$(call groupin10,$(notdir $(OBJECTFILES))) ; |
|
522 |
$(call startrule,win32simplelink) \ |
|
523 |
$(if $(SUPPORTS_STDCPP_NEWLIB),$(if $(STATICLIBFILES),$(CHECKLIB) $(CHECKLIB_TYPE) $(OPT.CHECKLIB.WIN32) $(STATICLIBFILES) &&,),) \ |
|
524 |
MWSym2LibraryFiles="$(MWSym2LibraryFiles)" $(LD) $(LFLAGS) $(OPT.MENTRYPOINT)$(ENTRYSYMBOL) $(MAP) $(LINKER_FIRSTSTATLIBFILE) $(NEWLIBFILE) $(WIN32_LIBRARIES) $(STATICLIBFILES) $(LINKLIBFILES) $(OPT.OUT)"$$@" $(OPT.NOIMPLIB) $(OPT.LIBPATH)$(BLDDIR) $(OPT.SEARCH) @$(OBJECTFILES_LRF) \ |
|
525 |
$(if $(SAVESPACE),; $(GNURM) -rf $(BLDDIR); true,) \ |
|
526 |
$(call endrule,win32simplelink) |
|
527 |
endef |
|
528 |
$(eval $(win32simplelink)) |
|
529 |
endif |
|
530 |
||
531 |
# |
|
532 |
# Two stage link |
|
533 |
# |
|
534 |
ifeq ($(BASE_TYPE),dll) |
|
535 |
TMP_IMPLIB:=$(BLDDIR)/$(TARGET).lib |
|
536 |
TMP_INFFILE:=$(BLDDIR)/$(TARGET).inf |
|
537 |
TMP_SYMFILE:=$(if $(OPEN_ENVIRONMENT),$(BLDDIR)/$(TARGET).sym,) |
|
538 |
TMP_TARGET:=$(BLDDIR)/$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(TARGETTYPE)) |
|
539 |
TMP_DEFFILE:=$(BLDDIR)/$(TARGET).def |
|
540 |
||
541 |
CLEANTARGETS:=$(CLEANTARGETS) $(TMP_IMPLIB) $(TMP_INFFILE) $(TMP_TARGET) $(TMP_DEFFILE) $(TMP_SYMFILE) |
|
542 |
||
543 |
MAKEDEF_ARGS:=-absent $(ENTRYSYMBOL) -Inffile $(call dblquote,$(TMP_INFFILE)) $(NAME_LOOKUP) |
|
544 |
||
545 |
ifeq ($(SYSTEM_TARGET),1) |
|
546 |
MAKEDEF_ARGS:=$(MAKEDEF_ARGS) -SystemTargetType |
|
547 |
endif |
|
548 |
||
549 |
ifneq ($(FIXED_EXPORT),) |
|
550 |
# Fixed export TARGETTYPE, but with possibility of a .def file if explicitly specified and available |
|
551 |
ifeq ($(DEFFILEKEYWORD),1) |
|
552 |
ifneq ($(DEFFILE),) |
|
553 |
MAKEDEF_ARGS:=$(MAKEDEF_ARGS) -Frzfile $(call dblquote,$(DEFFILE)) |
|
554 |
endif |
|
555 |
endif |
|
556 |
MAKEDEF_ARGS:=$(MAKEDEF_ARGS) -1 $(FIXED_EXPORT) |
|
557 |
else |
|
558 |
# Variable export TARGETTYPE with either deduced or explicitly specified .def file (if available) |
|
559 |
ifneq ($(DEFFILE),) |
|
560 |
MAKEDEF_ARGS:=$(MAKEDEF_ARGS) -Frzfile $(call dblquote,$(DEFFILE)) |
|
561 |
endif |
|
562 |
endif |
|
563 |
||
564 |
||
565 |
ifneq ($(EXPORTSUNFROZEN),) |
|
566 |
LIBRARY: $(TMP_IMPLIB) |
|
567 |
endif |
|
568 |
||
569 |
define win32stageonelink |
|
570 |
# Stage One |
|
571 |
# Link by name, generating temporary main binary and import library. |
|
572 |
$(TMP_IMPLIB): $(TMP_TARGET) |
|
573 |
||
574 |
$(TMP_TARGET): $(OBJECTFILES) $(LINKER_FIRSTSTATLIBFILE) $(NEWLIBFILE) $(STATICLIBFILES) $(LINKLIBFILES) |
|
575 |
@echo "" > $(OBJECTFILES_LRF); |
|
576 |
$(call groupin10,$(notdir $(OBJECTFILES))) ; |
|
577 |
$(call startrule,win32stageonelink) \ |
|
578 |
$(if $(SUPPORTS_STDCPP_NEWLIB),$(if $(STATICLIBFILES),$(CHECKLIB) $(CHECKLIB_TYPE) $(OPT.CHECKLIB.WIN32) $(STATICLIBFILES) &&,),) \ |
|
579 |
MWSym2LibraryFiles="$(MWSym2LibraryFiles)" $(LD) $(LFLAGS) $(OPT.MENTRYPOINT)$(ENTRYSYMBOL) $(OPT.EXPORT)$(EXPORT_TYPE) $(OPT.NOCOMPACTIMPORTLIB) $(OPT.ADDCOMMAND) "out:$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(TARGETTYPE))" $(OPT.WARNINGS) off $(OPT.IMPLIB)"$(TMP_IMPLIB)" $(OPT.OUT)"$(TMP_TARGET)" $(LINKER_FIRSTSTATLIBFILE) $(NEWLIBFILE) $(WIN32_LIBRARIES) $(STATICLIBFILES) $(LINKLIBFILES) $(OPT.LIBPATH)$(BLDDIR) $(OPT.SEARCH) @$(OBJECTFILES_LRF) \ |
|
580 |
$(call endrule,win32stageonelink) |
|
581 |
endef |
|
582 |
$(eval $(win32stageonelink)) |
|
583 |
||
584 |
define win32processexports |
|
585 |
# Process exports |
|
586 |
# Generate a descriptive info file from the import library. |
|
587 |
# Push info file through MAKEDEF to generated a valid .def file for link by ordinal. |
|
588 |
$(TMP_DEFFILE): $(TMP_IMPLIB) |
|
589 |
$(call startrule,win32processexports) \ |
|
590 |
$(LD) $(LFLAGS_INFGEN) $(OPT.OUT)"$(TMP_INFFILE)" "$(TMP_IMPLIB)" && \ |
|
591 |
$(MAKEDEF) $(MAKEDEF_ARGS) "$$@" \ |
|
592 |
$(call endrule,win32processexports) |
|
593 |
endef |
|
594 |
$(eval $(win32processexports)) |
|
595 |
||
596 |
ifeq ($(OPEN_ENVIRONMENT),1) |
|
597 |
define win32processoeexports |
|
598 |
# Process additional exports for Open Environment |
|
599 |
# Generate a symbol file from the temporary DLL. |
|
600 |
# Generate a C++ source file from the symbol file |
|
601 |
||
602 |
$(TMP_SYMFILE): $(TMP_TARGET) |
|
603 |
$(call startrule,win32generatesymfile) \ |
|
604 |
$(LD) $(LFLAGS_SYMGEN) $(OPT.OUT)"$(TMP_SYMFILE)" "$(TMP_TARGET)" \ |
|
605 |
$(call endrule,win32generatesymfile) |
|
606 |
||
607 |
$(SYMSOURCE): $(TMP_SYMFILE) |
|
608 |
$(call startrule,win32generatesymcpp) \ |
|
609 |
$(SYMLOOKUPUTIL) $(OPT.OUT)"$(SYMSOURCE)" $(OPT.SYM)"$(TMP_SYMFILE)" $(SYMLOOKUPARGS) \ |
|
610 |
$(call endrule,win32generatesymcpp) |
|
611 |
endef |
|
612 |
$(eval $(win32processoeexports)) |
|
613 |
endif |
|
614 |
||
615 |
define win32stagetwolink |
|
616 |
# Stage Two |
|
617 |
# Link by ordinal, based on a previously MAKEDEF-generated temporary .def file |
|
618 |
# Optionally create an import library if EXPORTUNFROZEN is specified |
|
619 |
# |
|
620 |
$(BINTARGET).map: $(BINTARGET) |
|
621 |
||
622 |
$(BINTARGET): $(OBJECTFILES) $(OBJECTFILES_OE) $(LINKER_FIRSTSTATLIBFILE) $(STATICLIBFILES) $(NEWLIBFILE) $(LINKLIBFILES) $(TMP_DEFFILE) |
|
623 |
@echo "" > $(OBJECTFILES_LRF); |
|
624 |
$(call groupin10,$(notdir $(OBJECTFILES) $(OBJECTFILES_OE))) ; |
|
625 |
$(call startrule,win32stagetwolink) \ |
|
626 |
MWSym2LibraryFiles="$(MWSym2LibraryFiles)" \ |
|
627 |
$(LD) $(LFLAGS) $(OPT.DEFFILE)$(TMP_DEFFILE) $(MAP) $(LINKER_FIRSTSTATLIBFILE) $(NEWLIBFILE) $(WIN32_LIBRARIES) $(STATICLIBFILES) $(LINKLIBFILES) \ |
|
628 |
$(OPT.OUT)"$$@" \ |
|
629 |
$(if $(EXPORTUNFROZEN),$(OPT.IMPLIB)$(IMPORTLIBTARGET),$(OPT.NOIMPLIB)) \ |
|
630 |
$(OPT.LIBPATH)$(BLDDIR) $(OPT.SEARCH) @$(OBJECTFILES_LRF) \ |
|
631 |
$(if $(SAVESPACE),; $(GNURM) -rf $(BLDDIR); true,) \ |
|
632 |
$(call endrule,win32stagetwolink) |
|
633 |
endef |
|
634 |
$(eval $(win32stagetwolink)) |
|
635 |
||
636 |
define win32copyforstaticlink |
|
637 |
# Copy additonal binary to "traditional" output location (if required) |
|
638 |
$(BINTARGETSTATICLINK): $(BINTARGET) |
|
639 |
$(call startrule,win32copyforstaticlink) \ |
|
640 |
$(GNUCP) $$< $$@ \ |
|
641 |
$(call endrule,win32copyforstaticlink) |
|
642 |
endef |
|
643 |
ifeq ($(COPY_FOR_STATIC_LINKAGE),1) |
|
644 |
$(eval $(win32copyforstaticlink)) |
|
645 |
endif |
|
646 |
||
647 |
define e32freeze |
|
648 |
# DLL-type targets that support import library generation support freezing of exports using EFREEZE |
|
649 |
FREEZE:: $(1) |
|
650 |
$(call startrule,freeze,,$(RESOLVED_DEFFILE)) \ |
|
651 |
$(EFREEZE) $(EFREEZE_REMOVE_OPTION) "$(RESOLVED_DEFFILE)" $(FIVESPACES) "$(2)" \ |
|
652 |
$(call endrule,freeze) |
|
653 |
endef |
|
654 |
# Create only one freeze target per urel/udeb variant as the interface won't differ between them |
|
655 |
# Only create a freeze target if the component supports import library generation |
|
656 |
ifneq ($(TARGET_$(call sanitise,$(IMPORTLIBTARGET))_FREEZE),1) |
|
657 |
ifeq ($(SUPPORTS_IMPORT_LIBRARY),1) |
|
658 |
$(eval $(call e32freeze,$(BINTARGET),$(TMP_DEFFILE))) |
|
659 |
$(eval TARGET_$(call sanitise,$(IMPORTLIBTARGET))_FREEZE:=1) |
|
660 |
endif |
|
661 |
endif |
|
662 |
endif |
|
663 |
endif # neq $(BASE_TYPE),importlib |
|
664 |
||
665 |
||
666 |
# Global targets |
|
667 |
.PHONY:: $(ALLTARGET) |
|
168
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
668 |
$(ALLTARGET):: $(RELEASABLES) |
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
669 |
TARGET:: $(RELEASABLES) |
3 | 670 |
|
671 |
ifeq ($(TARGET_$(call sanitise,$(IMPORTLIBTARGET))),1) |
|
672 |
LIBRARY:: $(IMPORTLIBTARGET) |
|
673 |
else |
|
674 |
ifeq ($(BASE_TYPE),staticlib) |
|
675 |
LIBRARY:: $(BINTARGET) |
|
676 |
endif |
|
677 |
endif |
|
678 |
||
679 |
||
680 |
# Deal with test code batch files generation. |
|
681 |
ifneq ($(TESTPATH),) |
|
682 |
EPOC_ROOT:=$(patsubst %/,%,$(EPOCROOT)) |
|
683 |
TOBLDINF:=$(dir $(subst :,,$(subst $(EPOC_ROOT)/,,$(COMPONENT_META)))) |
|
684 |
||
685 |
||
686 |
BATCHDIR:=$(EPOCROOT)/epoc32/release/$(VARIANTPLATFORM)/$(VARIANTTYPE)/z/test/ |
|
687 |
$(eval $(call MakeTestBatchFiles,$(TARGET),$(BATCHDIR)$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH))) |
|
688 |
BATCHFILE_CREATED_$(BATCHDIR)$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH):=1 |
|
689 |
TARGET_CREATED_$(EPOCROOT)/epoc32/release/$(VARIANTPLATFORM)/$(VARIANTTYPE)/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH)_$(TARGET):=1 |
|
168
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
690 |
RELEASABLES:=$(RELEASABLES) $(EPOCROOT)/epoc32/release/$(VARIANTPLATFORM)/$(VARIANTTYPE)/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH) |
3 | 691 |
endif |
692 |
||
693 |
# clean up |
|
9 | 694 |
$(call raptor_clean,$(CLEANTARGETS)) |
3 | 695 |
# make the output directories while reading makefile - some build engines prefer this |
696 |
$(call makepath,$(CREATABLEPATHS)) |
|
9 | 697 |
# for the --what option and the log file |
168
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
698 |
$(call raptor_release,$(RELEASABLES) $(TC_RELEASABLES)) |