[heap] Move CALL_HEAP_FUNCTION macro into factory.cc file.
[platform/upstream/v8.git] / Makefile
1 # Copyright 2012 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are
4 # met:
5 #
6 #     * Redistributions of source code must retain the above copyright
7 #       notice, this list of conditions and the following disclaimer.
8 #     * Redistributions in binary form must reproduce the above
9 #       copyright notice, this list of conditions and the following
10 #       disclaimer in the documentation and/or other materials provided
11 #       with the distribution.
12 #     * Neither the name of Google Inc. nor the names of its
13 #       contributors may be used to endorse or promote products derived
14 #       from this software without specific prior written permission.
15 #
16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28
29 # Variable default definitions. Override them by exporting them in your shell.
30 OUTDIR ?= out
31 TESTJOBS ?=
32 GYPFLAGS ?=
33 TESTFLAGS ?=
34 ANDROID_NDK_HOST_ARCH ?=
35 ANDROID_V8 ?= /data/local/tmp/v8
36 NACL_SDK_ROOT ?=
37
38 # Special build flags. Use them like this: "make library=shared"
39
40 # library=shared || component=shared_library
41 ifeq ($(library), shared)
42   GYPFLAGS += -Dcomponent=shared_library
43 endif
44 ifdef component
45   GYPFLAGS += -Dcomponent=$(component)
46 endif
47 # disassembler=on
48 ifeq ($(disassembler), on)
49   GYPFLAGS += -Dv8_enable_disassembler=1
50 endif
51 # objectprint=on
52 ifeq ($(objectprint), on)
53   GYPFLAGS += -Dv8_object_print=1
54 endif
55 # verifyheap=on
56 ifeq ($(verifyheap), on)
57   GYPFLAGS += -Dv8_enable_verify_heap=1
58 endif
59 # tracemaps=on
60 ifeq ($(tracemaps), on)
61   GYPFLAGS += -Dv8_trace_maps=1
62 endif
63 # backtrace=off
64 ifeq ($(backtrace), off)
65   GYPFLAGS += -Dv8_enable_backtrace=0
66 else
67   GYPFLAGS += -Dv8_enable_backtrace=1
68 endif
69 # verifypredictable=on
70 ifeq ($(verifypredictable), on)
71   GYPFLAGS += -Dv8_enable_verify_predictable=1
72 endif
73 # snapshot=off
74 ifeq ($(snapshot), off)
75   GYPFLAGS += -Dv8_use_snapshot='false'
76 endif
77 ifeq ($(snapshot), external)
78   GYPFLAGS += -Dv8_use_external_startup_data=1
79 endif
80 # extrachecks=on/off
81 ifeq ($(extrachecks), on)
82   GYPFLAGS += -Ddcheck_always_on=1 -Dv8_enable_handle_zapping=1
83 endif
84 ifeq ($(extrachecks), off)
85   GYPFLAGS += -Ddcheck_always_on=0 -Dv8_enable_handle_zapping=0
86 endif
87 # slowdchecks=on/off
88 ifeq ($(slowdchecks), on)
89   GYPFLAGS += -Dv8_enable_slow_dchecks=1
90 endif
91 ifeq ($(slowdchecks), off)
92   GYPFLAGS += -Dv8_enable_slow_dchecks=0
93 endif
94 # debugsymbols=on
95 ifeq ($(debugsymbols), on)
96   GYPFLAGS += -Drelease_extra_cflags=-ggdb3
97 endif
98 # gdbjit=on/off
99 ifeq ($(gdbjit), on)
100   GYPFLAGS += -Dv8_enable_gdbjit=1
101 endif
102 ifeq ($(gdbjit), off)
103   GYPFLAGS += -Dv8_enable_gdbjit=0
104 endif
105 # vtunejit=on
106 ifeq ($(vtunejit), on)
107   GYPFLAGS += -Dv8_enable_vtunejit=1
108 endif
109 # unalignedaccess=on
110 ifeq ($(unalignedaccess), on)
111   GYPFLAGS += -Dv8_can_use_unaligned_accesses=true
112 endif
113 # randomseed=12345, disable random seed via randomseed=0
114 ifdef randomseed
115   GYPFLAGS += -Dv8_random_seed=$(randomseed)
116 endif
117 # soname_version=1.2.3
118 ifdef soname_version
119   GYPFLAGS += -Dsoname_version=$(soname_version)
120 endif
121 # werror=no
122 ifeq ($(werror), no)
123   GYPFLAGS += -Dwerror=''
124 endif
125 # presubmit=no
126 ifeq ($(presubmit), no)
127   TESTFLAGS += --no-presubmit
128 endif
129 # strictaliasing=off (workaround for GCC-4.5)
130 ifeq ($(strictaliasing), off)
131   GYPFLAGS += -Dv8_no_strict_aliasing=1
132 endif
133 # regexp=interpreted
134 ifeq ($(regexp), interpreted)
135   GYPFLAGS += -Dv8_interpreted_regexp=1
136 endif
137 # i18nsupport=off
138 ifeq ($(i18nsupport), off)
139   GYPFLAGS += -Dv8_enable_i18n_support=0
140   TESTFLAGS += --noi18n
141 endif
142 # deprecationwarnings=on
143 ifeq ($(deprecationwarnings), on)
144   GYPFLAGS += -Dv8_deprecation_warnings=1
145 endif
146 # vectorstores=on
147 ifeq ($(vectorstores), on)
148   GYPFLAGS += -Dv8_vector_stores=1
149 endif
150 # imminentdeprecationwarnings=on
151 ifeq ($(imminentdeprecationwarnings), on)
152   GYPFLAGS += -Dv8_imminent_deprecation_warnings=1
153 endif
154 # asan=on
155 ifeq ($(asan), on)
156   GYPFLAGS += -Dasan=1 -Dclang=1
157   TESTFLAGS += --asan
158   ifeq ($(lsan), on)
159     GYPFLAGS += -Dlsan=1
160   endif
161 endif
162 ifdef embedscript
163   GYPFLAGS += -Dembed_script=$(embedscript)
164 endif
165 ifeq ($(goma), on)
166   GYPFLAGS += -Duse_goma=1
167 endif
168 # arm specific flags.
169 # arm_version=<number | "default">
170 ifneq ($(strip $(arm_version)),)
171   GYPFLAGS += -Darm_version=$(arm_version)
172 else
173 # Deprecated (use arm_version instead): armv7=false/true
174 ifeq ($(armv7), false)
175   GYPFLAGS += -Darm_version=6
176 else
177 ifeq ($(armv7), true)
178   GYPFLAGS += -Darm_version=7
179 endif
180 endif
181 endif
182 # hardfp=on/off. Deprecated, use armfloatabi
183 ifeq ($(hardfp),on)
184   GYPFLAGS += -Darm_float_abi=hard
185 else
186 ifeq ($(hardfp),off)
187   GYPFLAGS += -Darm_float_abi=softfp
188 endif
189 endif
190 # fpu: armfpu=xxx
191 # xxx: vfp, vfpv3-d16, vfpv3, neon.
192 ifeq ($(armfpu),)
193   GYPFLAGS += -Darm_fpu=default
194 else
195   GYPFLAGS += -Darm_fpu=$(armfpu)
196 endif
197 # float abi: armfloatabi=softfp/hard
198 ifeq ($(armfloatabi),)
199 ifeq ($(hardfp),)
200   GYPFLAGS += -Darm_float_abi=default
201 endif
202 else
203   GYPFLAGS += -Darm_float_abi=$(armfloatabi)
204 endif
205 # armthumb=on/off
206 ifeq ($(armthumb), off)
207   GYPFLAGS += -Darm_thumb=0
208 else
209 ifeq ($(armthumb), on)
210   GYPFLAGS += -Darm_thumb=1
211 endif
212 endif
213 # arm_test_noprobe=on
214 # With this flag set, by default v8 will only use features implied
215 # by the compiler (no probe). This is done by modifying the default
216 # values of enable_armv7, enable_vfp3, enable_32dregs and enable_neon.
217 # Modifying these flags when launching v8 will enable the probing for
218 # the specified values.
219 ifeq ($(arm_test_noprobe), on)
220   GYPFLAGS += -Darm_test_noprobe=on
221 endif
222
223 # Optionally enable wasm prototype.
224 # Assume you've placed a link to v8-native-prototype in third_party/wasm.
225 ifeq ($(wasm), on)
226   GYPFLAGS += -Dv8_wasm=1
227 endif
228
229 # ----------------- available targets: --------------------
230 # - "grokdump": rebuilds heap constants lists used by grokdump
231 # - any arch listed in ARCHES (see below)
232 # - any mode listed in MODES
233 # - every combination <arch>.<mode>, e.g. "ia32.release"
234 # - "native": current host's architecture, release mode
235 # - any of the above with .check appended, e.g. "ia32.release.check"
236 # - "android": cross-compile for Android/ARM
237 # - "nacl" : cross-compile for Native Client (ia32 and x64)
238 # - default (no target specified): build all DEFAULT_ARCHES and MODES
239 # - "check": build all targets and run all tests
240 # - "<arch>.clean" for any <arch> in ARCHES
241 # - "clean": clean all ARCHES
242
243 # ----------------- internal stuff ------------------------
244
245 # Architectures and modes to be compiled. Consider these to be internal
246 # variables, don't override them (use the targets instead).
247 ARCHES = ia32 x64 x32 arm arm64 mips mipsel mips64el x87 ppc ppc64
248 DEFAULT_ARCHES = ia32 x64 arm
249 MODES = release debug optdebug
250 DEFAULT_MODES = release debug
251 ANDROID_ARCHES = android_ia32 android_x64 android_arm android_arm64 \
252                  android_mipsel android_x87
253 NACL_ARCHES = nacl_ia32 nacl_x64
254
255 # List of files that trigger Makefile regeneration:
256 GYPFILES = third_party/icu/icu.gypi third_party/icu/icu.gyp \
257            build/shim_headers.gypi build/features.gypi build/standalone.gypi \
258            build/toolchain.gypi build/all.gyp build/mac/asan.gyp \
259            test/cctest/cctest.gyp \
260            test/unittests/unittests.gyp tools/gyp/v8.gyp \
261            tools/parser-shell.gyp testing/gmock.gyp testing/gtest.gyp \
262            buildtools/third_party/libc++abi/libc++abi.gyp \
263            buildtools/third_party/libc++/libc++.gyp samples/samples.gyp \
264            src/third_party/vtune/v8vtune.gyp src/d8.gyp
265
266 # If vtunejit=on, the v8vtune.gyp will be appended.
267 ifeq ($(vtunejit), on)
268   GYPFILES += src/third_party/vtune/v8vtune.gyp
269 endif
270 # Generates all combinations of ARCHES and MODES, e.g. "ia32.release".
271 BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES)))
272 ANDROID_BUILDS = $(foreach mode,$(MODES), \
273                    $(addsuffix .$(mode),$(ANDROID_ARCHES)))
274 NACL_BUILDS = $(foreach mode,$(MODES), \
275                    $(addsuffix .$(mode),$(NACL_ARCHES)))
276 # Generates corresponding test targets, e.g. "ia32.release.check".
277 CHECKS = $(addsuffix .check,$(BUILDS))
278 QUICKCHECKS = $(addsuffix .quickcheck,$(BUILDS))
279 ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS))
280 NACL_CHECKS = $(addsuffix .check,$(NACL_BUILDS))
281 # File where previously used GYPFLAGS are stored.
282 ENVFILE = $(OUTDIR)/environment
283
284 .PHONY: all check clean builddeps dependencies $(ENVFILE).new native \
285         qc quickcheck $(QUICKCHECKS) turbocheck \
286         $(addsuffix .quickcheck,$(MODES)) $(addsuffix .quickcheck,$(ARCHES)) \
287         $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \
288         $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \
289         $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \
290         $(NACL_ARCHES) $(NACL_BUILDS) $(NACL_CHECKS) \
291         must-set-NACL_SDK_ROOT
292
293 # Target definitions. "all" is the default.
294 all: $(DEFAULT_MODES)
295
296 # Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile
297 # having been created before.
298 buildbot:
299         $(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \
300                 builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)"
301
302 # Compile targets. MODES and ARCHES are convenience targets.
303 .SECONDEXPANSION:
304 $(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES))
305
306 $(ARCHES): $(addprefix $$@.,$(DEFAULT_MODES))
307
308 # Defines how to build a particular target (e.g. ia32.release).
309 $(BUILDS): $(OUTDIR)/Makefile.$$@
310         @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \
311                  BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
312                              python -c "print \
313                              raw_input().replace('opt', '').capitalize()") \
314                  builddir="$(shell pwd)/$(OUTDIR)/$@"
315
316 native: $(OUTDIR)/Makefile.native
317         @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \
318                  BUILDTYPE=Release \
319                  builddir="$(shell pwd)/$(OUTDIR)/$@"
320
321 $(ANDROID_ARCHES): $(addprefix $$@.,$(MODES))
322
323 $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) Makefile.android
324         @$(MAKE) -f Makefile.android $@ \
325                 ARCH="$(basename $@)" \
326                 MODE="$(subst .,,$(suffix $@))" \
327                 OUTDIR="$(OUTDIR)" \
328                 GYPFLAGS="$(GYPFLAGS)"
329
330 $(NACL_ARCHES): $(addprefix $$@.,$(MODES))
331
332 $(NACL_BUILDS): $(GYPFILES) $(ENVFILE) \
333                    Makefile.nacl must-set-NACL_SDK_ROOT
334         @$(MAKE) -f Makefile.nacl $@ \
335                 ARCH="$(basename $@)" \
336                 MODE="$(subst .,,$(suffix $@))" \
337                 OUTDIR="$(OUTDIR)" \
338                 GYPFLAGS="$(GYPFLAGS)"
339
340 # Test targets.
341 check: all
342         @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
343             --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \
344             $(TESTFLAGS)
345
346 $(addsuffix .check,$(MODES)): $$(basename $$@)
347         @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
348             --mode=$(basename $@) $(TESTFLAGS)
349
350 $(addsuffix .check,$(ARCHES)): $$(basename $$@)
351         @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
352             --arch=$(basename $@) $(TESTFLAGS)
353
354 $(CHECKS): $$(basename $$@)
355         @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
356             --arch-and-mode=$(basename $@) $(TESTFLAGS)
357
358 $(addsuffix .quickcheck,$(MODES)): $$(basename $$@)
359         @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
360             --mode=$(basename $@) $(TESTFLAGS) --quickcheck
361
362 $(addsuffix .quickcheck,$(ARCHES)): $$(basename $$@)
363         @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
364             --arch=$(basename $@) $(TESTFLAGS) --quickcheck
365
366 $(QUICKCHECKS): $$(basename $$@)
367         @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
368             --arch-and-mode=$(basename $@) $(TESTFLAGS) --quickcheck
369
370 $(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@)
371         @tools/android-sync.sh $(basename $@) $(OUTDIR) \
372                                $(shell pwd) $(ANDROID_V8)
373
374 $(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync
375         @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
376              --arch-and-mode=$(basename $@) \
377              --timeout=600 \
378              --command-prefix="tools/android-run.py" $(TESTFLAGS)
379
380 $(addsuffix .check, $(ANDROID_ARCHES)): \
381                 $(addprefix $$(basename $$@).,$(MODES)).check
382
383 $(addsuffix .check, $(NACL_BUILDS)): $$(basename $$@)
384         @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
385              --arch-and-mode=$(basename $@) \
386              --timeout=600 --nopresubmit --noi18n \
387              --command-prefix="tools/nacl-run.py"
388
389 $(addsuffix .check, $(NACL_ARCHES)): \
390                 $(addprefix $$(basename $$@).,$(MODES)).check
391
392 native.check: native
393         @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \
394             --arch-and-mode=. $(TESTFLAGS)
395
396 SUPERFASTTESTMODES = ia32.release
397 FASTTESTMODES = $(SUPERFASTTESTMODES),x64.release,ia32.optdebug,x64.optdebug,arm.optdebug,arm64.release
398 FASTCOMPILEMODES = $(FASTTESTMODES),arm64.optdebug
399
400 COMMA = ,
401 EMPTY =
402 SPACE = $(EMPTY) $(EMPTY)
403 quickcheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES))
404         tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
405             --arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) --quickcheck \
406             --download-data mozilla webkit
407         tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
408             --arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) --quickcheck
409 qc: quickcheck
410
411 turbocheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES))
412         tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
413             --arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) \
414             --quickcheck --variants=turbofan --download-data mozilla webkit
415         tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
416             --arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) \
417             --quickcheck --variants=turbofan
418 tc: turbocheck
419
420 # Clean targets. You can clean each architecture individually, or everything.
421 $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)):
422         rm -f $(OUTDIR)/Makefile.$(basename $@)*
423         rm -rf $(OUTDIR)/$(basename $@).release
424         rm -rf $(OUTDIR)/$(basename $@).debug
425         rm -rf $(OUTDIR)/$(basename $@).optdebug
426         find $(OUTDIR) -regex '.*\(host\|target\)\.$(basename $@).*\.mk' -delete
427
428 native.clean:
429         rm -f $(OUTDIR)/Makefile.native
430         rm -rf $(OUTDIR)/native
431         find $(OUTDIR) -regex '.*\(host\|target\)\.native\.mk' -delete
432
433 clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)) native.clean gtags.clean
434
435 # GYP file generation targets.
436 OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(BUILDS))
437 $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
438         $(eval CXX_TARGET_ARCH:=$(shell $(CXX) -v 2>&1 | grep ^Target: | \
439                 cut -f 2 -d " " | cut -f 1 -d "-" ))
440         $(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH)))
441         $(eval CXX_TARGET_ARCH:=$(subst x86_64,x64,$(CXX_TARGET_ARCH)))
442         $(eval V8_TARGET_ARCH:=$(subst .,,$(suffix $(basename $@))))
443         PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \
444         GYP_GENERATORS=make \
445         build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
446                       -Ibuild/standalone.gypi --depth=. \
447                       -Dv8_target_arch=$(V8_TARGET_ARCH) \
448                       $(if $(findstring $(CXX_TARGET_ARCH),$(V8_TARGET_ARCH)), \
449                       -Dtarget_arch=$(V8_TARGET_ARCH),) \
450                       $(if $(findstring optdebug,$@),-Dv8_optimized_debug=1,) \
451                       -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS)
452
453 $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE)
454         PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \
455         GYP_GENERATORS=make \
456         build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
457                       -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS)
458
459 # Note that NACL_SDK_ROOT must be set to point to an appropriate
460 # Native Client SDK before using this makefile. You can download
461 # an SDK here:
462 #   https://developers.google.com/native-client/sdk/download
463 # The path indicated by NACL_SDK_ROOT will typically end with
464 # a folder for a pepper version such as "pepper_25" that should
465 # have "tools" and "toolchain" subdirectories.
466 must-set-NACL_SDK_ROOT:
467 ifndef NACL_SDK_ROOT
468           $(error NACL_SDK_ROOT must be set)
469 endif
470
471 # Replaces the old with the new environment file if they're different, which
472 # will trigger GYP to regenerate Makefiles.
473 $(ENVFILE): $(ENVFILE).new
474         @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) > /dev/null; \
475             then rm $(ENVFILE).new; \
476             else mv $(ENVFILE).new $(ENVFILE); fi
477
478 # Stores current GYPFLAGS in a file.
479 $(ENVFILE).new:
480         $(eval CXX_TARGET_ARCH:=$(shell $(CXX) -v 2>&1 | grep ^Target: | \
481                 cut -f 2 -d " " | cut -f 1 -d "-" ))
482         $(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH)))
483         $(eval CXX_TARGET_ARCH:=$(subst x86_64,x64,$(CXX_TARGET_ARCH)))
484         @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS) -Dtarget_arch=$(CXX_TARGET_ARCH)" > $(ENVFILE).new;
485
486 # Heap constants for grokdump.
487 DUMP_FILE = tools/v8heapconst.py
488 grokdump: ia32.release
489         @cat $(DUMP_FILE).tmpl > $(DUMP_FILE)
490         @$(OUTDIR)/ia32.release/d8 --dump-heap-constants >> $(DUMP_FILE)
491
492 # Support for the GNU GLOBAL Source Code Tag System.
493 gtags.files: $(GYPFILES) $(ENVFILE)
494         @find include src test -name '*.h' -o -name '*.cc' -o -name '*.c' > $@
495
496 # We need to manually set the stack limit here, to work around bugs in
497 # gmake-3.81 and global-5.7.1 on recent 64-bit Linux systems.
498 GPATH GRTAGS GSYMS GTAGS: gtags.files $(shell cat gtags.files 2> /dev/null)
499         @bash -c 'ulimit -s 10240 && GTAGSFORCECPP=yes gtags -i -q -f $<'
500
501 gtags.clean:
502         rm -f gtags.files GPATH GRTAGS GSYMS GTAGS
503
504 dependencies builddeps:
505         $(error Use 'gclient sync' instead)