Makefile 18.7 KB
Newer Older
1
# Copyright 2012 the V8 project authors. All rights reserved.
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
# 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.
30 31
CXX ?= g++
LINK ?= g++
32
OUTDIR ?= out
33
TESTJOBS ?=
34
GYPFLAGS ?=
35
TESTFLAGS ?=
36
ANDROID_NDK_ROOT ?=
37
ANDROID_NDK_HOST_ARCH ?=
38
ANDROID_TOOLCHAIN ?=
39
ANDROID_V8 ?= /data/local/tmp/v8
40
NACL_SDK_ROOT ?=
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58

# 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
# console=readline
ifdef console
  GYPFLAGS += -Dconsole=$(console)
endif
# disassembler=on
ifeq ($(disassembler), on)
  GYPFLAGS += -Dv8_enable_disassembler=1
endif
59 60 61 62
# objectprint=on
ifeq ($(objectprint), on)
  GYPFLAGS += -Dv8_object_print=1
endif
63 64 65 66
# verifyheap=on
ifeq ($(verifyheap), on)
  GYPFLAGS += -Dv8_enable_verify_heap=1
endif
67 68 69 70
# tracemaps=on
ifeq ($(tracemaps), on)
  GYPFLAGS += -Dv8_trace_maps=1
endif
71 72 73 74 75 76
# backtrace=off
ifeq ($(backtrace), off)
  GYPFLAGS += -Dv8_enable_backtrace=0
else
  GYPFLAGS += -Dv8_enable_backtrace=1
endif
77 78 79 80
# verifypredictable=on
ifeq ($(verifypredictable), on)
  GYPFLAGS += -Dv8_enable_verify_predictable=1
endif
81 82 83 84
# snapshot=off
ifeq ($(snapshot), off)
  GYPFLAGS += -Dv8_use_snapshot='false'
endif
85 86
# extrachecks=on/off
ifeq ($(extrachecks), on)
87
  GYPFLAGS += -Dv8_enable_extra_checks=1 -Dv8_enable_handle_zapping=1
88 89
endif
ifeq ($(extrachecks), off)
90
  GYPFLAGS += -Dv8_enable_extra_checks=0 -Dv8_enable_handle_zapping=0
91
endif
92
# gdbjit=on/off
93 94 95
ifeq ($(gdbjit), on)
  GYPFLAGS += -Dv8_enable_gdbjit=1
endif
96 97 98
ifeq ($(gdbjit), off)
  GYPFLAGS += -Dv8_enable_gdbjit=0
endif
99 100 101 102
# vtunejit=on
ifeq ($(vtunejit), on)
  GYPFLAGS += -Dv8_enable_vtunejit=1
endif
103 104
# optdebug=on
ifeq ($(optdebug), on)
105
  GYPFLAGS += -Dv8_optimized_debug=2
106
endif
107 108 109 110
# unalignedaccess=on
ifeq ($(unalignedaccess), on)
  GYPFLAGS += -Dv8_can_use_unaligned_accesses=true
endif
111 112 113 114
# randomseed=12345, disable random seed via randomseed=0
ifdef randomseed
  GYPFLAGS += -Dv8_random_seed=$(randomseed)
endif
115 116 117 118
# soname_version=1.2.3
ifdef soname_version
  GYPFLAGS += -Dsoname_version=$(soname_version)
endif
119 120 121 122 123 124 125 126
# werror=no
ifeq ($(werror), no)
  GYPFLAGS += -Dwerror=''
endif
# presubmit=no
ifeq ($(presubmit), no)
  TESTFLAGS += --no-presubmit
endif
127 128 129 130
# strictaliasing=off (workaround for GCC-4.5)
ifeq ($(strictaliasing), off)
  GYPFLAGS += -Dv8_no_strict_aliasing=1
endif
131 132 133 134
# regexp=interpreted
ifeq ($(regexp), interpreted)
  GYPFLAGS += -Dv8_interpreted_regexp=1
endif
135 136 137 138
# i18nsupport=off
ifeq ($(i18nsupport), off)
  GYPFLAGS += -Dv8_enable_i18n_support=0
  TESTFLAGS += --noi18n
139
endif
140 141 142
# deprecation_warnings=on
ifeq ($(deprecationwarnings), on)
  GYPFLAGS += -Dv8_deprecation_warnings=1
143 144 145 146
endif
# asan=/path/to/clang++
ifneq ($(strip $(asan)),)
  GYPFLAGS += -Dasan=1
147
  export CC=$(dir $(asan))clang
148 149 150
  export CXX=$(asan)
  export CXX_host=$(asan)
  export LINK=$(asan)
