Home | History | Annotate | Download | only in v8
      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 # ----------------- available targets: --------------------
    224 # - "grokdump": rebuilds heap constants lists used by grokdump
    225 # - any arch listed in ARCHES (see below)
    226 # - any mode listed in MODES
    227 # - every combination <arch>.<mode>, e.g. "ia32.release"
    228 # - "native": current host's architecture, release mode
    229 # - any of the above with .check appended, e.g. "ia32.release.check"
    230 # - "android": cross-compile for Android/ARM
    231 # - "nacl" : cross-compile for Native Client (ia32 and x64)
    232 # - default (no target specified): build all DEFAULT_ARCHES and MODES
    233 # - "check": build all targets and run all tests
    234 # - "<arch>.clean" for any <arch> in ARCHES
    235 # - "clean": clean all ARCHES
    236 
    237 # ----------------- internal stuff ------------------------
    238 
    239 # Architectures and modes to be compiled. Consider these to be internal
    240 # variables, don't override them (use the targets instead).
    241 ARCHES = ia32 x64 x32 arm arm64 mips mipsel mips64 mips64el x87 ppc ppc64 \
    242 		 s390 s390x
    243 DEFAULT_ARCHES = ia32 x64 arm
    244 MODES = release debug optdebug
    245 DEFAULT_MODES = release debug
    246 ANDROID_ARCHES = android_ia32 android_x64 android_arm android_arm64 \
    247 		 android_mipsel android_x87
    248 NACL_ARCHES = nacl_ia32 nacl_x64
    249 
    250 # List of files that trigger Makefile regeneration:
    251 GYPFILES = third_party/icu/icu.gypi third_party/icu/icu.gyp \
    252 	   build/shim_headers.gypi build/features.gypi build/standalone.gypi \
    253 	   build/toolchain.gypi build/all.gyp build/mac/asan.gyp \
    254 	   test/cctest/cctest.gyp \
    255 	   test/unittests/unittests.gyp tools/gyp/v8.gyp \
    256 	   tools/parser-shell.gyp testing/gmock.gyp testing/gtest.gyp \
    257 	   buildtools/third_party/libc++abi/libc++abi.gyp \
    258 	   buildtools/third_party/libc++/libc++.gyp samples/samples.gyp \
    259 	   src/third_party/vtune/v8vtune.gyp src/d8.gyp
    260 
    261 # If vtunejit=on, the v8vtune.gyp will be appended.
    262 ifeq ($(vtunejit), on)
    263   GYPFILES += src/third_party/vtune/v8vtune.gyp
    264 endif
    265 # Generates all combinations of ARCHES and MODES, e.g. "ia32.release".
    266 BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES)))
    267 ANDROID_BUILDS = $(foreach mode,$(MODES), \
    268                    $(addsuffix .$(mode),$(ANDROID_ARCHES)))
    269 NACL_BUILDS = $(foreach mode,$(MODES), \
    270                    $(addsuffix .$(mode),$(NACL_ARCHES)))
    271 # Generates corresponding test targets, e.g. "ia32.release.check".
    272 CHECKS = $(addsuffix .check,$(BUILDS))
    273 QUICKCHECKS = $(addsuffix .quickcheck,$(BUILDS))
    274 ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS))
    275 NACL_CHECKS = $(addsuffix .check,$(NACL_BUILDS))
    276 # File where previously used GYPFLAGS are stored.
    277 ENVFILE = $(OUTDIR)/environment
    278 
    279 .PHONY: all check clean builddeps dependencies $(ENVFILE).new native \
    280         qc quickcheck $(QUICKCHECKS) turbocheck \
    281         $(addsuffix .quickcheck,$(MODES)) $(addsuffix .quickcheck,$(ARCHES)) \
    282         $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \
    283         $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \
    284         $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \
    285         $(NACL_ARCHES) $(NACL_BUILDS) $(NACL_CHECKS) \
    286         must-set-NACL_SDK_ROOT
    287 
    288 # Target definitions. "all" is the default.
    289 all: $(DEFAULT_MODES)
    290 
    291 # Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile
    292 # having been created before.
    293 buildbot:
    294 	$(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \
    295 	        builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)"
    296 
    297 # Compile targets. MODES and ARCHES are convenience targets.
    298 .SECONDEXPANSION:
    299 $(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES))
    300 
    301 $(ARCHES): $(addprefix $$@.,$(DEFAULT_MODES))
    302 
    303 # Defines how to build a particular target (e.g. ia32.release).
    304 $(BUILDS): $(OUTDIR)/Makefile.$$@
    305 	@$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \
    306 	         BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
    307 	                     python -c "print \
    308 	                     raw_input().replace('opt', '').capitalize()") \
    309 	         builddir="$(shell pwd)/$(OUTDIR)/$@"
    310 
    311 native: $(OUTDIR)/Makefile.native
    312 	@$(MAKE) -C "$(OUTDIR)" -f Makefile.native \
    313 	         BUILDTYPE=Release \
    314 	         builddir="$(shell pwd)/$(OUTDIR)/$@"
    315 
    316 $(ANDROID_ARCHES): $(addprefix $$@.,$(MODES))
    317 
    318 $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) Makefile.android
    319 	@$(MAKE) -f Makefile.android $@ \
    320 	        ARCH="$(basename $@)" \
    321 	        MODE="$(subst .,,$(suffix $@))" \
    322 	        OUTDIR="$(OUTDIR)" \
    323 	        GYPFLAGS="$(GYPFLAGS)"
    324 
    325 $(NACL_ARCHES): $(addprefix $$@.,$(MODES))
    326 
    327 $(NACL_BUILDS): $(GYPFILES) $(ENVFILE) \
    328 		   Makefile.nacl must-set-NACL_SDK_ROOT
    329 	@$(MAKE) -f Makefile.nacl $@ \
    330 	        ARCH="$(basename $@)" \
    331 	        MODE="$(subst .,,$(suffix $@))" \
    332 	        OUTDIR="$(OUTDIR)" \
    333 	        GYPFLAGS="$(GYPFLAGS)"
    334 
    335 # Test targets.
    336 check: all
    337 	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
    338 	    --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \
    339 	    $(TESTFLAGS)
    340 
    341 $(addsuffix .check,$(MODES)): $$(basename $$@)
    342 	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
    343 	    --mode=$(basename $@) $(TESTFLAGS)
    344 
    345 $(addsuffix .check,$(ARCHES)): $$(basename $$@)
    346 	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
    347 	    --arch=$(basename $@) $(TESTFLAGS)
    348 
    349 $(CHECKS): $$(basename $$@)
    350 	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
    351 	    --arch-and-mode=$(basename $@) $(TESTFLAGS)
    352 
    353 $(addsuffix .quickcheck,$(MODES)): $$(basename $$@)
    354 	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
    355 	    --mode=$(basename $@) $(TESTFLAGS) --quickcheck
    356 
    357 $(addsuffix .quickcheck,$(ARCHES)): $$(basename $$@)
    358 	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
    359 	    --arch=$(basename $@) $(TESTFLAGS) --quickcheck
    360 
    361 $(QUICKCHECKS): $$(basename $$@)
    362 	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
    363 	    --arch-and-mode=$(basename $@) $(TESTFLAGS) --quickcheck
    364 
    365 $(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@)
    366 	@tools/android-sync.sh $(basename $@) $(OUTDIR) \
    367 	                       $(shell pwd) $(ANDROID_V8)
    368 
    369 $(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync
    370 	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
    371 	     --arch-and-mode=$(basename $@) \
    372 	     --timeout=600 \
    373 	     --command-prefix="tools/android-run.py" $(TESTFLAGS)
    374 
    375 $(addsuffix .check, $(ANDROID_ARCHES)): \
    376                 $(addprefix $$(basename $$@).,$(MODES)).check
    377 
    378 $(addsuffix .check, $(NACL_BUILDS)): $$(basename $$@)
    379 	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
    380 	     --arch-and-mode=$(basename $@) \
    381 	     --timeout=600 --nopresubmit --noi18n \
    382 	     --command-prefix="tools/nacl-run.py"
    383 
    384 $(addsuffix .check, $(NACL_ARCHES)): \
    385                 $(addprefix $$(basename $$@).,$(MODES)).check
    386 
    387 native.check: native
    388 	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \
    389 	    --arch-and-mode=. $(TESTFLAGS)
    390 
    391 SUPERFASTTESTMODES = ia32.release
    392 FASTTESTMODES = $(SUPERFASTTESTMODES),x64.release,ia32.optdebug,x64.optdebug,arm.optdebug,arm64.release
    393 FASTCOMPILEMODES = $(FASTTESTMODES),arm64.optdebug
    394 
    395 COMMA = ,
    396 EMPTY =
    397 SPACE = $(EMPTY) $(EMPTY)
    398 quickcheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES))
    399 	tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
    400 	    --arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) --quickcheck \
    401 	    --download-data mozilla webkit
    402 	tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
    403 	    --arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) --quickcheck
    404 qc: quickcheck
    405 
    406 turbocheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES))
    407 	tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
    408 	    --arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) \
    409 	    --quickcheck --variants=turbofan --download-data mozilla webkit
    410 	tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
    411 	    --arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) \
    412 	    --quickcheck --variants=turbofan
    413 tc: turbocheck
    414 
    415 # Clean targets. You can clean each architecture individually, or everything.
    416 $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)):
    417 	rm -f $(OUTDIR)/Makefile.$(basename $@)*
    418 	rm -rf $(OUTDIR)/$(basename $@).release
    419 	rm -rf $(OUTDIR)/$(basename $@).debug
    420 	rm -rf $(OUTDIR)/$(basename $@).optdebug
    421 	find $(OUTDIR) -regex '.*\(host\|target\)\.$(basename $@).*\.mk' -delete
    422 
    423 native.clean:
    424 	rm -f $(OUTDIR)/Makefile.native
    425 	rm -rf $(OUTDIR)/native
    426 	find $(OUTDIR) -regex '.*\(host\|target\)\.native\.mk' -delete
    427 
    428 clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)) native.clean gtags.clean
    429 
    430 # GYP file generation targets.
    431 OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(BUILDS))
    432 $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
    433 	$(eval CXX_TARGET_ARCH:=$(shell $(CXX) -v 2>&1 | grep ^Target: | \
    434 	        cut -f 2 -d " " | cut -f 1 -d "-" ))
    435 	$(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH)))
    436 	$(eval CXX_TARGET_ARCH:=$(subst x86_64,x64,$(CXX_TARGET_ARCH)))
    437 	$(eval V8_TARGET_ARCH:=$(subst .,,$(suffix $(basename $@))))
    438 	PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \
    439 	GYP_GENERATORS=make \
    440 	build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
    441 	              -Ibuild/standalone.gypi --depth=. \
    442 	              -Dv8_target_arch=$(V8_TARGET_ARCH) \
    443 	              $(if $(findstring $(CXX_TARGET_ARCH),$(V8_TARGET_ARCH)), \
    444 	              -Dtarget_arch=$(V8_TARGET_ARCH),) \
    445 	              $(if $(findstring optdebug,$@),-Dv8_optimized_debug=1,) \
    446 	              -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS)
    447 
    448 $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE)
    449 	PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \
    450 	GYP_GENERATORS=make \
    451 	build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
    452 	              -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS)
    453 
    454 # Note that NACL_SDK_ROOT must be set to point to an appropriate
    455 # Native Client SDK before using this makefile. You can download
    456 # an SDK here:
    457 #   https://developers.google.com/native-client/sdk/download
    458 # The path indicated by NACL_SDK_ROOT will typically end with
    459 # a folder for a pepper version such as "pepper_25" that should
    460 # have "tools" and "toolchain" subdirectories.
    461 must-set-NACL_SDK_ROOT:
    462 ifndef NACL_SDK_ROOT
    463 	  $(error NACL_SDK_ROOT must be set)
    464 endif
    465 
    466 # Replaces the old with the new environment file if they're different, which
    467 # will trigger GYP to regenerate Makefiles.
    468 $(ENVFILE): $(ENVFILE).new
    469 	@if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) > /dev/null; \
    470 	    then rm $(ENVFILE).new; \
    471 	    else mv $(ENVFILE).new $(ENVFILE); fi
    472 
    473 # Stores current GYPFLAGS in a file.
    474 $(ENVFILE).new:
    475 	$(eval CXX_TARGET_ARCH:=$(shell $(CXX) -v 2>&1 | grep ^Target: | \
    476 	        cut -f 2 -d " " | cut -f 1 -d "-" ))
    477 	$(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH)))
    478 	$(eval CXX_TARGET_ARCH:=$(subst x86_64,x64,$(CXX_TARGET_ARCH)))
    479 	@mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS) -Dtarget_arch=$(CXX_TARGET_ARCH)" > $(ENVFILE).new;
    480 
    481 # Heap constants for grokdump.
    482 DUMP_FILE = tools/v8heapconst.py
    483 grokdump: ia32.release
    484 	@cat $(DUMP_FILE).tmpl > $(DUMP_FILE)
    485 	@$(OUTDIR)/ia32.release/d8 --dump-heap-constants >> $(DUMP_FILE)
    486 
    487 # Support for the GNU GLOBAL Source Code Tag System.
    488 gtags.files: $(GYPFILES) $(ENVFILE)
    489 	@find include src test -name '*.h' -o -name '*.cc' -o -name '*.c' > $@
    490 
    491 # We need to manually set the stack limit here, to work around bugs in
    492 # gmake-3.81 and global-5.7.1 on recent 64-bit Linux systems.
    493 GPATH GRTAGS GSYMS GTAGS: gtags.files $(shell cat gtags.files 2> /dev/null)
    494 	@bash -c 'ulimit -s 10240 && GTAGSFORCECPP=yes gtags -i -q -f $<'
    495 
    496 gtags.clean:
    497 	rm -f gtags.files GPATH GRTAGS GSYMS GTAGS
    498 
    499 dependencies builddeps:
    500 	$(error Use 'gclient sync' instead)
    501