author | timothy.murphy@nokia.com |
Sat, 01 May 2010 00:09:59 +0100 | |
branch | fix |
changeset 516 | cd8318d5fb3a |
parent 511 | 7581d432643a |
child 522 | 9971c248e894 |
permissions | -rw-r--r-- |
185
69334660be7a
Fixing Bug 1569 - excessive recompilation in incremental tracecompiler builds
Iain Williamson <iain.williamson@nokia.com>
parents:
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 |
|
53 |
# Strip switch-type parameters |
|
54 |
# |
|
55 |
POSTLINKTARGETTYPE:=$(strip $(POSTLINKTARGETTYPE)) |
|
516
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
56 |
TARGETEXT:=$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE)) |
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
57 |
|
3 | 58 |
UID1:=$(strip $(UID1)) |
59 |
UID2:=$(strip $(UID2)) |
|
60 |
UID3:=$(strip $(UID3)) |
|
61 |
SID:=$(strip $(SECUREID)) |
|
62 |
VENDORID:=$(strip $(VENDORID)) |
|
63 |
AUTOEXPORTS:=$(strip $(AUTOEXPORTS)) |
|
64 |
DEFFILE:=$(strip $(DEFFILE)) |
|
65 |
IMPORTLIBRARYREQUIRED:=$(strip $(IMPORTLIBRARYREQUIRED)) |
|
66 |
EPOCALLOWDLLDATA:=$(strip $(EPOCALLOWDLLDATA)) |
|
67 |
PAGED:=$(strip $(PAGED)) |
|
68 |
||
69 |
# the output directories |
|
70 |
VARIANTPLATFORM:=$(VARIANTPLATFORM)$(FEATUREVARIANTNAME) |
|
71 |
RELEASABLEPATH:=$(RELEASEPATH)/$(VARIANTPLATFORM)/$(VARIANTTYPE) |
|
72 |
INTERMEDIATEPATH:=$(OUTPUTPATH)/$(VARIANTPLATFORM)/$(VARIANTTYPE) |
|
73 |
INTERMEDIATE_PLATFORM_PATH:=$(OUTPUTPATH)/$(VARIANTPLATFORM) |
|
74 |
TRACE_MARKER_PATH:=$(OUTPUTPATH) |
|
75 |
IMPORTLIBPATH:=$(RUNTIME_LIBS_PATH) |
|
76 |
||
77 |
# LOCALLY USED VARIABLES |
|
78 |
CLEANTARGETS:= |
|
79 |
WHATRELEASE:= |
|
80 |
||
81 |
# Work out which new/delete library to use for binaries. |
|
82 |
CHECKLIB_TYPE:=symc++ |
|
83 |
STDCPPTAGFILE:= |
|
84 |
ifeq ($(NOSTDCPP),1) |
|
85 |
ifeq ($(STDCPP),1) |
|
86 |
$(info <warning>STDCPP and NOSTDCPP both specified in $(PROJECT_META)</warning>) |
|
87 |
else |
|
88 |
ifeq ($(HAS_DEDICATED_OP_NEWDEL_LIB),1) |
|
89 |
DEFAULT_NEWLIB:=$(DEFAULT_SYMBIAN_NEWLIB) |
|
90 |
endif |
|
91 |
endif |
|
92 |
else |
|
93 |
ifeq ($(STDCPP),1) |
|
94 |
CDEFS:=$(CDEFS) __SYMBIAN_STDCPP_SUPPORT__ |
|
95 |
ifneq ($(SUPPORTS_STDCPP_NEWLIB),) |
|
96 |
ifeq ($(HAS_DEDICATED_OP_NEWDEL_LIB),1) |
|
97 |
DEFAULT_NEWLIB:=$(DEFAULT_STDCPP_NEWLIB) |
|
98 |
endif |
|
99 |
CHECKLIB_TYPE:=stdc++ |
|
100 |
STDCPPTAGFILE:=$(EPOCROOT)/epoc32/tools/tag/tag_elf |
|
101 |
endif |
|
102 |
endif |
|
103 |
endif |
|
104 |
||
105 |
# If NEWLIB is specified in the MMP file, it overrides all the past stuff. |
|
106 |
ifeq ($(NEWLIB),) |
|
107 |
NEWLIB:=$(DEFAULT_NEWLIB) |
|
108 |
endif |
|
109 |
||
110 |
||
111 |
########################################################################## |
|
112 |
## OUTPUTS - externally relevant targets that this FLM generates |
|
113 |
||
114 |
||
115 |
ifeq ($(EXPORTLIBRARY),) |
|
116 |
EXPORTLIBRARY:=$(TARGET) |
|
117 |
endif |
|
118 |
||
119 |
# This will insert the file version between the name and the extension. |
|
120 |
# If there is more than one dot in generated filename the inserted position will be |
|
121 |
# BEFORE the last but two dot. E.g name1.name2.name3.dll to name1.name2{version}.name3.dll |
|
122 |
LIBEXT:=$(lastword $(subst .,$(CHAR_SPACE) ,$(EXPORTLIBRARY))) |
|
123 |
LIBBASE:=$(patsubst %.$(LIBEXT),%,$(EXPORTLIBRARY)) |
|
124 |
ifneq ($(findstring .,$(EXPORTLIBRARY)),) |
|
125 |
# Please note $(EXPORTLIBRARY) doesn't include target type. |
|
126 |
VER_E32IMPORTLIBBASE:=$(IMPORTLIBPATH)/$(LIBBASE){$(VERSIONHEX)}.$(LIBEXT) |
|
127 |
else |
|
128 |
VER_E32IMPORTLIBBASE:=$(IMPORTLIBPATH)/$(EXPORTLIBRARY){$(VERSIONHEX)} |
|
129 |
endif |
|
130 |
||
131 |
# Postlinkable targets need to be linked and elf2e32'd |
|
132 |
ifneq ($(DOPOSTLINK),) |
|
516
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
133 |
E32TARGET:=$(RELEASABLEPATH)/$(TARGET)$(if $(EXPLICITVERSION),{$(VERSIONHEX)},).$(TARGETEXT) |
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
134 |
LINK_TARGET:=$(RELEASABLEPATH)/$(TARGET)$(if $(EXPLICITVERSION),{$(VERSIONHEX)},).$(TARGETEXT).sym |
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
135 |
MAPFILE:=$(RELEASABLEPATH)/$(TARGET).$(TARGETEXT).map |
3 | 136 |
else |
137 |
E32TARGET:= |
|
138 |
LINK_TARGET:= |
|
139 |
MAPFILE:= |
|
140 |
endif |
|
141 |
||
142 |
# libs and klibs, on the other hand need to be archived |
|
143 |
ifneq ($(call isoneof,$(TARGETTYPE),lib klib stdlib),) |
|
144 |
ARTARGET:=$(RELEASABLEPATH)/$(TARGET).lib |
|
145 |
# We need libs and klibs before we can link stuff with them: |
|
146 |
LIBRARY:: $(ARTARGET) |
|
147 |
else |
|
148 |
ARTARGET:= |
|
149 |
endif |
|
150 |
||
151 |
||
152 |
ifneq ($(IMPORTLIBRARYREQUIRED),) # no dso files for plugins, animation dlls etc |
|
153 |
# make sure we don't build import libraries more than once for UDEB and UREL |
|
154 |
# Without this, wierd target-specific variable problems happen with LIBRARY in particular |
|
155 |
||
156 |
TMP_IMPORTLIBTARGET_ROOT:=$(IMPORTLIBPATH)/$(EXPORTLIBRARY) |
|
157 |
||
158 |
# ABIv2 .dso |
|
159 |
IMPORTLIBTARGET_DSO:= |
|
160 |
IMPORTLIBTARGETVERSIONED_DSO:= |
|
161 |
||
162 |
BUILDMARKER_IMPORTLIBTARGET_DSO:=TARGET_$(subst :,,$(VER_E32IMPORTLIBBASE)).dso |
|
163 |
WHATRELEASE:=$(WHATRELEASE) $(if $(EXPLICITVERSION),,$(TMP_IMPORTLIBTARGET_ROOT).dso) |
|
164 |
WHATRELEASE:=$(WHATRELEASE) $(VER_E32IMPORTLIBBASE).dso |
|
165 |
ifeq ($($(BUILDMARKER_IMPORTLIBTARGET_DSO)),) |
|
166 |
IMPORTLIBTARGET_DSO:=$(TMP_IMPORTLIBTARGET_ROOT).dso |
|
167 |
IMPORTLIBTARGETVERSIONED_DSO:=$(VER_E32IMPORTLIBBASE).dso |
|
168 |
endif |
|
169 |
||
170 |
# ABIv1 .lib (for specific builds, toolchains and host OS platforms only) |
|
171 |
IMPORTLIBTARGET_LIB:= |
|
172 |
IMPORTLIBTARGETVERSIONED_LIB:= |
|
173 |
BUILDMARKER_IMPORTLIBTARGET_LIB:=TARGET_$(subst :,,$(VER_E32IMPORTLIBBASE)).lib |
|
174 |
# Only for builds that require and support them, and only on windows |
|
175 |
ifeq ($(OSTYPE),cygwin) |
|
176 |
ifeq ($(GENERATE_ABIV1_IMPLIBS),1) |
|
177 |
WHATRELEASE:=$(WHATRELEASE) $(if $(EXPLICITVERSION),,$(TMP_IMPORTLIBTARGET_ROOT).lib) |
|
178 |
WHATRELEASE:=$(WHATRELEASE) $(VER_E32IMPORTLIBBASE).lib |
|
179 |
ifeq ($($(BUILDMARKER_IMPORTLIBTARGET_LIB)),) |
|
180 |
IMPORTLIBTARGET_LIB:=$(TMP_IMPORTLIBTARGET_ROOT).lib |
|
181 |
IMPORTLIBTARGETVERSIONED_LIB:=$(VER_E32IMPORTLIBBASE).lib |
|
182 |
endif |
|
183 |
endif |
|
184 |
endif |
|
185 |
endif |
|
186 |
||
187 |
# Try to make sure that we get the right linkas name |
|
188 |
# If linkas is specified then split it up and |
|
189 |
# put the hex version number in the right place |
|
190 |
ifeq ($(LINKAS),) |
|
191 |
LINKASNAME=$(TARGET) |
|
516
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
192 |
LINKASTYPE=$(TARGETEXT) |
3 | 193 |
else |
194 |
SPLIT_LINKAS=$(subst ., ,$(LINKAS)) |
|
195 |
LINKASNAME=$(word 1,$(SPLIT_LINKAS)) |
|
196 |
LINKASTYPE=$(word 2,$(SPLIT_LINKAS)) |
|
197 |
endif |
|
198 |
||
199 |
# ignore UID3 if it is zero |
|
200 |
ifeq ($(UID3),00000000) |
|
201 |
LINKASVERSIONED=$(LINKASNAME){$(VERSIONHEX)}.$(LINKASTYPE) |
|
202 |
else |
|
203 |
LINKASVERSIONED=$(LINKASNAME){$(VERSIONHEX)}$(if $(UID3),[$(UID3)],).$(LINKASTYPE) |
|
204 |
endif |
|
205 |
||
206 |
########################################################################## |
|
207 |
## TARGET GROUPS ## |
|
208 |
RELEASABLES:=$(strip $(E32TARGET) $(ARTARGET) $(LINK_TARGET) $(MAPFILE)) |
|
209 |
# More targets to be added later |
|
210 |
TARGETS:=$(strip $(E32TARGET) $(IMPORTLIBTARGET) $(LINK_TARGET) $(ARTARGET)) |
|
211 |
||
212 |
CREATABLEPATHS:=$(OUTPUTPATH) |
|
213 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(INTERMEDIATE_PLATFORM_PATH) |
|
214 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(INTERMEDIATEPATH) |
|
215 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(RELEASABLEPATH) |
|
216 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(RUNTIME_LIBS_PATH) |
|
217 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(IMPORTLIBPATH) |
|
218 |
WHATRELEASE:=$(WHATRELEASE) $(RELEASABLES) |
|
219 |
||
220 |
||
221 |
||
222 |
## HIGH LEVEL Targets ## |
|
223 |
.PHONY:: $(ALLTARGET) |
|
224 |
||
225 |
## GLOBAL TARGETS ############################################################ |
|
226 |
$(ALLTARGET):: $(RELEASABLES) |
|
227 |
TARGET:: $(RELEASABLES) |
|
228 |
||
229 |
## Internal targets ## |
|
230 |
||
231 |
# Determine the name of the generated DSO file ############################### |
|
232 |
# This is to generate the dso with the Some{Versionhex}.file.dso |
|
233 |
# It reproduces what appears to be a problem in the current build system |
|
234 |
# that affects messageintercept{000a0000}.esockdebug.dso whose |
|
235 |
# filename differs from it's "linkas" name. |
|
236 |
E32VAR:=$(subst .,$(CHAR_SPACE) ,$(TARGET)) |
|
237 |
E32SOME:=$(word 1,$(E32VAR)) |
|
238 |
E32VAR2:=$(patsubst $(E32SOME).%,%,$(TARGET)) |
|
239 |
||
240 |
# Separate '_SH' variables created for output into bash - Preserves '{' and '}' |
|
241 |
||
242 |
ifneq ($(findstring .,$(TARGET)),) |
|
243 |
DSODEFFILENAMEBASE:=$(E32SOME){$(VERSIONHEX)}.$(E32VAR2) |
|
244 |
else |
|
245 |
DSODEFFILENAMEBASE:=$(TARGET){$(VERSIONHEX)} |
|
246 |
endif |
|
247 |
GENERATED_DSO:=$(call dblquote,$(INTERMEDIATEPATH)/$(DSODEFFILENAMEBASE).dso) |
|
248 |
GENERATED_DEFFILE:=$(INTERMEDIATEPATH)/$(DSODEFFILENAMEBASE).def |
|
249 |
||
250 |
## IMPORT LIBRARY ########################################################### |
|
251 |
||
252 |
# Static libraries will be postlinked when they are used so don't try to postlink them |
|
253 |
||
254 |
ifneq ($(IMPORTLIBRARYREQUIRED),) |
|
255 |
ifneq ($(or $(DEFFILE),$(EXPORTUNFROZEN)),) |
|
256 |
# Both ABIv2 .dso and ABIv1 .lib import library generation require a processed .def file, |
|
257 |
# unless EXPORTUNFROZEN is being used |
|
258 |
PREPPEDDEFFILE:= |
|
259 |
ifneq ($(DEFFILE),) |
|
260 |
ifeq ($(EXPORTUNFROZEN),) |
|
261 |
PREPPEDDEFFILE:=$(INTERMEDIATEPATH)/$(TARGET).prep |
|
262 |
CLEANTARGETS:=$(CLEANTARGETS) $(PREPPEDDEFFILE) |
|
263 |
define importlibtarget_prepfile |
|
264 |
$(PREPPEDDEFFILE): $(DEFFILE) |
|
265 |
$(call startrule,importlibtarget_prepfile,FORCESUCCESS) \ |
|
266 |
$(PREPDEF) $(call dblquote,$(DEFFILE)) $(call dblquote,$(PREPPEDDEFFILE)) \ |
|
267 |
$(call endrule,importlibtarget_prepfile) |
|
268 |
endef |
|
269 |
$(eval $(importlibtarget_prepfile)) |
|
270 |
endif |
|
271 |
endif |
|
272 |
||
273 |
# ABIv2 .dso |
|
274 |
ifneq ($(IMPORTLIBTARGET_DSO),) # check that we haven't tried to specify this target already |
|
275 |
||
26
96670e6a4bfd
Try to cope with the iscapi implib problem.
timothy.murphy@nokia.com
parents:
9
diff
changeset
|
276 |
# 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
|
277 |
# 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
|
278 |
$(eval $(BUILDMARKER_IMPORTLIBTARGET_DSO):=1) |
96670e6a4bfd
Try to cope with the iscapi implib problem.
timothy.murphy@nokia.com
parents:
9
diff
changeset
|
279 |
|
3 | 280 |
ifneq ($(EXPLICITVERSION),) |
281 |
TARGETS:=$(strip $(TARGETS) $(IMPORTLIBTARGETVERSIONED_DSO)) |
|
282 |
||
283 |
# Add this importlibrary to our global targets |
|
284 |
LIBRARY:: $(IMPORTLIBTARGETVERSIONED_DSO) |
|
285 |
$(ALLTARGET):: $(IMPORTLIBTARGETVERSIONED_DSO) |
|
286 |
TARGET:: $(IMPORTLIBTARGETVERSIONED_DSO) |
|
287 |
||
288 |
else |
|
289 |
TARGETS:=$(strip $(TARGETS) $(IMPORTLIBTARGETVERSIONED_DSO) $(IMPORTLIBTARGET_DSO)) |
|
290 |
||
291 |
# Add this importlibrary to our global targets |
|
292 |
LIBRARY:: $(IMPORTLIBTARGET_DSO) |
|
293 |
$(ALLTARGET):: $(IMPORTLIBTARGETVERSIONED_DSO) $(IMPORTLIBTARGET_DSO) |
|
294 |
TARGET:: $(IMPORTLIBTARGETVERSIONED_DSO) $(IMPORTLIBTARGET_DSO) |
|
295 |
||
296 |
||
297 |
endif |
|
298 |
||
299 |
||
300 |
||
301 |
ifneq ($(EXPORTUNFROZEN),) # Unfrozen - warn and create .dso as side-effect of the final postlink |
|
302 |
$(info <warning project='$(PROJECT_META)' component='$(COMPONENT_META)'>EXPORTUNFROZEN present in $(PROJECT_META) - unfrozen exports will be represented in import library.</warning> ) |
|
303 |
define importlibtarget_unfrozen |
|
304 |
$(IMPORTLIBTARGET_DSO): $(IMPORTLIBTARGETVERSIONED_DSO) |
|
305 |
$(call startrule,importlibtarget_unfrozen,FORCESUCCESS) \ |
|
306 |
$(GNUCP) $$(call dblquote,$$<) $$(call dblquote,$$@) \ |
|
307 |
$(call endrule,importlibtarget_unfrozen) |
|
308 |
endef |
|
309 |
||
310 |
define importlibtarget_unfrozen_ver |
|
311 |
$(IMPORTLIBTARGETVERSIONED_DSO): $(E32TARGET) |
|
312 |
$(call startrule,importlibversioned_unfrozen,FORCESUCCESS) \ |
|
313 |
$(GNUCP) "$(GENERATED_DSO)" "$$@" \ |
|
314 |
$(call endrule,importlibversioned_unfrozen) |
|
315 |
endef |
|
316 |
||
317 |
ifeq ($(EXPLICITVERSION),) |
|
318 |
# Generate the general dso if we aren't |
|
319 |
# being asked to make just the specific version. |
|
320 |
$(eval $(importlibtarget_unfrozen)) |
|
321 |
endif |
|
322 |
||
323 |
$(eval $(importlibtarget_unfrozen_ver)) |
|
324 |
else |
|
325 |
ifneq ($(DEFFILE),) # Frozen - use the def file and create .dso directly |
|
326 |
define importlibtarget_func |
|
327 |
$(IMPORTLIBTARGET_DSO): $(IMPORTLIBTARGETVERSIONED_DSO) |
|
328 |
$(call startrule,importlibtarget,FORCESUCCESS) \ |
|
329 |
$(GNUCP) "$$<" "$$@" \ |
|
330 |
$(call endrule,importlibtarget) |
|
331 |
endef |
|
332 |
||
333 |
ifeq ($(EXPLICITVERSION),) |
|
334 |
# Generate the general dso if we aren't |
|
335 |
# being asked to make just the specific version. |
|
336 |
$(eval $(importlibtarget_func)) |
|
337 |
endif |
|
338 |
||
339 |
define importlibtargetversioned_func |
|
340 |
$(IMPORTLIBTARGETVERSIONED_DSO): $(ELF2E32) $(PREPPEDDEFFILE) |
|
341 |
$(call startrule,importlibversioned,FORCESUCCESS) \ |
|
342 |
$(ELF2E32) --sid=0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) --version=$(VERSION) \ |
|
343 |
--definput="$(PREPPEDDEFFILE)" \ |
|
344 |
--dso=$$(call dblquote,$$@) \ |
|
345 |
--linkas=$(call dblquote,$(LINKASVERSIONED)) \ |
|
346 |
$(call endrule,importlibversioned) |
|
347 |
endef |
|
348 |
$(eval $(importlibtargetversioned_func)) |
|
349 |
endif # ifneq ($(DEFFILE),) |
|
350 |
endif # ifneq ($(EXPORTUNFROZEN),) |
|
351 |
endif # ifneq ($(IMPORTLIBTARGET_DSO),) |
|
352 |
||
353 |
# ABIv1 .lib |
|
354 |
ifneq ($(IMPORTLIBTARGETVERSIONED_LIB),) # check that we haven't tried to specify this target already |
|
355 |
||
26
96670e6a4bfd
Try to cope with the iscapi implib problem.
timothy.murphy@nokia.com
parents:
9
diff
changeset
|
356 |
# 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
|
357 |
# 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
|
358 |
$(eval $(BUILDMARKER_IMPORTLIBTARGET_LIB):=1) |
96670e6a4bfd
Try to cope with the iscapi implib problem.
timothy.murphy@nokia.com
parents:
9
diff
changeset
|
359 |
|
3 | 360 |
define abiv1_generatelib |
361 |
||
362 |
ifeq ($(EXPLICITVERSION),) |
|
363 |
LIBRARY:: $(IMPORTLIBTARGETVERSIONED_LIB) $(IMPORTLIBTARGET_LIB) |
|
364 |
||
365 |
else |
|
366 |
LIBRARY:: $(IMPORTLIBTARGETVERSIONED_LIB) |
|
367 |
||
368 |
endif |
|
369 |
||
370 |
# If frozen, a prepped .def file is used as the basis for .lib creation |
|
371 |
# If unfrozen, .lib files are based on the .def file generated by the final postlink |
|
372 |
$(IMPORTLIBTARGETVERSIONED_LIB): $(if $(EXPORTUNFROZEN),$(E32TARGET),$(PREPPEDDEFFILE)) |
|
373 |
$(call startrule,importlibversioned_abiv1) \ |
|
374 |
if [ -f "$(EPOCROOT)/epoc32/tools/def2dll.pl" -a -f "$(if $(EXPORTUNFROZEN),$(call dblquote,$(GENERATED_DEFFILE)),$(PREPPEDDEFFILE))" ]; then \ |
|
375 |
$(PERL) $(EPOCROOT)/epoc32/tools/def2dll.pl \ |
|
376 |
--path=$(IMPORTLIBPATH) \ |
|
377 |
--bldpath=$(INTERMEDIATEPATH) \ |
|
378 |
--import=$(notdir $(basename $(IMPORTLIBTARGETVERSIONED_LIB))) \ |
|
379 |
--deffile="$(if $(EXPORTUNFROZEN),$(call dblquote,$(GENERATED_DEFFILE)),$(PREPPEDDEFFILE))" \ |
|
380 |
--linkAs=$(call dblquote,$(LINKASVERSIONED)) \ |
|
381 |
--inter ; fi \ |
|
382 |
$(call endrule,importlibversioned_abiv1) |
|
383 |
||
384 |
ifeq ($(EXPLICITVERSION),) |
|
385 |
$(IMPORTLIBTARGET_LIB): $(IMPORTLIBTARGETVERSIONED_LIB) |
|
386 |
$(call startrule,importlibtarget_abiv1) \ |
|
387 |
if [ -f $(EPOCROOT)/epoc32/tools/def2dll.pl ]; then $(GNUCP) "$$<" "$$@" ; fi \ |
|
388 |
$(call endrule,importlibtarget_abiv1) |
|
389 |
endif |
|
390 |
endef |
|
391 |
||
392 |
$(eval $(abiv1_generatelib)) |
|
393 |
endif # ifneq ($(IMPORTLIBTARGET_LIB),) |
|
394 |
endif # ($(or $(DEFFILE),$(EXPORTUNFROZEN)),) |
|
395 |
endif # ifneq ($(IMPORTLIBRARYREQUIRED),) |
|
396 |
||
397 |
||
398 |
## POSTLINK ################################################################## |
|
399 |
||
400 |
# Set up the name of the exports file if this is a customdll |
|
401 |
EXPTARGET:= |
|
402 |
ifneq ($(DOPOSTLINK),) |
|
403 |
ifneq ($(and $(or $(STATICLIBRARY),$(ARMLIBS),$(ARMRT)),$(DEFFILE)),) |
|
404 |
EXPTARGET:=$(INTERMEDIATE_PLATFORM_PATH)/$(notdir $(VER_E32IMPORTLIBBASE)).exp |
|
405 |
endif |
|
406 |
endif |
|
407 |
||
408 |
# Generating the import library is enough if TARGETTYPE=implib ############# |
|
409 |
||
410 |
ifneq ($(DOPOSTLINK),) |
|
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
411 |
# 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
|
412 |
FINAL_CAPABILITIES:=$(if $(CAPABILITY),$(CAPABILITY),NONE) |
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
413 |
|
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
414 |
# Paging options for the old postlinker |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
415 |
POSTLINKER_PAGEDOPTION:=--defaultpaged |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
416 |
ifeq ($(PAGED),1) |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
417 |
POSTLINKER_PAGEDOPTION:=--paged |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
418 |
endif |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
419 |
ifeq ($(PAGED),0) |
102
80785a1bc266
single character fix for --unpaged
Richard Taylor <richard.i.taylor@nokia.com>
parents:
75
diff
changeset
|
420 |
POSTLINKER_PAGEDOPTION:=--unpaged |
71
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 |
|
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
423 |
CLEANTARGETS:=$(CLEANTARGETS) $(E32TARGET) |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
424 |
CLEANTARGETS:=$(CLEANTARGETS) $(GENERATED_DEFFILE) |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
425 |
CLEANTARGETS:=$(CLEANTARGETS) $(GENERATED_DSO) |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
426 |
|
3 | 427 |
endif # ifneq ($(DOPOSTLINK),) |
428 |
||
429 |
ifneq ($(TARGETTYPE),implib) |
|
430 |
||
431 |
## CUSTOM DLLS ############################################################### |
|
432 |
# exp file |
|
433 |
# |
|
434 |
# This tends to help getting exported objects |
|
435 |
# out of the arm libs and into custom dlls. |
|
436 |
||
437 |
ifneq ($(EXPTARGET),) |
|
438 |
ifeq ($(TARGET_$(EXPTARGET)),) |
|
439 |
# We only need one of these exptargets for UDEB and UREL |
|
440 |
TARGET_$(EXPTARGET):=1 |
|
441 |
||
442 |
EXPTARGETASMFILE:=$(INTERMEDIATE_PLATFORM_PATH)/$(notdir $(VER_E32IMPORTLIBBASE)).s |
|
443 |
||
444 |
define e32expgen_func |
|
445 |
$(EXPTARGET): $(DEFFILE) $(ELF2E32) |
|
446 |
$(call startrule,expgen) \ |
|
447 |
$(ELF2E32) \ |
|
448 |
--definput=$$(call dblquote,$(DEFFILE)) \ |
|
449 |
--dump=a \ |
|
450 |
--output=$(call dblquote,$(EXPTARGETASMFILE)) && \ |
|
451 |
$(ASM) $(TARGET_ARCH_OPTION) $(AAPCS_OPTION) $(ASM_OUTPUT_OPTION) $$(call dblquote, $$@) $(EXPTARGETASMFILE) \ |
|
452 |
$(call endrule,expgen) |
|
453 |
endef |
|
454 |
||
455 |
$(eval $(e32expgen_func)) |
|
456 |
CLEANTARGETS:=$(CLEANTARGETS) $(EXPTARGET) $(EXPTARGETASMFILE) |
|
457 |
endif |
|
458 |
endif |
|
459 |
||
460 |
||
461 |
||
462 |
||
463 |
## SOURCE FILES ############################################################## |
|
464 |
||
465 |
# Source files can be either C++ files (.cpp) or Assmbler-in-C++ files (.cia) |
|
466 |
# We have to split the two because they have the same link stage, the compile |
|
467 |
# stage is different for each. |
|
468 |
||
469 |
CPPFILEEXTENSIONS:=.cpp .CPP .Cpp .CPp .CpP .cPP .cpP .cPp .cc .CC \ |
|
470 |
.Cc .c++ .C++ .cxx .CXX .Cxx .cXx .CxX .CXx .cC .cXX .cxX |
|
471 |
CFILEEXTENSIONS:=.c .C |
|
472 |
CIAFILEEXTENSIONS:=.CIA .cia .Cia .cIa .cIA .ciA .CIa .CiA |
|
473 |
ASMFILEEXTENSIONS:=.s .S |
|
474 |
||
475 |
||
476 |
# Extract the CPP files from our sources |
|
477 |
CPPFILES:=$(call extractfilesoftype,$(CPPFILEEXTENSIONS),$(SOURCE)) |
|
478 |
CFILES:=$(call extractfilesoftype,$(CFILEEXTENSIONS),$(SOURCE)) |
|
479 |
ASMFILES:=$(call extractfilesoftype,$(ASMFILEEXTENSIONS),$(SOURCE)) |
|
480 |
||
481 |
# Find out what assember-in-c files there are |
|
482 |
# If appropriate, work out what CPP files will be created from the assembler files |
|
483 |
CIAFILES:=$(call extractfilesoftype,$(CIAFILEEXTENSIONS),$(SOURCE)) |
|
484 |
CIA_CPPFILES:= |
|
485 |
ifeq ($(TRANSFORM_CIA),1) |
|
486 |
CIA_CPPFILES:=$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CIAFILEEXTENSIONS),_.cpp,$(CIAFILES))) |
|
487 |
else |
|
488 |
||
489 |
endif |
|
490 |
||
491 |
## LINK ###################################################################### |
|
492 |
# Bring together all the .o files compiled from .cpp, .c, .s and .cia files. |
|
493 |
# These files are stored in the "non-releasable" output diretory. |
|
494 |
||
495 |
define mapcpp2object |
|
496 |
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CPPFILEEXTENSIONS),.o,$1)) |
|
497 |
endef |
|
498 |
||
499 |
define mapc2object |
|
500 |
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CFILEEXTENSIONS),.o,$1)) |
|
501 |
endef |
|
502 |
||
503 |
define mapasm2object |
|
504 |
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(ASMFILEEXTENSIONS),.o,$1)) |
|
505 |
endef |
|
506 |
||
507 |
define mapcia2object |
|
508 |
$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CIAFILEEXTENSIONS),_.o,$1)) |
|
509 |
endef |
|
510 |
||
511 |
# Determine what object files will be linked by using the source files. |
|
512 |
CPPFILES_LINKOBJECTS:=$(call mapcpp2object,$(CPPFILES)) |
|
513 |
CFILES_LINKOBJECTS:=$(call mapc2object,$(CFILES)) |
|
514 |
ifeq ($(TRANSFORM_CIA),1) |
|
515 |
CIAFILES_LINKOBJECTS:=$(patsubst %_.cpp,%_.o,$(CIA_CPPFILES)) |
|
516 |
else |
|
517 |
CIAFILES_LINKOBJECTS:=$(call mapcia2object,$(CIAFILES)) |
|
518 |
endif |
|
519 |
ASMFILES_LINKOBJECTS:=$(call mapasm2object,$(ASMFILES)) |
|
520 |
||
521 |
# Try to link object files in the order in which the source files were specified. |
|
522 |
# This makes BC comparisons with non-Raptor builds easier. |
|
523 |
# Use the order of the source list to establish the order of the object files: |
|
524 |
LINKOBJECTS:=$(call relocatefiles,$(INTERMEDIATEPATH),$(SOURCE)) |
|
525 |
# Replace the file extensions of the Source files with .o (or _.o for cia files) now |
|
526 |
# the list will contain the object files in the same order as the list of source files. |
|
527 |
LINKOBJECTS:=$(foreach FILE,$(LINKOBJECTS),$(basename $(FILE))$(if $(filter $(addprefix %,$(CIAFILEEXTENSIONS)),$(FILE)),_).o) |
|
528 |
||
529 |
ifneq ($(MULTIFILE_ENABLED),) |
|
530 |
MULTIFILEOBJECT:=$(INTERMEDIATEPATH)/$(TARGET).$(POSTLINKFILETYPE)_$(VARIANTTYPE)_multifileobject.o |
|
531 |
MULTIFILE_VIAFILE:=$(INTERMEDIATEPATH)/$(TARGET)_$(VARIANTTYPE)_multifile.via |
|
532 |
endif |
|
533 |
||
534 |
## Via file #################################### |
|
535 |
# list of all objects to be linked |
|
536 |
# |
|
537 |
VIAFILE:=$(INTERMEDIATEPATH)/$(TARGET)_$(VARIANTTYPE)_objects.via |
|
538 |
ifneq ($(GENERATELINKERFEEDBACK),) |
|
539 |
FEEDBACKFILE:=$(INTERMEDIATEPATH)/$(TARGET)_$(VARIANTTYPE)_feedback.fdb |
|
540 |
endif |
|
541 |
||
542 |
# The groupin10 macro allows us to construct a via file, 10 objects at a time |
|
543 |
# to avoid limits on argument lengths and sizes on Windows. |
|
544 |
# It expands to a list of commands, each of which is on a separate line. |
|
545 |
# This causes the shell to be invoked once for each line but each line should |
|
546 |
# be shorter than the maximum allowed by windows. |
|
547 |
define groupin10 |
|
548 |
$(if $1,@echo -e $(foreach L,$(wordlist 1,10,$1),"$(L)\\n") >>$(VIAFILE),) |
|
549 |
$(if $1,$(call groupin10,$(wordlist 11,$(words $1),$1)),@true) |
|
550 |
endef |
|
551 |
||
552 |
################################################ |
|
553 |
||
554 |
||
555 |
## Link-type selection: |
|
556 |
# runtime static libraries link via AR |
|
557 |
ifneq ($(ARTARGET),) |
|
558 |
# Assuming that there are no libdeps in this case because this is probably one of the |
|
559 |
# Runtime libraries which has no deps. |
|
560 |
||
561 |
define artarget_func |
|
562 |
$(ARTARGET): $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT),$(LINKOBJECTS)) $(STDCPPTAGFILE) |
|
563 |
$(if $(MULTIFILE_ENABLED),,@echo "$(STDCPPTAGFILE)" > $(VIAFILE); |
|
564 |
$(call groupin10,$(LINKOBJECTS)) ;) |
|
565 |
$(call startrule,ar,FORCESUCCESS) \ |
|
566 |
$$(call dblquote,$(AR)) $(ARCHIVER_CREATE_OPTION) $$@ $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT),$(COMMANDFILE_OPTION)$(VIAFILE)) \ |
|
567 |
$(if $(DUMPBCINFO),&& $(FROMELF) -v $$@ > $$@.elfdump,) \ |
|
568 |
$(call endrule,ar) |
|
569 |
endef |
|
570 |
$(eval $(artarget_func)) |
|
571 |
||
5 | 572 |
CLEANTARGETS:=$(CLEANTARGETS) $(VIAFILE) $(if $(DUMPBCINFO),$(ARTARGET).elfdump,) |
3 | 573 |
endif |
574 |
||
575 |
||
576 |
||
577 |
# Targettype is some type of DLL or EXE (or derivative) |
|
578 |
ifneq ($(LINK_TARGET),) |
|
579 |
||
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
580 |
located_ARMLIBS:=$(foreach L,$(ARMLIBS),$(wildcard $(RVCTLIB)/*/$(L))) |
3 | 581 |
located_STATICLIBRARIES:=$(foreach L,$(STATICLIBRARY),$(STATIC_LIBRARY_DIR)/$(L).lib) |
582 |
e32abiv2_LIBS:=$(EXPTARGET) $(LINKER_STUB_LIBRARY) $(if $(STATIC_RUNTIME_LIB),$(STATIC_RUNTIME_DIR)/$(STATIC_RUNTIME_LIB),) $(located_STATICLIBRARIES) |
|
583 |
# DLLS and EXEs - These objects are linked by a linker |
|
584 |
ifeq ($(ARMRT),) |
|
585 |
# Some of the runtime libraries do not set ARMRT because of a circular reference |
|
586 |
# problem; we need to stop these from linking to their own dso and not link to |
|
587 |
# the STATIC_LIBS_LIST. |
|
588 |
ifneq ($(findstring $(TARGET).dso,$(RUNTIME_LIBS_LIST)),) |
|
589 |
# (almost) ARM RUNTIME LIBS |
|
590 |
REDUCED_RUNTIME_LIBS_LIST:=$(subst $(TARGET).dso,,$(RUNTIME_LIBS_LIST)) |
|
591 |
||
592 |
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
|
593 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG)) $(addprefix $(RUNTIME_LIBS_PATH)/,$(REDUCED_RUNTIME_LIBS_LIST)) $(located_ARMLIBS) |
3 | 594 |
else |
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
595 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY)) $(addprefix $(RUNTIME_LIBS_PATH)/,$(REDUCED_RUNTIME_LIBS_LIST)) $(located_ARMLIBS) |
3 | 596 |
endif |
597 |
||
598 |
else |
|
599 |
# NORMAL |
|
600 |
# |
|
601 |
ifeq ($(VARIANTTYPE),udeb) |
|
602 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG)) |
|
603 |
else |
|
604 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY)) |
|
605 |
endif |
|
606 |
ifeq ($(HAS_DEDICATED_OP_NEWDEL_LIB),1) |
|
607 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(RUNTIME_LIBS_PATH)/,$(NEWLIB)) |
|
608 |
endif |
|
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
609 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(RUNTIME_LIBS_PATH)/,$(RUNTIME_LIBS_LIST)) $(addprefix $(STATIC_LIBS_PATH)/,$(STATIC_LIBS_LIST)) $(located_ARMLIBS) |
3 | 610 |
|
611 |
endif |
|
612 |
else |
|
613 |
# ARM RUNTIME LIBS |
|
614 |
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
|
615 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG)) $(located_ARMLIBS) |
3 | 616 |
else |
400
554cc189839f
Support for resolving, on Windows only, <env/> 'tool' and 'toolchain' type paths with spaces.
Jon Chatten
parents:
226
diff
changeset
|
617 |
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY)) $(located_ARMLIBS) |
3 | 618 |
endif |
619 |
endif |
|
620 |
||
621 |
# NOTE: the groupin10 macro must be used before a call to the "startrule" macro |
|
622 |
# because the code between startrule and endrule is packaged up into one |
|
623 |
# commandline which would defeat the purpose of groupin10. |
|
624 |
# This is undesirable because viafile generation commands appear |
|
625 |
# outside the relevant tags but it is also unavoidable. |
|
626 |
define linktarget_func |
|
627 |
## 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
|
628 |
$(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 | 629 |
$(if $(MULTIFILE_ENABLED),,@echo -n "" > $(VIAFILE); |
630 |
$(call groupin10,$(LINKOBJECTS)) ;) |
|
75
000ba5e4ba7d
Application of review comments.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
74
diff
changeset
|
631 |
$(call startrule,linkandpostlink) \ |
3 | 632 |
$(if $(PERTURBSTARTTIME),$(RANSLEEP) $(PERTURBMSECS) ;,) \ |
633 |
$(if $(SUPPORTS_STDCPP_NEWLIB),$(if $(located_STATICLIBRARIES),$(CHECKLIB) $(CHECKLIB_TYPE) --elf $(call dblquote,$(located_STATICLIBRARIES)) &&,),) \ |
|
634 |
$(LD) $(LINKER_MISC_FLAGS) $(LINKER_DEFAULT_LIB_PATHS) $(SYMBIAN_LINK_FLAGS) $(if $(DEBUG_INFO),$(LINKER_DEBUG_OPTION),$(LINKER_NODEBUG_OPTION)) \ |
|
635 |
$(if $(ARMLIBS),$(LD_WARNINGS_SUPPRESSION_ARMLIBS),) \ |
|
636 |
$(SHARED_OBJECT_OPTION) $(SPLIT_OPTION) \ |
|
22 | 637 |
$(RW_BASE) \ |
3 | 638 |
$(LINKER_ARCH_OPTION) \ |
22 | 639 |
$(SYMVER_OPTION) $(SO_NAME_OPTION)=$(call dblquote,$(LINKASVERSIONED)) \ |
3 | 640 |
$(LINKER_ENTRYPOINT_SETTING) \ |
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
641 |
-o $$(call dblquote,$(LINK_TARGET)) \ |
3 | 642 |
$(if $(LTCG),$(LTCG_OPTION),) \ |
22 | 643 |
$(LINKER_SYMBOLS_OPTION) $(LINKER_SYMBOLS_FILE_OPTION)=$(call dblquote,$(MAPFILE)) \ |
3 | 644 |
$(LINKEROPTION) \ |
645 |
$(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
|
646 |
$(if $(GENERATELINKERFEEDBACK),$(FEEDBACK_OPTION)$(call dblquote,$(FEEDBACKFILE))) \ |
3 | 647 |
$(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
|
648 |
$(call dblquote,$(e32abiv2_LIBS)) $(LINKER_DEFAULT_LIBS) && \ |
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
649 |
$(ELF2E32) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
650 |
--sid=0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
651 |
--version=$(VERSION) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
652 |
--capability=$(FINAL_CAPABILITIES) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
653 |
--linkas=$(call dblquote,$(LINKASVERSIONED)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
654 |
--fpu=$(if $(ARMFPU),$(ARMFPU),$(POSTLINKER_FPU_DEFAULT)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
655 |
--targettype=$(POSTLINKTARGETTYPE) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
656 |
--output=$$(call dblquote,$$@) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
657 |
--elfinput=$(call dblquote,$(LINK_TARGET)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
658 |
$(if $(UID1),--uid1=0x$(UID1),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
659 |
$(if $(UID2),--uid2=0x$(UID2),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
660 |
$(if $(UID3),--uid3=0x$(UID3),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
661 |
$(if $(VENDORID),--vid=0x$(VENDORID),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
662 |
$(if $(EXPTARGET),--customdlltarget,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
663 |
$(if $(ARMLIBS),--excludeunwantedexports,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
664 |
$(if $(EPOCALLOWDLLDATA),--dlldata,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
665 |
$(if $(EPOCPROCESSPRIORITY),--priority=$(EPOCPROCESSPRIORITY),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
666 |
$(if $(EPOCSTACKSIZE),--stack=0x$(EPOCSTACKSIZE),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
667 |
$(if $(EPOCHEAPSIZEMIN),--heap=0x$(EPOCHEAPSIZEMIN)$(CHAR_COMMA)0x$(EPOCHEAPSIZEMAX),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
668 |
$(if $(EPOCFIXEDPROCESS),--fixedaddress,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
669 |
$(if $(EPOCDATALINKADDRESS),--datalinkaddress=$(EPOCDATALINKADDRESS),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
670 |
$(if $(NAMEDSYMLKUP),--namedlookup,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
671 |
$(if $(SMPSAFE),--smpsafe,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
672 |
$(if $(POSTLINKDEFFILE),--definput=$(POSTLINKDEFFILE),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
673 |
$(if $(EXPORTUNFROZEN),--unfrozen,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
674 |
$(if $(AUTOEXPORTS),--sysdef=$(call dblquote,$(AUTOEXPORTS)),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
675 |
$(if $(CANIGNORENONCALLABLE), \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
676 |
$(if $(IMPORTLIBRARYREQUIRED),,--ignorenoncallable),) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
677 |
$(if $(CANHAVEEXPORTS), --defoutput=$(call dblquote,$(GENERATED_DEFFILE)) --dso=$(GENERATED_DSO)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
678 |
$(if $(filter $(VARIANTTYPE),$(DEBUGGABLE)),--debuggable,) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
679 |
$(if $(POSTLINKER_SUPPORTS_WDP), \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
680 |
--codepaging=$(PAGEDCODE_OPTION) --datapaging=$(PAGEDDATA_OPTION), \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
681 |
$(POSTLINKER_PAGEDOPTION)) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
682 |
$(if $(NOCOMPRESSTARGET),--uncompressed, \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
683 |
$(if $(INFLATECOMPRESSTARGET),--compressionmethod=inflate, \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
684 |
$(if $(BYTEPAIRCOMPRESSTARGET),--compressionmethod=bytepair, \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
685 |
--compressionmethod=$(POSTLINKER_COMPRESSION_DEFAULT)))) \ |
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
686 |
--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
|
687 |
$(if $(SAVESPACE),$(if $(EXPORTUNFROZEN),,&& { $(GNURM) -rf $(INTERMEDIATEPATH); true; })) \ |
75
000ba5e4ba7d
Application of review comments.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
74
diff
changeset
|
688 |
$(call endrule,linkandpostlink) |
3 | 689 |
|
71
ba3ff6a1ecab
Experimental combined linknpostlink.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
27
diff
changeset
|
690 |
$(MAPFILE): $(E32TARGET) |
74
2f301831ccbb
Add dependency for .sym files.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
72
diff
changeset
|
691 |
$(LINK_TARGET): $(E32TARGET) |
3 | 692 |
endef |
75
000ba5e4ba7d
Application of review comments.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
74
diff
changeset
|
693 |
ifneq ($(DOPOSTLINK),) |
3 | 694 |
$(eval $(linktarget_func)) |
75
000ba5e4ba7d
Application of review comments.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents:
74
diff
changeset
|
695 |
endif # ifneq ($(DOPOSTLINK),) |
3 | 696 |
|
5 | 697 |
CLEANTARGETS:=$(CLEANTARGETS) $(VIAFILE) $(if $(GENERATELINKERFEEDBACK),$(FEEDBACKFILE)) $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT)) |
3 | 698 |
WHATRELEASE:=$(WHATRELEASE) $(MAPFILE) |
699 |
||
700 |
endif # if TARGETTYPE lib |
|
701 |
||
702 |
||
703 |
## Run trace compiler ############################################## |
|
704 |
ifeq ($(UID3),) |
|
705 |
ifeq ($(UID2),) |
|
706 |
USE_TRACE_COMPILER:= |
|
707 |
else |
|
708 |
UID_TC:=$(UID2) |
|
709 |
endif |
|
710 |
else |
|
711 |
UID_TC:=$(UID3) |
|
712 |
endif |
|
713 |
||
714 |
# USE_TRACE_COMPILER defaults to blank in Raptor config. |
|
715 |
# Users can turn TC on by setting it to 1 in user config. |
|
716 |
ifneq ($(USE_TRACE_COMPILER),) |
|
516
cd8318d5fb3a
Somewhat more sane choice of directory.
timothy.murphy@nokia.com
parents:
511
diff
changeset
|
717 |
# TARGETEXT is already set |
3 | 718 |
include $(FLMHOME)/tracecompiler.mk |
163
c3eca3dd5925
Fixing bug 1494 (tracecompiler whatlog) properly this time
Iain Williamson <iain.williamson@nokia.com>
parents:
161
diff
changeset
|
719 |
WHATRELEASE:=$(WHATRELEASE) $(TRACE_DICTIONARY) $(AUTOGEN_HEADER) |
511
7581d432643a
fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents:
483
diff
changeset
|
720 |
ifneq ($(TRACE_PATH),) |
7581d432643a
fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents:
483
diff
changeset
|
721 |
CDEFS:=$(CDEFS) OST_TRACE_COMPILER_IN_USE |
7581d432643a
fix: support new trace compiler features for preventing clashes. Automatically turn on OST_TRACE_COMPILER_IN_USE macro. Look for trace header in systemincludes. Make directories in makefile parse to prevent clashes during build. Correct path for autogen headers. Correct case issue with autogen headers on Linux.
timothy.murphy@nokia.com
parents:
483
diff
changeset
|
722 |
endif |
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) \ |
801 |
--via $$(call dblquote, $(MULTIFILE_VIAFILE)),$(OUTPUT_OPTION) $$@ $$(call dblquote, $$<)) \ |
|
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,) \ |
|
860 |
$$(call dblquote, $$<) $(OUTPUT_OPTION) $$(@) \ |
|
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))) \ |
3 | 895 |
$$(call dblquote, $$<) $(OUTPUT_OPTION) $$(@) \ |
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))) \ |
|
990 |
$$(call dblquote, $$<) $(OUTPUT_OPTION) $$@ \ |
|
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) ;,) \ |
|
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
1016 |
$(CC) $(e32abiv2_PREFILE_OPTIONS) $(OUTPUT_OPTION) $$@ $$(call dblquote,$1) \ |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
173
diff
changeset
|
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))) \ |
3 | 1061 |
$$(call dblquote, $$<) $(OUTPUT_OPTION) $$@ \ |
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 \ |
|
1066 |
$(OUTPUT_OPTION) $$@ $$(call dblquote,$2) > $(call dblquote,$(DEPENDFILENAME)) \ |
|
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 |