151 152 153 154 155
  export ASAN_SYMBOLIZER_PATH=$(dir $(asan))llvm-symbolizer
  TESTFLAGS += --asan
  ifeq ($(lsan), on)
    GYPFLAGS += -Dlsan=1
  endif
156
endif
157

158
# arm specific flags.
159 160 161 162 163
# arm_version=<number | "default">
ifneq ($(strip $(arm_version)),)
  GYPFLAGS += -Darm_version=$(arm_version)
else
# Deprecated (use arm_version instead): armv7=false/true
164
ifeq ($(armv7), false)
165
  GYPFLAGS += -Darm_version=6
166 167
else
ifeq ($(armv7), true)
168 169
  GYPFLAGS += -Darm_version=7
endif
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
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
203
# arm_test_noprobe=on
204 205
# With this flag set, by default v8 will only use features implied
# by the compiler (no probe). This is done by modifying the default
206
# values of enable_armv7, enable_vfp3, enable_32dregs and enable_neon.
207 208
# Modifying these flags when launching v8 will enable the probing for
# the specified values.
209 210
ifeq ($(arm_test_noprobe), on)
  GYPFLAGS += -Darm_test_noprobe=on
211
endif
212 213

# ----------------- available targets: --------------------
214 215
# - "builddeps": pulls in external dependencies for building
# - "dependencies": pulls in all external dependencies
216
# - "grokdump": rebuilds heap constants lists used by grokdump
217 218 219
# - any arch listed in ARCHES (see below)
# - any mode listed in MODES
# - every combination <arch>.<mode>, e.g. "ia32.release"
220
# - "native": current host's architecture, release mode
221
# - any of the above with .check appended, e.g. "ia32.release.check"
222
# - "android": cross-compile for Android/ARM
223
# - "nacl" : cross-compile for Native Client (ia32 and x64)
224
# - default (no target specified): build all DEFAULT_ARCHES and MODES
225 226 227 228 229 230 231 232
# - "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).
233
ARCHES = ia32 x64 x32 arm arm64 mips mipsel mips64el x87
234
DEFAULT_ARCHES = ia32 x64 arm
235 236
MODES = release debug optdebug
DEFAULT_MODES = release debug
danno@chromium.org's avatar
danno@chromium.org committed
237
ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel android_x87
238
NACL_ARCHES = nacl_ia32 nacl_x64
239 240

# List of files that trigger Makefile regeneration:
241
GYPFILES = build/all.gyp build/features.gypi build/standalone.gypi \
242 243
           build/toolchain.gypi samples/samples.gyp src/d8.gyp \
           test/cctest/cctest.gyp test/unittests/unittests.gyp tools/gyp/v8.gyp
244

245 246 247 248
# If vtunejit=on, the v8vtune.gyp will be appended.
ifeq ($(vtunejit), on)
  GYPFILES += src/third_party/vtune/v8vtune.gyp
endif
249 250
# Generates all combinations of ARCHES and MODES, e.g. "ia32.release".
BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES)))
251 252
ANDROID_BUILDS = $(foreach mode,$(MODES), \
                   $(addsuffix .$(mode),$(ANDROID_ARCHES)))
253 254
NACL_BUILDS = $(foreach mode,$(MODES), \
                   $(addsuffix .$(mode),$(NACL_ARCHES)))
255
# Generates corresponding test targets, e.g. "ia32.release.check".
256
CHECKS = $(addsuffix .check,$(BUILDS))
257
QUICKCHECKS = $(addsuffix .quickcheck,$(BUILDS))
258
ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS))
259
NACL_CHECKS = $(addsuffix .check,$(NACL_BUILDS))
260 261
# File where previously used GYPFLAGS are stored.
ENVFILE = $(OUTDIR)/environment
262

263
.PHONY: all check clean builddeps dependencies $(ENVFILE).new native \
264
        qc quickcheck $(QUICKCHECKS) turbocheck \
265
        $(addsuffix .quickcheck,$(MODES)) $(addsuffix .quickcheck,$(ARCHES)) \
266
        $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \
267
        $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \
268
        $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \
269 270 271
        must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN \
        $(NACL_ARCHES) $(NACL_BUILDS) $(NACL_CHECKS) \
        must-set-NACL_SDK_ROOT
272

273
# Target definitions. "all" is the default.
274
all: $(DEFAULT_MODES)
275

276 277 278 279 280 281
# Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile
# having been created before.
buildbot:
	$(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \
	        builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)"

282 283
# Compile targets. MODES and ARCHES are convenience targets.
.SECONDEXPANSION:
284
$(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES))
285

286
$(ARCHES): $(addprefix $$@.,$(DEFAULT_MODES))
287

288
# Defines how to build a particular target (e.g. ia32.release).
289 290
$(BUILDS): $(OUTDIR)/Makefile.$$@
	@$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \
