author | Jon Chatten |
Tue, 30 Mar 2010 15:24:50 +0100 | |
branch | fix |
changeset 421 | 7db5250b5d4c |
parent 400 | 554cc189839f |
child 412 | 824dddcc66f7 |
permissions | -rw-r--r-- |
185
69334660be7a
Fixing Bug 1569 - excessive recompilation in incremental tracecompiler builds
Iain Williamson <iain.williamson@nokia.com>
parents:
173
diff
changeset
|
1 |
# Copyright (c) 2006-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 |
# ARMv5 EXE/DLL ABIv2 Function Like Makefile (FLM) |
|
15 |
# Knows how to build all possible ABIV2 executables for ARM |
|
16 |
# |
|
17 |
# |
|
18 |
||
19 |
# Only build feature invariant binaries in non-product builds *and* |
|
20 |
# Only build feature variant binaries in product builds. |
|
21 |
# |
|
22 |
# FEATUREVARIANTNAME != "" implies product build |
|
23 |
# FEATUREVARIANT == 1 implies a feature variant binary |
|
24 |
# |
|
25 |
# test FEATUREVARIANTNAME=="" or FEATUREVARIANT==1 |
|
26 |
# |
|
27 |
ifneq ($(or $(call equal,$(FEATUREVARIANTNAME),),$(call equal,$(FEATUREVARIANT),1)),) |
|
28 |
||
29 |
$(if $(FLMDEBUG),$(info <flm name='e32abiv2' target='$(TARGET)' type='$(TARGETTYPE)' outputpath='$(OUTPUTPATH)' metasource='$(METASOURCE)' postlinkfiletype='$(POSTLINKFILETYPE)' />)) |
|
30 |
||
31 |
# Strip switch-type parameters |
|
32 |
# |
|
33 |
POSTLINKTARGETTYPE:=$(strip $(POSTLINKTARGETTYPE)) |
|
34 |
UID1:=$(strip $(UID1)) |
|
35 |
UID2:=$(strip $(UID2)) |
|
36 |
UID3:=$(strip $(UID3)) |
|
37 |
SID:=$(strip $(SECUREID)) |
|
38 |
VENDORID:=$(strip $(VENDORID)) |
|
39 |
AUTOEXPORTS:=$(strip $(AUTOEXPORTS)) |
|
40 |
DEFFILE:=$(strip $(DEFFILE)) |
|
41 |
IMPORTLIBRARYREQUIRED:=$(strip $(IMPORTLIBRARYREQUIRED)) |
|
42 |
EPOCALLOWDLLDATA:=$(strip $(EPOCALLOWDLLDATA)) |
|
43 |
PAGED:=$(strip $(PAGED)) |
|
44 |
||
45 |
# the output directories |
|
46 |
VARIANTPLATFORM:=$(VARIANTPLATFORM)$(FEATUREVARIANTNAME) |
|
47 |
RELEASABLEPATH:=$(RELEASEPATH)/$(VARIANTPLATFORM)/$(VARIANTTYPE) |
|
48 |
INTERMEDIATEPATH:=$(OUTPUTPATH)/$(VARIANTPLATFORM)/$(VARIANTTYPE) |
|
49 |
INTERMEDIATE_PLATFORM_PATH:=$(OUTPUTPATH)/$(VARIANTPLATFORM) |
|
50 |
TRACE_MARKER_PATH:=$(OUTPUTPATH) |
|
51 |
IMPORTLIBPATH:=$(RUNTIME_LIBS_PATH) |
|
52 |
||
53 |
# LOCALLY USED VARIABLES |
|
54 |
CLEANTARGETS:= |
|
55 |
WHATRELEASE:= |
|
56 |
||
57 |
# Work out which new/delete library to use for binaries. |
|
58 |
CHECKLIB_TYPE:=symc++ |
|
59 |
STDCPPTAGFILE:= |
|
60 |
ifeq ($(NOSTDCPP),1) |
|
61 |
ifeq ($(STDCPP),1) |
|
62 |
$(info <warning>STDCPP and NOSTDCPP both specified in $(PROJECT_META)</warning>) |
|
63 |
else |
|
64 |
ifeq ($(HAS_DEDICATED_OP_NEWDEL_LIB),1) |
|
65 |
DEFAULT_NEWLIB:=$(DEFAULT_SYMBIAN_NEWLIB) |
|
66 |
endif |
|
67 |
endif |
|
68 |
else |
|
69 |
ifeq ($(STDCPP),1) |
|
70 |
CDEFS:=$(CDEFS) __SYMBIAN_STDCPP_SUPPORT__ |
|
71 |
ifneq ($(SUPPORTS_STDCPP_NEWLIB),) |
|
72 |
ifeq ($(HAS_DEDICATED_OP_NEWDEL_LIB),1) |
|
73 |
DEFAULT_NEWLIB:=$(DEFAULT_STDCPP_NEWLIB) |
|
74 |
endif |
|
75 |
CHECKLIB_TYPE:=stdc++ |
|
76 |
STDCPPTAGFILE:=$(EPOCROOT)/epoc32/tools/tag/tag_elf |
|
77 |
endif |
|
78 |
endif |
|
79 |
endif |
|
80 |
||
81 |
# If NEWLIB is specified in the MMP file, it overrides all the past stuff. |
|
82 |
ifeq ($(NEWLIB),) |
|
83 |
NEWLIB:=$(DEFAULT_NEWLIB) |
|
84 |
endif |
|
85 |
||
86 |
||
87 |
########################################################################## |
|
88 |
## OUTPUTS - externally relevant targets that this FLM generates |
|
89 |
||
90 |
||
91 |
ifeq ($(EXPORTLIBRARY),) |
|
92 |
EXPORTLIBRARY:=$(TARGET) |
|
93 |
endif |
|
94 |
||
95 |
# This will insert the file version between the name and the extension. |
|
96 |
# If there is more than one dot in generated filename the inserted position will be |
|
97 |
# BEFORE the last but two dot. E.g name1.name2.name3.dll to name1.name2{version}.name3.dll |
|
98 |
LIBEXT:=$(lastword $(subst .,$(CHAR_SPACE) ,$(EXPORTLIBRARY))) |
|
99 |
LIBBASE:=$(patsubst %.$(LIBEXT),%,$(EXPORTLIBRARY)) |
|
100 |
ifneq ($(findstring .,$(EXPORTLIBRARY)),) |
|
101 |
# Please note $(EXPORTLIBRARY) doesn't include target type. |
|
102 |
VER_E32IMPORTLIBBASE:=$(IMPORTLIBPATH)/$(LIBBASE){$(VERSIONHEX)}.$(LIBEXT) |
|
103 |
else |
|
104 |
VER_E32IMPORTLIBBASE:=$(IMPORTLIBPATH)/$(EXPORTLIBRARY){$(VERSIONHEX)} |
|
105 |
endif |
|
106 |
||
107 |
# Postlinkable targets need to be linked and elf2e32'd |
|
108 |
ifneq ($(DOPOSTLINK),) |
|
109 |
E32TARGET:=$(RELEASABLEPATH)/$(TARGET)$(if $(EXPLICITVERSION),{$(VERSIONHEX)},).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE)) |
|
110 |
LINK_TARGET:=$(RELEASABLEPATH)/$(TARGET)$(if $(EXPLICITVERSION),{$(VERSIONHEX)},).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE)).sym |
|
111 |
MAPFILE:=$(RELEASABLEPATH)/$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE)).map |
|
112 |
else |
|
113 |
E32TARGET:= |
|
114 |
LINK_TARGET:= |
|
115 |
MAPFILE:= |
|
116 |
endif |
|
117 |
||
118 |
# libs and klibs, on the other hand need to be archived |
|
119 |
ifneq ($(call isoneof,$(TARGETTYPE),lib klib stdlib),) |
|
120 |
ARTARGET:=$(RELEASABLEPATH)/$(TARGET).lib |
|
121 |
# We need libs and klibs before we can link stuff with them: |
|
122 |
LIBRARY:: $(ARTARGET) |
|
123 |
else |
|
124 |
ARTARGET:= |
|
125 |
endif |
|
126 |
||
127 |
||
128 |
ifneq ($(IMPORTLIBRARYREQUIRED),) # no dso files for plugins, animation dlls etc |
|
129 |
# make sure we don't build import libraries more than once for UDEB and UREL |
|
130 |
# Without this, wierd target-specific variable problems happen with LIBRARY in particular |
|
131 |
||
132 |
TMP_IMPORTLIBTARGET_ROOT:=$(IMPORTLIBPATH)/$(EXPORTLIBRARY) |
|
133 |
||
134 |
# ABIv2 .dso |
|
135 |
IMPORTLIBTARGET_DSO:= |
|
136 |
IMPORTLIBTARGETVERSIONED_DSO:= |
|
137 |
||
138 |
BUILDMARKER_IMPORTLIBTARGET_DSO:=TARGET_$(subst :,,$(VER_E32IMPORTLIBBASE)).dso |
|
139 |
WHATRELEASE:=$(WHATRELEASE) $(if $(EXPLICITVERSION),,$(TMP_IMPORTLIBTARGET_ROOT).dso) |
|
140 |
WHATRELEASE:=$(WHATRELEASE) $(VER_E32IMPORTLIBBASE).dso |
|
141 |
ifeq ($($(BUILDMARKER_IMPORTLIBTARGET_DSO)),) |
|
142 |
IMPORTLIBTARGET_DSO:=$(TMP_IMPORTLIBTARGET_ROOT).dso |
|
143 |
IMPORTLIBTARGETVERSIONED_DSO:=$(VER_E32IMPORTLIBBASE).dso |
|
144 |
endif |
|
145 |
||
146 |
# ABIv1 .lib (for specific builds, toolchains and host OS platforms only) |
|
147 |
IMPORTLIBTARGET_LIB:= |
|
148 |
IMPORTLIBTARGETVERSIONED_LIB:= |
|
149 |
BUILDMARKER_IMPORTLIBTARGET_LIB:=TARGET_$(subst :,,$(VER_E32IMPORTLIBBASE)).lib |
|
150 |
# Only for builds that require and support them, and only on windows |
|
151 |
ifeq ($(OSTYPE),cygwin) |
|
152 |
ifeq ($(GENERATE_ABIV1_IMPLIBS),1) |
|
153 |
WHATRELEASE:=$(WHATRELEASE) $(if $(EXPLICITVERSION),,$(TMP_IMPORTLIBTARGET_ROOT).lib) |
|
154 |
WHATRELEASE:=$(WHATRELEASE) $(VER_E32IMPORTLIBBASE).lib |
|
155 |
ifeq ($($(BUILDMARKER_IMPORTLIBTARGET_LIB)),) |
|
156 |
IMPORTLIBTARGET_LIB:=$(TMP_IMPORTLIBTARGET_ROOT).lib |
|
157 |
IMPORTLIBTARGETVERSIONED_LIB:=$(VER_E32IMPORTLIBBASE).lib |
|
158 |
endif |
|
159 |
endif |
|
160 |
endif |
|
161 |
endif |
|
162 |
||
163 |
# Try to make sure that we get the right linkas name |
|
164 |
# If linkas is specified then split it up and |
|
165 |
# put the hex version number in the right place |
|
166 |
ifeq ($(LINKAS),) |
|
167 |
LINKASNAME=$(TARGET) |
|
168 |
LINKASTYPE=$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE)) |
|
169 |
else |
|
170 |
SPLIT_LINKAS=$(subst ., ,$(LINKAS)) |
|
171 |
LINKASNAME=$(word 1,$(SPLIT_LINKAS)) |
|
172 |
LINKASTYPE=$(word 2,$(SPLIT_LINKAS)) |
|
173 |
endif |
|
174 |
||
175 |
# ignore UID3 if it is zero |
|
176 |
ifeq ($(UID3),00000000) |
|
177 |
LINKASVERSIONED=$(LINKASNAME){$(VERSIONHEX)}.$(LINKASTYPE) |
|
178 |
else |
|
179 |
LINKASVERSIONED=$(LINKASNAME){$(VERSIONHEX)}$(if $(UID3),[$(UID3)],).$(LINKASTYPE) |
|
180 |
endif |
|
181 |
||
182 |
########################################################################## |
|
183 |
## TARGET GROUPS ## |
|
184 |
RELEASABLES:=$(strip $(E32TARGET) $(ARTARGET) $(LINK_TARGET) $(MAPFILE)) |
|
185 |
# More targets to be added later |
|
186 |
TARGETS:=$(strip $(E32TARGET) $(IMPORTLIBTARGET) $(LINK_TARGET) $(ARTARGET)) |
|
187 |
||
188 |
CREATABLEPATHS:=$(OUTPUTPATH) |
|
189 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(INTERMEDIATE_PLATFORM_PATH) |
|
190 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(INTERMEDIATEPATH) |
|
191 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(RELEASABLEPATH) |
|
192 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(RUNTIME_LIBS_PATH) |
|
193 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(IMPORTLIBPATH) |
|
194 |
WHATRELEASE:=$(WHATRELEASE) $(RELEASABLES) |
|
195 |
||
196 |
||
197 |
||
198 |
## HIGH LEVEL Targets ## |
|
199 |
.PHONY:: $(ALLTARGET) |
|
200 |
||
201 |
## GLOBAL TARGETS ############################################################ |
|
202 |
$(ALLTARGET):: $(RELEASABLES) |
|
203 |
TARGET:: $(RELEASABLES) |
|
204 |
||
205 |
## Internal targets ## |
|
206 |
||
207 |
# Determine the name of the generated DSO file ############################### |
|
208 |
# This is to generate the dso with the Some{Versionhex}.file.dso |
|
209 |
# It reproduces what appears to be a problem in the current build system |
|
210 |
# that affects messageintercept{000a0000}.esockdebug.dso whose |
|
211 |
# filename differs from it's "linkas" name. |
|
212 |
E32VAR:=$(subst .,$(CHAR_SPACE) ,$(TARGET)) |
|
213 |
E32SOME:=$(word 1,$(E32VAR)) |
|
214 |
E32VAR2:=$(patsubst $(E32SOME).%,%,$(TARGET)) |
|
215 |
||
216 |
# Separate '_SH' variables created for output into bash - Preserves '{' and '}' |
|
217 |
||
218 |
ifneq ($(findstring .,$(TARGET)),) |
|
219 |
DSODEFFILENAMEBASE:=$(E32SOME){$(VERSIONHEX)}.$(E32VAR2) |
|
220 |
else |
|
221 |
DSODEFFILENAMEBASE:=$(TARGET){$(VERSIONHEX)} |
|
222 |
endif |
|
223 |
GENERATED_DSO:=$(call dblquote,$(INTERMEDIATEPATH)/$(DSODEFFILENAMEBASE).dso) |
|
224 |
GENERATED_DEFFILE:=$(INTERMEDIATEPATH)/$(DSODEFFILENAMEBASE).def |
|
225 |
||
226 |
## IMPORT LIBRARY ########################################################### |
|
227 |
||
228 |
# Static libraries will be postlinked when they are used so don't try to postlink them |
|
229 |
||
230 |
ifneq ($(IMPORTLIBRARYREQUIRED),) |
|
231 |
ifneq ($(or $(DEFFILE),$(EXPORTUNFROZEN)),) |
|
232 |
# Both ABIv2 .dso and ABIv1 .lib import library generation require a processed .def file, |
|
233 |
# unless EXPORTUNFROZEN is being used |
|
234 |
PREPPEDDEFFILE:= |
|
235 |
ifneq ($(DEFFILE),) |
|
236 |
ifeq ($(EXPORTUNFROZEN),) |
|
237 |
PREPPEDDEFFILE:=$(INTERMEDIATEPATH)/$(TARGET).prep |
|
238 |
CLEANTARGETS:=$(CLEANTARGETS) $(PREPPEDDEFFILE) |
|
239 |
define importlibtarget_prepfile |
|
240 |
$(PREPPEDDEFFILE): $(DEFFILE) |
|
241 |
$(call startrule,importlibtarget_prepfile,FORCESUCCESS) \ |
|
242 |
$(PREPDEF) $(call dblquote,$(DEFFILE)) $(call dblquote,$(PREPPEDDEFFILE)) \ |
|
243 |
$(call endrule,importlibtarget_prepfile) |
|
244 |
endef |
|
245 |
$(eval $(importlibtarget_prepfile)) |
|
246 |
endif |
|
247 |
endif |
|
248 |
||
249 |
# ABIv2 .dso |
|
250 |
ifneq ($(IMPORTLIBTARGET_DSO),) # check that we haven't tried to specify this target already |
|
251 |
||
26
96670e6a4bfd
Try to cope with the iscapi implib problem.
timothy.murphy@nokia.com
parents:
9
diff
changeset
|
252 |
# By Now we're committed to producing a target for this DSO so it's safe to |
96670e6a4bfd
Try to cope with the iscapi implib problem.
timothy.murphy@nokia.com
parents:
9
diff
changeset
|
253 |
# set the marker that will prevent any further targets from being made. |
96670e6a4bfd
Try to cope with the iscapi implib problem.
timothy.murphy@nokia.com
parents:
9
diff
changeset
|
254 |
$(eval $(BUILDMARKER_IMPORTLIBTARGET_DSO):=1) |
96670e6a4bfd
Try to cope with the iscapi implib problem.
timothy.murphy@nokia.com
parents:
9
diff
changeset
|
255 |
|
3 | 256 |
ifneq ($(EXPLICITVERSION),) |
257 |
TARGETS:=$(strip $(TARGETS) $(IMPORTLIBTARGETVERSIONED_DSO)) |
|
258 |
||
259 |
# Add this importlibrary to our global targets |
|
260 |
LIBRARY:: $(IMPORTLIBTARGETVERSIONED_DSO) |
|
261 |
$(ALLTARGET):: $(IMPORTLIBTARGETVERSIONED_DSO) |
|
262 |
TARGET:: $(IMPORTLIBTARGETVERSIONED_DSO) |
|
263 |
||
264 |
else |
|
265 |
TARGETS:=$(strip $(TARGETS) $(IMPORTLIBTARGETVERSIONED_DSO) $(IMPORTLIBTARGET_DSO)) |
|
266 |
||
267 |
# Add this importlibrary to our global targets |
|
268 |
LIBRARY:: $(IMPORTLIBTARGET_DSO) |
|
269 |
$(ALLTARGET):: $(IMPORTLIBTARGETVERSIONED_DSO) $(IMPORTLIBTARGET_DSO) |
|
270 |
TARGET:: $(IMPORTLIBTARGETVERSIONED_DSO) $(IMPORTLIBTARGET_DSO) |
|
271 |
||
272 |
||
273 |
endif |
|
274 |
||
275 |
||
276 |
||
277 |
ifneq ($(EXPORTUNFROZEN),) # Unfrozen - warn and create .dso as side-effect of the final postlink |
|
278 |
$(info <warning project='$(PROJECT_META)' component='$(COMPONENT_META)'>EXPORTUNFROZEN present in $(PROJECT_META) - unfrozen exports will be represented in import library.</warning> ) |
|
279 |
define importlibtarget_unfrozen |
|
280 |
$(IMPORTLIBTARGET_DSO): $(IMPORTLIBTARGETVERSIONED_DSO) |
|
281 |
$(call startrule,importlibtarget_unfrozen,FORCESUCCESS) \ |
|
282 |
$(GNUCP) $$(call dblquote,$$<) $$(call dblquote,$$@) \ |
|
283 |
$(call endrule,importlibtarget_unfrozen) |
|
284 |
endef |
|
285 |
||
286 |
define importlibtarget_unfrozen_ver |
|
287 |
$(IMPORTLIBTARGETVERSIONED_DSO): $(E32TARGET) |
|
288 |
$(call startrule,importlibversioned_unfrozen,FORCESUCCESS) \ |
|
289 |
$(GNUCP) "$(GENERATED_DSO)" "$$@" \ |
|
290 |
$(call endrule,importlibversioned_unfrozen) |
|
291 |
endef |
|
292 |
||
293 |
ifeq ($(EXPLICITVERSION),) |
|
294 |
# Generate the general dso if we aren't |
|
295 |
# being asked to make just the specific version. |
|
296 |
$(eval $(importlibtarget_unfrozen)) |
|
297 |
endif |
|
298 |
||
299 |
$(eval $(importlibtarget_unfrozen_ver)) |
|
300 |
else |
|
301 |
ifneq ($(DEFFILE),) # Frozen - use the def file and create .dso directly |
|
302 |
define importlibtarget_func |
|
303 |
$(IMPORTLIBTARGET_DSO): $(IMPORTLIBTARGETVERSIONED_DSO) |
|
304 |
$(call startrule,importlibtarget,FORCESUCCESS) \ |
|
305 |
$(GNUCP) "$$<" "$$@" \ |
|
306 |
$(call endrule,importlibtarget) |
|
307 |
endef |
|
308 |
||
309 |
ifeq ($(EXPLICITVERSION),) |
|
310 |
# Generate the general dso if we aren't |
|
311 |
# being asked to make just the specific version. |
|
312 |
$(eval $(importlibtarget_func)) |
|
313 |
endif |
|
314 |
||
315 |
define importlibtargetversioned_func |
|
316 |
$(IMPORTLIBTARGETVERSIONED_DSO): $(ELF2E32) $(PREPPEDDEFFILE) |
|
317 |
$(call startrule,importlibversioned,FORCESUCCESS) \ |
|
318 |
$(ELF2E32) --sid=0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) --version=$(VERSION) \ |
|
319 |
--definput="$(PREPPEDDEFFILE)" \ |
|
320 |
--dso=$$(call dblquote,$$@) \ |
|
321 |
--linkas=$(call dblquote,$(LINKASVERSIONED)) \ |
|
322 |
$(call endrule,importlibversioned) |
|
323 |
endef |
|
324 |
$(eval $(importlibtargetversioned_func)) |
|
325 |
endif # ifneq ($(DEFFILE),) |
|
326 |
endif # ifneq ($(EXPORTUNFROZEN),) |
|
327 |
endif # ifneq ($(IMPORTLIBTARGET_DSO),) |
|
328 |
||
329 |
# ABIv1 .lib |
|
330 |
ifneq ($(IMPORTLIBTARGETVERSIONED_LIB),) # check that we haven't tried to specify this target already |
|
331 |
||
26
96670e6a4bfd
Try to cope with the iscapi implib problem.
timothy.murphy@nokia.com
parents:
9
diff
changeset
|
332 |
# By Now we're committed to producing a target for this DSO so it's safe to |
96670e6a4bfd
Try to cope with the iscapi implib problem.
timothy.murphy@nokia.com
parents:
9
diff
changeset
|
333 |
# set the marker that will prevent any further targets from being made. |
96670e6a4bfd
Try to cope with the iscapi implib problem.
timothy.murphy@nokia.com
parents:
9
diff
changeset
|
334 |
$(eval $(BUILDMARKER_IMPORTLIBTARGET_LIB):=1) |
96670e6a4bfd
Try to cope with the iscapi implib problem.
timothy.murphy@nokia.com
parents:
9
diff
changeset
|
335 |
|
3 | 336 |
define abiv1_generatelib |
337 |
||
338 |
ifeq ($(EXPLICITVERSION),) |
|
339 |
LIBRARY:: $(IMPORTLIBTARGETVERSIONED_LIB) $(IMPORTLIBTARGET_LIB) |
|
340 |
||
341 |
else |
|
342 |
LIBRARY:: $(IMPORTLIBTARGETVERSIONED_LIB) |
|
343 |
||
344 |
endif |
|
345 |
||
346 |
# If frozen, a prepped .def file is used as the basis for .lib creation |
|
347 |
# If unfrozen, .lib files are based on the .def file generated by the final postlink |
|
348 |
$(IMPORTLIBTARGETVERSIONED_LIB): $(if $(EXPORTUNFROZEN),$(E32TARGET),$(PREPPEDDEFFILE)) |
|
349 |
$(call startrule,importlibversioned_abiv1) \ |
|
350 |
if [ -f "$(EPOCROOT)/epoc32/tools/def2dll.pl" -a -f "$(if $(EXPORTUNFROZEN),$(call dblquote,$(GENERATED_DEFFILE)),$(PREPPEDDEFFILE))" ]; then \ |
|
351 |
$(PERL) $(EPOCROOT)/epoc32/tools/def2dll.pl \ |
|
352 |
--path=$(IMPORTLIBPATH) \ |
|
353 |
--bldpath=$(INTERMEDIATEPATH) \ |
|
354 |
--import=$(notdir $(basename $(IMPORTLIBTARGETVERSIONED_LIB))) \ |
|
355 |
--deffile="$(if $(EXPORTUNFROZEN),$(call dblquote,$(GENERATED_DEFFILE)),$(PREPPEDDEFFILE))" \ |
|
356 |
--linkAs=$(call dblquote,$(LINKASVERSIONED)) \ |
|
357 |
--inter ; fi \ |
|
358 |
$(call endrule,importlibversioned_abiv1) |
|
359 |
||
360 |
ifeq ($(EXPLICITVERSION),) |
|
361 |
$(IMPORTLIBTARGET_LIB): $(IMPORTLIBTARGETVERSIONED_LIB) |
|
362 |
$(call startrule,importlibtarget_abiv1) \ |
|
363 |
if [ -f $(EPOCROOT)/epoc32/tools/def2dll.pl ]; then $(GNUCP) "$$<" "$$@" ; fi \ |
|
364 |
$(call endrule,importlibtarget_abiv1) |
|
365 |
endif |
|
366 |
endef |
|
367 |
||
368 |
$(eval $(abiv1_generatelib)) |
|
369 |
endif # ifneq ($(IMPORTLIBTARGET_LIB),) |
|
370 |
endif # ($(or $(DEFFILE),$(EXPORTUNFROZEN)),) |
|
371 |
endif # ifneq ($(IMPORTLIBRARYREQUIRED),) |
|
372 |
||
373 |
||
374 |
## POSTLINK ################################################################## |
|
375 |
||
376 |
# Set up the name of the exports file if this is a customdll |
|
377 |
EXPTARGET:= |
|
378 |
ifneq ($(DOPOSTLINK),) |
|
379 |
ifneq ($(and $(or $(STATICLIBRARY),$(ARMLIBS),$(ARMRT)),$(DEFFILE)),) |
|
380 |
EXPTARGET:=$(INTERMEDIATE_PLATFORM_PATH)/$(notdir $(VER_E32IMPORTLIBBASE)).exp |
|
381 |
endif |
|
382 |
endif |
|
383 |
||
384 |
# Generating the import library is enough if TARGETTYPE=implib ############# |
|
385 |
||
386 |
ifneq ($(DOPOSTLINK),) |
|
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
387 |
# Capabilities |
147
bbe5275eca96
fix bug 1570: actually *use* the capabilities and fix test for windows and for capability flags.
timothy.murphy@nokia.com
parents:
144
diff
changeset
|
388 |
FINAL_CAPABILITIES:=$(if $(CAPABILITY),$(CAPABILITY),NONE) |
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
389 |
|
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
390 |
# Paging options for the old postlinker |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
391 |
POSTLINKER_PAGEDOPTION:=--defaultpaged |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
392 |
ifeq ($(PAGED),1) |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
393 |
POSTLINKER_PAGEDOPTION:=--paged |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
394 |
endif |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
395 |
ifeq ($(PAGED),0) |
102
80785a1bc266
single character fix for --unpaged
Richard Taylor <richard.i.taylor@nokia.com>
parents:
75
diff
changeset
|
396 |
POSTLINKER_PAGEDOPTION:=--unpaged |
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
397 |
endif |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
398 |
|
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
399 |
CLEANTARGETS:=$(CLEANTARGETS) $(E32TARGET) |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
400 |
CLEANTARGETS:=$(CLEANTARGETS) $(GENERATED_DEFFILE) |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
401 |
CLEANTARGETS:=$(CLEANTARGETS) $(GENERATED_DSO) |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
402 |
|
3 | 403 |
endif # ifneq ($(DOPOSTLINK),) |
404 |
||
405 |
ifneq ($(TARGETTYPE),implib) |
|
406 |
||
407 |
## CUSTOM DLLS ############################################################### |
|
408 |
# exp file |
|
409 |
# |
|
410 |
# This tends to help getting exported objects |
|
411 |
# out of the arm libs and into custom dlls. |
|
412 |
||
413 |
ifneq ($(EXPTARGET),) |
|
414 |
ifeq ($(TARGET_$(EXPTARGET)),) |
|
415 |
# We only need one of these exptargets for UDEB and UREL |
|
416 |
TARGET_$(EXPTARGET):=1 |
|
417 |
||
418 |
EXPTARGETASMFILE:=$(INTERMEDIATE_PLATFORM_PATH)/$(notdir $(VER_E32IMPORTLIBBASE)).s |
|
419 |
||
420 |
define e32expgen_func |
|
421 |
$(EXPTARGET): $(DEFFILE) $(ELF2E32) |
|
422 |
$(call startrule,expgen) \ |
|
423 |
$(ELF2E32) \ |
|
424 |
--definput=$$(call dblquote,$(DEFFILE)) \ |
|
425 |
--dump=a \ |
|
426 |
--output=$(call dblquote,$(EXPTARGETASMFILE)) && \ |
|
427 |
$(ASM) $(TARGET_ARCH_OPTION) $(AAPCS_OPTION) $(ASM_OUTPUT_OPTION) $$(call dblquote, $$@) $(EXPTARGETASMFILE) \ |
|
428 |
$(call endrule,expgen) |
|
429 |
endef |
|
430 |
||
431 |
$(eval $(e32expgen_func)) |
|
432 |
CLEANTARGETS:=$(CLEANTARGETS) $(EXPTARGET) $(EXPTARGETASMFILE) |
|
433 |
endif |
|
434 |
endif |
|
435 |
||
436 |
||
437 |
||
438 |
||
439 |
## SOURCE FILES ############################################################## |
|
440 |
||
441 |
# Source files can be either C++ files (.cpp) or Assmbler-in-C++ files (.cia) |
|
442 |
# We have to split the two because they have the same link stage, the compile |
|
443 |
# stage is different for each. |
|
444 |
||
445 |
CPPFILEEXTENSIONS:=.cpp .CPP .Cpp .CPp .CpP .cPP .cpP .cPp .cc .CC \ |
|
446 |
.Cc .c++ .C++ .cxx .CXX .Cxx .cXx .CxX .CXx .cC .cXX .cxX |
|
447 |
CFILEEXTENSIONS:=.c .C |
|
448 |
CIAFILEEXTENSIONS:=.CIA .cia .Cia .cIa .cIA .ciA .CIa .CiA |
|
449 |
ASMFILEEXTENSIONS:=.s .S |
|
450 |
||
451 |
||
452 |
# Extract the CPP files from our sources |
|
453 |
CPPFILES:=$(call extractfilesoftype,$(CPPFILEEXTENSIONS),$(SOURCE)) |
|
454 |
CFILES:=$(call extractfilesoftype,$(CFILEEXTENSIONS),$(SOURCE)) |
|
455 |
ASMFILES:=$(call extractfilesoftype,$(ASMFILEEXTENSIONS),$(SOURCE)) |
|
456 |
||
457 |
# Find out what assember-in-c files there are |
|
458 |
# If appropriate, work out what CPP files will be created from the assembler files |
|
459 |
CIAFILES:=$(call extractfilesoftype,$(CIAFILEEXTENSIONS),$(SOURCE)) |
|
460 |
CIA_CPPFILES:= |
|
461 |
ifeq ($(TRANSFORM_CIA),1) |
|
462 |
CIA_CPPFILES:=$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CIAFILEEXTENSIONS),_.cpp,$(CIAFILES))) |
|
463 |
else |
|
464 |
||
465 |
endif |
|
466 |
||
467 |
## LINK ###################################################################### |
|
468 |
# Bring together all the .o files compiled from .cpp, .c, .s and .cia files. |
|
469 |
# These files are stored in the "non-releasable" output diretory. |
|
470 |
||
471 |
define mapcpp2object |
|
472 |
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CPPFILEEXTENSIONS),.o,$1)) |
|
473 |
endef |
|
474 |
||
475 |
define mapc2object |
|
476 |
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CFILEEXTENSIONS),.o,$1)) |
|
477 |
endef |
|
478 |
||
479 |
define mapasm2object |
|
480 |
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(ASMFILEEXTENSIONS),.o,$1)) |
|
481 |
endef |
|
482 |
||
483 |
define mapcia2object |
|
484 |
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CIAFILEEXTENSIONS),_.o,$1)) |
|
485 |
endef |
|
486 |
||
487 |
# Determine what object files will be linked by using the source files. |
|
488 |
CPPFILES_LINKOBJECTS:=$(call mapcpp2object,$(CPPFILES)) |
|
489 |
CFILES_LINKOBJECTS:=$(call mapc2object,$(CFILES)) |
|
490 |
ifeq ($(TRANSFORM_CIA),1) |
|
491 |
CIAFILES_LINKOBJECTS:=$(patsubst %_.cpp,%_.o,$(CIA_CPPFILES)) |
|
492 |
else |
|
493 |
CIAFILES_LINKOBJECTS:=$(call mapcia2object,$(CIAFILES)) |
|
494 |
endif |
|
495 |
ASMFILES_LINKOBJECTS:=$(call mapasm2object,$(ASMFILES)) |
|
496 |
||
497 |
# Try to link object files in the order in which the source files were specified. |
|
498 |
# This makes BC comparisons with non-Raptor builds easier. |
|
499 |
# Use the order of the source list to establish the order of the object files: |
|
500 |
LINKOBJECTS:=$(call relocatefiles,$(INTERMEDIATEPATH),$(SOURCE)) |
|
501 |
# Replace the file extensions of the Source files with .o (or _.o for cia files) now |
|
502 |
# the list will contain the object files in the same order as the list of source files. |
|
503 |
LINKOBJECTS:=$(foreach FILE,$(LINKOBJECTS),$(basename $(FILE))$(if $(filter $(addprefix %,$(CIAFILEEXTENSIONS)),$(FILE)),_).o) |
|
504 |
||
505 |
ifneq ($(MULTIFILE_ENABLED),) |
|
506 |
MULTIFILEOBJECT:=$(INTERMEDIATEPATH)/$(TARGET).$(POSTLINKFILETYPE)_$(VARIANTTYPE)_multifileobject.o |
|
507 |
MULTIFILE_VIAFILE:=$(INTERMEDIATEPATH)/$(TARGET)_$(VARIANTTYPE)_multifile.via |
|
508 |
endif |
|
509 |
||
510 |
## Via file #################################### |
|
511 |
# list of all objects to be linked |
|
512 |
# |
|
513 |
VIAFILE:=$(INTERMEDIATEPATH)/$(TARGET)_$(VARIANTTYPE)_objects.via |
|
514 |
ifneq ($(GENERATELINKERFEEDBACK),) |
|
515 |
FEEDBACKFILE:=$(INTERMEDIATEPATH)/$(TARGET)_$(VARIANTTYPE)_feedback.fdb |
|
516 |
endif |
|
517 |
||
518 |
# The groupin10 macro allows us to construct a via file, 10 objects at a time |
|
519 |
# to avoid limits on argument lengths and sizes on Windows. |
|
520 |
# It expands to a list of commands, each of which is on a separate line. |
|
521 |
# This causes the shell to be invoked once for each line but each line should |
|
522 |
# be shorter than the maximum allowed by windows. |
|
523 |
define groupin10 |
|
524 |
$(if $1,@echo -e $(foreach L,$(wordlist 1,10,$1),"$(L)\\n") >>$(VIAFILE),) |
|
525 |
$(if $1,$(call groupin10,$(wordlist 11,$(words $1),$1)),@true) |
|
526 |
endef |
|
527 |
||
528 |
################################################ |
|
529 |
||
530 |
||
531 |
## Link-type selection: |
|
532 |
# runtime static libraries link via AR |
|
533 |
ifneq ($(ARTARGET),) |
|
534 |
# Assuming that there are no libdeps in this case because this is probably one of the |
|
535 |
# Runtime libraries which has no deps. |
|
536 |
||
537 |
define artarget_func |
|
538 |
$(ARTARGET): $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT),$(LINKOBJECTS)) $(STDCPPTAGFILE) |
|
539 |
$(if $(MULTIFILE_ENABLED),,@echo "$(STDCPPTAGFILE)" > $(VIAFILE); |
|
540 |
$(call groupin10,$(LINKOBJECTS)) ;) |
|
541 |
$(call startrule,ar,FORCESUCCESS) \ |
|
542 |
$$(call dblquote,$(AR)) $(ARCHIVER_CREATE_OPTION) $$@ $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT),$(COMMANDFILE_OPTION)$(VIAFILE)) \ |
|
543 |
$(if $(DUMPBCINFO),&& $(FROMELF) -v $$@ > $$@.elfdump,) \ |
|
544 |
$(call endrule,ar) |
|
545 |
endef |
|
546 |
$(eval $(artarget_func)) |
|
547 |
||
5 | 548 |
CLEANTARGETS:=$(CLEANTARGETS) $(VIAFILE) $(if $(DUMPBCINFO),$(ARTARGET).elfdump,) |
3 | 549 |
endif |
550 |
||
551 |
||
552 |
||
553 |
# Targettype is some type of DLL or EXE (or derivative) |
|
554 |
ifneq ($(LINK_TARGET),) |
|
555 |
||
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
556 |
located_ARMLIBS:=$(foreach L,$(ARMLIBS),$(wildcard $(RVCTLIB)/*/$(L))) |
3 | 557 |
located_STATICLIBRARIES:=$(foreach L,$(STATICLIBRARY),$(STATIC_LIBRARY_DIR)/$(L).lib) |
558 |
e32abiv2_LIBS:=$(EXPTARGET) $(LINKER_STUB_LIBRARY) $(if $(STATIC_RUNTIME_LIB),$(STATIC_RUNTIME_DIR)/$(STATIC_RUNTIME_LIB),) $(located_STATICLIBRARIES) |
|
559 |
# DLLS and EXEs - These objects are linked by a linker |
|
560 |
ifeq ($(ARMRT),) |
|
561 |
# Some of the runtime libraries do not set ARMRT because of a circular reference |
|
562 |
# problem; we need to stop these from linking to their own dso and not link to |
|
563 |
# the STATIC_LIBS_LIST. |
|
564 |
ifneq ($(findstring $(TARGET).dso,$(RUNTIME_LIBS_LIST)),) |
|
565 |
# (almost) ARM RUNTIME LIBS |
|
566 |
REDUCED_RUNTIME_LIBS_LIST:=$(subst $(TARGET).dso,,$(RUNTIME_LIBS_LIST)) |
|
567 |
||
568 |
ifeq ($(VARIANTTYPE),udeb) |
|
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
569 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG)) $(addprefix $(RUNTIME_LIBS_PATH)/,$(REDUCED_RUNTIME_LIBS_LIST)) $(located_ARMLIBS) |
3 | 570 |
else |
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
571 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY)) $(addprefix $(RUNTIME_LIBS_PATH)/,$(REDUCED_RUNTIME_LIBS_LIST)) $(located_ARMLIBS) |
3 | 572 |
endif |
573 |
||
574 |
else |
|
575 |
# NORMAL |
|
576 |
# |
|
577 |
ifeq ($(VARIANTTYPE),udeb) |
|
578 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG)) |
|
579 |
else |
|
580 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY)) |
|
581 |
endif |
|
582 |
ifeq ($(HAS_DEDICATED_OP_NEWDEL_LIB),1) |
|
583 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(RUNTIME_LIBS_PATH)/,$(NEWLIB)) |
|
584 |
endif |
|
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
585 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(RUNTIME_LIBS_PATH)/,$(RUNTIME_LIBS_LIST)) $(addprefix $(STATIC_LIBS_PATH)/,$(STATIC_LIBS_LIST)) $(located_ARMLIBS) |
3 | 586 |
|
587 |
endif |
|
588 |
else |
|
589 |
# ARM RUNTIME LIBS |
|
590 |
ifeq ($(VARIANTTYPE),udeb) |
|
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
591 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG)) $(located_ARMLIBS) |
3 | 592 |
else |
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
593 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY)) $(located_ARMLIBS) |
3 | 594 |
endif |
595 |
endif |
|
596 |
||
597 |
# NOTE: the groupin10 macro must be used before a call to the "startrule" macro |
|
598 |
# because the code between startrule and endrule is packaged up into one |
|
599 |
# commandline which would defeat the purpose of groupin10. |
|
600 |
# This is undesirable because viafile generation commands appear |
|
601 |
# outside the relevant tags but it is also unavoidable. |
|
602 |
define linktarget_func |
|
603 |
## The actual link target, dependencies and build step |
|
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
604 |
$(E32TARGET): $(POSTLINKDEFFILE) $(ELF2E32) $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT) $(CIAFILES_LINKOBJECTS),$(LINKOBJECTS)) $(e32abiv2_LIBS) $(LINKER_ENTRYPOINT_LIBDEP) $(if $(SUPPORTS_STDCPP_NEWLIB),$(CHECKLIB)) $(if $(LINKERFEEDBACK_STAGE2),$(FEEDBACKFILE),) $(if $(HAVE_ORDERONLY),|,) $(EPOCROOT)/epoc32/build/TEM_LIB |
3 | 605 |
$(if $(MULTIFILE_ENABLED),,@echo -n "" > $(VIAFILE); |
606 |
$(call groupin10,$(LINKOBJECTS)) ;) |
|
75
000ba5e4ba7d
Application of review comments.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
74
diff
changeset
|
607 |
$(call startrule,linkandpostlink) \ |
3 | 608 |
$(if $(PERTURBSTARTTIME),$(RANSLEEP) $(PERTURBMSECS) ;,) \ |
609 |
$(if $(SUPPORTS_STDCPP_NEWLIB),$(if $(located_STATICLIBRARIES),$(CHECKLIB) $(CHECKLIB_TYPE) --elf $(call dblquote,$(located_STATICLIBRARIES)) &&,),) \ |
|
610 |
$(LD) $(LINKER_MISC_FLAGS) $(LINKER_DEFAULT_LIB_PATHS) $(SYMBIAN_LINK_FLAGS) $(if $(DEBUG_INFO),$(LINKER_DEBUG_OPTION),$(LINKER_NODEBUG_OPTION)) \ |
|
611 |
$(if $(ARMLIBS),$(LD_WARNINGS_SUPPRESSION_ARMLIBS),) \ |
|
612 |
$(SHARED_OBJECT_OPTION) $(SPLIT_OPTION) \ |
|
22 | 613 |
$(RW_BASE) \ |
3 | 614 |
$(LINKER_ARCH_OPTION) \ |
22 | 615 |
$(SYMVER_OPTION) $(SO_NAME_OPTION)=$(call dblquote,$(LINKASVERSIONED)) \ |
3 | 616 |
$(LINKER_ENTRYPOINT_SETTING) \ |
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
617 |
-o $$(call dblquote,$(LINK_TARGET)) \ |
3 | 618 |
$(if $(LTCG),$(LTCG_OPTION),) \ |
22 | 619 |
$(LINKER_SYMBOLS_OPTION) $(LINKER_SYMBOLS_FILE_OPTION)=$(call dblquote,$(MAPFILE)) \ |
3 | 620 |
$(LINKEROPTION) \ |
621 |
$(if $(MULTIFILE_ENABLED),$(call dblquote,$(MULTIFILEOBJECT) $(CIAFILES_LINKOBJECTS)),$(COMMANDFILE_OPTION)$(call dblquote,$(VIAFILE))) \ |
|
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
622 |
$(if $(GENERATELINKERFEEDBACK),$(FEEDBACK_OPTION)$(call dblquote,$(FEEDBACKFILE))) \ |
3 | 623 |
$(if $(LINKER_ADD_STATIC_RUNTIME),$(if $(STATIC_RUNTIME_LIB),$(LINKER_GROUP_START_OPTION) $(STATIC_RUNTIME_DIR)/$(STATIC_RUNTIME_LIB) $(LINKER_GROUP_END_OPTION),)) \ |
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
624 |
$(call dblquote,$(e32abiv2_LIBS)) $(LINKER_DEFAULT_LIBS) && \ |
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
625 |
$(ELF2E32) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
626 |
--sid=0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
627 |
--version=$(VERSION) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
628 |
--capability=$(FINAL_CAPABILITIES) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
629 |
--linkas=$(call dblquote,$(LINKASVERSIONED)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
630 |
--fpu=$(if $(ARMFPU),$(ARMFPU),$(POSTLINKER_FPU_DEFAULT)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
631 |
--targettype=$(POSTLINKTARGETTYPE) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
632 |
--output=$$(call dblquote,$$@) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
633 |
--elfinput=$(call dblquote,$(LINK_TARGET)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
634 |
$(if $(UID1),--uid1=0x$(UID1),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
635 |
$(if $(UID2),--uid2=0x$(UID2),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
636 |
$(if $(UID3),--uid3=0x$(UID3),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
637 |
$(if $(VENDORID),--vid=0x$(VENDORID),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
638 |
$(if $(EXPTARGET),--customdlltarget,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
639 |
$(if $(ARMLIBS),--excludeunwantedexports,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
640 |
$(if $(EPOCALLOWDLLDATA),--dlldata,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
641 |
$(if $(EPOCPROCESSPRIORITY),--priority=$(EPOCPROCESSPRIORITY),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
642 |
$(if $(EPOCSTACKSIZE),--stack=0x$(EPOCSTACKSIZE),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
643 |
$(if $(EPOCHEAPSIZEMIN),--heap=0x$(EPOCHEAPSIZEMIN)$(CHAR_COMMA)0x$(EPOCHEAPSIZEMAX),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
644 |
$(if $(EPOCFIXEDPROCESS),--fixedaddress,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
645 |
$(if $(EPOCDATALINKADDRESS),--datalinkaddress=$(EPOCDATALINKADDRESS),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
646 |
$(if $(NAMEDSYMLKUP),--namedlookup,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
647 |
$(if $(SMPSAFE),--smpsafe,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
648 |
$(if $(POSTLINKDEFFILE),--definput=$(POSTLINKDEFFILE),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
649 |
$(if $(EXPORTUNFROZEN),--unfrozen,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
650 |
$(if $(AUTOEXPORTS),--sysdef=$(call dblquote,$(AUTOEXPORTS)),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
651 |
$(if $(CANIGNORENONCALLABLE), \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
652 |
$(if $(IMPORTLIBRARYREQUIRED),,--ignorenoncallable),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
653 |
$(if $(CANHAVEEXPORTS), --defoutput=$(call dblquote,$(GENERATED_DEFFILE)) --dso=$(GENERATED_DSO)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
654 |
$(if $(filter $(VARIANTTYPE),$(DEBUGGABLE)),--debuggable,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
655 |
$(if $(POSTLINKER_SUPPORTS_WDP), \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
656 |
--codepaging=$(PAGEDCODE_OPTION) --datapaging=$(PAGEDDATA_OPTION), \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
657 |
$(POSTLINKER_PAGEDOPTION)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
658 |
$(if $(NOCOMPRESSTARGET),--uncompressed, \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
659 |
$(if $(INFLATECOMPRESSTARGET),--compressionmethod=inflate, \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
660 |
$(if $(BYTEPAIRCOMPRESSTARGET),--compressionmethod=bytepair, \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
661 |
--compressionmethod=$(POSTLINKER_COMPRESSION_DEFAULT)))) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
662 |
--libpath="$(call concat,$(PATHSEP)$(CHAR_SEMIC),$(strip $(RUNTIME_LIBS_PATH) $(STATIC_LIBS_PATH)))" \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
663 |
$(if $(SAVESPACE),$(if $(EXPORTUNFROZEN),,&& { $(GNURM) -rf $(INTERMEDIATEPATH); true; })) \ |
75
000ba5e4ba7d
Application of review comments.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
74
diff
changeset
|
664 |
$(call endrule,linkandpostlink) |
3 | 665 |
|
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
666 |
$(MAPFILE): $(E32TARGET) |
74
2f301831ccbb
Add dependency for .sym files.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
72
diff
changeset
|
667 |
$(LINK_TARGET): $(E32TARGET) |
3 | 668 |
endef |
75
000ba5e4ba7d
Application of review comments.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
74
diff
changeset
|
669 |
ifneq ($(DOPOSTLINK),) |
3 | 670 |
$(eval $(linktarget_func)) |
75
000ba5e4ba7d
Application of review comments.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
74
diff
changeset
|
671 |
endif # ifneq ($(DOPOSTLINK),) |
3 | 672 |
|
5 | 673 |
CLEANTARGETS:=$(CLEANTARGETS) $(VIAFILE) $(if $(GENERATELINKERFEEDBACK),$(FEEDBACKFILE)) $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT)) |
3 | 674 |
WHATRELEASE:=$(WHATRELEASE) $(MAPFILE) |
675 |
||
676 |
endif # if TARGETTYPE lib |
|
677 |
||
678 |
||
679 |
## Run trace compiler ############################################## |
|
680 |
ifeq ($(UID3),) |
|
681 |
ifeq ($(UID2),) |
|
682 |
USE_TRACE_COMPILER:= |
|
683 |
else |
|
684 |
UID_TC:=$(UID2) |
|
685 |
endif |
|
686 |
else |
|
687 |
UID_TC:=$(UID3) |
|
688 |
endif |
|
689 |
||
690 |
# USE_TRACE_COMPILER defaults to blank in Raptor config. |
|
691 |
# Users can turn TC on by setting it to 1 in user config. |
|
692 |
ifneq ($(USE_TRACE_COMPILER),) |
|
693 |
include $(FLMHOME)/tracecompiler.mk |
|
163
c3eca3dd5925
Fixing bug 1494 (tracecompiler whatlog) properly this time
Iain Williamson <iain.williamson@nokia.com>
parents:
161
diff
changeset
|
694 |
WHATRELEASE:=$(WHATRELEASE) $(TRACE_DICTIONARY) $(AUTOGEN_HEADER) |
3 | 695 |
endif |
696 |
||
697 |
CC_CPPONLY_ARGS:=$(SYMBIAN_CCFLAGS) $(if $(DEBUG_INFO),-g) $(DEBUG_FORMAT) \ |
|
698 |
$(RUNTIME_SYMBOL_VISIBILITY_OPTION) $(EXCEPTIONS) \ |
|
699 |
$(CC_WARNINGS_CONTROL_OPTION) $(CC_ERRORS_CONTROL_OPTION) \ |
|
700 |
$(TARGET_ARCH_OPTION) $(ENUM_OPTION) $(OWN_LIBRARY_OPTION) $(FPMODE_OPTION) \ |
|
701 |
$(EXPORT_VTBL_OPTION) $(NO_UNALIGNED_ACCESS) $(VFE_OPTION) $(AAPCS_OPTION) \ |
|
702 |
$(CPPONLYOPTION) $(INSTRUCTION_SET) \ |
|
703 |
$(if $(ALWAYS_BUILD_AS_ARM),$(ARM_INSTRUCTION_SET),$(THUMB_INSTRUCTION_SET) $(call makemacrodef,-D,$(COMPILER_THUMB_DEFINES))) \ |
|
9 | 704 |
$(COMPILER_FPU_OPTION)$(if $(ARMFPU),$(ARMFPU),$(COMPILER_FPU_DEFAULT)) |
3 | 705 |
|
706 |
## COMPILE CPP Files ################################################################# |
|
707 |
||
708 |
# For ARMCC we can compile all sourcefiles with one invocation |
|
709 |
# The pathprep macro is used to make sure that forward slashes in options |
|
710 |
# are not interpreted as being paths by CYGWIN on Windows. On windows |
|
711 |
# pathprep makes a forward slash into two. |
|
712 |
||
713 |
# The majority of ARMCC arguments are common across all compiler invocations |
|
714 |
# Order is significant here in that OPTION_REPLACE here and in ABLD should |
|
715 |
# have the same impact |
|
716 |
CC_CORE_ARGS:=$(SYMBIAN_CCFLAGS) $(if $(DEBUG_INFO),-g) $(DEBUG_FORMAT) \ |
|
717 |
$(RUNTIME_SYMBOL_VISIBILITY_OPTION) $(EXCEPTIONS) \ |
|
718 |
$(CC_WARNINGS_CONTROL_OPTION) $(CC_ERRORS_CONTROL_OPTION) \ |
|
719 |
$(TARGET_ARCH_OPTION) $(ENUM_OPTION) $(OWN_LIBRARY_OPTION) $(FPMODE_OPTION) \ |
|
720 |
$(EXPORT_VTBL_OPTION) $(NO_UNALIGNED_ACCESS) $(VFE_OPTION) $(AAPCS_OPTION) \ |
|
721 |
$(COMPILE_ONLY_OPTION) $(INSTRUCTION_SET) \ |
|
722 |
$(if $(ALWAYS_BUILD_AS_ARM),$(ARM_INSTRUCTION_SET),$(THUMB_INSTRUCTION_SET) $(call makemacrodef,-D,$(COMPILER_THUMB_DEFINES))) \ |
|
9 | 723 |
$(COMPILER_FPU_OPTION)$(if $(ARMFPU),$(ARMFPU),$(COMPILER_FPU_DEFAULT)) |
3 | 724 |
|
725 |
ifeq ($(STDCPP),1) |
|
726 |
SYSTEMINCLUDE:=$(SYSTEMINCLUDE) $(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$(call dblquote,$(STDCPP_INCLUDE))) |
|
727 |
endif |
|
728 |
||
729 |
define option_replace |
|
730 |
# Process a single, combined, item of the form 'search<->replace' in order to modify the command line tool call |
|
731 |
# We split this into its component arguments for use in substitutions |
|
732 |
# Spaces will have been escaped elsewhere to maintain distinct words, so we resurrect these |
|
733 |
# after the split. |
|
734 |
SEARCH:=$(subst %20,$(CHAR_SPACE),$(word 1,$(subst <->,$(CHAR_SPACE),$(1)))) |
|
735 |
REPLACE:=$(subst %20,$(CHAR_SPACE),$(word 2,$(subst <->,$(CHAR_SPACE),$(1)))) |
|
736 |
||
737 |
# Depending on whether there's a wildcard in the search, we may require either a normal $(subst) or a $(patsubst) |
|
738 |
PATSUBST:=$$(if $$(findstring %,$$(SEARCH)),1,) |
|
739 |
||
740 |
ifeq ($$(PATSUBST),1) |
|
741 |
CC_CORE_ARGS:=$$(patsubst $$(SEARCH),$$(REPLACE),$$(CC_CORE_ARGS)) |
|
742 |
else |
|
743 |
CC_CORE_ARGS:=$$(subst $$(SEARCH),$$(REPLACE),$$(CC_CORE_ARGS)) |
|
744 |
endif |
|
745 |
endef |
|
746 |
$(foreach ITEM,$(OPTION_REPLACE_COMPILER),$(eval $(call option_replace,$(ITEM)))) |
|
747 |
||
748 |
define e32abiv2_compile |
|
749 |
||
750 |
$(eval DEPENDFILENAME:=$(1).d) |
|
751 |
$(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME))) |
|
752 |
||
753 |
# $4 is for language specific options (e.g. C++ vs C) |
|
185
69334660be7a
Fixing Bug 1569 - excessive recompilation in incremental tracecompiler builds
Iain Williamson <iain.williamson@nokia.com>
parents:
173
diff
changeset
|
754 |
$(1): $(2) $(PROJECT_META) $(if $(MULTIFILE_ENABLED),,$(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT)) $(if $(LINKERFEEDBACK_STAGE2),$(FEEDBACKFILE),) | $(if $(USE_TRACE_COMPILER),$(TRACE_MARKER),) |
3 | 755 |
$(call startrule,compile,,$(2)) \ |
756 |
$(if $(PERTURBSTARTTIME), $(RANSLEEP) $(PERTURBMSECS) ;,) \ |
|
757 |
$(if $(MULTIFILE_ENABLED), echo $(2) $(3) > $(MULTIFILE_VIAFILE) ;,) \ |
|
758 |
$(CC) $(LICENSERETRY_OPTION) \ |
|
759 |
$(CC_CORE_ARGS) \ |
|
760 |
$(OPTION_COMPILER) $(if $(MULTIFILE_ENABLED),$(4),$(3)) \ |
|
761 |
$(if $(LTCG),$(LTCG_OPTION),) \ |
|
762 |
$(if $(USE_PROFILER_FEEDBACK),--profile=$(call dblquote,$(ARM_PROFILER_FILE)),) \ |
|
763 |
$(call makemacrodef,-D,$(COMPILER_INTERWORK_DEFINES) $(CDEFS)) \ |
|
764 |
$(if $(PREINCLUDE),$(PREINCLUDE_OPTION) ,)$(call concat, $(PREINCLUDE_OPTION) ,$(call dblquote,$(PREINCLUDE)))\ |
|
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
765 |
$(if $(SET_ARMINC),$(if $(RVCTINC),$(COMPILER_SYSTEM_INCLUDE_OPTION)$(call dblquote,$(RVCTINC)),),) \ |
3 | 766 |
$(COMPILER_SYSTEM_INCLUDE_OPTION)$$(call dblquote,$$(<D)) \ |
767 |
$(if $(USERINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$(call dblquote,$(USERINCLUDE))) \ |
|
768 |
$(if $(SYSTEMINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$(call dblquote,$(SYSTEMINCLUDE))) \ |
|
769 |
$(if $(NOHIDEALL),--no_hide_all,) \ |
|
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
770 |
$(if $(NO_DEPEND_GENERATE),,$(DEPEND_OPTION) $(call dblquote,$(1).d)) \ |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
771 |
$(if $(LINKERFEEDBACK_STAGE2),$(FEEDBACK_OPTION)$(call dblquote,$(FEEDBACKFILE))) \ |
3 | 772 |
$(if $(MULTIFILE_ENABLED),--multifile $(OUTPUT_OPTION) $(MULTIFILEOBJECT) \ |
773 |
--via $$(call dblquote, $(MULTIFILE_VIAFILE)),$(OUTPUT_OPTION) $$@ $$(call dblquote, $$<)) \ |
|
774 |
$(call endrule,compile) |
|
775 |
||
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
776 |
ifeq ($(NO_DEPEND_GENERATE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
777 |
CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
778 |
endif |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
779 |
|
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
780 |
ifneq ($(DEPENDFILE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
781 |
ifeq ($(NO_DEPEND_INCLUDE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
782 |
ifeq ($(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS))),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
783 |
-include $(DEPENDFILE) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
784 |
endif |
3 | 785 |
endif |
786 |
endif |
|
787 |
||
788 |
# individual source file compilation |
|
789 |
SOURCETARGET_$(call sanitise,$(2)): $(1) |
|
790 |
||
791 |
endef |
|
792 |
||
793 |
# Evaluate .cpp and .c files in one go for multifile, cannot do in separate steps since we have the same target. |
|
794 |
# This implementation means the .c files will always get put at the end of the .via file. Maybe there is a better way to do this? |
|
795 |
$(if $(MULTIFILE_ENABLED),$(eval $(call e32abiv2_compile,$(MULTIFILEOBJECT),$(CPPFILES),$(CFILES),$(CPP_LANG_OPTION))),$(foreach F,$(CPPFILES),$(eval $(call e32abiv2_compile,$(call mapcpp2object,$(F)),$(F),$(CPP_LANG_OPTION))))) |
|
796 |
$(if $(MULTIFILE_ENABLED),,$(foreach F,$(CFILES),$(eval $(call e32abiv2_compile,$(call mapc2object,$(F)),$(F),$(C_LANG_OPTION))))) |
|
797 |
ifneq ($(TRANSFORM_CIA),1) |
|
798 |
$(if $(MULTIFILE_ENABLED),,$(foreach F,$(CIAFILES),$(eval $(call e32abiv2_compile,$(call mapcia2object,$(F)),$(F),$(CPP_LANG_OPTION) $(COMPILER_CIA_FLAGS))))) |
|
799 |
endif |
|
800 |
||
801 |
CLEANTARGETS:=$(CLEANTARGETS) $(if $(MULTIFILE_ENABLED),$(MULTIFILE_VIAFILE) $(MULTIFILEOBJECT),$(CPPFILES_LINKOBJECTS) $(CFILES_LINKOBJECTS) $(CIAFILES_LINKOBJECTS)) $(if $(GENERATELINKERFEEDBACK),$(FEEDBACKFILE)) |
|
802 |
||
803 |
## Listing target ################################################### |
|
804 |
# Very similar to compile, apart from the extra flags passed to the |
|
805 |
# compile and different output options |
|
806 |
||
807 |
define map2listfile |
|
808 |
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CPPFILEEXTENSIONS) $(CFILEEXTENSIONS),.lis,$1)) |
|
809 |
endef |
|
810 |
||
811 |
||
812 |
define e32abiv2_cpponly |
|
813 |
# $1 is the sourcefile |
|
814 |
||
815 |
$(eval CPPONLYTARGET:=$(strip $(call extractandmap,$(CPPFILEEXTENSIONS) $(CFILEEXTENSIONS),.$(subst _,.,$(call sanitise,$(FULLVARIANTPATH))).pre,$1))) |
|
816 |
||
817 |
CPPONLY:: $(CPPONLYTARGET) |
|
818 |
||
819 |
$(CPPONLYTARGET): $(1) $(PROJECT_META) $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT) |
|
820 |
$(call startrule,e32cpponly,,$(1)) \ |
|
821 |
$(if $(PERTURBSTARTTIME), $(RANSLEEP) $(PERTURBMSECS) ;,) \ |
|
822 |
$(CC) $(LICENSERETRY_OPTION) $(SYMBIAN_CCFLAGS) \ |
|
823 |
$(CC_CPPONLY_ARGS) \ |
|
824 |
$(OPTION_COMPILER) \ |
|
825 |
$(call makemacrodef,-D,$(COMPILER_INTERWORK_DEFINES) $(CDEFS)) \ |
|
826 |
$(if $(PREINCLUDE),$(PREINCLUDE_OPTION) ,)$(call concat, $(PREINCLUDE_OPTION) ,$(call dblquote,$(PREINCLUDE)))\ |
|
827 |
$(if $(SET_ARMINC),$(if $(RVCTINC),$(COMPILER_SYSTEM_INCLUDE_OPTION)$(call dblquote,$(RVCTINC)),),) \ |
|
828 |
$(COMPILER_SYSTEM_INCLUDE_OPTION)$$(call dblquote,$$(<D)) \ |
|
829 |
$(if $(USERINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$(call dblquote,$(USERINCLUDE))) \ |
|
830 |
$(if $(SYSTEMINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$(call dblquote,$(SYSTEMINCLUDE))) \ |
|
831 |
$(if $(NOHIDEALL),--no_hide_all,) \ |
|
832 |
$$(call dblquote, $$<) $(OUTPUT_OPTION) $$(@) \ |
|
833 |
$(call endrule,e32cpponly) |
|
834 |
||
835 |
CLEANTARGETS:=$$(CLEANTARGETS) $(CPPONLYTARGET) |
|
836 |
endef |
|
837 |
||
838 |
ifneq ($(filter CPPONLY,$(call uppercase,$(MAKECMDGOALS))),) |
|
839 |
$(foreach F,$(CPPFILES) $(CFILES),$(eval $(call e32abiv2_cpponly,$(F)))) |
|
840 |
endif |
|
841 |
||
842 |
define e32abiv2_listing |
|
843 |
# $1 is the sourcefile |
|
844 |
||
845 |
$(eval LISTINGTARGET:=$(strip $(call extractandmap,$(CPPFILEEXTENSIONS) $(CFILEEXTENSIONS),.$(subst _,.,$(call sanitise,$(FULLVARIANTPATH))).$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE)).lst,$1))) |
|
846 |
$(eval DEPENDFILENAME:=$(call map2listfile,$1).d) |
|
847 |
$(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME))) |
|
848 |
||
849 |
||
850 |
LISTING:: $(LISTINGTARGET) |
|
851 |
||
852 |
$(LISTINGTARGET): $(1) $(PROJECT_META) $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT) |
|
853 |
$(call startrule,e32listing,,$(1)) \ |
|
854 |
$(if $(PERTURBSTARTTIME), $(RANSLEEP) $(PERTURBMSECS) ;,) \ |
|
855 |
$(CC) $(LICENSERETRY_OPTION) $(SYMBIAN_CCFLAGS) \ |
|
856 |
$(CC_CORE_ARGS) \ |
|
857 |
$(LISTING_OPTION) \ |
|
858 |
$(OPTION_COMPILER) \ |
|
859 |
$(call makemacrodef,-D,$(COMPILER_INTERWORK_DEFINES) $(CDEFS)) \ |
|
860 |
$(if $(PREINCLUDE),$(PREINCLUDE_OPTION) ,)$(call concat, $(PREINCLUDE_OPTION) ,$(call dblquote,$(PREINCLUDE)))\ |
|
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
861 |
$(if $(SET_ARMINC),$(if $(RVCTINC),$(COMPILER_SYSTEM_INCLUDE_OPTION)$(call dblquote,$(RVCTINC)),),) \ |
3 | 862 |
$(COMPILER_SYSTEM_INCLUDE_OPTION)$$(call dblquote,$$(<D)) \ |
863 |
$(if $(USERINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$(call dblquote,$(USERINCLUDE))) \ |
|
864 |
$(if $(SYSTEMINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$(call dblquote,$(SYSTEMINCLUDE))) \ |
|
865 |
$(if $(NOHIDEALL),--no_hide_all,) \ |
|
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
866 |
$(if $(NO_DEPEND_GENERATE),,$(DEPEND_OPTION) $(call dblquote,$(DEPENDFILENAME))) \ |
3 | 867 |
$$(call dblquote, $$<) $(OUTPUT_OPTION) $$(@) \ |
868 |
$(call endrule,e32listing) |
|
869 |
||
870 |
CLEANTARGETS:=$$(CLEANTARGETS) $(LISTINGTARGET) |
|
871 |
||
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
872 |
ifeq ($(NO_DEPEND_GENERATE),)) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
873 |
CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
874 |
endif |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
875 |
|
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
876 |
ifneq ($(DEPENDFILE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
877 |
ifeq ($(NO_DEPEND_INCLUDE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
878 |
ifeq ($(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS))),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
879 |
-include $(DEPENDFILE) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
880 |
endif |
3 | 881 |
endif |
882 |
endif |
|
883 |
||
884 |
endef |
|
885 |
||
886 |
# No point at all in generating listing targetsif we aren't going to make them |
|
887 |
ifneq ($(filter LISTING,$(call uppercase,$(MAKECMDGOALS))),) |
|
888 |
$(foreach F,$(CPPFILES) $(CFILES),$(eval $(call e32abiv2_listing,$(F)))) |
|
889 |
endif |
|
890 |
||
891 |
||
892 |
||
893 |
# Function to execute FREEZE ########################################### |
|
894 |
ifneq ($(SUPPORT_FREEZE),) |
|
895 |
||
896 |
# Fivespaces variable created to ensure a suitable gap of space characters |
|
897 |
# Is placed between the separate arguments. This fixes a problem in Cygwin, where |
|
898 |
# separate arguments are interpreted as a single argument when passed to bash |
|
899 |
FIVESPACES=$(BLANK) $(BLANK) |
|
900 |
||
901 |
FREEZEGUARD:=TARGET_$(TARGET)_$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE))_$(IMPORTLIBPATH)_EFREEZE |
|
902 |
||
903 |
define e32freeze |
|
904 |
||
905 |
FREEZE:: $(1) |
|
906 |
$(call startrule,freeze,,$(RESOLVED_DEFFILE)) \ |
|
907 |
$(EFREEZE) $(EFREEZE_REMOVE_OPTION) "$(RESOLVED_DEFFILE)" $(FIVESPACES) $(call dblquote,$(GENERATED_DEFFILE)) \ |
|
908 |
$(call endrule,freeze) |
|
909 |
endef |
|
910 |
||
911 |
# Only freeze once - udeb and urel cannot differ |
|
912 |
ifeq ($($(FREEZEGUARD)),) |
|
913 |
# For most freezing activity we need the temporary .def file generated in the final post-link |
|
914 |
# that lists the current exports - FREEZE can therefore be dependent on the final post-linked binary, |
|
915 |
# with the side-effect that a build is triggered if someone tries to freeze without having built. |
|
916 |
# |
|
917 |
# However, there's one case where we don't want to be dependent on the post-linked binary in this way, |
|
918 |
# and that's when (a) there are missing exports, (b) the user's aware of them and (c) they're deliberately freezing to |
|
919 |
# remove them using EFREEZE's remove option. Being dependent on the post-linked binary in this case, where ELF2E32 |
|
920 |
# actually fails to generate a final binary, would mean that the freeze would never happen and post-linking would |
|
921 |
# just be continually re-attempted (to fail each time). |
|
922 |
# |
|
923 |
# So, as a special case, if the user is explicitly attempting to freeze and perform removals, we make FREEZE dependent |
|
924 |
# on the temporary .def file instead. This has no rule to actually make it, but gives a hint as to what is wrong if |
|
925 |
# the users performs a freeze with remove without having explicitly built previously. |
|
926 |
# |
|
927 |
ifneq ($(EFREEZE_REMOVE_OPTION),) |
|
928 |
$(eval $(call e32freeze,$(GENERATED_DEFFILE))) |
|
929 |
else |
|
930 |
$(eval $(call e32freeze,$(E32TARGET))) |
|
931 |
endif |
|
932 |
$(FREEZEGUARD):=1 |
|
933 |
endif |
|
934 |
||
935 |
endif |
|
936 |
||
937 |
CLEANTARGETS:=$(CLEANTARGETS) $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT),$(CPPFILES_LINKOBJECTS) $(CFILES_LINKOBJECTS)) |
|
938 |
||
939 |
## ASSEMBLER FILES ################################################################### |
|
940 |
# CIA VERSION ############################################ |
|
941 |
define mapcia2xxx |
|
942 |
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CIAFILEEXTENSIONS),$2,$1)) |
|
943 |
endef |
|
944 |
||
945 |
define e32abiv2_CIA2CPP |
|
946 |
||
947 |
$(eval e32abiv2_OFILE:=$(call mapcia2xxx,$(1),_.o)) |
|
948 |
$(eval e32abiv2_PREFILE:=$(call mapcia2xxx,$(1),_.pre)) |
|
949 |
$(eval e32abiv2_CPPFILE:=$(call mapcia2xxx,$(1),_.cpp)) |
|
950 |
$(eval CLEANTARGETS:=$(CLEANTARGETS) $(e32abiv2_OFILE) $(e32abiv2_CPPFILE) $(e32abiv2_PREFILE)) |
|
951 |
||
952 |
$(e32abiv2_OFILE): $(e32abiv2_CPPFILE) $(PROJECT_META) |
|
953 |
$(call startrule,cia2cpp2o,,$(e32abiv2_CPPFILE)) \ |
|
954 |
$(if $(PERTURBSTARTTIME),$(RANSLEEP) $(PERTURBMSECS) ;,) \ |
|
955 |
$(CC) $(LICENSERETRY_OPTION) \ |
|
956 |
$(CC_CORE_ARGS) \ |
|
957 |
$(if $(LTCG),$(LTCG_OPTION),) \ |
|
958 |
$(OPTION_COMPILER) \ |
|
959 |
$(call makemacrodef,-D,$(COMPILER_INTERWORK_DEFINES) $(CDEFS) $(CIADEFS)) $(CPP_LANG_OPTION) \ |
|
960 |
$(if $(USERINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$$(call dblquote,$(USERINCLUDE))) \ |
|
961 |
$(if $(SYSTEMINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$$(call dblquote,$(SYSTEMINCLUDE))) \ |
|
962 |
$$(call dblquote, $$<) $(OUTPUT_OPTION) $$@ \ |
|
963 |
$(call endrule,cia2cpp2o) |
|
964 |
||
965 |
||
966 |
# preprocessed CIA file to a CPP file |
|
967 |
$(e32abiv2_CPPFILE): $(e32abiv2_PREFILE) |
|
968 |
$(call startrule,tranasm) \ |
|
969 |
$(if $(CPPFILT),CPPFILT="$(CPPFILT)",) \ |
|
970 |
$(TRANASM) --suppress-check --output="$$@" $$^ \ |
|
971 |
$(call endrule,tranasm) |
|
972 |
||
973 |
$(eval DEPENDFILENAME:=$(e32abiv2_PREFILE).d) |
|
974 |
$(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME))) |
|
975 |
||
976 |
# preprocess the cia file |
|
977 |
$(eval e32abiv2_PREFILE_OPTIONS:= $(LICENSERETRY_OPTION) $(PREPROCESSOR_OPTION) $(CPP_OPTION) \ |
|
978 |
$(SYMBIAN_CCFLAGS) $(call makemacrodef,-D,$(COMPILER_INTERWORK_DEFINES) $(CDEFS) $(CIADEFS)) $(CPP_LANG_OPTION) \ |
|
979 |
$(if $(PREINCLUDE),$(PREINCLUDE_OPTION) ,)$$(call concat, $(PREINCLUDE_OPTION) ,$$(call dblquote,$(PREINCLUDE))) \ |
|
980 |
$(if $(USERINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$$(call dblquote,$(USERINCLUDE))) \ |
|
981 |
$(if $(SYSTEMINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$$(call dblquote,$(SYSTEMINCLUDE))) \ |
|
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
982 |
$(if $(ARMINC),$(if $(RVCTINC), $(COMPILER_SYSTEM_INCLUDE_OPTION)$$(call dblquote,$(RVCTINC)),),) ) |
3 | 983 |
|
984 |
||
985 |
$(e32abiv2_PREFILE): $1 $(PROJECT_META) $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT) |
|
986 |
$(call startrule,cia2cpp,,$1) \ |
|
987 |
$(if $(PERTURBSTARTTIME),$(RANSLEEP) $(PERTURBMSECS) ;,) \ |
|
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
988 |
$(CC) $(e32abiv2_PREFILE_OPTIONS) $(OUTPUT_OPTION) $$@ $$(call dblquote,$1) \ |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
989 |
$(if $(NO_DEPEND_GENERATE),,&& $(CC) -M $(e32abiv2_PREFILE_OPTIONS) --depend_format=unix $(OUTPUT_OPTION) $$@ $$(call dblquote,$1) > $(call dblquote,$(e32abiv2_PREFILE).d)) \ |
3 | 990 |
$(call endrule,cia2cpp) |
991 |
||
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
992 |
ifeq ($(NO_DEPEND_GENERATE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
993 |
CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
994 |
endif |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
995 |
|
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
996 |
ifneq ($(DEPENDFILE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
997 |
ifeq ($(NO_DEPEND_INCLUDE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
998 |
ifeq ($(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS))),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
999 |
-include $(DEPENDFILE) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
1000 |
endif |
3 | 1001 |
endif |
1002 |
endif |
|
1003 |
||
1004 |
endef |
|
1005 |
||
1006 |
# Create a rule for each cia file |
|
1007 |
ifeq ($(TRANSFORM_CIA),1) |
|
1008 |
$(eval $(foreach e32abiv2_RULE,$(CIAFILES),$(call e32abiv2_CIA2CPP,$(e32abiv2_RULE)))) |
|
1009 |
endif |
|
1010 |
||
1011 |
# Pure assembler (.s files) ################################ |
|
1012 |
||
1013 |
e32abiv2_asm_OPTIONS:=$(LICENSERETRY_OPTION) \ |
|
1014 |
$(CC_CORE_ARGS) \ |
|
1015 |
$(OPTION_COMPILER) \ |
|
1016 |
$(call makemacrodef,-D,$(COMPILER_INTERWORK_DEFINES) $(CDEFS)) \ |
|
1017 |
$(if $(USERINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$$(call dblquote,$(USERINCLUDE))) \ |
|
1018 |
$(if $(SYSTEMINCLUDE),$(COMPILER_SYSTEM_INCLUDE_OPTION),)$$(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$$(call dblquote,$(SYSTEMINCLUDE))) |
|
1019 |
||
1020 |
# note that the --no_rtti option cannot be passed with the -M option |
|
1021 |
# so forcibly remove it when generating ASM dependencies. |
|
1022 |
# |
|
1023 |
define e32abiv2_asm |
|
1024 |
||
1025 |
$(eval DEPENDFILENAME:=$(1).d) |
|
1026 |
$(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME))) |
|
1027 |
||
1028 |
$(1): $(2) $(PROJECT_META) $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT) |
|
1029 |
$(call startrule,asmcompile,,$(2)) \ |
|
1030 |
$(if $(PERTURBSTARTTIME),$(RANSLEEP) $(PERTURBMSECS) ;,) \ |
|
1031 |
$(CC) $(e32abiv2_asm_OPTIONS) \ |
|
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
1032 |
$(if $(NO_DEPEND_GENERATE),,$(DEPEND_OPTION) $(call dblquote,$(DEPENDFILENAME))) \ |
3 | 1033 |
$$(call dblquote, $$<) $(OUTPUT_OPTION) $$@ \ |
1034 |
$(call endrule,asmcompile) |
|
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
1035 |
ifeq ($(NO_DEPEND_GENERATE),) |
3 | 1036 |
$(call startrule,asmdependencies) \ |
1037 |
$(CC) -M $(subst --no_rtti,,$(e32abiv2_asm_OPTIONS)) --depend_format=unix \ |
|
1038 |
$(OUTPUT_OPTION) $$@ $$(call dblquote,$2) > $(call dblquote,$(DEPENDFILENAME)) \ |
|
1039 |
$(call endrule,asmdependencies) |
|
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
1040 |
endif |
3 | 1041 |
|
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
1042 |
ifeq ($(NO_DEPEND_GENERATE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
1043 |
CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
1044 |
endif |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
1045 |
|
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
1046 |
ifneq ($(DEPENDFILE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
1047 |
ifeq ($(NO_DEPEND_INCLUDE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
1048 |
ifeq ($(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS))),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
1049 |
-include $(DEPENDFILE) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
1050 |
endif |
3 | 1051 |
endif |
1052 |
endif |
|
1053 |
||
1054 |
CREATABLEPATHS:=$$(CREATABLEPATHS) $(INTERMEDIATEPATH) |
|
1055 |
||
1056 |
endef |
|
1057 |
||
1058 |
$(eval $(foreach F,$(ASMFILES), $(call e32abiv2_asm,$(call mapasm2object,$(F)),$(F)))) |
|
1059 |
CLEANTARGETS:=$(CLEANTARGETS) $(ASMFILES_LINKOBJECTS) |
|
1060 |
||
1061 |
endif # ifneq ($(TARGETTYPE),implib) |
|
1062 |
||
1063 |
||
1064 |
########################## Build ROMFILE target ############################ |
|
1065 |
EPOC_ROOT:=$(patsubst %/,%,$(EPOCROOT)) |
|
1066 |
TOBLDINF:=$(dir $(subst :,,$(subst $(EPOC_ROOT)/,,$(COMPONENT_META)))) |
|
1067 |
||
1068 |
# Only build ROMFILE if asked |
|
1069 |
ifneq ($(filter ROMFILE,$(call uppercase,$(MAKECMDGOALS))),) |
|
1070 |
ifeq ($(ROMFILE_$(call sanitise,$(TARGET).$(REQUESTEDTARGETEXT))),) |
|
1071 |
ROMFILE_$(call sanitise,$(TARGET).$(REQUESTEDTARGETEXT)):=1 |
|
1072 |
ROMDIR:=$(EPOC_ROOT)/epoc32/rom/$(TOBLDINF) |
|
1073 |
||
1074 |
# Default values |
|
1075 |
ROMFILETYPE:=file |
|
1076 |
ROMFILE:=$(TARGET).$(REQUESTEDTARGETEXT) |
|
1077 |
ROMPATH:=sys/bin/ |
|
1078 |
ROMDECORATIONS:= |
|
1079 |
ROMFILETYPE_RAM:=data |
|
1080 |
ROMFILE_RAM:=$(TARGET).$(REQUESTEDTARGETEXT) |
|
1081 |
ROMPATH_RAM:=sys/bin/ |
|
1082 |
BUILDROMTARGET:=1 |
|
1083 |
ABIDIR:=MAIN |
|
1084 |
||
1085 |
$(eval $(call DoRomSet)) |
|
1086 |
||
1087 |
ifneq ($(EPOCFIXEDPROCESS),) |
|
1088 |
ROMDECORATIONS:=$(ROMDECORATIONS) fixed |
|
1089 |
endif |
|
1090 |
ifeq ($(PAGED),1) |
|
1091 |
ROMDECORATIONS:=$(ROMDECORATIONS) paged |
|
1092 |
endif |
|
1093 |
ifeq ($(PAGED),0) |
|
1094 |
ROMDECORATIONS:=$(ROMDECORATIONS) unpaged |
|
1095 |
endif |
|
1096 |
||
1097 |
||
1098 |
ifeq ($(TESTCODE),TRUE) |
|
1099 |
# Add 'TEST' to the .iby filename |
|
1100 |
ROMTEST:=test |
|
1101 |
ifeq ($(TEST_OPTION),BOTH) |
|
1102 |
DATATEXT:="data=/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).auto.bat test/$(MODULE).auto.bat"\n"data=/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).manual.bat test/$(MODULE).manual.bat" |
|
1103 |
else |
|
1104 |
ifneq ($(TEST_OPTION),NONE) |
|
1105 |
DATATEXT:="data=/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TEST_OPTION).bat test/$(MODULE).$(TEST_OPTION).bat" |
|
1106 |
endif |
|
1107 |
endif |
|
1108 |
else |
|
1109 |
DATATEXT:= |
|
1110 |
endif |
|
1111 |
||
1112 |
# ROMTARGET |
|
1113 |
ifneq ($(ROMTARGET),) |
|
1114 |
ifneq ($(words $(ROMTARGET)),1) |
|
1115 |
ROMTARGETALL:=$(ROMTARGET) |
|
1116 |
ROMTARGET:=$(word 1,$(ROMTARGET)) |
|
1117 |
endif |
|
1118 |
||
1119 |
ifeq ($(ROMTARGET),<none>) |
|
1120 |
BUILDROMTARGET:= |
|
1121 |
else |
|
1122 |
ifneq ($(ROMTARGET),+) |
|
1123 |
ifneq ($(notdir $(ROMTARGET)),) |
|
1124 |
ROMFILE:=$(notdir $(ROMTARGET)) |
|
1125 |
endif |
|
1126 |
ifneq ($(dir $(ROMTARGET)),./) |
|
1127 |
ROMPATH:=$(dir $(ROMTARGET)) |
|
1128 |
endif |
|
1129 |
endif |
|
1130 |
endif |
|
1131 |
endif |
|
1132 |
endif |
|
1133 |
||
1134 |
ROMFILENAME:=$(ROMDIR)$(PLATFORM)$(ROMTEST).iby |
|
1135 |
||
1136 |
# RAMTARGET |
|
1137 |
ifneq ($(RAMTARGET),) |
|
1138 |
ROMDECORATIONS_RAM:=" attrib=r" |
|
1139 |
ifneq ($(RAMTARGET),+) |
|
1140 |
ifneq ($(notdir $(RAMTARGET)),) |
|
1141 |
ROMFILE_RAM:=$(notdir $(RAMTARGET)) |
|
1142 |
endif |
|
1143 |
ifneq ($(dir $(RAMTARGET)),./) |
|
1144 |
ROMPATH_RAM:=$(dir $(RAMTARGET)) |
|
1145 |
endif |
|
1146 |
endif |
|
1147 |
endif |
|
1148 |
||
1149 |
define BuildRomfileTarget |
|
1150 |
$(ALLTARGET)::ROMFILE |
|
1151 |
ROMFILE:: |
|
1152 |
$(call startrule,rombuild) \ |
|
1153 |
$(GNUMKDIR) -p $(ROMDIR) \ |
|
1154 |
$(if $(ROMFILE_CREATED_$(TOBLDINF)),,&& echo -e "// $(subst $(EPOC_ROOT)/,,$(ROMFILENAME))\n//\n$(DATATEXT)" > $(ROMFILENAME)) \ |
|
1155 |
$(if $(BUILDROMTARGET),&& echo "$(ROMFILETYPE)=/epoc32/release/##$(ABIDIR)##/##BUILD##/$(TARGET).$(REQUESTEDTARGETEXT) $(1)$(ROMDECORATIONS)" >> $(ROMFILENAME)) \ |
|
1156 |
$(if $(RAMTARGET),&& echo "$(ROMFILETYPE_RAM)=/epoc32/release/##$(ABIDIR)##/##BUILD##/$(TARGET).$(REQUESTEDTARGETEXT) $(ROMPATH_RAM)$(ROMFILE_RAM)$(ROMDECORATIONS_RAM)" >> $(ROMFILENAME)) \ |
|
1157 |
$(call endrule,buildromfiletarget) |
|
1158 |
endef |
|
1159 |
||
1160 |
# When VARIANTTYPE changes, romfile is finished, |
|
1161 |
# apart from if this is a new component...... |
|
1162 |
ifneq ($(PREVIOUSVARIANTTYPE),) |
|
1163 |
ifneq ($(VARIANTTYPE),$(PREVIOUSVARIANTTYPE)) |
|
1164 |
ifneq ($(ROMFILE_CREATED_$(TOBLDINF)),) |
|
1165 |
ROMFILEFINISHED:=1 |
|
1166 |
else |
|
1167 |
ROMFILEFINISHED:= |
|
1168 |
endif |
|
1169 |
endif |
|
1170 |
endif |
|
1171 |
||
1172 |
# When romfile is finished, don't continue to add to it |
|
1173 |
ifeq ($(ROMFILEFINISHED),) |
|
1174 |
$(eval $(call BuildRomfileTarget,$(ROMPATH)$(ROMFILE))) |
|
1175 |
endif |
|
1176 |
||
1177 |
# Don't allow romfile to be recreated for every MMP |
|
1178 |
ifeq ($(ROMFILE_CREATED_$(TOBLDINF)),) |
|
1179 |
ROMFILE_CREATED_$(TOBLDINF):=1 |
|
1180 |
endif |
|
1181 |
||
1182 |
# Build other ROMTARGETs if there is more than one |
|
1183 |
ifneq ($(ROMTARGETALL),) |
|
1184 |
RAMTARGET:= |
|
1185 |
$(foreach ROMTARGET,$(wordlist 2,$(words $(ROMTARGETALL)),$(ROMTARGETALL)),$(eval $(call BuildRomfileTarget,$(ROMTARGET)))) |
|
1186 |
ROMTARGETALL:= |
|
1187 |
endif |
|
1188 |
||
1189 |
# Keep track of variant type while romfile is being created |
|
1190 |
PREVIOUSVARIANTTYPE:=$(VARIANTTYPE) |
|
1191 |
||
1192 |
WHATRELEASE:=$(WHATRELEASE) $(ROMFILENAME) |
|
1193 |
endif |
|
1194 |
||
1195 |
# Deal with test code batch files generation. |
|
1196 |
ifneq ($(TESTPATH),) |
|
1197 |
||
1198 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(EPOCROOT)/epoc32/data/z/test/ |
|
1199 |
$(eval $(call MakeTestBatchFiles,$(TARGET),$(EPOCROOT)/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH))) |
|
1200 |
BATCHFILE_CREATED_$(EPOCROOT)/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH):=1 |
|
1201 |
TARGET_CREATED_$(EPOCROOT)/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH)_$(TARGET):=1 |
|
1202 |
WHATRELEASE:=$(WHATRELEASE) $(EPOCROOT)/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH) |
|
1203 |
endif |
|
1204 |
||
1205 |
###################### End of Build ROMFILE target ###################### |
|
1206 |
||
1207 |
# Feature Variation requires a .vmap file to be created for each binary |
|
1208 |
# |
|
1209 |
ifneq ($(FEATUREVARIANTNAME),) |
|
1210 |
ifneq ($(E32TARGET),) |
|
1211 |
||
1212 |
OUTPUTVMAP:=$(E32TARGET).vmap |
|
1213 |
WHATRELEASE:=$(WHATRELEASE) $(OUPUTVMAP) |
|
1214 |
||
1215 |
TARGET:: $(OUTPUTVMAP) |
|
1216 |
VMAPNEEDS:=$(E32TARGET) $(SOURCE) $(PROJECT_META) |
|
1217 |
||
1218 |
BV_SOURCELIST:=$(addprefix -s ,$(SOURCE) $(PROJECT_META)) |
|
1219 |
BV_FEATURELIST:=$(addprefix -f ,$(FEATURELISTFILES)) |
|
1220 |
BV_USER_INCLUDES:=$(addprefix -u ,$(USERINCLUDE)) |
|
1221 |
BV_SYSTEM_INCLUDES:=$(addprefix -x ,$(SYSTEMINCLUDE)) |
|
1222 |
||
1223 |
# translate double quoted macros because $(shell) messes them up in some make engines |
|
1224 |
BV_MACROLIST:=$(COMPILER_INTERWORK_DEFINES) $(CDEFS) $(if $(ALWAYS_BUILD_AS_ARM),,$(COMPILER_THUMB_DEFINES)) |
|
1225 |
BV_DEFINES:=$(call makemacrodef,-D,$(subst ",__SBS__QUOTE__,$(BV_MACROLIST))) |
|
1226 |
||
1227 |
# the script to generate our .vmap file and hash value |
|
1228 |
VMAPCOMMAND:=$(CREATEVMAP) -o $(OUTPUTVMAP) $(BV_FEATURELIST) $(BV_DEFINES) -p $(PREINCLUDE) $(BV_SOURCELIST) $(BV_USER_INCLUDES) $(BV_SYSTEM_INCLUDES) -c $(CREATEVMAPCPP) |
|
1229 |
||
1230 |
# a recipe to create the .vmap from the "sources" with the createvmap script |
|
1231 |
$(call raptor_recipe,createvmap,$(OUTPUTVMAP),$(VMAPNEEDS),$(VMAPCOMMAND)) |
|
1232 |
||
1233 |
endif # E32TARGET != "" |
|
1234 |
endif # FEATUREVARIANTNAME != "" |
|
1235 |
||
1236 |
########################### CONCLUSION ################################### |
|
1237 |
||
1238 |
# make the output directories while reading makefile - some build engines prefer this |
|
1239 |
$(call makepath,$(CREATABLEPATHS)) |
|
1240 |
||
1241 |
## Clean up |
|
5 | 1242 |
$(call raptor_clean,$(CLEANTARGETS)) |
3 | 1243 |
|
5 | 1244 |
# For the --what option and the log file |
1245 |
$(call raptor_release,$(filter-out %.sym,$(WHATRELEASE))) |
|
3 | 1246 |
|
1247 |
endif # FEATUREVARIANTNAME=="" or FEATUREVARIANT==1 |
|
1248 |
||
1249 |
## The End |
|
1250 |