ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 1 | # Copyright 2012 the V8 project authors. All rights reserved. |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 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. |
danno@chromium.org | c612e02 | 2011-11-10 11:38:15 +0000 | [diff] [blame] | 30 | CXX ?= g++ |
| 31 | LINK ?= g++ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 32 | OUTDIR ?= out |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 33 | TESTJOBS ?= |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 34 | GYPFLAGS ?= |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 35 | TESTFLAGS ?= |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 36 | ANDROID_NDK_ROOT ?= |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 37 | ANDROID_TOOLCHAIN ?= |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 38 | ANDROID_V8 ?= /data/local/v8 |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 39 | |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 40 | # Special build flags. Use them like this: "make library=shared" |
| 41 | |
| 42 | # library=shared || component=shared_library |
| 43 | ifeq ($(library), shared) |
| 44 | GYPFLAGS += -Dcomponent=shared_library |
| 45 | endif |
| 46 | ifdef component |
| 47 | GYPFLAGS += -Dcomponent=$(component) |
| 48 | endif |
| 49 | # console=readline |
| 50 | ifdef console |
| 51 | GYPFLAGS += -Dconsole=$(console) |
| 52 | endif |
| 53 | # disassembler=on |
| 54 | ifeq ($(disassembler), on) |
| 55 | GYPFLAGS += -Dv8_enable_disassembler=1 |
| 56 | endif |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 57 | # objectprint=on |
| 58 | ifeq ($(objectprint), on) |
| 59 | GYPFLAGS += -Dv8_object_print=1 |
| 60 | endif |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 61 | # verifyheap=on |
| 62 | ifeq ($(verifyheap), on) |
| 63 | GYPFLAGS += -Dv8_enable_verify_heap=1 |
| 64 | endif |
yangguo@chromium.org | a6bbcc8 | 2012-12-21 12:35:02 +0000 | [diff] [blame^] | 65 | # backtrace=off |
| 66 | ifeq ($(backtrace), off) |
| 67 | GYPFLAGS += -Dv8_enable_backtrace=0 |
| 68 | else |
| 69 | GYPFLAGS += -Dv8_enable_backtrace=1 |
| 70 | endif |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 71 | # snapshot=off |
| 72 | ifeq ($(snapshot), off) |
| 73 | GYPFLAGS += -Dv8_use_snapshot='false' |
| 74 | endif |
jkummerow@chromium.org | 67255be | 2012-09-05 16:44:50 +0000 | [diff] [blame] | 75 | # extrachecks=on/off |
| 76 | ifeq ($(extrachecks), on) |
| 77 | GYPFLAGS += -Dv8_enable_extra_checks=1 |
| 78 | endif |
| 79 | ifeq ($(extrachecks), off) |
| 80 | GYPFLAGS += -Dv8_enable_extra_checks=0 |
| 81 | endif |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 82 | # gdbjit=on |
| 83 | ifeq ($(gdbjit), on) |
| 84 | GYPFLAGS += -Dv8_enable_gdbjit=1 |
| 85 | endif |
| 86 | # liveobjectlist=on |
| 87 | ifeq ($(liveobjectlist), on) |
| 88 | GYPFLAGS += -Dv8_use_liveobjectlist=true |
| 89 | endif |
yangguo@chromium.org | a6bbcc8 | 2012-12-21 12:35:02 +0000 | [diff] [blame^] | 90 | # vfp2=off |
| 91 | ifeq ($(vfp2), off) |
| 92 | GYPFLAGS += -Dv8_can_use_vfp2_instructions=false |
| 93 | else |
| 94 | GYPFLAGS += -Dv8_can_use_vfp2_instructions=true |
| 95 | endif |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 96 | # vfp3=off |
| 97 | ifeq ($(vfp3), off) |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 98 | GYPFLAGS += -Dv8_can_use_vfp3_instructions=false |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 99 | else |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 100 | GYPFLAGS += -Dv8_can_use_vfp3_instructions=true |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 101 | endif |
erik.corry@gmail.com | bbceb57 | 2012-03-09 10:52:05 +0000 | [diff] [blame] | 102 | # debuggersupport=off |
| 103 | ifeq ($(debuggersupport), off) |
| 104 | GYPFLAGS += -Dv8_enable_debugger_support=0 |
| 105 | endif |
ricow@chromium.org | 55ee807 | 2011-09-08 16:33:10 +0000 | [diff] [blame] | 106 | # soname_version=1.2.3 |
| 107 | ifdef soname_version |
| 108 | GYPFLAGS += -Dsoname_version=$(soname_version) |
| 109 | endif |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 110 | # werror=no |
| 111 | ifeq ($(werror), no) |
| 112 | GYPFLAGS += -Dwerror='' |
| 113 | endif |
| 114 | # presubmit=no |
| 115 | ifeq ($(presubmit), no) |
| 116 | TESTFLAGS += --no-presubmit |
| 117 | endif |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 118 | # strictaliasing=off (workaround for GCC-4.5) |
| 119 | ifeq ($(strictaliasing), off) |
| 120 | GYPFLAGS += -Dv8_no_strict_aliasing=1 |
| 121 | endif |
yangguo@chromium.org | 5a11aaf | 2012-06-20 11:29:00 +0000 | [diff] [blame] | 122 | # regexp=interpreted |
| 123 | ifeq ($(regexp), interpreted) |
| 124 | GYPFLAGS += -Dv8_interpreted_regexp=1 |
| 125 | endif |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 126 | # hardfp=on |
| 127 | ifeq ($(hardfp), on) |
| 128 | GYPFLAGS += -Dv8_use_arm_eabi_hardfloat=true |
| 129 | endif |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 130 | |
| 131 | # ----------------- available targets: -------------------- |
ricow@chromium.org | 55ee807 | 2011-09-08 16:33:10 +0000 | [diff] [blame] | 132 | # - "dependencies": pulls in external dependencies (currently: GYP) |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 133 | # - any arch listed in ARCHES (see below) |
| 134 | # - any mode listed in MODES |
| 135 | # - every combination <arch>.<mode>, e.g. "ia32.release" |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 136 | # - "native": current host's architecture, release mode |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 137 | # - any of the above with .check appended, e.g. "ia32.release.check" |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 138 | # - "android": cross-compile for Android/ARM |
danno@chromium.org | c612e02 | 2011-11-10 11:38:15 +0000 | [diff] [blame] | 139 | # - default (no target specified): build all DEFAULT_ARCHES and MODES |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 140 | # - "check": build all targets and run all tests |
| 141 | # - "<arch>.clean" for any <arch> in ARCHES |
| 142 | # - "clean": clean all ARCHES |
| 143 | |
| 144 | # ----------------- internal stuff ------------------------ |
| 145 | |
| 146 | # Architectures and modes to be compiled. Consider these to be internal |
| 147 | # variables, don't override them (use the targets instead). |
rossberg@chromium.org | 657d53b | 2012-07-12 11:06:03 +0000 | [diff] [blame] | 148 | ARCHES = ia32 x64 arm mipsel |
danno@chromium.org | c612e02 | 2011-11-10 11:38:15 +0000 | [diff] [blame] | 149 | DEFAULT_ARCHES = ia32 x64 arm |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 150 | MODES = release debug |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 151 | ANDROID_ARCHES = android_ia32 android_arm |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 152 | |
| 153 | # List of files that trigger Makefile regeneration: |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 154 | GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 155 | preparser/preparser.gyp samples/samples.gyp src/d8.gyp \ |
| 156 | test/cctest/cctest.gyp tools/gyp/v8.gyp |
| 157 | |
| 158 | # Generates all combinations of ARCHES and MODES, e.g. "ia32.release". |
| 159 | BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 160 | ANDROID_BUILDS = $(foreach mode,$(MODES), \ |
| 161 | $(addsuffix .$(mode),$(ANDROID_ARCHES))) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 162 | # Generates corresponding test targets, e.g. "ia32.release.check". |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 163 | CHECKS = $(addsuffix .check,$(BUILDS)) |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 164 | ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS)) |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 165 | # File where previously used GYPFLAGS are stored. |
| 166 | ENVFILE = $(OUTDIR)/environment |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 167 | |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 168 | .PHONY: all check clean dependencies $(ENVFILE).new native \ |
fschneider@chromium.org | 1805e21 | 2011-09-05 10:49:12 +0000 | [diff] [blame] | 169 | $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 170 | $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \ |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 171 | $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \ |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 172 | must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 173 | |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 174 | # Target definitions. "all" is the default. |
| 175 | all: $(MODES) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 176 | |
jkummerow@chromium.org | 212d964 | 2012-05-11 15:02:09 +0000 | [diff] [blame] | 177 | # Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile |
| 178 | # having been created before. |
| 179 | buildbot: |
| 180 | $(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \ |
| 181 | builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)" |
| 182 | |
rossberg@chromium.org | 657d53b | 2012-07-12 11:06:03 +0000 | [diff] [blame] | 183 | mips mips.release mips.debug: |
| 184 | @echo "V8 does not support big-endian MIPS builds at the moment," \ |
| 185 | "please use little-endian builds (mipsel)." |
| 186 | |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 187 | # Compile targets. MODES and ARCHES are convenience targets. |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 188 | .SECONDEXPANSION: |
danno@chromium.org | c612e02 | 2011-11-10 11:38:15 +0000 | [diff] [blame] | 189 | $(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES)) |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 190 | |
| 191 | $(ARCHES): $(addprefix $$@.,$(MODES)) |
| 192 | |
| 193 | # Defines how to build a particular target (e.g. ia32.release). |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 194 | $(BUILDS): $(OUTDIR)/Makefile.$$(basename $$@) |
| 195 | @$(MAKE) -C "$(OUTDIR)" -f Makefile.$(basename $@) \ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 196 | CXX="$(CXX)" LINK="$(LINK)" \ |
| 197 | BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ |
| 198 | python -c "print raw_input().capitalize()") \ |
| 199 | builddir="$(shell pwd)/$(OUTDIR)/$@" |
| 200 | |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 201 | native: $(OUTDIR)/Makefile.native |
| 202 | @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \ |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 203 | CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \ |
| 204 | builddir="$(shell pwd)/$(OUTDIR)/$@" |
| 205 | |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 206 | $(ANDROID_ARCHES): $(addprefix $$@.,$(MODES)) |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 207 | |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 208 | $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \ |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 209 | must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN Makefile.android |
ulan@chromium.org | ea52b5f | 2012-07-30 13:05:33 +0000 | [diff] [blame] | 210 | @$(MAKE) -f Makefile.android $@ \ |
| 211 | ARCH="$(basename $@)" \ |
| 212 | MODE="$(subst .,,$(suffix $@))" \ |
| 213 | OUTDIR="$(OUTDIR)" \ |
| 214 | GYPFLAGS="$(GYPFLAGS)" |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 215 | |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 216 | # Test targets. |
| 217 | check: all |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 218 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
danno@chromium.org | c612e02 | 2011-11-10 11:38:15 +0000 | [diff] [blame] | 219 | --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 220 | $(TESTFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 221 | |
| 222 | $(addsuffix .check,$(MODES)): $$(basename $$@) |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 223 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 224 | --mode=$(basename $@) $(TESTFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 225 | |
| 226 | $(addsuffix .check,$(ARCHES)): $$(basename $$@) |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 227 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 228 | --arch=$(basename $@) $(TESTFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 229 | |
| 230 | $(CHECKS): $$(basename $$@) |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 231 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 232 | --arch-and-mode=$(basename $@) $(TESTFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 233 | |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 234 | $(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@) |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 235 | @tools/android-sync.sh $(basename $@) $(OUTDIR) \ |
| 236 | $(shell pwd) $(ANDROID_V8) |
| 237 | |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 238 | $(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 239 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 240 | --arch-and-mode=$(basename $@) \ |
mstarzinger@chromium.org | 471f2f1 | 2012-08-10 14:46:33 +0000 | [diff] [blame] | 241 | --timeout=600 \ |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 242 | --command-prefix="tools/android-run.py" |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 243 | |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 244 | $(addsuffix .check, $(ANDROID_ARCHES)): \ |
| 245 | $(addprefix $$(basename $$@).,$(MODES)).check |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 246 | |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 247 | native.check: native |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 248 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 249 | --arch-and-mode=. $(TESTFLAGS) |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 250 | |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 251 | # Clean targets. You can clean each architecture individually, or everything. |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 252 | $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)): |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 253 | rm -f $(OUTDIR)/Makefile.$(basename $@) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 254 | rm -rf $(OUTDIR)/$(basename $@).release |
| 255 | rm -rf $(OUTDIR)/$(basename $@).debug |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 256 | find $(OUTDIR) -regex '.*\(host\|target\).$(basename $@)\.mk' -delete |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 257 | |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 258 | native.clean: |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 259 | rm -f $(OUTDIR)/Makefile.native |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 260 | rm -rf $(OUTDIR)/native |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 261 | find $(OUTDIR) -regex '.*\(host\|target\).native\.mk' -delete |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 262 | |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 263 | clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)) native.clean |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 264 | |
| 265 | # GYP file generation targets. |
ulan@chromium.org | ea52b5f | 2012-07-30 13:05:33 +0000 | [diff] [blame] | 266 | OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ARCHES)) |
| 267 | $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE) |
jkummerow@chromium.org | 1456e70 | 2012-03-30 08:38:13 +0000 | [diff] [blame] | 268 | GYP_GENERATORS=make \ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 269 | build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 270 | -Ibuild/standalone.gypi --depth=. \ |
| 271 | -Dv8_target_arch=$(subst .,,$(suffix $@)) \ |
| 272 | -S.$(subst .,,$(suffix $@)) $(GYPFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 273 | |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 274 | $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) |
jkummerow@chromium.org | 1456e70 | 2012-03-30 08:38:13 +0000 | [diff] [blame] | 275 | GYP_GENERATORS=make \ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 276 | build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 277 | -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 278 | |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 279 | must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN: |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 280 | ifndef ANDROID_NDK_ROOT |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 281 | ifndef ANDROID_TOOLCHAIN |
| 282 | $(error ANDROID_NDK_ROOT or ANDROID_TOOLCHAIN must be set)) |
| 283 | endif |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 284 | endif |
| 285 | |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 286 | # Replaces the old with the new environment file if they're different, which |
| 287 | # will trigger GYP to regenerate Makefiles. |
| 288 | $(ENVFILE): $(ENVFILE).new |
| 289 | @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \ |
| 290 | then rm $(ENVFILE).new; \ |
| 291 | else mv $(ENVFILE).new $(ENVFILE); fi |
| 292 | |
| 293 | # Stores current GYPFLAGS in a file. |
| 294 | $(ENVFILE).new: |
jkummerow@chromium.org | 28faa98 | 2012-04-13 09:58:30 +0000 | [diff] [blame] | 295 | @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ |
| 296 | echo "CXX=$(CXX)" >> $(ENVFILE).new |
ricow@chromium.org | 55ee807 | 2011-09-08 16:33:10 +0000 | [diff] [blame] | 297 | |
| 298 | # Dependencies. |
verwaest@chromium.org | 33e09c8 | 2012-10-10 17:07:22 +0000 | [diff] [blame] | 299 | # Remember to keep these in sync with the DEPS file. |
ricow@chromium.org | 55ee807 | 2011-09-08 16:33:10 +0000 | [diff] [blame] | 300 | dependencies: |
| 301 | svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ |
verwaest@chromium.org | 33e09c8 | 2012-10-10 17:07:22 +0000 | [diff] [blame] | 302 | --revision 1501 |