2012-01-16 13:29:12 +00:00
|
|
|
# Copyright 2012 the V8 project authors. All rights reserved.
|
2011-08-05 09:44:30 +00:00
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions are
|
|
|
|
# met:
|
|
|
|
#
|
|
|
|
# * Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# * Redistributions in binary form must reproduce the above
|
|
|
|
# copyright notice, this list of conditions and the following
|
|
|
|
# disclaimer in the documentation and/or other materials provided
|
|
|
|
# with the distribution.
|
|
|
|
# * Neither the name of Google Inc. nor the names of its
|
|
|
|
# contributors may be used to endorse or promote products derived
|
|
|
|
# from this software without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
|
|
|
|
# Variable default definitions. Override them by exporting them in your shell.
|
|
|
|
OUTDIR ?= out
|
2012-10-18 14:21:35 +00:00
|
|
|
TESTJOBS ?=
|
2011-08-26 11:23:51 +00:00
|
|
|
GYPFLAGS ?=
|
2011-10-06 11:08:41 +00:00
|
|
|
TESTFLAGS ?=
|
2013-07-17 08:37:48 +00:00
|
|
|
ANDROID_NDK_HOST_ARCH ?=
|
2013-06-28 07:31:23 +00:00
|
|
|
ANDROID_V8 ?= /data/local/tmp/v8
|
2013-04-17 08:27:40 +00:00
|
|
|
NACL_SDK_ROOT ?=
|
2011-08-26 11:23:51 +00:00
|
|
|
|
|
|
|
# Special build flags. Use them like this: "make library=shared"
|
|
|
|
|
|
|
|
# library=shared || component=shared_library
|
|
|
|
ifeq ($(library), shared)
|
|
|
|
GYPFLAGS += -Dcomponent=shared_library
|
|
|
|
endif
|
|
|
|
ifdef component
|
|
|
|
GYPFLAGS += -Dcomponent=$(component)
|
|
|
|
endif
|
|
|
|
# disassembler=on
|
|
|
|
ifeq ($(disassembler), on)
|
|
|
|
GYPFLAGS += -Dv8_enable_disassembler=1
|
|
|
|
endif
|
2011-09-23 09:38:03 +00:00
|
|
|
# objectprint=on
|
|
|
|
ifeq ($(objectprint), on)
|
|
|
|
GYPFLAGS += -Dv8_object_print=1
|
|
|
|
endif
|
2012-10-12 11:41:14 +00:00
|
|
|
# verifyheap=on
|
|
|
|
ifeq ($(verifyheap), on)
|
|
|
|
GYPFLAGS += -Dv8_enable_verify_heap=1
|
|
|
|
endif
|
2014-11-07 16:03:11 +00:00
|
|
|
# tracemaps=on
|
|
|
|
ifeq ($(tracemaps), on)
|
|
|
|
GYPFLAGS += -Dv8_trace_maps=1
|
|
|
|
endif
|
2012-12-14 14:27:06 +00:00
|
|
|
# backtrace=off
|
|
|
|
ifeq ($(backtrace), off)
|
|
|
|
GYPFLAGS += -Dv8_enable_backtrace=0
|
|
|
|
else
|
|
|
|
GYPFLAGS += -Dv8_enable_backtrace=1
|
|
|
|
endif
|
2014-06-20 07:35:48 +00:00
|
|
|
# verifypredictable=on
|
|
|
|
ifeq ($(verifypredictable), on)
|
|
|
|
GYPFLAGS += -Dv8_enable_verify_predictable=1
|
|
|
|
endif
|
2011-08-26 11:23:51 +00:00
|
|
|
# snapshot=off
|
|
|
|
ifeq ($(snapshot), off)
|
|
|
|
GYPFLAGS += -Dv8_use_snapshot='false'
|
|
|
|
endif
|
2014-12-10 11:46:27 +00:00
|
|
|
ifeq ($(snapshot), external)
|
|
|
|
GYPFLAGS += -Dv8_use_external_startup_data=1
|
|
|
|
endif
|
2012-09-05 09:24:37 +00:00
|
|
|
# extrachecks=on/off
|
|
|
|
ifeq ($(extrachecks), on)
|
2015-01-08 16:29:27 +00:00
|
|
|
GYPFLAGS += -Ddcheck_always_on=1 -Dv8_enable_handle_zapping=1
|
2012-09-05 09:24:37 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(extrachecks), off)
|
2015-01-08 16:29:27 +00:00
|
|
|
GYPFLAGS += -Ddcheck_always_on=0 -Dv8_enable_handle_zapping=0
|
2012-09-05 09:24:37 +00:00
|
|
|
endif
|
2015-01-09 16:25:36 +00:00
|
|
|
# slowdchecks=on/off
|
|
|
|
ifeq ($(slowdchecks), on)
|
|
|
|
GYPFLAGS += -Dv8_enable_slow_dchecks=1
|
|
|
|
endif
|
|
|
|
ifeq ($(slowdchecks), off)
|
|
|
|
GYPFLAGS += -Dv8_enable_slow_dchecks=0
|
|
|
|
endif
|
2015-04-15 15:20:14 +00:00
|
|
|
# debugsymbols=on
|
|
|
|
ifeq ($(debugsymbols), on)
|
|
|
|
GYPFLAGS += -Drelease_extra_cflags=-ggdb3
|
|
|
|
endif
|
2013-07-03 12:00:40 +00:00
|
|
|
# gdbjit=on/off
|
2011-08-26 11:23:51 +00:00
|
|
|
ifeq ($(gdbjit), on)
|
|
|
|
GYPFLAGS += -Dv8_enable_gdbjit=1
|
|
|
|
endif
|
2013-07-03 12:00:40 +00:00
|
|
|
ifeq ($(gdbjit), off)
|
|
|
|
GYPFLAGS += -Dv8_enable_gdbjit=0
|
|
|
|
endif
|
2013-04-12 12:48:27 +00:00
|
|
|
# vtunejit=on
|
|
|
|
ifeq ($(vtunejit), on)
|
|
|
|
GYPFLAGS += -Dv8_enable_vtunejit=1
|
|
|
|
endif
|
2013-04-16 14:39:48 +00:00
|
|
|
# unalignedaccess=on
|
|
|
|
ifeq ($(unalignedaccess), on)
|
|
|
|
GYPFLAGS += -Dv8_can_use_unaligned_accesses=true
|
|
|
|
endif
|
2013-11-07 12:01:26 +00:00
|
|
|
# randomseed=12345, disable random seed via randomseed=0
|
|
|
|
ifdef randomseed
|
|
|
|
GYPFLAGS += -Dv8_random_seed=$(randomseed)
|
|
|
|
endif
|
2011-09-08 13:20:49 +00:00
|
|
|
# soname_version=1.2.3
|
|
|
|
ifdef soname_version
|
|
|
|
GYPFLAGS += -Dsoname_version=$(soname_version)
|
|
|
|
endif
|
2011-10-06 11:08:41 +00:00
|
|
|
# werror=no
|
|
|
|
ifeq ($(werror), no)
|
|
|
|
GYPFLAGS += -Dwerror=''
|
|
|
|
endif
|
|
|
|
# presubmit=no
|
|
|
|
ifeq ($(presubmit), no)
|
|
|
|
TESTFLAGS += --no-presubmit
|
|
|
|
endif
|
2012-01-18 10:17:03 +00:00
|
|
|
# strictaliasing=off (workaround for GCC-4.5)
|
|
|
|
ifeq ($(strictaliasing), off)
|
|
|
|
GYPFLAGS += -Dv8_no_strict_aliasing=1
|
|
|
|
endif
|
2012-06-14 08:01:05 +00:00
|
|
|
# regexp=interpreted
|
|
|
|
ifeq ($(regexp), interpreted)
|
|
|
|
GYPFLAGS += -Dv8_interpreted_regexp=1
|
|
|
|
endif
|
2013-09-19 12:07:03 +00:00
|
|
|
# i18nsupport=off
|
|
|
|
ifeq ($(i18nsupport), off)
|
|
|
|
GYPFLAGS += -Dv8_enable_i18n_support=0
|
|
|
|
TESTFLAGS += --noi18n
|
2013-07-03 11:22:29 +00:00
|
|
|
endif
|
2015-05-21 10:34:42 +00:00
|
|
|
# deprecationwarnings=on
|
2013-09-30 13:28:23 +00:00
|
|
|
ifeq ($(deprecationwarnings), on)
|
|
|
|
GYPFLAGS += -Dv8_deprecation_warnings=1
|
2014-03-26 10:01:53 +00:00
|
|
|
endif
|
2015-09-11 10:00:05 +00:00
|
|
|
# vectorstores=on
|
|
|
|
ifeq ($(vectorstores), on)
|
|
|
|
GYPFLAGS += -Dv8_vector_stores=1
|
|
|
|
endif
|
2015-05-21 10:34:42 +00:00
|
|
|
# imminentdeprecationwarnings=on
|
|
|
|
ifeq ($(imminentdeprecationwarnings), on)
|
|
|
|
GYPFLAGS += -Dv8_imminent_deprecation_warnings=1
|
|
|
|
endif
|
2015-01-07 13:33:10 +00:00
|
|
|
# asan=on
|
|
|
|
ifeq ($(asan), on)
|
|
|
|
GYPFLAGS += -Dasan=1 -Dclang=1
|
2014-10-06 15:21:37 +00:00
|
|
|
TESTFLAGS += --asan
|
|
|
|
ifeq ($(lsan), on)
|
|
|
|
GYPFLAGS += -Dlsan=1
|
|
|
|
endif
|
2014-03-26 10:01:53 +00:00
|
|
|
endif
|
2015-01-12 15:26:20 +00:00
|
|
|
ifdef embedscript
|
|
|
|
GYPFLAGS += -Dembed_script=$(embedscript)
|
|
|
|
endif
|
2016-03-17 10:32:36 +00:00
|
|
|
ifdef warmupscript
|
|
|
|
GYPFLAGS += -Dwarmup_script=$(warmupscript)
|
|
|
|
endif
|
2015-07-09 09:50:48 +00:00
|
|
|
ifeq ($(goma), on)
|
|
|
|
GYPFLAGS += -Duse_goma=1
|
|
|
|
endif
|
2013-04-16 14:39:48 +00:00
|
|
|
# arm specific flags.
|
2013-12-11 11:58:07 +00:00
|
|
|
# arm_version=<number | "default">
|
|
|
|
ifneq ($(strip $(arm_version)),)
|
|
|
|
GYPFLAGS += -Darm_version=$(arm_version)
|
|
|
|
else
|
|
|
|
# Deprecated (use arm_version instead): armv7=false/true
|
2013-01-03 08:56:05 +00:00
|
|
|
ifeq ($(armv7), false)
|
2013-12-11 11:58:07 +00:00
|
|
|
GYPFLAGS += -Darm_version=6
|
2013-04-16 14:39:48 +00:00
|
|
|
else
|
|
|
|
ifeq ($(armv7), true)
|
2013-12-11 11:58:07 +00:00
|
|
|
GYPFLAGS += -Darm_version=7
|
|
|
|
endif
|
2013-04-16 14:39:48 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
# hardfp=on/off. Deprecated, use armfloatabi
|
|
|
|
ifeq ($(hardfp),on)
|
|
|
|
GYPFLAGS += -Darm_float_abi=hard
|
|
|
|
else
|
|
|
|
ifeq ($(hardfp),off)
|
|
|
|
GYPFLAGS += -Darm_float_abi=softfp
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
# fpu: armfpu=xxx
|
|
|
|
# xxx: vfp, vfpv3-d16, vfpv3, neon.
|
|
|
|
ifeq ($(armfpu),)
|
|
|
|
GYPFLAGS += -Darm_fpu=default
|
|
|
|
else
|
|
|
|
GYPFLAGS += -Darm_fpu=$(armfpu)
|
|
|
|
endif
|
|
|
|
# float abi: armfloatabi=softfp/hard
|
|
|
|
ifeq ($(armfloatabi),)
|
|
|
|
ifeq ($(hardfp),)
|
|
|
|
GYPFLAGS += -Darm_float_abi=default
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
GYPFLAGS += -Darm_float_abi=$(armfloatabi)
|
|
|
|
endif
|
|
|
|
# armthumb=on/off
|
|
|
|
ifeq ($(armthumb), off)
|
|
|
|
GYPFLAGS += -Darm_thumb=0
|
|
|
|
else
|
|
|
|
ifeq ($(armthumb), on)
|
|
|
|
GYPFLAGS += -Darm_thumb=1
|
|
|
|
endif
|
|
|
|
endif
|
2014-06-23 12:19:54 +00:00
|
|
|
# arm_test_noprobe=on
|
2013-04-16 14:39:48 +00:00
|
|
|
# With this flag set, by default v8 will only use features implied
|
|
|
|
# by the compiler (no probe). This is done by modifying the default
|
2014-05-12 09:25:32 +00:00
|
|
|
# values of enable_armv7, enable_vfp3, enable_32dregs and enable_neon.
|
2013-04-16 14:39:48 +00:00
|
|
|
# Modifying these flags when launching v8 will enable the probing for
|
|
|
|
# the specified values.
|
2014-06-23 12:19:54 +00:00
|
|
|
ifeq ($(arm_test_noprobe), on)
|
|
|
|
GYPFLAGS += -Darm_test_noprobe=on
|
2013-01-03 08:56:05 +00:00
|
|
|
endif
|
2016-03-10 12:59:27 +00:00
|
|
|
# Do not omit the frame pointer, needed for profiling with perf
|
|
|
|
ifeq ($(no_omit_framepointer), on)
|
|
|
|
GYPFLAGS += -Drelease_extra_cflags=-fno-omit-frame-pointer
|
|
|
|
endif
|
2011-08-26 11:23:51 +00:00
|
|
|
|
2016-04-13 23:11:54 +00:00
|
|
|
ifdef android_ndk_root
|
|
|
|
GYPFLAGS += -Dandroid_ndk_root=$(android_ndk_root)
|
|
|
|
export ANDROID_NDK_ROOT = $(android_ndk_root)
|
|
|
|
endif
|
|
|
|
|
2011-08-26 11:23:51 +00:00
|
|
|
# ----------------- available targets: --------------------
|
2013-08-02 09:02:02 +00:00
|
|
|
# - "grokdump": rebuilds heap constants lists used by grokdump
|
2011-08-26 11:23:51 +00:00
|
|
|
# - any arch listed in ARCHES (see below)
|
|
|
|
# - any mode listed in MODES
|
|
|
|
# - every combination <arch>.<mode>, e.g. "ia32.release"
|
2011-09-15 08:16:07 +00:00
|
|
|
# - "native": current host's architecture, release mode
|
2011-08-26 11:23:51 +00:00
|
|
|
# - any of the above with .check appended, e.g. "ia32.release.check"
|
2012-07-03 07:45:58 +00:00
|
|
|
# - "android": cross-compile for Android/ARM
|
2013-04-17 08:27:40 +00:00
|
|
|
# - "nacl" : cross-compile for Native Client (ia32 and x64)
|
2011-11-09 16:18:36 +00:00
|
|
|
# - default (no target specified): build all DEFAULT_ARCHES and MODES
|
2011-08-26 11:23:51 +00:00
|
|
|
# - "check": build all targets and run all tests
|
|
|
|
# - "<arch>.clean" for any <arch> in ARCHES
|
|
|
|
# - "clean": clean all ARCHES
|
|
|
|
|
|
|
|
# ----------------- internal stuff ------------------------
|
|
|
|
|
|
|
|
# Architectures and modes to be compiled. Consider these to be internal
|
|
|
|
# variables, don't override them (use the targets instead).
|
2016-01-14 17:16:10 +00:00
|
|
|
ARCHES = ia32 x64 x32 arm arm64 mips mipsel mips64 mips64el x87 ppc ppc64 \
|
|
|
|
s390 s390x
|
2011-11-09 16:18:36 +00:00
|
|
|
DEFAULT_ARCHES = ia32 x64 arm
|
2013-12-03 14:24:40 +00:00
|
|
|
MODES = release debug optdebug
|
|
|
|
DEFAULT_MODES = release debug
|
2015-03-09 03:25:07 +00:00
|
|
|
ANDROID_ARCHES = android_ia32 android_x64 android_arm android_arm64 \
|
|
|
|
android_mipsel android_x87
|
2013-04-17 08:27:40 +00:00
|
|
|
NACL_ARCHES = nacl_ia32 nacl_x64
|
2011-08-05 09:44:30 +00:00
|
|
|
|
|
|
|
# List of files that trigger Makefile regeneration:
|
2015-01-14 12:48:29 +00:00
|
|
|
GYPFILES = third_party/icu/icu.gypi third_party/icu/icu.gyp \
|
|
|
|
build/shim_headers.gypi build/features.gypi build/standalone.gypi \
|
|
|
|
build/toolchain.gypi build/all.gyp build/mac/asan.gyp \
|
2016-01-26 10:38:37 +00:00
|
|
|
test/cctest/cctest.gyp test/fuzzer/fuzzer.gyp \
|
2016-04-25 12:19:32 +00:00
|
|
|
test/unittests/unittests.gyp src/v8.gyp \
|
2015-01-14 12:48:29 +00:00
|
|
|
tools/parser-shell.gyp testing/gmock.gyp testing/gtest.gyp \
|
|
|
|
buildtools/third_party/libc++abi/libc++abi.gyp \
|
|
|
|
buildtools/third_party/libc++/libc++.gyp samples/samples.gyp \
|
|
|
|
src/third_party/vtune/v8vtune.gyp src/d8.gyp
|
2011-08-05 09:44:30 +00:00
|
|
|
|
2013-04-12 12:48:27 +00:00
|
|
|
# If vtunejit=on, the v8vtune.gyp will be appended.
|
|
|
|
ifeq ($(vtunejit), on)
|
|
|
|
GYPFILES += src/third_party/vtune/v8vtune.gyp
|
|
|
|
endif
|
2011-08-05 09:44:30 +00:00
|
|
|
# Generates all combinations of ARCHES and MODES, e.g. "ia32.release".
|
|
|
|
BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES)))
|
2012-07-18 11:43:44 +00:00
|
|
|
ANDROID_BUILDS = $(foreach mode,$(MODES), \
|
|
|
|
$(addsuffix .$(mode),$(ANDROID_ARCHES)))
|
2013-04-17 08:27:40 +00:00
|
|
|
NACL_BUILDS = $(foreach mode,$(MODES), \
|
|
|
|
$(addsuffix .$(mode),$(NACL_ARCHES)))
|
2011-08-05 09:44:30 +00:00
|
|
|
# Generates corresponding test targets, e.g. "ia32.release.check".
|
2011-08-26 11:23:51 +00:00
|
|
|
CHECKS = $(addsuffix .check,$(BUILDS))
|
2014-03-06 10:05:33 +00:00
|
|
|
QUICKCHECKS = $(addsuffix .quickcheck,$(BUILDS))
|
2012-07-18 11:43:44 +00:00
|
|
|
ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS))
|
2013-04-17 08:27:40 +00:00
|
|
|
NACL_CHECKS = $(addsuffix .check,$(NACL_BUILDS))
|
2011-08-26 11:23:51 +00:00
|
|
|
# File where previously used GYPFLAGS are stored.
|
|
|
|
ENVFILE = $(OUTDIR)/environment
|
2011-08-05 09:44:30 +00:00
|
|
|
|
2015-01-23 10:45:24 +00:00
|
|
|
.PHONY: all check clean builddeps dependencies $(ENVFILE).new native \
|
2014-10-31 08:39:14 +00:00
|
|
|
qc quickcheck $(QUICKCHECKS) turbocheck \
|
2014-03-06 10:05:33 +00:00
|
|
|
$(addsuffix .quickcheck,$(MODES)) $(addsuffix .quickcheck,$(ARCHES)) \
|
2011-08-31 13:01:28 +00:00
|
|
|
$(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \
|
2012-01-16 13:29:12 +00:00
|
|
|
$(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \
|
2012-07-18 11:43:44 +00:00
|
|
|
$(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \
|
2013-04-17 08:27:40 +00:00
|
|
|
$(NACL_ARCHES) $(NACL_BUILDS) $(NACL_CHECKS) \
|
|
|
|
must-set-NACL_SDK_ROOT
|
2011-08-05 09:44:30 +00:00
|
|
|
|
2011-08-26 11:23:51 +00:00
|
|
|
# Target definitions. "all" is the default.
|
2013-12-03 14:24:40 +00:00
|
|
|
all: $(DEFAULT_MODES)
|
2011-08-05 09:44:30 +00:00
|
|
|
|
2012-05-11 12:18:09 +00:00
|
|
|
# Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile
|
|
|
|
# having been created before.
|
2015-01-23 10:45:24 +00:00
|
|
|
buildbot:
|
2012-05-11 12:18:09 +00:00
|
|
|
$(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \
|
|
|
|
builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)"
|
|
|
|
|
2011-08-26 11:23:51 +00:00
|
|
|
# Compile targets. MODES and ARCHES are convenience targets.
|
|
|
|
.SECONDEXPANSION:
|
2011-11-09 16:18:36 +00:00
|
|
|
$(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES))
|
2011-08-05 09:44:30 +00:00
|
|
|
|
2013-12-05 12:37:24 +00:00
|
|
|
$(ARCHES): $(addprefix $$@.,$(DEFAULT_MODES))
|
2011-08-05 09:44:30 +00:00
|
|
|
|
2011-08-26 11:23:51 +00:00
|
|
|
# Defines how to build a particular target (e.g. ia32.release).
|
2015-01-23 10:45:24 +00:00
|
|
|
$(BUILDS): $(OUTDIR)/Makefile.$$@
|
2013-12-03 14:24:40 +00:00
|
|
|
@$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \
|
2011-08-05 09:44:30 +00:00
|
|
|
BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
|
2013-12-03 14:24:40 +00:00
|
|
|
python -c "print \
|
|
|
|
raw_input().replace('opt', '').capitalize()") \
|
2011-08-05 09:44:30 +00:00
|
|
|
builddir="$(shell pwd)/$(OUTDIR)/$@"
|
|
|
|
|
2015-01-23 10:45:24 +00:00
|
|
|
native: $(OUTDIR)/Makefile.native
|
2012-05-03 08:11:38 +00:00
|
|
|
@$(MAKE) -C "$(OUTDIR)" -f Makefile.native \
|
2015-01-07 13:33:10 +00:00
|
|
|
BUILDTYPE=Release \
|
2011-09-15 08:16:07 +00:00
|
|
|
builddir="$(shell pwd)/$(OUTDIR)/$@"
|
|
|
|
|
2012-07-23 12:02:46 +00:00
|
|
|
$(ANDROID_ARCHES): $(addprefix $$@.,$(MODES))
|
2012-07-03 07:45:58 +00:00
|
|
|
|
2015-06-24 05:35:07 +00:00
|
|
|
$(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) Makefile.android
|
2012-07-27 11:14:44 +00:00
|
|
|
@$(MAKE) -f Makefile.android $@ \
|
|
|
|
ARCH="$(basename $@)" \
|
|
|
|
MODE="$(subst .,,$(suffix $@))" \
|
|
|
|
OUTDIR="$(OUTDIR)" \
|
|
|
|
GYPFLAGS="$(GYPFLAGS)"
|
2012-01-16 13:29:12 +00:00
|
|
|
|
2013-04-17 08:27:40 +00:00
|
|
|
$(NACL_ARCHES): $(addprefix $$@.,$(MODES))
|
|
|
|
|
|
|
|
$(NACL_BUILDS): $(GYPFILES) $(ENVFILE) \
|
2015-01-23 10:45:24 +00:00
|
|
|
Makefile.nacl must-set-NACL_SDK_ROOT
|
2013-04-17 08:27:40 +00:00
|
|
|
@$(MAKE) -f Makefile.nacl $@ \
|
|
|
|
ARCH="$(basename $@)" \
|
|
|
|
MODE="$(subst .,,$(suffix $@))" \
|
|
|
|
OUTDIR="$(OUTDIR)" \
|
|
|
|
GYPFLAGS="$(GYPFLAGS)"
|
|
|
|
|
2011-08-05 09:44:30 +00:00
|
|
|
# Test targets.
|
|
|
|
check: all
|
2012-10-18 14:21:35 +00:00
|
|
|
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
|
2011-11-09 16:18:36 +00:00
|
|
|
--arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \
|
2011-10-06 11:08:41 +00:00
|
|
|
$(TESTFLAGS)
|
2011-08-05 09:44:30 +00:00
|
|
|
|
2011-08-10 11:07:31 +00:00
|
|
|
$(addsuffix .check,$(MODES)): $$(basename $$@)
|
2012-10-18 14:21:35 +00:00
|
|
|
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
|
2011-10-06 11:08:41 +00:00
|
|
|
--mode=$(basename $@) $(TESTFLAGS)
|
2011-08-05 09:44:30 +00:00
|
|
|
|
|
|
|
$(addsuffix .check,$(ARCHES)): $$(basename $$@)
|
2012-10-18 14:21:35 +00:00
|
|
|
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
|
2011-10-06 11:08:41 +00:00
|
|
|
--arch=$(basename $@) $(TESTFLAGS)
|
2011-08-05 09:44:30 +00:00
|
|
|
|
|
|
|
$(CHECKS): $$(basename $$@)
|
2012-10-18 14:21:35 +00:00
|
|
|
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
|
2011-10-06 11:08:41 +00:00
|
|
|
--arch-and-mode=$(basename $@) $(TESTFLAGS)
|
2011-08-05 09:44:30 +00:00
|
|
|
|
2014-03-06 10:05:33 +00:00
|
|
|
$(addsuffix .quickcheck,$(MODES)): $$(basename $$@)
|
|
|
|
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
|
|
|
|
--mode=$(basename $@) $(TESTFLAGS) --quickcheck
|
|
|
|
|
|
|
|
$(addsuffix .quickcheck,$(ARCHES)): $$(basename $$@)
|
|
|
|
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
|
|
|
|
--arch=$(basename $@) $(TESTFLAGS) --quickcheck
|
|
|
|
|
|
|
|
$(QUICKCHECKS): $$(basename $$@)
|
|
|
|
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
|
|
|
|
--arch-and-mode=$(basename $@) $(TESTFLAGS) --quickcheck
|
|
|
|
|
2012-07-18 11:43:44 +00:00
|
|
|
$(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@)
|
2012-07-03 07:45:58 +00:00
|
|
|
@tools/android-sync.sh $(basename $@) $(OUTDIR) \
|
|
|
|
$(shell pwd) $(ANDROID_V8)
|
|
|
|
|
2012-07-18 11:43:44 +00:00
|
|
|
$(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync
|
2012-10-18 14:21:35 +00:00
|
|
|
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
|
2012-07-03 07:45:58 +00:00
|
|
|
--arch-and-mode=$(basename $@) \
|
2012-08-01 13:06:08 +00:00
|
|
|
--timeout=600 \
|
2013-10-25 05:52:11 +00:00
|
|
|
--command-prefix="tools/android-run.py" $(TESTFLAGS)
|
2012-07-03 07:45:58 +00:00
|
|
|
|
2012-07-18 11:43:44 +00:00
|
|
|
$(addsuffix .check, $(ANDROID_ARCHES)): \
|
|
|
|
$(addprefix $$(basename $$@).,$(MODES)).check
|
2012-07-03 07:45:58 +00:00
|
|
|
|
2013-04-17 08:27:40 +00:00
|
|
|
$(addsuffix .check, $(NACL_BUILDS)): $$(basename $$@)
|
|
|
|
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
|
|
|
|
--arch-and-mode=$(basename $@) \
|
2013-09-19 12:07:03 +00:00
|
|
|
--timeout=600 --nopresubmit --noi18n \
|
2013-04-17 08:27:40 +00:00
|
|
|
--command-prefix="tools/nacl-run.py"
|
|
|
|
|
|
|
|
$(addsuffix .check, $(NACL_ARCHES)): \
|
|
|
|
$(addprefix $$(basename $$@).,$(MODES)).check
|
|
|
|
|
2011-09-15 08:16:07 +00:00
|
|
|
native.check: native
|
2012-10-18 14:21:35 +00:00
|
|
|
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \
|
2011-10-06 11:08:41 +00:00
|
|
|
--arch-and-mode=. $(TESTFLAGS)
|
2011-09-15 08:16:07 +00:00
|
|
|
|
2014-03-19 10:48:44 +00:00
|
|
|
SUPERFASTTESTMODES = ia32.release
|
2014-03-21 09:28:26 +00:00
|
|
|
FASTTESTMODES = $(SUPERFASTTESTMODES),x64.release,ia32.optdebug,x64.optdebug,arm.optdebug,arm64.release
|
|
|
|
FASTCOMPILEMODES = $(FASTTESTMODES),arm64.optdebug
|
2013-11-28 13:18:04 +00:00
|
|
|
|
2013-12-03 14:24:40 +00:00
|
|
|
COMMA = ,
|
|
|
|
EMPTY =
|
|
|
|
SPACE = $(EMPTY) $(EMPTY)
|
2014-02-18 08:53:51 +00:00
|
|
|
quickcheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES))
|
2014-03-19 10:48:44 +00:00
|
|
|
tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
|
|
|
|
--arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) --quickcheck \
|
|
|
|
--download-data mozilla webkit
|
2013-12-03 14:24:40 +00:00
|
|
|
tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
|
|
|
|
--arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) --quickcheck
|
2013-11-28 13:18:04 +00:00
|
|
|
qc: quickcheck
|
|
|
|
|
2014-10-31 08:39:14 +00:00
|
|
|
turbocheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES))
|
|
|
|
tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
|
|
|
|
--arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) \
|
|
|
|
--quickcheck --variants=turbofan --download-data mozilla webkit
|
|
|
|
tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
|
|
|
|
--arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) \
|
|
|
|
--quickcheck --variants=turbofan
|
|
|
|
tc: turbocheck
|
|
|
|
|
2011-08-05 09:44:30 +00:00
|
|
|
# Clean targets. You can clean each architecture individually, or everything.
|
2013-04-17 08:27:40 +00:00
|
|
|
$(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)):
|
2013-12-03 14:24:40 +00:00
|
|
|
rm -f $(OUTDIR)/Makefile.$(basename $@)*
|
2011-08-05 09:44:30 +00:00
|
|
|
rm -rf $(OUTDIR)/$(basename $@).release
|
|
|
|
rm -rf $(OUTDIR)/$(basename $@).debug
|
2013-12-05 12:37:24 +00:00
|
|
|
rm -rf $(OUTDIR)/$(basename $@).optdebug
|
2013-12-03 14:24:40 +00:00
|
|
|
find $(OUTDIR) -regex '.*\(host\|target\)\.$(basename $@).*\.mk' -delete
|
2011-08-05 09:44:30 +00:00
|
|
|
|
2011-09-15 08:16:07 +00:00
|
|
|
native.clean:
|
2012-05-03 08:11:38 +00:00
|
|
|
rm -f $(OUTDIR)/Makefile.native
|
2011-09-15 08:16:07 +00:00
|
|
|
rm -rf $(OUTDIR)/native
|
2013-12-03 14:24:40 +00:00
|
|
|
find $(OUTDIR) -regex '.*\(host\|target\)\.native\.mk' -delete
|
2011-09-15 08:16:07 +00:00
|
|
|
|
2016-04-13 09:20:55 +00:00
|
|
|
clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)) native.clean gtags.clean tags.clean
|
2011-08-05 09:44:30 +00:00
|
|
|
|
|
|
|
# GYP file generation targets.
|
2013-12-03 14:24:40 +00:00
|
|
|
OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(BUILDS))
|
2012-07-27 11:14:44 +00:00
|
|
|
$(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
|
2014-07-21 15:25:50 +00:00
|
|
|
$(eval CXX_TARGET_ARCH:=$(shell $(CXX) -v 2>&1 | grep ^Target: | \
|
|
|
|
cut -f 2 -d " " | cut -f 1 -d "-" ))
|
2014-07-23 14:54:12 +00:00
|
|
|
$(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH)))
|
2015-01-14 12:48:29 +00:00
|
|
|
$(eval CXX_TARGET_ARCH:=$(subst x86_64,x64,$(CXX_TARGET_ARCH)))
|
2014-07-21 15:25:50 +00:00
|
|
|
$(eval V8_TARGET_ARCH:=$(subst .,,$(suffix $(basename $@))))
|
2016-04-27 12:35:38 +00:00
|
|
|
PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/tools/gyp/pylib:$(PYTHONPATH)" \
|
2012-03-28 12:42:49 +00:00
|
|
|
GYP_GENERATORS=make \
|
2016-04-27 12:35:38 +00:00
|
|
|
tools/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
|
2012-05-03 08:11:38 +00:00
|
|
|
-Ibuild/standalone.gypi --depth=. \
|
2014-07-21 15:25:50 +00:00
|
|
|
-Dv8_target_arch=$(V8_TARGET_ARCH) \
|
2014-07-22 15:29:22 +00:00
|
|
|
$(if $(findstring $(CXX_TARGET_ARCH),$(V8_TARGET_ARCH)), \
|
|
|
|
-Dtarget_arch=$(V8_TARGET_ARCH),) \
|
2015-01-12 09:58:29 +00:00
|
|
|
$(if $(findstring optdebug,$@),-Dv8_optimized_debug=1,) \
|
2013-12-03 14:24:40 +00:00
|
|
|
-S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS)
|
2011-11-09 16:18:36 +00:00
|
|
|
|
2012-05-03 08:11:38 +00:00
|
|
|
$(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE)
|
2016-04-27 12:35:38 +00:00
|
|
|
PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/tools/gyp/pylib:$(PYTHONPATH)" \
|
2012-03-28 12:42:49 +00:00
|
|
|
GYP_GENERATORS=make \
|
2016-04-27 12:35:38 +00:00
|
|
|
tools/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
|
2012-05-03 08:11:38 +00:00
|
|
|
-Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS)
|
2011-09-15 08:16:07 +00:00
|
|
|
|
2013-04-17 08:27:40 +00:00
|
|
|
# Note that NACL_SDK_ROOT must be set to point to an appropriate
|
|
|
|
# Native Client SDK before using this makefile. You can download
|
|
|
|
# an SDK here:
|
|
|
|
# https://developers.google.com/native-client/sdk/download
|
|
|
|
# The path indicated by NACL_SDK_ROOT will typically end with
|
|
|
|
# a folder for a pepper version such as "pepper_25" that should
|
|
|
|
# have "tools" and "toolchain" subdirectories.
|
|
|
|
must-set-NACL_SDK_ROOT:
|
|
|
|
ifndef NACL_SDK_ROOT
|
|
|
|
$(error NACL_SDK_ROOT must be set)
|
|
|
|
endif
|
|
|
|
|
2011-08-26 11:23:51 +00:00
|
|
|
# Replaces the old with the new environment file if they're different, which
|
|
|
|
# will trigger GYP to regenerate Makefiles.
|
|
|
|
$(ENVFILE): $(ENVFILE).new
|
2013-08-02 09:02:02 +00:00
|
|
|
@if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) > /dev/null; \
|
2011-08-26 11:23:51 +00:00
|
|
|
then rm $(ENVFILE).new; \
|
|
|
|
else mv $(ENVFILE).new $(ENVFILE); fi
|
|
|
|
|
|
|
|
# Stores current GYPFLAGS in a file.
|
|
|
|
$(ENVFILE).new:
|
2015-01-07 13:33:10 +00:00
|
|
|
$(eval CXX_TARGET_ARCH:=$(shell $(CXX) -v 2>&1 | grep ^Target: | \
|
|
|
|
cut -f 2 -d " " | cut -f 1 -d "-" ))
|
|
|
|
$(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH)))
|
2015-01-14 12:48:29 +00:00
|
|
|
$(eval CXX_TARGET_ARCH:=$(subst x86_64,x64,$(CXX_TARGET_ARCH)))
|
2015-01-07 13:33:10 +00:00
|
|
|
@mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS) -Dtarget_arch=$(CXX_TARGET_ARCH)" > $(ENVFILE).new;
|
2011-09-07 13:48:29 +00:00
|
|
|
|
2013-08-02 09:02:02 +00:00
|
|
|
# Heap constants for grokdump.
|
|
|
|
DUMP_FILE = tools/v8heapconst.py
|
|
|
|
grokdump: ia32.release
|
|
|
|
@cat $(DUMP_FILE).tmpl > $(DUMP_FILE)
|
|
|
|
@$(OUTDIR)/ia32.release/d8 --dump-heap-constants >> $(DUMP_FILE)
|
|
|
|
|
2014-04-08 06:19:05 +00:00
|
|
|
# Support for the GNU GLOBAL Source Code Tag System.
|
|
|
|
gtags.files: $(GYPFILES) $(ENVFILE)
|
|
|
|
@find include src test -name '*.h' -o -name '*.cc' -o -name '*.c' > $@
|
|
|
|
|
2014-04-08 08:07:50 +00:00
|
|
|
# We need to manually set the stack limit here, to work around bugs in
|
|
|
|
# gmake-3.81 and global-5.7.1 on recent 64-bit Linux systems.
|
2016-04-13 09:20:55 +00:00
|
|
|
# Using $(wildcard ...) gracefully ignores non-existing files, so that stale
|
|
|
|
# gtags.files after switching branches don't cause recipe failures.
|
|
|
|
GPATH GRTAGS GSYMS GTAGS: gtags.files $(wildcard $(shell cat gtags.files 2> /dev/null))
|
2014-04-08 08:07:50 +00:00
|
|
|
@bash -c 'ulimit -s 10240 && GTAGSFORCECPP=yes gtags -i -q -f $<'
|
2014-04-08 06:19:05 +00:00
|
|
|
|
|
|
|
gtags.clean:
|
2014-04-08 08:07:50 +00:00
|
|
|
rm -f gtags.files GPATH GRTAGS GSYMS GTAGS
|
2014-04-08 06:19:05 +00:00
|
|
|
|
2016-04-13 09:20:55 +00:00
|
|
|
tags: gtags.files $(wildcard $(shell cat gtags.files 2> /dev/null))
|
|
|
|
@(ctags --version | grep 'Exuberant Ctags' >/dev/null) || \
|
|
|
|
(echo "Please install Exuberant Ctags (check 'ctags --version')" >&2; false)
|
|
|
|
ctags --fields=+l -L $<
|
|
|
|
|
|
|
|
tags.clean:
|
|
|
|
rm -r tags
|
|
|
|
|
2015-01-19 13:21:06 +00:00
|
|
|
dependencies builddeps:
|
|
|
|
$(error Use 'gclient sync' instead)
|