author | yiluzhu |
Wed, 26 May 2010 10:25:38 +0100 | |
branch | fix |
changeset 572 | c1583702caf5 |
parent 562 | 50c238674c4b |
child 612 | 72ff9b952200 |
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 |
|
483
941b2742ee49
Fix a copyright date. Make sure all FLMBDEBUG usage is wrapped in <debug> tags.
timothy.murphy@nokia.com
parents:
412
diff
changeset
|
51 |
$(if $(FLMDEBUG),$(info <debug><flm name='e32abiv2' target='$(TARGET)' type='$(TARGETTYPE)' outputpath='$(OUTPUTPATH)' metasource='$(METASOURCE)' postlinkfiletype='$(POSTLINKFILETYPE)' /></debug>)) |
3 | 52 |
|
447
e95d56493ef6
Apply missed review comment change.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
446
diff
changeset
|
53 |
# Enable DELETE_ON_FAILED_COMPILE work around for failed RVCT 2.2 compiles |
e95d56493ef6
Apply missed review comment change.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
446
diff
changeset
|
54 |
ifneq ($(DELETE_ON_FAILED_COMPILE),) |
e95d56493ef6
Apply missed review comment change.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
446
diff
changeset
|
55 |
RVCT22_DELETE_WORKAROUND:=|| { $$(GNURM) $$@; exit 1; } |
e95d56493ef6
Apply missed review comment change.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
446
diff
changeset
|
56 |
endif # ifneq ($(DELETE_ON_FAILED_COMPILE),) |
e95d56493ef6
Apply missed review comment change.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
446
diff
changeset
|
57 |
|
3 | 58 |
# Strip switch-type parameters |
59 |
# |
|
60 |
POSTLINKTARGETTYPE:=$(strip $(POSTLINKTARGETTYPE)) |
|
516
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
61 |
TARGETEXT:=$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE)) |
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
62 |
|
3 | 63 |
UID1:=$(strip $(UID1)) |
64 |
UID2:=$(strip $(UID2)) |
|
65 |
UID3:=$(strip $(UID3)) |
|
66 |
SID:=$(strip $(SECUREID)) |
|
67 |
VENDORID:=$(strip $(VENDORID)) |
|
68 |
AUTOEXPORTS:=$(strip $(AUTOEXPORTS)) |
|
69 |
DEFFILE:=$(strip $(DEFFILE)) |
|
70 |
IMPORTLIBRARYREQUIRED:=$(strip $(IMPORTLIBRARYREQUIRED)) |
|
71 |
EPOCALLOWDLLDATA:=$(strip $(EPOCALLOWDLLDATA)) |
|
72 |
PAGED:=$(strip $(PAGED)) |
|
73 |
||
74 |
# the output directories |
|
75 |
VARIANTPLATFORM:=$(VARIANTPLATFORM)$(FEATUREVARIANTNAME) |
|
76 |
RELEASABLEPATH:=$(RELEASEPATH)/$(VARIANTPLATFORM)/$(VARIANTTYPE) |
|
77 |
INTERMEDIATEPATH:=$(OUTPUTPATH)/$(VARIANTPLATFORM)/$(VARIANTTYPE) |
|
78 |
INTERMEDIATE_PLATFORM_PATH:=$(OUTPUTPATH)/$(VARIANTPLATFORM) |
|
79 |
TRACE_MARKER_PATH:=$(OUTPUTPATH) |
|
80 |
IMPORTLIBPATH:=$(RUNTIME_LIBS_PATH) |
|
81 |
||
82 |
# LOCALLY USED VARIABLES |
|
83 |
CLEANTARGETS:= |
|
84 |
WHATRELEASE:= |
|
85 |
||
86 |
# Work out which new/delete library to use for binaries. |
|
87 |
CHECKLIB_TYPE:=symc++ |
|
88 |
STDCPPTAGFILE:= |
|
89 |
ifeq ($(NOSTDCPP),1) |
|
90 |
ifeq ($(STDCPP),1) |
|
91 |
$(info <warning>STDCPP and NOSTDCPP both specified in $(PROJECT_META)</warning>) |
|
92 |
else |
|
93 |
ifeq ($(HAS_DEDICATED_OP_NEWDEL_LIB),1) |
|
94 |
DEFAULT_NEWLIB:=$(DEFAULT_SYMBIAN_NEWLIB) |
|
95 |
endif |
|
96 |
endif |
|
97 |
else |
|
98 |
ifeq ($(STDCPP),1) |
|
99 |
CDEFS:=$(CDEFS) __SYMBIAN_STDCPP_SUPPORT__ |
|
100 |
ifneq ($(SUPPORTS_STDCPP_NEWLIB),) |
|
101 |
ifeq ($(HAS_DEDICATED_OP_NEWDEL_LIB),1) |
|
102 |
DEFAULT_NEWLIB:=$(DEFAULT_STDCPP_NEWLIB) |
|
103 |
endif |
|
104 |
CHECKLIB_TYPE:=stdc++ |
|
105 |
STDCPPTAGFILE:=$(EPOCROOT)/epoc32/tools/tag/tag_elf |
|
106 |
endif |
|
107 |
endif |
|
108 |
endif |
|
109 |
||
110 |
# If NEWLIB is specified in the MMP file, it overrides all the past stuff. |
|
111 |
ifeq ($(NEWLIB),) |
|
112 |
NEWLIB:=$(DEFAULT_NEWLIB) |
|
113 |
endif |
|
114 |
||
115 |
||
116 |
########################################################################## |
|
117 |
## OUTPUTS - externally relevant targets that this FLM generates |
|
118 |
||
119 |
||
120 |
ifeq ($(EXPORTLIBRARY),) |
|
121 |
EXPORTLIBRARY:=$(TARGET) |
|
122 |
endif |
|
123 |
||
124 |
# This will insert the file version between the name and the extension. |
|
125 |
# If there is more than one dot in generated filename the inserted position will be |
|
126 |
# BEFORE the last but two dot. E.g name1.name2.name3.dll to name1.name2{version}.name3.dll |
|
127 |
LIBEXT:=$(lastword $(subst .,$(CHAR_SPACE) ,$(EXPORTLIBRARY))) |
|
128 |
LIBBASE:=$(patsubst %.$(LIBEXT),%,$(EXPORTLIBRARY)) |
|
129 |
ifneq ($(findstring .,$(EXPORTLIBRARY)),) |
|
130 |
# Please note $(EXPORTLIBRARY) doesn't include target type. |
|
131 |
VER_E32IMPORTLIBBASE:=$(IMPORTLIBPATH)/$(LIBBASE){$(VERSIONHEX)}.$(LIBEXT) |
|
132 |
else |
|
133 |
VER_E32IMPORTLIBBASE:=$(IMPORTLIBPATH)/$(EXPORTLIBRARY){$(VERSIONHEX)} |
|
134 |
endif |
|
135 |
||
136 |
# Postlinkable targets need to be linked and elf2e32'd |
|
137 |
ifneq ($(DOPOSTLINK),) |
|
516
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
138 |
E32TARGET:=$(RELEASABLEPATH)/$(TARGET)$(if $(EXPLICITVERSION),{$(VERSIONHEX)},).$(TARGETEXT) |
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
139 |
LINK_TARGET:=$(RELEASABLEPATH)/$(TARGET)$(if $(EXPLICITVERSION),{$(VERSIONHEX)},).$(TARGETEXT).sym |
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
140 |
MAPFILE:=$(RELEASABLEPATH)/$(TARGET).$(TARGETEXT).map |
3 | 141 |
else |
142 |
E32TARGET:= |
|
143 |
LINK_TARGET:= |
|
144 |
MAPFILE:= |
|
145 |
endif |
|
146 |
||
147 |
# libs and klibs, on the other hand need to be archived |
|
148 |
ifneq ($(call isoneof,$(TARGETTYPE),lib klib stdlib),) |
|
149 |
ARTARGET:=$(RELEASABLEPATH)/$(TARGET).lib |
|
150 |
# We need libs and klibs before we can link stuff with them: |
|
151 |
LIBRARY:: $(ARTARGET) |
|
152 |
else |
|
153 |
ARTARGET:= |
|
154 |
endif |
|
155 |
||
156 |
||
157 |
ifneq ($(IMPORTLIBRARYREQUIRED),) # no dso files for plugins, animation dlls etc |
|
158 |
# make sure we don't build import libraries more than once for UDEB and UREL |
|
159 |
# Without this, wierd target-specific variable problems happen with LIBRARY in particular |
|
160 |
||
161 |
TMP_IMPORTLIBTARGET_ROOT:=$(IMPORTLIBPATH)/$(EXPORTLIBRARY) |
|
162 |
||
163 |
# ABIv2 .dso |
|
164 |
IMPORTLIBTARGET_DSO:= |
|
165 |
IMPORTLIBTARGETVERSIONED_DSO:= |
|
166 |
||
167 |
BUILDMARKER_IMPORTLIBTARGET_DSO:=TARGET_$(subst :,,$(VER_E32IMPORTLIBBASE)).dso |
|
168 |
WHATRELEASE:=$(WHATRELEASE) $(if $(EXPLICITVERSION),,$(TMP_IMPORTLIBTARGET_ROOT).dso) |
|
169 |
WHATRELEASE:=$(WHATRELEASE) $(VER_E32IMPORTLIBBASE).dso |
|
170 |
ifeq ($($(BUILDMARKER_IMPORTLIBTARGET_DSO)),) |
|
171 |
IMPORTLIBTARGET_DSO:=$(TMP_IMPORTLIBTARGET_ROOT).dso |
|
172 |
IMPORTLIBTARGETVERSIONED_DSO:=$(VER_E32IMPORTLIBBASE).dso |
|
173 |
endif |
|
174 |
||
505
ed08f3d1e6b9
make ABIv1 implib support a kit property
Richard Taylor <richard.i.taylor@nokia.com>
parents:
457
diff
changeset
|
175 |
# ABIv1 .lib (for specific kits and toolchains only) |
3 | 176 |
IMPORTLIBTARGET_LIB:= |
177 |
IMPORTLIBTARGETVERSIONED_LIB:= |
|
178 |
BUILDMARKER_IMPORTLIBTARGET_LIB:=TARGET_$(subst :,,$(VER_E32IMPORTLIBBASE)).lib |
|
505
ed08f3d1e6b9
make ABIv1 implib support a kit property
Richard Taylor <richard.i.taylor@nokia.com>
parents:
457
diff
changeset
|
179 |
# Only for kits that require and tools that support them |
ed08f3d1e6b9
make ABIv1 implib support a kit property
Richard Taylor <richard.i.taylor@nokia.com>
parents:
457
diff
changeset
|
180 |
ifneq ($(SUPPORTS_ABIV1_IMPLIBS),) |
3 | 181 |
WHATRELEASE:=$(WHATRELEASE) $(if $(EXPLICITVERSION),,$(TMP_IMPORTLIBTARGET_ROOT).lib) |
182 |
WHATRELEASE:=$(WHATRELEASE) $(VER_E32IMPORTLIBBASE).lib |
|
183 |
ifeq ($($(BUILDMARKER_IMPORTLIBTARGET_LIB)),) |
|
184 |
IMPORTLIBTARGET_LIB:=$(TMP_IMPORTLIBTARGET_ROOT).lib |
|
185 |
IMPORTLIBTARGETVERSIONED_LIB:=$(VER_E32IMPORTLIBBASE).lib |
|
186 |
endif |
|
187 |
endif |
|
188 |
endif |
|
189 |
||
190 |
# Try to make sure that we get the right linkas name |
|
191 |
# If linkas is specified then split it up and |
|
192 |
# put the hex version number in the right place |
|
193 |
ifeq ($(LINKAS),) |
|
194 |
LINKASNAME=$(TARGET) |
|
516
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
195 |
LINKASTYPE=$(TARGETEXT) |
3 | 196 |
else |
197 |
SPLIT_LINKAS=$(subst ., ,$(LINKAS)) |
|
198 |
LINKASNAME=$(word 1,$(SPLIT_LINKAS)) |
|
199 |
LINKASTYPE=$(word 2,$(SPLIT_LINKAS)) |
|
200 |
endif |
|
201 |
||
202 |
# ignore UID3 if it is zero |
|
203 |
ifeq ($(UID3),00000000) |
|
204 |
LINKASVERSIONED=$(LINKASNAME){$(VERSIONHEX)}.$(LINKASTYPE) |
|
205 |
else |
|
206 |
LINKASVERSIONED=$(LINKASNAME){$(VERSIONHEX)}$(if $(UID3),[$(UID3)],).$(LINKASTYPE) |
|
207 |
endif |
|
208 |
||
209 |
########################################################################## |
|
210 |
## TARGET GROUPS ## |
|
211 |
RELEASABLES:=$(strip $(E32TARGET) $(ARTARGET) $(LINK_TARGET) $(MAPFILE)) |
|
212 |
# More targets to be added later |
|
213 |
TARGETS:=$(strip $(E32TARGET) $(IMPORTLIBTARGET) $(LINK_TARGET) $(ARTARGET)) |
|
214 |
||
215 |
CREATABLEPATHS:=$(OUTPUTPATH) |
|
216 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(INTERMEDIATE_PLATFORM_PATH) |
|
217 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(INTERMEDIATEPATH) |
|
218 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(RELEASABLEPATH) |
|
219 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(RUNTIME_LIBS_PATH) |
|
220 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(IMPORTLIBPATH) |
|
221 |
WHATRELEASE:=$(WHATRELEASE) $(RELEASABLES) |
|
222 |
||
223 |
||
224 |
||
225 |
## HIGH LEVEL Targets ## |
|
226 |
.PHONY:: $(ALLTARGET) |
|
227 |
||
228 |
## GLOBAL TARGETS ############################################################ |
|
229 |
$(ALLTARGET):: $(RELEASABLES) |
|
230 |
TARGET:: $(RELEASABLES) |
|
231 |
||
232 |
## Internal targets ## |
|
233 |
||
234 |
# Determine the name of the generated DSO file ############################### |
|
235 |
# This is to generate the dso with the Some{Versionhex}.file.dso |
|
236 |
# It reproduces what appears to be a problem in the current build system |
|
237 |
# that affects messageintercept{000a0000}.esockdebug.dso whose |
|
238 |
# filename differs from it's "linkas" name. |
|
239 |
E32VAR:=$(subst .,$(CHAR_SPACE) ,$(TARGET)) |
|
240 |
E32SOME:=$(word 1,$(E32VAR)) |
|
241 |
E32VAR2:=$(patsubst $(E32SOME).%,%,$(TARGET)) |
|
242 |
||
243 |
# Separate '_SH' variables created for output into bash - Preserves '{' and '}' |
|
244 |
||
245 |
ifneq ($(findstring .,$(TARGET)),) |
|
246 |
DSODEFFILENAMEBASE:=$(E32SOME){$(VERSIONHEX)}.$(E32VAR2) |
|
247 |
else |
|
248 |
DSODEFFILENAMEBASE:=$(TARGET){$(VERSIONHEX)} |
|
249 |
endif |
|
250 |
GENERATED_DSO:=$(call dblquote,$(INTERMEDIATEPATH)/$(DSODEFFILENAMEBASE).dso) |
|
251 |
GENERATED_DEFFILE:=$(INTERMEDIATEPATH)/$(DSODEFFILENAMEBASE).def |
|
252 |
||
253 |
## IMPORT LIBRARY ########################################################### |
|
254 |
||
255 |
# Static libraries will be postlinked when they are used so don't try to postlink them |
|
256 |
||
257 |
ifneq ($(IMPORTLIBRARYREQUIRED),) |
|
258 |
ifneq ($(or $(DEFFILE),$(EXPORTUNFROZEN)),) |
|
259 |
# Both ABIv2 .dso and ABIv1 .lib import library generation require a processed .def file, |
|
260 |
# unless EXPORTUNFROZEN is being used |
|
261 |
PREPPEDDEFFILE:= |
|
262 |
ifneq ($(DEFFILE),) |
|
263 |
ifeq ($(EXPORTUNFROZEN),) |
|
264 |
PREPPEDDEFFILE:=$(INTERMEDIATEPATH)/$(TARGET).prep |
|
265 |
CLEANTARGETS:=$(CLEANTARGETS) $(PREPPEDDEFFILE) |
|
266 |
define importlibtarget_prepfile |
|
267 |
$(PREPPEDDEFFILE): $(DEFFILE) |
|
268 |
$(call startrule,importlibtarget_prepfile,FORCESUCCESS) \ |
|
269 |
$(PREPDEF) $(call dblquote,$(DEFFILE)) $(call dblquote,$(PREPPEDDEFFILE)) \ |
|
270 |
$(call endrule,importlibtarget_prepfile) |
|
271 |
endef |
|
272 |
$(eval $(importlibtarget_prepfile)) |
|
273 |
endif |
|
274 |
endif |
|
275 |
||
276 |
# ABIv2 .dso |
|
277 |
ifneq ($(IMPORTLIBTARGET_DSO),) # check that we haven't tried to specify this target already |
|
278 |
||
26
96670e6a4bfd
Try to cope with the iscapi implib problem.
timothy.murphy@nokia.com
parents:
9
diff
changeset
|
279 |
# 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
|
280 |
# 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
|
281 |
$(eval $(BUILDMARKER_IMPORTLIBTARGET_DSO):=1) |
96670e6a4bfd
Try to cope with the iscapi implib problem.
timothy.murphy@nokia.com
parents:
9
diff
changeset
|
282 |
|
3 | 283 |
ifneq ($(EXPLICITVERSION),) |
284 |
TARGETS:=$(strip $(TARGETS) $(IMPORTLIBTARGETVERSIONED_DSO)) |
|
285 |
||
286 |
# Add this importlibrary to our global targets |
|
287 |
LIBRARY:: $(IMPORTLIBTARGETVERSIONED_DSO) |
|
288 |
$(ALLTARGET):: $(IMPORTLIBTARGETVERSIONED_DSO) |
|
289 |
TARGET:: $(IMPORTLIBTARGETVERSIONED_DSO) |
|
290 |
||
291 |
else |
|
292 |
TARGETS:=$(strip $(TARGETS) $(IMPORTLIBTARGETVERSIONED_DSO) $(IMPORTLIBTARGET_DSO)) |
|
293 |
||
294 |
# Add this importlibrary to our global targets |
|
295 |
LIBRARY:: $(IMPORTLIBTARGET_DSO) |
|
296 |
$(ALLTARGET):: $(IMPORTLIBTARGETVERSIONED_DSO) $(IMPORTLIBTARGET_DSO) |
|
297 |
TARGET:: $(IMPORTLIBTARGETVERSIONED_DSO) $(IMPORTLIBTARGET_DSO) |
|
298 |
||
299 |
||
300 |
endif |
|
301 |
||
302 |
||
303 |
||
304 |
ifneq ($(EXPORTUNFROZEN),) # Unfrozen - warn and create .dso as side-effect of the final postlink |
|
305 |
$(info <warning project='$(PROJECT_META)' component='$(COMPONENT_META)'>EXPORTUNFROZEN present in $(PROJECT_META) - unfrozen exports will be represented in import library.</warning> ) |
|
306 |
define importlibtarget_unfrozen |
|
307 |
$(IMPORTLIBTARGET_DSO): $(IMPORTLIBTARGETVERSIONED_DSO) |
|
308 |
$(call startrule,importlibtarget_unfrozen,FORCESUCCESS) \ |
|
309 |
$(GNUCP) $$(call dblquote,$$<) $$(call dblquote,$$@) \ |
|
310 |
$(call endrule,importlibtarget_unfrozen) |
|
311 |
endef |
|
312 |
||
313 |
define importlibtarget_unfrozen_ver |
|
314 |
$(IMPORTLIBTARGETVERSIONED_DSO): $(E32TARGET) |
|
315 |
$(call startrule,importlibversioned_unfrozen,FORCESUCCESS) \ |
|
316 |
$(GNUCP) "$(GENERATED_DSO)" "$$@" \ |
|
317 |
$(call endrule,importlibversioned_unfrozen) |
|
318 |
endef |
|
319 |
||
320 |
ifeq ($(EXPLICITVERSION),) |
|
321 |
# Generate the general dso if we aren't |
|
322 |
# being asked to make just the specific version. |
|
323 |
$(eval $(importlibtarget_unfrozen)) |
|
324 |
endif |
|
325 |
||
326 |
$(eval $(importlibtarget_unfrozen_ver)) |
|
327 |
else |
|
328 |
ifneq ($(DEFFILE),) # Frozen - use the def file and create .dso directly |
|
329 |
define importlibtarget_func |
|
330 |
$(IMPORTLIBTARGET_DSO): $(IMPORTLIBTARGETVERSIONED_DSO) |
|
331 |
$(call startrule,importlibtarget,FORCESUCCESS) \ |
|
332 |
$(GNUCP) "$$<" "$$@" \ |
|
333 |
$(call endrule,importlibtarget) |
|
334 |
endef |
|
335 |
||
336 |
ifeq ($(EXPLICITVERSION),) |
|
337 |
# Generate the general dso if we aren't |
|
338 |
# being asked to make just the specific version. |
|
339 |
$(eval $(importlibtarget_func)) |
|
340 |
endif |
|
341 |
||
342 |
define importlibtargetversioned_func |
|
343 |
$(IMPORTLIBTARGETVERSIONED_DSO): $(ELF2E32) $(PREPPEDDEFFILE) |
|
344 |
$(call startrule,importlibversioned,FORCESUCCESS) \ |
|
345 |
$(ELF2E32) --sid=0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) --version=$(VERSION) \ |
|
346 |
--definput="$(PREPPEDDEFFILE)" \ |
|
347 |
--dso=$$(call dblquote,$$@) \ |
|
348 |
--linkas=$(call dblquote,$(LINKASVERSIONED)) \ |
|
349 |
$(call endrule,importlibversioned) |
|
350 |
endef |
|
351 |
$(eval $(importlibtargetversioned_func)) |
|
352 |
endif # ifneq ($(DEFFILE),) |
|
353 |
endif # ifneq ($(EXPORTUNFROZEN),) |
|
354 |
endif # ifneq ($(IMPORTLIBTARGET_DSO),) |
|
355 |
||
356 |
# ABIv1 .lib |
|
357 |
ifneq ($(IMPORTLIBTARGETVERSIONED_LIB),) # check that we haven't tried to specify this target already |
|
358 |
||
26
96670e6a4bfd
Try to cope with the iscapi implib problem.
timothy.murphy@nokia.com
parents:
9
diff
changeset
|
359 |
# 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
|
360 |
# 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
|
361 |
$(eval $(BUILDMARKER_IMPORTLIBTARGET_LIB):=1) |
96670e6a4bfd
Try to cope with the iscapi implib problem.
timothy.murphy@nokia.com
parents:
9
diff
changeset
|
362 |
|
3 | 363 |
define abiv1_generatelib |
364 |
||
365 |
ifeq ($(EXPLICITVERSION),) |
|
366 |
LIBRARY:: $(IMPORTLIBTARGETVERSIONED_LIB) $(IMPORTLIBTARGET_LIB) |
|
367 |
||
368 |
else |
|
369 |
LIBRARY:: $(IMPORTLIBTARGETVERSIONED_LIB) |
|
370 |
||
371 |
endif |
|
372 |
||
373 |
# If frozen, a prepped .def file is used as the basis for .lib creation |
|
374 |
# If unfrozen, .lib files are based on the .def file generated by the final postlink |
|
375 |
$(IMPORTLIBTARGETVERSIONED_LIB): $(if $(EXPORTUNFROZEN),$(E32TARGET),$(PREPPEDDEFFILE)) |
|
376 |
$(call startrule,importlibversioned_abiv1) \ |
|
377 |
if [ -f "$(EPOCROOT)/epoc32/tools/def2dll.pl" -a -f "$(if $(EXPORTUNFROZEN),$(call dblquote,$(GENERATED_DEFFILE)),$(PREPPEDDEFFILE))" ]; then \ |
|
378 |
$(PERL) $(EPOCROOT)/epoc32/tools/def2dll.pl \ |
|
379 |
--path=$(IMPORTLIBPATH) \ |
|
380 |
--bldpath=$(INTERMEDIATEPATH) \ |
|
381 |
--import=$(notdir $(basename $(IMPORTLIBTARGETVERSIONED_LIB))) \ |
|
382 |
--deffile="$(if $(EXPORTUNFROZEN),$(call dblquote,$(GENERATED_DEFFILE)),$(PREPPEDDEFFILE))" \ |
|
383 |
--linkAs=$(call dblquote,$(LINKASVERSIONED)) \ |
|
384 |
--inter ; fi \ |
|
385 |
$(call endrule,importlibversioned_abiv1) |
|
386 |
||
387 |
ifeq ($(EXPLICITVERSION),) |
|
388 |
$(IMPORTLIBTARGET_LIB): $(IMPORTLIBTARGETVERSIONED_LIB) |
|
389 |
$(call startrule,importlibtarget_abiv1) \ |
|
390 |
if [ -f $(EPOCROOT)/epoc32/tools/def2dll.pl ]; then $(GNUCP) "$$<" "$$@" ; fi \ |
|
391 |
$(call endrule,importlibtarget_abiv1) |
|
392 |
endif |
|
393 |
endef |
|
394 |
||
395 |
$(eval $(abiv1_generatelib)) |
|
396 |
endif # ifneq ($(IMPORTLIBTARGET_LIB),) |
|
397 |
endif # ($(or $(DEFFILE),$(EXPORTUNFROZEN)),) |
|
398 |
endif # ifneq ($(IMPORTLIBRARYREQUIRED),) |
|
399 |
||
400 |
||
401 |
## POSTLINK ################################################################## |
|
402 |
||
403 |
# Set up the name of the exports file if this is a customdll |
|
404 |
EXPTARGET:= |
|
405 |
ifneq ($(DOPOSTLINK),) |
|
406 |
ifneq ($(and $(or $(STATICLIBRARY),$(ARMLIBS),$(ARMRT)),$(DEFFILE)),) |
|
407 |
EXPTARGET:=$(INTERMEDIATE_PLATFORM_PATH)/$(notdir $(VER_E32IMPORTLIBBASE)).exp |
|
408 |
endif |
|
409 |
endif |
|
410 |
||
411 |
# Generating the import library is enough if TARGETTYPE=implib ############# |
|
412 |
||
413 |
ifneq ($(DOPOSTLINK),) |
|
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
414 |
# 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
|
415 |
FINAL_CAPABILITIES:=$(if $(CAPABILITY),$(CAPABILITY),NONE) |
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
416 |
|
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
417 |
# Paging options for the old postlinker |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
418 |
POSTLINKER_PAGEDOPTION:=--defaultpaged |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
419 |
ifeq ($(PAGED),1) |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
420 |
POSTLINKER_PAGEDOPTION:=--paged |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
421 |
endif |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
422 |
ifeq ($(PAGED),0) |
102
80785a1bc266
single character fix for --unpaged
Richard Taylor <richard.i.taylor@nokia.com>
parents:
75
diff
changeset
|
423 |
POSTLINKER_PAGEDOPTION:=--unpaged |
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
424 |
endif |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
425 |
|
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
426 |
CLEANTARGETS:=$(CLEANTARGETS) $(E32TARGET) |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
427 |
CLEANTARGETS:=$(CLEANTARGETS) $(GENERATED_DEFFILE) |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
428 |
CLEANTARGETS:=$(CLEANTARGETS) $(GENERATED_DSO) |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
429 |
|
3 | 430 |
endif # ifneq ($(DOPOSTLINK),) |
431 |
||
432 |
ifneq ($(TARGETTYPE),implib) |
|
433 |
||
434 |
## CUSTOM DLLS ############################################################### |
|
435 |
# exp file |
|
436 |
# |
|
437 |
# This tends to help getting exported objects |
|
438 |
# out of the arm libs and into custom dlls. |
|
439 |
||
440 |
ifneq ($(EXPTARGET),) |
|
441 |
ifeq ($(TARGET_$(EXPTARGET)),) |
|
442 |
# We only need one of these exptargets for UDEB and UREL |
|
443 |
TARGET_$(EXPTARGET):=1 |
|
444 |
||
445 |
EXPTARGETASMFILE:=$(INTERMEDIATE_PLATFORM_PATH)/$(notdir $(VER_E32IMPORTLIBBASE)).s |
|
446 |
||
447 |
define e32expgen_func |
|
448 |
$(EXPTARGET): $(DEFFILE) $(ELF2E32) |
|
449 |
$(call startrule,expgen) \ |
|
450 |
$(ELF2E32) \ |
|
451 |
--definput=$$(call dblquote,$(DEFFILE)) \ |
|
452 |
--dump=a \ |
|
453 |
--output=$(call dblquote,$(EXPTARGETASMFILE)) && \ |
|
454 |
$(ASM) $(TARGET_ARCH_OPTION) $(AAPCS_OPTION) $(ASM_OUTPUT_OPTION) $$(call dblquote, $$@) $(EXPTARGETASMFILE) \ |
|
455 |
$(call endrule,expgen) |
|
456 |
endef |
|
457 |
||
458 |
$(eval $(e32expgen_func)) |
|
459 |
CLEANTARGETS:=$(CLEANTARGETS) $(EXPTARGET) $(EXPTARGETASMFILE) |
|
460 |
endif |
|
461 |
endif |
|
462 |
||
463 |
||
464 |
||
465 |
||
466 |
## SOURCE FILES ############################################################## |
|
467 |
||
468 |
# Source files can be either C++ files (.cpp) or Assmbler-in-C++ files (.cia) |
|
469 |
# We have to split the two because they have the same link stage, the compile |
|
470 |
# stage is different for each. |
|
471 |
||
472 |
CPPFILEEXTENSIONS:=.cpp .CPP .Cpp .CPp .CpP .cPP .cpP .cPp .cc .CC \ |
|
473 |
.Cc .c++ .C++ .cxx .CXX .Cxx .cXx .CxX .CXx .cC .cXX .cxX |
|
474 |
CFILEEXTENSIONS:=.c .C |
|
475 |
CIAFILEEXTENSIONS:=.CIA .cia .Cia .cIa .cIA .ciA .CIa .CiA |
|
476 |
ASMFILEEXTENSIONS:=.s .S |
|
477 |
||
478 |
||
479 |
# Extract the CPP files from our sources |
|
480 |
CPPFILES:=$(call extractfilesoftype,$(CPPFILEEXTENSIONS),$(SOURCE)) |
|
481 |
CFILES:=$(call extractfilesoftype,$(CFILEEXTENSIONS),$(SOURCE)) |
|
482 |
ASMFILES:=$(call extractfilesoftype,$(ASMFILEEXTENSIONS),$(SOURCE)) |
|
483 |
||
484 |
# Find out what assember-in-c files there are |
|
485 |
# If appropriate, work out what CPP files will be created from the assembler files |
|
486 |
CIAFILES:=$(call extractfilesoftype,$(CIAFILEEXTENSIONS),$(SOURCE)) |
|
487 |
CIA_CPPFILES:= |
|
488 |
ifeq ($(TRANSFORM_CIA),1) |
|
489 |
CIA_CPPFILES:=$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CIAFILEEXTENSIONS),_.cpp,$(CIAFILES))) |
|
490 |
else |
|
491 |
||
492 |
endif |
|
493 |
||
494 |
## LINK ###################################################################### |
|
495 |
# Bring together all the .o files compiled from .cpp, .c, .s and .cia files. |
|
496 |
# These files are stored in the "non-releasable" output diretory. |
|
497 |
||
498 |
define mapcpp2object |
|
499 |
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CPPFILEEXTENSIONS),.o,$1)) |
|
500 |
endef |
|
501 |
||
502 |
define mapc2object |
|
503 |
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CFILEEXTENSIONS),.o,$1)) |
|
504 |
endef |
|
505 |
||
506 |
define mapasm2object |
|
507 |
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(ASMFILEEXTENSIONS),.o,$1)) |
|
508 |
endef |
|
509 |
||
510 |
define mapcia2object |
|
511 |
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CIAFILEEXTENSIONS),_.o,$1)) |
|
512 |
endef |
|
513 |
||
514 |
# Determine what object files will be linked by using the source files. |
|
515 |
CPPFILES_LINKOBJECTS:=$(call mapcpp2object,$(CPPFILES)) |
|
516 |
CFILES_LINKOBJECTS:=$(call mapc2object,$(CFILES)) |
|
517 |
ifeq ($(TRANSFORM_CIA),1) |
|
518 |
CIAFILES_LINKOBJECTS:=$(patsubst %_.cpp,%_.o,$(CIA_CPPFILES)) |
|
519 |
else |
|
520 |
CIAFILES_LINKOBJECTS:=$(call mapcia2object,$(CIAFILES)) |
|
521 |
endif |
|
522 |
ASMFILES_LINKOBJECTS:=$(call mapasm2object,$(ASMFILES)) |
|
523 |
||
524 |
# Try to link object files in the order in which the source files were specified. |
|
525 |
# This makes BC comparisons with non-Raptor builds easier. |
|
526 |
# Use the order of the source list to establish the order of the object files: |
|
527 |
LINKOBJECTS:=$(call relocatefiles,$(INTERMEDIATEPATH),$(SOURCE)) |
|
528 |
# Replace the file extensions of the Source files with .o (or _.o for cia files) now |
|
529 |
# the list will contain the object files in the same order as the list of source files. |
|
530 |
LINKOBJECTS:=$(foreach FILE,$(LINKOBJECTS),$(basename $(FILE))$(if $(filter $(addprefix %,$(CIAFILEEXTENSIONS)),$(FILE)),_).o) |
|
531 |
||
532 |
ifneq ($(MULTIFILE_ENABLED),) |
|
533 |
MULTIFILEOBJECT:=$(INTERMEDIATEPATH)/$(TARGET).$(POSTLINKFILETYPE)_$(VARIANTTYPE)_multifileobject.o |
|
534 |
MULTIFILE_VIAFILE:=$(INTERMEDIATEPATH)/$(TARGET)_$(VARIANTTYPE)_multifile.via |
|
535 |
endif |
|
536 |
||
537 |
## Via file #################################### |
|
538 |
# list of all objects to be linked |
|
539 |
# |
|
540 |
VIAFILE:=$(INTERMEDIATEPATH)/$(TARGET)_$(VARIANTTYPE)_objects.via |
|
541 |
ifneq ($(GENERATELINKERFEEDBACK),) |
|
542 |
FEEDBACKFILE:=$(INTERMEDIATEPATH)/$(TARGET)_$(VARIANTTYPE)_feedback.fdb |
|
543 |
endif |
|
544 |
||
545 |
# The groupin10 macro allows us to construct a via file, 10 objects at a time |
|
546 |
# to avoid limits on argument lengths and sizes on Windows. |
|
547 |
# It expands to a list of commands, each of which is on a separate line. |
|
548 |
# This causes the shell to be invoked once for each line but each line should |
|
549 |
# be shorter than the maximum allowed by windows. |
|
550 |
define groupin10 |
|
551 |
$(if $1,@echo -e $(foreach L,$(wordlist 1,10,$1),"$(L)\\n") >>$(VIAFILE),) |
|
552 |
$(if $1,$(call groupin10,$(wordlist 11,$(words $1),$1)),@true) |
|
553 |
endef |
|
554 |
||
555 |
################################################ |
|
556 |
||
557 |
||
558 |
## Link-type selection: |
|
559 |
# runtime static libraries link via AR |
|
560 |
ifneq ($(ARTARGET),) |
|
561 |
# Assuming that there are no libdeps in this case because this is probably one of the |
|
562 |
# Runtime libraries which has no deps. |
|
563 |
||
564 |
define artarget_func |
|
565 |
$(ARTARGET): $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT),$(LINKOBJECTS)) $(STDCPPTAGFILE) |
|
566 |
$(if $(MULTIFILE_ENABLED),,@echo "$(STDCPPTAGFILE)" > $(VIAFILE); |
|
567 |
$(call groupin10,$(LINKOBJECTS)) ;) |
|
568 |
$(call startrule,ar,FORCESUCCESS) \ |
|
569 |
$$(call dblquote,$(AR)) $(ARCHIVER_CREATE_OPTION) $$@ $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT),$(COMMANDFILE_OPTION)$(VIAFILE)) \ |
|
570 |
$(if $(DUMPBCINFO),&& $(FROMELF) -v $$@ > $$@.elfdump,) \ |
|
571 |
$(call endrule,ar) |
|
572 |
endef |
|
573 |
$(eval $(artarget_func)) |
|
574 |
||
5 | 575 |
CLEANTARGETS:=$(CLEANTARGETS) $(VIAFILE) $(if $(DUMPBCINFO),$(ARTARGET).elfdump,) |
3 | 576 |
endif |
577 |
||
578 |
||
579 |
||
580 |
# Targettype is some type of DLL or EXE (or derivative) |
|
581 |
ifneq ($(LINK_TARGET),) |
|
582 |
||
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
583 |
located_ARMLIBS:=$(foreach L,$(ARMLIBS),$(wildcard $(RVCTLIB)/*/$(L))) |
3 | 584 |
located_STATICLIBRARIES:=$(foreach L,$(STATICLIBRARY),$(STATIC_LIBRARY_DIR)/$(L).lib) |
585 |
e32abiv2_LIBS:=$(EXPTARGET) $(LINKER_STUB_LIBRARY) $(if $(STATIC_RUNTIME_LIB),$(STATIC_RUNTIME_DIR)/$(STATIC_RUNTIME_LIB),) $(located_STATICLIBRARIES) |
|
586 |
# DLLS and EXEs - These objects are linked by a linker |
|
587 |
ifeq ($(ARMRT),) |
|
588 |
# Some of the runtime libraries do not set ARMRT because of a circular reference |
|
589 |
# problem; we need to stop these from linking to their own dso and not link to |
|
590 |
# the STATIC_LIBS_LIST. |
|
591 |
ifneq ($(findstring $(TARGET).dso,$(RUNTIME_LIBS_LIST)),) |
|
592 |
# (almost) ARM RUNTIME LIBS |
|
593 |
REDUCED_RUNTIME_LIBS_LIST:=$(subst $(TARGET).dso,,$(RUNTIME_LIBS_LIST)) |
|
594 |
||
595 |
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
|
596 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG)) $(addprefix $(RUNTIME_LIBS_PATH)/,$(REDUCED_RUNTIME_LIBS_LIST)) $(located_ARMLIBS) |
3 | 597 |
else |
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
598 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY)) $(addprefix $(RUNTIME_LIBS_PATH)/,$(REDUCED_RUNTIME_LIBS_LIST)) $(located_ARMLIBS) |
3 | 599 |
endif |
600 |
||
601 |
else |
|
602 |
# NORMAL |
|
603 |
# |
|
604 |
ifeq ($(VARIANTTYPE),udeb) |
|
605 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG)) |
|
606 |
else |
|
607 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY)) |
|
608 |
endif |
|
609 |
ifeq ($(HAS_DEDICATED_OP_NEWDEL_LIB),1) |
|
610 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(RUNTIME_LIBS_PATH)/,$(NEWLIB)) |
|
611 |
endif |
|
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
612 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(RUNTIME_LIBS_PATH)/,$(RUNTIME_LIBS_LIST)) $(addprefix $(STATIC_LIBS_PATH)/,$(STATIC_LIBS_LIST)) $(located_ARMLIBS) |
3 | 613 |
|
614 |
endif |
|
615 |
else |
|
616 |
# ARM RUNTIME LIBS |
|
617 |
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
|
618 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG)) $(located_ARMLIBS) |
3 | 619 |
else |
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
620 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY)) $(located_ARMLIBS) |
3 | 621 |
endif |
622 |
endif |
|
623 |
||
624 |
# NOTE: the groupin10 macro must be used before a call to the "startrule" macro |
|
625 |
# because the code between startrule and endrule is packaged up into one |
|
626 |
# commandline which would defeat the purpose of groupin10. |
|
627 |
# This is undesirable because viafile generation commands appear |
|
628 |
# outside the relevant tags but it is also unavoidable. |
|
629 |
define linktarget_func |
|
630 |
## 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
|
631 |
$(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 | 632 |
$(if $(MULTIFILE_ENABLED),,@echo -n "" > $(VIAFILE); |
633 |
$(call groupin10,$(LINKOBJECTS)) ;) |
|
75
000ba5e4ba7d
Application of review comments.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
74
diff
changeset
|
634 |
$(call startrule,linkandpostlink) \ |
3 | 635 |
$(if $(PERTURBSTARTTIME),$(RANSLEEP) $(PERTURBMSECS) ;,) \ |
636 |
$(if $(SUPPORTS_STDCPP_NEWLIB),$(if $(located_STATICLIBRARIES),$(CHECKLIB) $(CHECKLIB_TYPE) --elf $(call dblquote,$(located_STATICLIBRARIES)) &&,),) \ |
|
637 |
$(LD) $(LINKER_MISC_FLAGS) $(LINKER_DEFAULT_LIB_PATHS) $(SYMBIAN_LINK_FLAGS) $(if $(DEBUG_INFO),$(LINKER_DEBUG_OPTION),$(LINKER_NODEBUG_OPTION)) \ |
|
638 |
$(if $(ARMLIBS),$(LD_WARNINGS_SUPPRESSION_ARMLIBS),) \ |
|
639 |
$(SHARED_OBJECT_OPTION) $(SPLIT_OPTION) \ |
|
22 | 640 |
$(RW_BASE) \ |
3 | 641 |
$(LINKER_ARCH_OPTION) \ |
22 | 642 |
$(SYMVER_OPTION) $(SO_NAME_OPTION)=$(call dblquote,$(LINKASVERSIONED)) \ |
3 | 643 |
$(LINKER_ENTRYPOINT_SETTING) \ |
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
644 |
-o $$(call dblquote,$(LINK_TARGET)) \ |
3 | 645 |
$(if $(LTCG),$(LTCG_OPTION),) \ |
22 | 646 |
$(LINKER_SYMBOLS_OPTION) $(LINKER_SYMBOLS_FILE_OPTION)=$(call dblquote,$(MAPFILE)) \ |
3 | 647 |
$(LINKEROPTION) \ |
648 |
$(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
|
649 |
$(if $(GENERATELINKERFEEDBACK),$(FEEDBACK_OPTION)$(call dblquote,$(FEEDBACKFILE))) \ |
3 | 650 |
$(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
|
651 |
$(call dblquote,$(e32abiv2_LIBS)) $(LINKER_DEFAULT_LIBS) && \ |
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
652 |
$(ELF2E32) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
653 |
--sid=0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
654 |
--version=$(VERSION) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
655 |
--capability=$(FINAL_CAPABILITIES) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
656 |
--linkas=$(call dblquote,$(LINKASVERSIONED)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
657 |
--fpu=$(if $(ARMFPU),$(ARMFPU),$(POSTLINKER_FPU_DEFAULT)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
658 |
--targettype=$(POSTLINKTARGETTYPE) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
659 |
--output=$$(call dblquote,$$@) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
660 |
--elfinput=$(call dblquote,$(LINK_TARGET)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
661 |
$(if $(UID1),--uid1=0x$(UID1),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
662 |
$(if $(UID2),--uid2=0x$(UID2),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
663 |
$(if $(UID3),--uid3=0x$(UID3),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
664 |
$(if $(VENDORID),--vid=0x$(VENDORID),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
665 |
$(if $(EXPTARGET),--customdlltarget,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
666 |
$(if $(ARMLIBS),--excludeunwantedexports,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
667 |
$(if $(EPOCALLOWDLLDATA),--dlldata,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
668 |
$(if $(EPOCPROCESSPRIORITY),--priority=$(EPOCPROCESSPRIORITY),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
669 |
$(if $(EPOCSTACKSIZE),--stack=0x$(EPOCSTACKSIZE),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
670 |
$(if $(EPOCHEAPSIZEMIN),--heap=0x$(EPOCHEAPSIZEMIN)$(CHAR_COMMA)0x$(EPOCHEAPSIZEMAX),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
671 |
$(if $(EPOCFIXEDPROCESS),--fixedaddress,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
672 |
$(if $(EPOCDATALINKADDRESS),--datalinkaddress=$(EPOCDATALINKADDRESS),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
673 |
$(if $(NAMEDSYMLKUP),--namedlookup,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
674 |
$(if $(SMPSAFE),--smpsafe,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
675 |
$(if $(POSTLINKDEFFILE),--definput=$(POSTLINKDEFFILE),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
676 |
$(if $(EXPORTUNFROZEN),--unfrozen,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
677 |
$(if $(AUTOEXPORTS),--sysdef=$(call dblquote,$(AUTOEXPORTS)),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
678 |
$(if $(CANIGNORENONCALLABLE), \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
679 |
$(if $(IMPORTLIBRARYREQUIRED),,--ignorenoncallable),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
680 |
$(if $(CANHAVEEXPORTS), --defoutput=$(call dblquote,$(GENERATED_DEFFILE)) --dso=$(GENERATED_DSO)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
681 |
$(if $(filter $(VARIANTTYPE),$(DEBUGGABLE)),--debuggable,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
682 |
$(if $(POSTLINKER_SUPPORTS_WDP), \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
683 |
--codepaging=$(PAGEDCODE_OPTION) --datapaging=$(PAGEDDATA_OPTION), \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
684 |
$(POSTLINKER_PAGEDOPTION)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
685 |
$(if $(NOCOMPRESSTARGET),--uncompressed, \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
686 |
$(if $(INFLATECOMPRESSTARGET),--compressionmethod=inflate, \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
687 |
$(if $(BYTEPAIRCOMPRESSTARGET),--compressionmethod=bytepair, \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
688 |
--compressionmethod=$(POSTLINKER_COMPRESSION_DEFAULT)))) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
689 |
--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
|
690 |
$(if $(SAVESPACE),$(if $(EXPORTUNFROZEN),,&& { $(GNURM) -rf $(INTERMEDIATEPATH); true; })) \ |
75
000ba5e4ba7d
Application of review comments.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
74
diff
changeset
|
691 |
$(call endrule,linkandpostlink) |
3 | 692 |
|
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
693 |
$(MAPFILE): $(E32TARGET) |
74
2f301831ccbb
Add dependency for .sym files.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
72
diff
changeset
|
694 |
$(LINK_TARGET): $(E32TARGET) |
3 | 695 |
endef |
75
000ba5e4ba7d
Application of review comments.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
74
diff
changeset
|
696 |
ifneq ($(DOPOSTLINK),) |
3 | 697 |
$(eval $(linktarget_func)) |
75
000ba5e4ba7d
Application of review comments.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
74
diff
changeset
|
698 |
endif # ifneq ($(DOPOSTLINK),) |
3 | 699 |
|
5 | 700 |
CLEANTARGETS:=$(CLEANTARGETS) $(VIAFILE) $(if $(GENERATELINKERFEEDBACK),$(FEEDBACKFILE)) $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT)) |
3 | 701 |
WHATRELEASE:=$(WHATRELEASE) $(MAPFILE) |
702 |
||
703 |
endif # if TARGETTYPE lib |
|
704 |
||
705 |
||
706 |
## Run trace compiler ############################################## |
|
707 |
ifeq ($(UID3),) |
|
708 |
ifeq ($(UID2),) |
|
709 |
USE_TRACE_COMPILER:= |
|
710 |
else |
|
711 |
UID_TC:=$(UID2) |
|
712 |
endif |
|
713 |
else |
|
714 |
UID_TC:=$(UID3) |
|
715 |
endif |
|
716 |
||
717 |
# USE_TRACE_COMPILER defaults to blank in Raptor config. |
|
718 |
# Users can turn TC on by setting it to 1 in user config. |
|
719 |
ifneq ($(USE_TRACE_COMPILER),) |
|
516
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
720 |
# TARGETEXT is already set |
3 | 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)))\ |
|
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
793 |
$(if $(SET_ARMINC),$(if $(RVCTINC),$(COMPILER_SYSTEM_INCLUDE_OPTION)$(call dblquote,$(RVCTINC)),),) \ |
3 | 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 |
||
516
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
873 |
$(eval LISTINGTARGET:=$(strip $(call extractandmap,$(CPPFILEEXTENSIONS) $(CFILEEXTENSIONS),.$(subst _,.,$(call sanitise,$(FULLVARIANTPATH))).$(TARGET).$(TARGETEXT).lst,$1))) |
3 | 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)))\ |
|
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
889 |
$(if $(SET_ARMINC),$(if $(RVCTINC),$(COMPILER_SYSTEM_INCLUDE_OPTION)$(call dblquote,$(RVCTINC)),),) \ |
3 | 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 |
||
516
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
929 |
FREEZEGUARD:=TARGET_$(TARGET)_$(TARGETEXT)_$(IMPORTLIBPATH)_EFREEZE |
3 | 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))) \ |
|
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
1010 |
$(if $(ARMINC),$(if $(RVCTINC), $(COMPILER_SYSTEM_INCLUDE_OPTION)$$(call dblquote,$(RVCTINC)),),) ) |
3 | 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) |
|
562
50c238674c4b
Added empty default value for TARGETPATH MMP keyword.
Dean Draper <dean.draper@nokia.com>
parents:
561
diff
changeset
|
1105 |
ROMPATH:=$(if $(TARGETPATH),$(TARGETPATH)/,sys/bin/) |
3 | 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 |
||
524
3bf22c929a73
Fix for SF Bug 2605 - [Raptor] ROMFILE creation using Raptor is not clean.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
483
diff
changeset
|
1126 |
DATATEXT:= |
3 | 1127 |
ifeq ($(TESTCODE),TRUE) |
1128 |
# Add 'TEST' to the .iby filename |
|
1129 |
ROMTEST:=test |
|
1130 |
ifeq ($(TEST_OPTION),BOTH) |
|
1131 |
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" |
|
1132 |
else |
|
1133 |
ifneq ($(TEST_OPTION),NONE) |
|
1134 |
DATATEXT:="data=/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TEST_OPTION).bat test/$(MODULE).$(TEST_OPTION).bat" |
|
1135 |
endif |
|
1136 |
endif |
|
1137 |
endif |
|
1138 |
||
1139 |
# ROMTARGET |
|
1140 |
ifneq ($(ROMTARGET),) |
|
1141 |
ifneq ($(words $(ROMTARGET)),1) |
|
1142 |
ROMTARGETALL:=$(ROMTARGET) |
|
1143 |
ROMTARGET:=$(word 1,$(ROMTARGET)) |
|
1144 |
endif |
|
1145 |
||
1146 |
ifeq ($(ROMTARGET),<none>) |
|
1147 |
BUILDROMTARGET:= |
|
1148 |
else |
|
1149 |
ifneq ($(ROMTARGET),+) |
|
1150 |
ifneq ($(notdir $(ROMTARGET)),) |
|
1151 |
ROMFILE:=$(notdir $(ROMTARGET)) |
|
1152 |
endif |
|
1153 |
ifneq ($(dir $(ROMTARGET)),./) |
|
1154 |
ROMPATH:=$(dir $(ROMTARGET)) |
|
1155 |
endif |
|
1156 |
endif |
|
1157 |
endif |
|
1158 |
endif |
|
1159 |
endif |
|
1160 |
||
1161 |
ROMFILENAME:=$(ROMDIR)$(PLATFORM)$(ROMTEST).iby |
|
1162 |
||
1163 |
# RAMTARGET |
|
1164 |
ifneq ($(RAMTARGET),) |
|
1165 |
ROMDECORATIONS_RAM:=" attrib=r" |
|
1166 |
ifneq ($(RAMTARGET),+) |
|
1167 |
ifneq ($(notdir $(RAMTARGET)),) |
|
1168 |
ROMFILE_RAM:=$(notdir $(RAMTARGET)) |
|
1169 |
endif |
|
1170 |
ifneq ($(dir $(RAMTARGET)),./) |
|
1171 |
ROMPATH_RAM:=$(dir $(RAMTARGET)) |
|
1172 |
endif |
|
1173 |
endif |
|
1174 |
endif |
|
1175 |
||
1176 |
define BuildRomfileTarget |
|
1177 |
$(ALLTARGET)::ROMFILE |
|
1178 |
ROMFILE:: |
|
1179 |
$(call startrule,rombuild) \ |
|
1180 |
$(GNUMKDIR) -p $(ROMDIR) \ |
|
1181 |
$(if $(ROMFILE_CREATED_$(TOBLDINF)),,&& echo -e "// $(subst $(EPOC_ROOT)/,,$(ROMFILENAME))\n//\n$(DATATEXT)" > $(ROMFILENAME)) \ |
|
558
e902bcdd2eef
Fix for Bug 2561 - Explicitly versioned MMPs produce invalid IBYs
Iain Williamson <iain.williamson@nokia.com>
parents:
527
diff
changeset
|
1182 |
$(if $(BUILDROMTARGET),&& echo "$(ROMFILETYPE)=/epoc32/release/##$(ABIDIR)##/##BUILD##/$(TARGET)$(if $(EXPLICITVERSION),{$(VERSIONHEX)},).$(REQUESTEDTARGETEXT) $(1)$(ROMDECORATIONS)" >> $(ROMFILENAME)) \ |
e902bcdd2eef
Fix for Bug 2561 - Explicitly versioned MMPs produce invalid IBYs
Iain Williamson <iain.williamson@nokia.com>
parents:
527
diff
changeset
|
1183 |
$(if $(RAMTARGET),&& echo "$(ROMFILETYPE_RAM)=/epoc32/release/##$(ABIDIR)##/##BUILD##/$(TARGET)$(if $(EXPLICITVERSION),{$(VERSIONHEX)},).$(REQUESTEDTARGETEXT) $(ROMPATH_RAM)$(ROMFILE_RAM)$(ROMDECORATIONS_RAM)" >> $(ROMFILENAME)) \ |
3 | 1184 |
$(call endrule,buildromfiletarget) |
1185 |
endef |
|
1186 |
||
1187 |
# When VARIANTTYPE changes, romfile is finished, |
|
1188 |
# apart from if this is a new component...... |
|
1189 |
ifneq ($(PREVIOUSVARIANTTYPE),) |
|
1190 |
ifneq ($(VARIANTTYPE),$(PREVIOUSVARIANTTYPE)) |
|
1191 |
ifneq ($(ROMFILE_CREATED_$(TOBLDINF)),) |
|
1192 |
ROMFILEFINISHED:=1 |
|
1193 |
else |
|
1194 |
ROMFILEFINISHED:= |
|
1195 |
endif |
|
1196 |
endif |
|
1197 |
endif |
|
1198 |
||
1199 |
# When romfile is finished, don't continue to add to it |
|
1200 |
ifeq ($(ROMFILEFINISHED),) |
|
1201 |
$(eval $(call BuildRomfileTarget,$(ROMPATH)$(ROMFILE))) |
|
1202 |
endif |
|
1203 |
||
1204 |
# Don't allow romfile to be recreated for every MMP |
|
1205 |
ifeq ($(ROMFILE_CREATED_$(TOBLDINF)),) |
|
1206 |
ROMFILE_CREATED_$(TOBLDINF):=1 |
|
1207 |
endif |
|
1208 |
||
1209 |
# Build other ROMTARGETs if there is more than one |
|
1210 |
ifneq ($(ROMTARGETALL),) |
|
1211 |
RAMTARGET:= |
|
1212 |
$(foreach ROMTARGET,$(wordlist 2,$(words $(ROMTARGETALL)),$(ROMTARGETALL)),$(eval $(call BuildRomfileTarget,$(ROMTARGET)))) |
|
1213 |
ROMTARGETALL:= |
|
1214 |
endif |
|
1215 |
||
1216 |
# Keep track of variant type while romfile is being created |
|
1217 |
PREVIOUSVARIANTTYPE:=$(VARIANTTYPE) |
|
1218 |
||
1219 |
WHATRELEASE:=$(WHATRELEASE) $(ROMFILENAME) |
|
1220 |
endif |
|
1221 |
||
1222 |
# Deal with test code batch files generation. |
|
1223 |
ifneq ($(TESTPATH),) |
|
1224 |
||
1225 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(EPOCROOT)/epoc32/data/z/test/ |
|
1226 |
$(eval $(call MakeTestBatchFiles,$(TARGET),$(EPOCROOT)/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH))) |
|
1227 |
BATCHFILE_CREATED_$(EPOCROOT)/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH):=1 |
|
1228 |
TARGET_CREATED_$(EPOCROOT)/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH)_$(TARGET):=1 |
|
1229 |
WHATRELEASE:=$(WHATRELEASE) $(EPOCROOT)/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH) |
|
1230 |
endif |
|
1231 |
||
1232 |
###################### End of Build ROMFILE target ###################### |
|
1233 |
||
1234 |
# Feature Variation requires a .vmap file to be created for each binary |
|
1235 |
# |
|
1236 |
ifneq ($(FEATUREVARIANTNAME),) |
|
1237 |
ifneq ($(E32TARGET),) |
|
1238 |
||
1239 |
OUTPUTVMAP:=$(E32TARGET).vmap |
|
1240 |
WHATRELEASE:=$(WHATRELEASE) $(OUPUTVMAP) |
|
1241 |
||
1242 |
TARGET:: $(OUTPUTVMAP) |
|
1243 |
VMAPNEEDS:=$(E32TARGET) $(SOURCE) $(PROJECT_META) |
|
1244 |
||
1245 |
BV_SOURCELIST:=$(addprefix -s ,$(SOURCE) $(PROJECT_META)) |
|
1246 |
BV_FEATURELIST:=$(addprefix -f ,$(FEATURELISTFILES)) |
|
1247 |
BV_USER_INCLUDES:=$(addprefix -u ,$(USERINCLUDE)) |
|
1248 |
BV_SYSTEM_INCLUDES:=$(addprefix -x ,$(SYSTEMINCLUDE)) |
|
1249 |
||
1250 |
# translate double quoted macros because $(shell) messes them up in some make engines |
|
1251 |
BV_MACROLIST:=$(COMPILER_INTERWORK_DEFINES) $(CDEFS) $(if $(ALWAYS_BUILD_AS_ARM),,$(COMPILER_THUMB_DEFINES)) |
|
1252 |
BV_DEFINES:=$(call makemacrodef,-D,$(subst ",__SBS__QUOTE__,$(BV_MACROLIST))) |
|
1253 |
||
1254 |
# the script to generate our .vmap file and hash value |
|
1255 |
VMAPCOMMAND:=$(CREATEVMAP) -o $(OUTPUTVMAP) $(BV_FEATURELIST) $(BV_DEFINES) -p $(PREINCLUDE) $(BV_SOURCELIST) $(BV_USER_INCLUDES) $(BV_SYSTEM_INCLUDES) -c $(CREATEVMAPCPP) |
|
1256 |
||
1257 |
# a recipe to create the .vmap from the "sources" with the createvmap script |
|
1258 |
$(call raptor_recipe,createvmap,$(OUTPUTVMAP),$(VMAPNEEDS),$(VMAPCOMMAND)) |
|
1259 |
||
1260 |
endif # E32TARGET != "" |
|
1261 |
endif # FEATUREVARIANTNAME != "" |
|
1262 |
||
1263 |
########################### CONCLUSION ################################### |
|
1264 |
||
1265 |
# make the output directories while reading makefile - some build engines prefer this |
|
1266 |
$(call makepath,$(CREATABLEPATHS)) |
|
1267 |
||
1268 |
## Clean up |
|
5 | 1269 |
$(call raptor_clean,$(CLEANTARGETS)) |
3 | 1270 |
|
5 | 1271 |
# For the --what option and the log file |
1272 |
$(call raptor_release,$(filter-out %.sym,$(WHATRELEASE))) |
|
3 | 1273 |
|
347 | 1274 |
endif # DOBUILD |
3 | 1275 |
|
1276 |
## The End |
|
1277 |