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