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