author | yiluzhu |
Tue, 25 May 2010 10:23:35 +0100 | |
branch | fix |
changeset 570 | 971d2c670e06 |
parent 522 | 9971c248e894 |
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 |
||
516
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
202 |
TARGETEXT:=$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(TARGETTYPE)) |
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
203 |
BINTARGET:=$(BINDIR)/$(TARGET).$(TARGETEXT) |
3 | 204 |
|
205 |
||
206 |
# Run trace compiler ##################################### |
|
207 |
TRACE_MARKER_PATH:=$(OUTPUTPATH) |
|
208 |
||
169
a803b4fa1dd7
Fix winscw trace compile to not use the default UID3 if unspecified
Iain Williamson <iain.williamson@nokia.com>
parents:
168
diff
changeset
|
209 |
ifeq ($(subst 0,,$(UID3)),) |
3 | 210 |
ifeq ($(UID2),) |
211 |
USE_TRACE_COMPILER:= |
|
212 |
else |
|
213 |
UID_TC:=$(UID2) |
|
214 |
endif |
|
215 |
else |
|
216 |
UID_TC:=$(UID3) |
|
217 |
endif |
|
218 |
||
219 |
# USE_TRACE_COMPILER defaults to blank in Raptor config. |
|
220 |
# Users can turn TC on by setting it to 1 in user config. |
|
516
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
221 |
ifneq ($(USE_TRACE_COMPILER),) |
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
222 |
# TARGETEXT must be set before here |
3 | 223 |
include $(FLMHOME)/tracecompiler.mk |
168
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
224 |
TC_RELEASABLES:=$(TRACE_DICTIONARY) $(AUTOGEN_HEADER) |
3 | 225 |
endif |
226 |
||
227 |
||
228 |
#################### |
|
229 |
## IMPORT LIBRARY ## |
|
230 |
#################### |
|
231 |
||
516
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
232 |
IMPORTLIBLINKAS:=$(TARGET).$(TARGETEXT) |
3 | 233 |
# LINKAS, if supplied, only applies to IMPLIB TARGETTYPEs |
234 |
ifeq ($(BASE_TYPE),importlib) |
|
235 |
ifneq ($(LINKAS),) |
|
236 |
IMPORTLIBLINKAS:=$(LINKAS) |
|
237 |
else |
|
238 |
IMPORTLIBLINKAS:=$(TARGET).dll |
|
239 |
endif |
|
240 |
endif |
|
241 |
||
242 |
ifneq ($(EXPORTLIBRARY),) |
|
243 |
IMPORTLIBTARGET:=$(LIBDIR)/$(EXPORTLIBRARY).lib |
|
244 |
else |
|
245 |
IMPORTLIBTARGET:=$(LIBDIR)/$(TARGET).lib |
|
246 |
endif |
|
247 |
||
248 |
# Regardless of whether a TARGETTYPE normally supports an import library, always attempt |
|
249 |
# to generate one if an explicit DEFFILE keyword was listed |
|
250 |
ifeq ($(DEFFILEKEYWORD),1) |
|
251 |
SUPPORTS_IMPORT_LIBRARY:=1 |
|
252 |
endif |
|
253 |
||
254 |
ifeq ($(SUPPORTS_IMPORT_LIBRARY),1) |
|
255 |
ifneq ($(NOEXPORTLIBRARY),1) |
|
256 |
ifneq ($(TARGET_$(call sanitise,$(IMPORTLIBTARGET))),1) |
|
168
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
257 |
RELEASABLES:=$(RELEASABLES) $(if $(or $(EXPORTUNFROZEN),$(DEFFILE)),$(IMPORTLIBTARGET)) |
3 | 258 |
|
259 |
# import libraries are generated to the UDEB release directory |
|
260 |
ifneq ($(VARIANTTYPE),udeb) |
|
261 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(if $(or $(EXPORTUNFROZEN),$(DEFFILE)),$(LIBDIR)) |
|
262 |
endif |
|
263 |
||
264 |
ifneq ($(EXPORTUNFROZEN),) |
|
265 |
# EXPORTUNFROZEN amounts to doing the stage-two link with the makedef generated temporary .def file but creating a .lib |
|
266 |
# file as a side-effect of linking. The import library is therefore dependent on the final binary in this instance. |
|
267 |
$(info <warning project='$(PROJECT_META)' component='$(COMPONENT_META)'>EXPORTUNFROZEN present in $(PROJECT_META) - unfrozen exports will be represented in import library.</warning> ) |
|
268 |
$(IMPORTLIBTARGET): $(BINTARGET) |
|
269 |
$(eval TARGET_$(call sanitise,$(IMPORTLIBTARGET)):=1) |
|
270 |
else |
|
271 |
ifneq ($(DEFFILE),) |
|
272 |
# If a .def file physically exists (either explicitly via DEFFILE or implicitly in the correct place) then we |
|
273 |
# generate an import library with reference to it |
|
274 |
PREPPEDDEFFILE:=$(BLDDIR)/$(TARGET).prep.def |
|
275 |
CLEANTARGETS:=$(CLEANTARGETS) $(PREPPEDDEFFILE) |
|
276 |
||
277 |
define win32def2lib |
|
278 |
$(IMPORTLIBTARGET): $(DEFFILE) |
|
279 |
$(call startrule,win32def2lib) \ |
|
280 |
$(PREPDEF) "$(DEFFILE)" "$(PREPPEDDEFFILE)" && \ |
|
281 |
$(LD) $(PREPPEDDEFFILE) $(OPT.IMPORTLIB) -o "$$@" $(OPT.ADDCOMMAND) "out:$(IMPORTLIBLINKAS)" $(OPT.WARNINGS) off \ |
|
282 |
$(call endrule,win32def2lib) |
|
283 |
endef |
|
284 |
$(eval $(win32def2lib)) |
|
285 |
$(eval TARGET_$(call sanitise,$(IMPORTLIBTARGET)):=1) |
|
286 |
endif |
|
287 |
endif |
|
288 |
endif |
|
289 |
endif |
|
290 |
endif |
|
291 |
||
292 |
||
293 |
ifneq ($(BASE_TYPE),importlib) |
|
294 |
||
295 |
############# |
|
296 |
## COMPILE ## |
|
297 |
############# |
|
298 |
||
299 |
ifeq ($(COPY_FOR_STATIC_LINKAGE),1) |
|
516
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
300 |
BINTARGETSTATICLINK:=$(BINDIRSTATICLINK)/$(TARGET).$(TARGETEXT) |
3 | 301 |
endif |
302 |
||
168
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
303 |
RELEASABLES:=$(RELEASABLES) $(BINTARGET) $(BINTARGETSTATICLINK) |
3 | 304 |
|
305 |
# work on a local source files list |
|
306 |
SRCFILES:=$(SOURCE) |
|
307 |
# and there may be more source for stage 2 in OE builds |
|
308 |
SRCFILES_OE:= |
|
309 |
||
310 |
ifneq ($(BASE_TYPE),staticlib) |
|
311 |
# add the generated UID source file |
|
312 |
GENSOURCE:=$(BLDDIR)/$(TARGET).UID.CPP |
|
313 |
SRCFILES:=$(SRCFILES) $(GENSOURCE) |
|
314 |
||
315 |
# the generated symbol lookup source file for Open Environment. |
|
316 |
# this only gets linked in at stage 2 |
|
317 |
SYMSOURCE:=$(if $(OPEN_ENVIRONMENT),$(BLDDIR)/$(TARGET)_SYM_.cpp,) |
|
318 |
SRCFILES_OE:=$(SYMSOURCE) |
|
319 |
||
320 |
CLEANTARGETS:=$(CLEANTARGETS) $(GENSOURCE) $(SYMSOURCE) |
|
321 |
||
322 |
ifeq ($(UID2),00000000) |
|
323 |
ifneq ($(UID2_DEFAULT),) |
|
324 |
UID2:=$(UID2_DEFAULT) |
|
325 |
endif |
|
326 |
endif |
|
327 |
||
328 |
ifeq ($(SECUREID),) |
|
329 |
SECUREID:=$(UID3) |
|
330 |
endif |
|
331 |
||
332 |
define win32generateUIDcpp |
|
333 |
$(GENSOURCE): $(PROJECT_META) |
|
334 |
$(call startrule,win32generateUIDcpp,,) \ |
|
335 |
echo "// SBS-generated uid source file" > $$@ && \ |
|
336 |
echo "#include <e32cmn.h>" >> $$@ && \ |
|
337 |
echo "#pragma data_seg(\".SYMBIAN\")" >> $$@ && \ |
|
338 |
echo "__EMULATOR_IMAGE_HEADER2(0x$(UID1),0x$(UID2),0x$(UID3),EPriority$(EPOCPROCESSPRIORITY),0x$(CAPABILITYFLAG1),0x$(CAPABILITYFLAG2),0x$(SECUREID),0x$(VENDORID),0x$(VERSIONHEX),$(EPOCALLOWDLLDATA))" >> $$@ && \ |
|
339 |
echo "#pragma data_seg()" >> $$@ \ |
|
340 |
$(call endrule,win32generateUIDcpp) |
|
341 |
endef |
|
342 |
$(eval $(win32generateUIDcpp)) |
|
343 |
endif # neq $(BASE_TYPE),staticlib |
|
344 |
||
345 |
# object files |
|
346 |
OBJECTFILES:=$(patsubst %,$(BLDDIR)/%,$(addsuffix .o,$(basename $(notdir $(call allsuffixsubst,.cia .CIA .Cia,_.cia,$(SRCFILES)))))) |
|
347 |
OBJECTFILES:=$(patsubst %.UID.o,%_UID_.o,$(OBJECTFILES)) |
|
348 |
||
349 |
# object file extras for stage 2 |
|
350 |
OBJECTFILES_OE:=$(patsubst %,$(BLDDIR)/%,$(addsuffix .o,$(basename $(notdir $(SRCFILES_OE))))) |
|
351 |
||
352 |
CLEANTARGETS:=$(CLEANTARGETS) $(OBJECTFILES) $(OBJECTFILES_OE) |
|
353 |
||
354 |
# include paths and preinclude file |
|
355 |
UINCLUDE:=$(patsubst %,$(OPT.USERINCLUDE)%,$(USERINCLUDE)) |
|
356 |
SINCLUDE:=$(patsubst %,$(OPT.SYSINCLUDE)%,$(SYSTEMINCLUDE)) |
|
357 |
PINCLUDE:=$(OPT.PREINCLUDE)$(notdir $(PRODUCT_INCLUDE)) |
|
358 |
||
359 |
#INCLUDES:=$(UINCLUDE) $(OPT.SPLITINCLUDE) $(SINCLUDE) $(PINCLUDE) |
|
360 |
INCLUDES:=$(OPT.SPLITINCLUDE) $(UINCLUDE) $(SINCLUDE) $(PINCLUDE) |
|
361 |
||
362 |
# macro definitions |
|
363 |
DEFINES:=$(call makemacrodef,$(OPT.DEFINE),$(CDEFS) $(TARGET_MACRO)) |
|
364 |
||
365 |
||
366 |
# $(1) is the name of the source file, $(2) is the extension to map it to e.g. .o |
|
367 |
# no space in front of function body |
|
368 |
define mapwin32file |
|
369 |
$(patsubst %.UID$(2),%_UID_$(2),$(BLDDIR)/$(addsuffix $2,$(basename $(notdir $(call allsuffixsubst,.cia .CIA .Cia,_.cia,$(1)))))) |
|
370 |
endef |
|
371 |
||
372 |
# compile all source files, creating and including compiler generated dependency files along the way |
|
373 |
# SED is used to (a) remove relatively pathed "object_file: source_file" references that can appear |
|
374 |
# with some versions of mwccsym2 and (b) convert slashes |
|
375 |
define win32compile2object |
|
376 |
||
377 |
$(eval DEPENDFILENAME:=$(call mapwin32file,$(1),.o.d)) |
|
378 |
$(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME))) |
|
379 |
||
185
69334660be7a
Fixing Bug 1569 - excessive recompilation in incremental tracecompiler builds
Iain Williamson <iain.williamson@nokia.com>
parents:
169
diff
changeset
|
380 |
$(call mapwin32file,$(1),.o): $(1) $(PROJECT_META) $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT) | $(if $(USE_TRACE_COMPILER),$(TRACE_MARKER)) |
3 | 381 |
$(call startrule,win32compile2object,,$(1)) \ |
382 |
$(CC) $$(if $$(filter %.C,$(1)),-lang c) $(CFLAGS) $(OPTION_CW) \ |
|
383 |
$(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
|
384 |
$(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
|
385 |
$(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 | 386 |
$(call endrule,win32compile2object) |
387 |
||
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
388 |
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
|
389 |
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
|
390 |
endif |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
391 |
|
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
392 |
ifneq ($(DEPENDFILE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
393 |
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
|
394 |
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
|
395 |
-include $(DEPENDFILE) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
396 |
endif |
3 | 397 |
endif |
398 |
endif |
|
399 |
||
400 |
# individual source file compilation |
|
401 |
SOURCETARGET_$(call sanitise,$(1)): $(call mapwin32file,$(1),.o) |
|
402 |
||
403 |
endef |
|
404 |
||
405 |
# List target, depends on object file |
|
406 |
define win32list |
|
407 |
LISTING:: $(OBJECTFILES) $(OBJECTFILES_OE) |
|
408 |
$(call startrule,win32listing) \ |
|
409 |
$(CC) $(OPT.LISTING) $(patsubst %.UID.o,%_UID_.o,$(BLDDIR)/$(addsuffix .o,$(basename $(notdir $(1))))) -o $(basename $1).WINSCW.lst \ |
|
410 |
$(call endrule,win32listing) |
|
411 |
endef |
|
412 |
||
413 |
$(foreach SRCFILE,$(SRCFILES) $(SRCFILES_OE),$(eval $(call win32compile2object,$(SRCFILE)))) |
|
414 |
$(foreach SRCFILE,$(SRCFILES) $(SRCFILES_OE),$(eval $(call win32list,$(SRCFILE)))) |
|
415 |
||
416 |
###################### |
|
417 |
## RESOURCE COMPILE ## |
|
418 |
###################### |
|
419 |
||
420 |
# If Python has been used to construct the environment on Windows then the standard MW include path environment |
|
421 |
# variable will have been munged to UPPERCASE. |
|
422 |
STDMWCINCLUDEPATHS:=$(if $(MWCSym2Includes),$(MWCSym2Includes),$(MWCSYM2INCLUDES)) |
|
423 |
||
424 |
define win32resourcecompile |
|
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
425 |
# 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
|
426 |
# 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
|
427 |
# So - we compile once for real, and then pipe dependency output through SED afterwards to create the dependency file where we want it |
3 | 428 |
|
429 |
$(eval DEPENDFILENAME:=$(call mapwin32file,$(1),.res.d)) |
|
430 |
$(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME))) |
|
431 |
||
432 |
$(call mapwin32file,$(1),.res): $(1) $(PROJECT_META) $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT) |
|
433 |
$(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
|
434 |
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
|
435 |
$(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
|
436 |
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
|
437 |
$(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 | 438 |
$(call endrule,win32resourcecompile) |
439 |
||
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
440 |
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
|
441 |
CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
442 |
endif |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
443 |
|
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
444 |
ifneq ($(DEPENDFILE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
445 |
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
|
446 |
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
|
447 |
-include $(DEPENDFILE) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
169
diff
changeset
|
448 |
endif |
3 | 449 |
endif |
450 |
endif |
|
451 |
||
452 |
endef |
|
453 |
||
454 |
$(foreach WIN32RESOURCEFILE,$(WIN32_RESOURCE),$(eval $(call win32resourcecompile,$(WIN32RESOURCEFILE)))) |
|
455 |
OBJECTFILES:=$(OBJECTFILES) $(patsubst %,$(BLDDIR)/%,$(addsuffix .res,$(basename $(notdir $(WIN32_RESOURCE))))) |
|
456 |
||
457 |
################## |
|
458 |
## LINK/ARCHIVE ## |
|
459 |
################## |
|
460 |
||
461 |
# libraries |
|
462 |
STATICLIBS:=$(patsubst %,%.lib,$(STATICLIBRARY)) |
|
463 |
STATICLIBFILES:=$(patsubst %,$(STATLIBDIR)/%,$(STATICLIBS)) |
|
464 |
LINKER_FIRSTSTATLIBFILE:=$(STATLIBDIR)/$(LINKER_FIRSTSTATLIB) |
|
465 |
||
466 |
ifeq ($(VARIANTTYPE),urel) |
|
467 |
LINKLIBS:=$(patsubst %.dso,%.lib,$(LIBRARY)) |
|
468 |
else |
|
469 |
LINKLIBS:=$(patsubst %.dso,%.lib,$(LIBRARY_DEBUG)) |
|
470 |
endif |
|
471 |
||
472 |
LINKLIBFILES:=$(patsubst %,$(LIBDIR)/%,$(LINKLIBS)) |
|
473 |
||
474 |
MAP:= |
|
475 |
ifneq ($(BASE_TYPE),staticlib) |
|
476 |
ifneq ($(BASE_TYPE),importlib) |
|
477 |
# link map file (urel only) |
|
478 |
ifeq ($(VARIANTTYPE),urel) |
|
479 |
MAP:=$(OPT.MAP)$(BINTARGET).map |
|
168
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
480 |
RELEASABLES:=$(RELEASABLES) $(BINTARGET).map |
3 | 481 |
endif |
482 |
endif |
|
483 |
endif |
|
484 |
||
485 |
# all object files are listed in a response file to minimise the length of linker calls |
|
486 |
OBJECTFILES_LRF:=$(BLDDIR)/$(TARGET)_$(VARIANTTYPE)_objects.lrf |
|
487 |
CLEANTARGET:=$(CLEANTARGETS) $(OBJECTFILES_LRF) |
|
488 |
||
489 |
define groupin10 |
|
490 |
$(if $1,@echo -e $(foreach L,$(wordlist 1,10,$1),"$(L)\\n") >> $(OBJECTFILES_LRF),) |
|
491 |
$(if $1,$(call groupin10,$(wordlist 11,$(words $1),$1)),@true) |
|
492 |
endef |
|
493 |
||
494 |
# |
|
495 |
# Archive |
|
496 |
# |
|
497 |
ifeq ($(BASE_TYPE),staticlib) |
|
498 |
define win32archive |
|
499 |
$(BINTARGET): $(OBJECTFILES) |
|
500 |
@echo "" > $(OBJECTFILES_LRF); |
|
501 |
$(call groupin10,$(notdir $(OBJECTFILES))) ; |
|
502 |
$(call startrule,win32archive) \ |
|
503 |
$(LD) $(OPT.STATICLIBRARY) $(LFLAGS) $(OPT.NOIMPLIB) $(WIN32_LIBRARIES) $(OPT.OUT)"$$@" $(STDCPPTAGFILE) $(OPT.LIBPATH)$(BLDDIR) $(OPT.SEARCH) @$(OBJECTFILES_LRF) \ |
|
504 |
$(if $(SAVESPACE),; $(GNURM) -rf $(BLDDIR); true,) \ |
|
505 |
$(call endrule,win32archive) |
|
506 |
endef |
|
507 |
$(eval $(win32archive)) |
|
508 |
endif |
|
509 |
||
510 |
ifneq ($(EPOCHEAPSIZEMIN_DEC_KB),) |
|
511 |
LFLAGS:=$(LFLAGS) $(OPT.HEAPRESERVE)$(EPOCHEAPSIZEMAX_DEC_KB) $(OPT.HEAPCOMMIT)$(EPOCHEAPSIZEMIN_DEC_KB) |
|
512 |
endif |
|
513 |
||
514 |
# |
|
515 |
# Simple link |
|
516 |
# |
|
517 |
ifeq ($(BASE_TYPE),exe) |
|
518 |
define win32simplelink |
|
519 |
$(BINTARGET).map: $(BINTARGET) |
|
520 |
||
521 |
$(BINTARGET): $(OBJECTFILES) $(LINKER_FIRSTSTATLIBFILE) $(NEWLIBFILE) $(STATICLIBFILES) $(LINKLIBFILES) |
|
522 |
@echo "" > $(OBJECTFILES_LRF); |
|
523 |
$(call groupin10,$(notdir $(OBJECTFILES))) ; |
|
524 |
$(call startrule,win32simplelink) \ |
|
525 |
$(if $(SUPPORTS_STDCPP_NEWLIB),$(if $(STATICLIBFILES),$(CHECKLIB) $(CHECKLIB_TYPE) $(OPT.CHECKLIB.WIN32) $(STATICLIBFILES) &&,),) \ |
|
526 |
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) \ |
|
527 |
$(if $(SAVESPACE),; $(GNURM) -rf $(BLDDIR); true,) \ |
|
528 |
$(call endrule,win32simplelink) |
|
529 |
endef |
|
530 |
$(eval $(win32simplelink)) |
|
531 |
endif |
|
532 |
||
533 |
# |
|
534 |
# Two stage link |
|
535 |
# |
|
536 |
ifeq ($(BASE_TYPE),dll) |
|
537 |
TMP_IMPLIB:=$(BLDDIR)/$(TARGET).lib |
|
538 |
TMP_INFFILE:=$(BLDDIR)/$(TARGET).inf |
|
539 |
TMP_SYMFILE:=$(if $(OPEN_ENVIRONMENT),$(BLDDIR)/$(TARGET).sym,) |
|
516
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
540 |
TMP_TARGET:=$(BLDDIR)/$(TARGET).$(TARGETEXT) |
3 | 541 |
TMP_DEFFILE:=$(BLDDIR)/$(TARGET).def |
542 |
||
543 |
CLEANTARGETS:=$(CLEANTARGETS) $(TMP_IMPLIB) $(TMP_INFFILE) $(TMP_TARGET) $(TMP_DEFFILE) $(TMP_SYMFILE) |
|
544 |
||
545 |
MAKEDEF_ARGS:=-absent $(ENTRYSYMBOL) -Inffile $(call dblquote,$(TMP_INFFILE)) $(NAME_LOOKUP) |
|
546 |
||
547 |
ifeq ($(SYSTEM_TARGET),1) |
|
548 |
MAKEDEF_ARGS:=$(MAKEDEF_ARGS) -SystemTargetType |
|
549 |
endif |
|
550 |
||
551 |
ifneq ($(FIXED_EXPORT),) |
|
552 |
# Fixed export TARGETTYPE, but with possibility of a .def file if explicitly specified and available |
|
553 |
ifeq ($(DEFFILEKEYWORD),1) |
|
554 |
ifneq ($(DEFFILE),) |
|
555 |
MAKEDEF_ARGS:=$(MAKEDEF_ARGS) -Frzfile $(call dblquote,$(DEFFILE)) |
|
556 |
endif |
|
557 |
endif |
|
558 |
MAKEDEF_ARGS:=$(MAKEDEF_ARGS) -1 $(FIXED_EXPORT) |
|
559 |
else |
|
560 |
# Variable export TARGETTYPE with either deduced or explicitly specified .def file (if available) |
|
561 |
ifneq ($(DEFFILE),) |
|
562 |
MAKEDEF_ARGS:=$(MAKEDEF_ARGS) -Frzfile $(call dblquote,$(DEFFILE)) |
|
563 |
endif |
|
564 |
endif |
|
565 |
||
566 |
||
567 |
ifneq ($(EXPORTSUNFROZEN),) |
|
568 |
LIBRARY: $(TMP_IMPLIB) |
|
569 |
endif |
|
570 |
||
571 |
define win32stageonelink |
|
572 |
# Stage One |
|
573 |
# Link by name, generating temporary main binary and import library. |
|
574 |
$(TMP_IMPLIB): $(TMP_TARGET) |
|
575 |
||
576 |
$(TMP_TARGET): $(OBJECTFILES) $(LINKER_FIRSTSTATLIBFILE) $(NEWLIBFILE) $(STATICLIBFILES) $(LINKLIBFILES) |
|
577 |
@echo "" > $(OBJECTFILES_LRF); |
|
578 |
$(call groupin10,$(notdir $(OBJECTFILES))) ; |
|
579 |
$(call startrule,win32stageonelink) \ |
|
580 |
$(if $(SUPPORTS_STDCPP_NEWLIB),$(if $(STATICLIBFILES),$(CHECKLIB) $(CHECKLIB_TYPE) $(OPT.CHECKLIB.WIN32) $(STATICLIBFILES) &&,),) \ |
|
516
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
581 |
MWSym2LibraryFiles="$(MWSym2LibraryFiles)" $(LD) $(LFLAGS) $(OPT.MENTRYPOINT)$(ENTRYSYMBOL) $(OPT.EXPORT)$(EXPORT_TYPE) $(OPT.NOCOMPACTIMPORTLIB) $(OPT.ADDCOMMAND) "out:$(TARGET).$(TARGETEXT)" $(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) \ |
3 | 582 |
$(call endrule,win32stageonelink) |
583 |
endef |
|
584 |
$(eval $(win32stageonelink)) |
|
585 |
||
586 |
define win32processexports |
|
587 |
# Process exports |
|
588 |
# Generate a descriptive info file from the import library. |
|
589 |
# Push info file through MAKEDEF to generated a valid .def file for link by ordinal. |
|
590 |
$(TMP_DEFFILE): $(TMP_IMPLIB) |
|
591 |
$(call startrule,win32processexports) \ |
|
592 |
$(LD) $(LFLAGS_INFGEN) $(OPT.OUT)"$(TMP_INFFILE)" "$(TMP_IMPLIB)" && \ |
|
593 |
$(MAKEDEF) $(MAKEDEF_ARGS) "$$@" \ |
|
594 |
$(call endrule,win32processexports) |
|
595 |
endef |
|
596 |
$(eval $(win32processexports)) |
|
597 |
||
598 |
ifeq ($(OPEN_ENVIRONMENT),1) |
|
599 |
define win32processoeexports |
|
600 |
# Process additional exports for Open Environment |
|
601 |
# Generate a symbol file from the temporary DLL. |
|
602 |
# Generate a C++ source file from the symbol file |
|
603 |
||
604 |
$(TMP_SYMFILE): $(TMP_TARGET) |
|
605 |
$(call startrule,win32generatesymfile) \ |
|
606 |
$(LD) $(LFLAGS_SYMGEN) $(OPT.OUT)"$(TMP_SYMFILE)" "$(TMP_TARGET)" \ |
|
607 |
$(call endrule,win32generatesymfile) |
|
608 |
||
609 |
$(SYMSOURCE): $(TMP_SYMFILE) |
|
610 |
$(call startrule,win32generatesymcpp) \ |
|
611 |
$(SYMLOOKUPUTIL) $(OPT.OUT)"$(SYMSOURCE)" $(OPT.SYM)"$(TMP_SYMFILE)" $(SYMLOOKUPARGS) \ |
|
612 |
$(call endrule,win32generatesymcpp) |
|
613 |
endef |
|
614 |
$(eval $(win32processoeexports)) |
|
615 |
endif |
|
616 |
||
617 |
define win32stagetwolink |
|
618 |
# Stage Two |
|
619 |
# Link by ordinal, based on a previously MAKEDEF-generated temporary .def file |
|
620 |
# Optionally create an import library if EXPORTUNFROZEN is specified |
|
621 |
# |
|
622 |
$(BINTARGET).map: $(BINTARGET) |
|
623 |
||
624 |
$(BINTARGET): $(OBJECTFILES) $(OBJECTFILES_OE) $(LINKER_FIRSTSTATLIBFILE) $(STATICLIBFILES) $(NEWLIBFILE) $(LINKLIBFILES) $(TMP_DEFFILE) |
|
625 |
@echo "" > $(OBJECTFILES_LRF); |
|
626 |
$(call groupin10,$(notdir $(OBJECTFILES) $(OBJECTFILES_OE))) ; |
|
627 |
$(call startrule,win32stagetwolink) \ |
|
628 |
MWSym2LibraryFiles="$(MWSym2LibraryFiles)" \ |
|
629 |
$(LD) $(LFLAGS) $(OPT.DEFFILE)$(TMP_DEFFILE) $(MAP) $(LINKER_FIRSTSTATLIBFILE) $(NEWLIBFILE) $(WIN32_LIBRARIES) $(STATICLIBFILES) $(LINKLIBFILES) \ |
|
630 |
$(OPT.OUT)"$$@" \ |
|
631 |
$(if $(EXPORTUNFROZEN),$(OPT.IMPLIB)$(IMPORTLIBTARGET),$(OPT.NOIMPLIB)) \ |
|
632 |
$(OPT.LIBPATH)$(BLDDIR) $(OPT.SEARCH) @$(OBJECTFILES_LRF) \ |
|
633 |
$(if $(SAVESPACE),; $(GNURM) -rf $(BLDDIR); true,) \ |
|
634 |
$(call endrule,win32stagetwolink) |
|
635 |
endef |
|
636 |
$(eval $(win32stagetwolink)) |
|
637 |
||
638 |
define win32copyforstaticlink |
|
639 |
# Copy additonal binary to "traditional" output location (if required) |
|
640 |
$(BINTARGETSTATICLINK): $(BINTARGET) |
|
641 |
$(call startrule,win32copyforstaticlink) \ |
|
642 |
$(GNUCP) $$< $$@ \ |
|
643 |
$(call endrule,win32copyforstaticlink) |
|
644 |
endef |
|
645 |
ifeq ($(COPY_FOR_STATIC_LINKAGE),1) |
|
646 |
$(eval $(win32copyforstaticlink)) |
|
647 |
endif |
|
648 |
||
649 |
define e32freeze |
|
650 |
# DLL-type targets that support import library generation support freezing of exports using EFREEZE |
|
651 |
FREEZE:: $(1) |
|
652 |
$(call startrule,freeze,,$(RESOLVED_DEFFILE)) \ |
|
653 |
$(EFREEZE) $(EFREEZE_REMOVE_OPTION) "$(RESOLVED_DEFFILE)" $(FIVESPACES) "$(2)" \ |
|
654 |
$(call endrule,freeze) |
|
655 |
endef |
|
656 |
# Create only one freeze target per urel/udeb variant as the interface won't differ between them |
|
657 |
# Only create a freeze target if the component supports import library generation |
|
658 |
ifneq ($(TARGET_$(call sanitise,$(IMPORTLIBTARGET))_FREEZE),1) |
|
659 |
ifeq ($(SUPPORTS_IMPORT_LIBRARY),1) |
|
660 |
$(eval $(call e32freeze,$(BINTARGET),$(TMP_DEFFILE))) |
|
661 |
$(eval TARGET_$(call sanitise,$(IMPORTLIBTARGET))_FREEZE:=1) |
|
662 |
endif |
|
663 |
endif |
|
664 |
endif |
|
665 |
endif # neq $(BASE_TYPE),importlib |
|
666 |
||
667 |
||
668 |
# Global targets |
|
669 |
.PHONY:: $(ALLTARGET) |
|
168
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
670 |
$(ALLTARGET):: $(RELEASABLES) |
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
671 |
TARGET:: $(RELEASABLES) |
3 | 672 |
|
673 |
ifeq ($(TARGET_$(call sanitise,$(IMPORTLIBTARGET))),1) |
|
674 |
LIBRARY:: $(IMPORTLIBTARGET) |
|
675 |
else |
|
676 |
ifeq ($(BASE_TYPE),staticlib) |
|
677 |
LIBRARY:: $(BINTARGET) |
|
678 |
endif |
|
679 |
endif |
|
680 |
||
681 |
||
682 |
# Deal with test code batch files generation. |
|
683 |
ifneq ($(TESTPATH),) |
|
684 |
EPOC_ROOT:=$(patsubst %/,%,$(EPOCROOT)) |
|
685 |
TOBLDINF:=$(dir $(subst :,,$(subst $(EPOC_ROOT)/,,$(COMPONENT_META)))) |
|
686 |
||
687 |
||
688 |
BATCHDIR:=$(EPOCROOT)/epoc32/release/$(VARIANTPLATFORM)/$(VARIANTTYPE)/z/test/ |
|
689 |
$(eval $(call MakeTestBatchFiles,$(TARGET),$(BATCHDIR)$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH))) |
|
690 |
BATCHFILE_CREATED_$(BATCHDIR)$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH):=1 |
|
691 |
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
|
692 |
RELEASABLES:=$(RELEASABLES) $(EPOCROOT)/epoc32/release/$(VARIANTPLATFORM)/$(VARIANTTYPE)/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH) |
3 | 693 |
endif |
694 |
||
695 |
# clean up |
|
9 | 696 |
$(call raptor_clean,$(CLEANTARGETS)) |
3 | 697 |
# make the output directories while reading makefile - some build engines prefer this |
698 |
$(call makepath,$(CREATABLEPATHS)) |
|
9 | 699 |
# for the --what option and the log file |
168
e0540a130417
Undoing spelling 'fix'
Iain Williamson <iain.williamson@nokia.com>
parents:
167
diff
changeset
|
700 |
$(call raptor_release,$(RELEASABLES) $(TC_RELEASABLES)) |