291 292
	         CXX="$(CXX)" LINK="$(LINK)" \
	         BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
293 294
	                     python -c "print \
	                     raw_input().replace('opt', '').capitalize()") \
295 296
	         builddir="$(shell pwd)/$(OUTDIR)/$@"

297 298
native: $(OUTDIR)/Makefile.native
	@$(MAKE) -C "$(OUTDIR)" -f Makefile.native \
299 300 301
	         CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \
	         builddir="$(shell pwd)/$(OUTDIR)/$@"

302
$(ANDROID_ARCHES): $(addprefix $$@.,$(MODES))
303

304
$(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \
305
                   must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN Makefile.android
306 307 308 309 310
	@$(MAKE) -f Makefile.android $@ \
	        ARCH="$(basename $@)" \
	        MODE="$(subst .,,$(suffix $@))" \
	        OUTDIR="$(OUTDIR)" \
	        GYPFLAGS="$(GYPFLAGS)"
311

312 313 314 315 316 317 318 319 320 321
$(NACL_ARCHES): $(addprefix $$@.,$(MODES))

$(NACL_BUILDS): $(GYPFILES) $(ENVFILE) \
		   Makefile.nacl must-set-NACL_SDK_ROOT
	@$(MAKE) -f Makefile.nacl $@ \
	        ARCH="$(basename $@)" \
	        MODE="$(subst .,,$(suffix $@))" \
	        OUTDIR="$(OUTDIR)" \
	        GYPFLAGS="$(GYPFLAGS)"

322 323
# Test targets.
check: all
324
	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
325
	    --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \
326
	    $(TESTFLAGS)
327

328
$(addsuffix .check,$(MODES)): $$(basename $$@)
329
	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
330
	    --mode=$(basename $@) $(TESTFLAGS)
331 332

$(addsuffix .check,$(ARCHES)): $$(basename $$@)
333
	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
334
	    --arch=$(basename $@) $(TESTFLAGS)
335 336

$(CHECKS): $$(basename $$@)
337
	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
338
	    --arch-and-mode=$(basename $@) $(TESTFLAGS)
339

340 341 342 343 344 345 346 347 348 349 350 351
$(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

352
$(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@)
353 354 355
	@tools/android-sync.sh $(basename $@) $(OUTDIR) \
	                       $(shell pwd) $(ANDROID_V8)

356
$(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync
357
	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
358
	     --arch-and-mode=$(basename $@) \
359
	     --timeout=600 \
360
	     --command-prefix="tools/android-run.py" $(TESTFLAGS)
361

362 363
$(addsuffix .check, $(ANDROID_ARCHES)): \
                $(addprefix $$(basename $$@).,$(MODES)).check
364

365 366 367
$(addsuffix .check, $(NACL_BUILDS)): $$(basename $$@)
	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
	     --arch-and-mode=$(basename $@) \
368
	     --timeout=600 --nopresubmit --noi18n \
369 370 371 372 373
	     --command-prefix="tools/nacl-run.py"

$(addsuffix .check, $(NACL_ARCHES)): \
                $(addprefix $$(basename $$@).,$(MODES)).check

374
native.check: native
375
	@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \
376
	    --arch-and-mode=. $(TESTFLAGS)
377

378
SUPERFASTTESTMODES = ia32.release
379 380
FASTTESTMODES = $(SUPERFASTTESTMODES),x64.release,ia32.optdebug,x64.optdebug,arm.optdebug,arm64.release
FASTCOMPILEMODES = $(FASTTESTMODES),arm64.optdebug
381

382 383 384
COMMA = ,
EMPTY =
SPACE = $(EMPTY) $(EMPTY)
385
quickcheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES))
386 387 388
	tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
	    --arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) --quickcheck \
	    --download-data mozilla webkit
389 390
	tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
	    --arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) --quickcheck
391 392
qc: quickcheck

393 394 395 396 397 398 399 400 401
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

402
# Clean targets. You can clean each architecture individually, or everything.
403
$(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)):
404
	rm -f $(OUTDIR)/Makefile.$(basename $@)*
405 406
	rm -rf $(OUTDIR)/$(basename $@).release
	rm -rf $(OUTDIR)/$(basename $@).debug
407
	rm -rf $(OUTDIR)/$(basename $@).optdebug
408
	find $(OUTDIR) -regex '.*\(host\|target\)\.$(basename $@).*\.mk' -delete
409

410
native.clean:
411
	rm -f $(OUTDIR)/Makefile.native
412
	rm -rf $(OUTDIR)/native
413
	find $(OUTDIR) -regex '.*\(host\|target\)\.native\.mk' -delete
414

415
clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)) native.clean gtags.clean
416 417

# GYP file generation targets.
418
OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(BUILDS))
419
$(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
420 421
	$(eval CXX_TARGET_ARCH:=$(shell $(CXX) -v 2>&1 | grep ^Target: | \
	        cut -f 2 -d " " | cut -f 1 -d "-" ))
422
	$(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH)))
423
	$(eval V8_TARGET_ARCH:=$(subst .,,$(suffix $(basename $@))))
424
	PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \
425
	GYP_GENERATORS=make \
426
	build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
427
	              -Ibuild/standalone.gypi --depth=. \
428
	              -Dv8_target_arch=$(V8_TARGET_ARCH) \
429 430
	              $(if $(findstring $(CXX_TARGET_ARCH),$(V8_TARGET_ARCH)), \
	              -Dtarget_arch=$(V8_TARGET_ARCH),) \
431
	              $(if $(findstring optdebug,$@),-Dv8_optimized_debug=2,) \
432
	              -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS)
433

434
$(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE)
435
	PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \
436
	GYP_GENERATORS=make \
437
	build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
438
	              -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS)
439

440
must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN:
441
ifndef ANDROID_NDK_ROOT
442 443 444
ifndef ANDROID_TOOLCHAIN
	  $(error ANDROID_NDK_ROOT or ANDROID_TOOLCHAIN must be set))
endif
445 446
endif

447 448 449 450 451 452 453 454 455 456 457 458
# 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

459 460 461
# Replaces the old with the new environment file if they're different, which
# will trigger GYP to regenerate Makefiles.
$(ENVFILE): $(ENVFILE).new
462
	@if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) > /dev/null; \
463 464 465 466 467
	    then rm $(ENVFILE).new; \
	    else mv $(ENVFILE).new $(ENVFILE); fi

# Stores current GYPFLAGS in a file.
$(ENVFILE).new:
468 469
	@mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \
	    echo "CXX=$(CXX)" >> $(ENVFILE).new
470

471 472 473 474 475 476
# 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)

477 478 479 480
# 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' > $@

481 482
# 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.
483
GPATH GRTAGS GSYMS GTAGS: gtags.files $(shell cat gtags.files 2> /dev/null)
484
	@bash -c 'ulimit -s 10240 && GTAGSFORCECPP=yes gtags -i -q -f $<'
485 486

gtags.clean:
487
	rm -f gtags.files GPATH GRTAGS GSYMS GTAGS
488

489 490
# Dependencies. "builddeps" are dependencies required solely for building,
# "dependencies" includes also dependencies required for development.
491
# Remember to keep these in sync with the DEPS file.
492
builddeps:
493
	svn checkout --force https://gyp.googlecode.com/svn/trunk build/gyp \
jochen@chromium.org's avatar
jochen@chromium.org committed
494
	    --revision 1831
495
	if svn info third_party/icu 2>&1 | grep -q icu46 ; then \
496 497 498 499 500 501 502 503
	  svn switch --force \
	      https://src.chromium.org/chrome/trunk/deps/third_party/icu52 \
	      third_party/icu --revision 277999 ; \
	else \
	  svn checkout --force \
	      https://src.chromium.org/chrome/trunk/deps/third_party/icu52 \
	      third_party/icu --revision 277999 ; \
	fi
504
	svn checkout --force https://googletest.googlecode.com/svn/trunk \
505
	    testing/gtest --revision 692
506
	svn checkout --force https://googlemock.googlecode.com/svn/trunk \
507
	    testing/gmock --revision 485
508 509

dependencies: builddeps
510 511
	# The spec is a copy of the hooks in v8's DEPS file.
	gclient sync -r fb782d4369d5ae04f17a2fceef7de5a63e50f07b --spec="solutions = [{u'managed': False, u'name': u'buildtools', u'url': u'https://chromium.googlesource.com/chromium/buildtools.git', u'custom_deps': {}, u'custom_hooks': [{u'name': u'clang_format_win',u'pattern': u'.',u'action': [u'download_from_google_storage',u'--no_resume',u'--platform=win32',u'--no_auth',u'--bucket',u'chromium-clang-format',u'-s',u'buildtools/win/clang-format.exe.sha1']},{u'name': u'clang_format_mac',u'pattern': u'.',u'action': [u'download_from_google_storage',u'--no_resume',u'--platform=darwin',u'--no_auth',u'--bucket',u'chromium-clang-format',u'-s',u'buildtools/mac/clang-format.sha1']},{u'name': u'clang_format_linux',u'pattern': u'.',u'action': [u'download_from_google_storage',u'--no_resume',u'--platform=linux*',u'--no_auth',u'--bucket',u'chromium-clang-format',u'-s',u'buildtools/linux64/clang-format.sha1']}],u'deps_file': u'.DEPS.git', u'safesync_url': u''}]"