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 | 1510d58 | 2013-06-28 14:00:48 +0000 | [diff] [blame] | 38 | ANDROID_V8 ?= /data/local/tmp/v8 |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 39 | NACL_SDK_ROOT ?= |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 40 | |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 41 | # Special build flags. Use them like this: "make library=shared" |
| 42 | |
| 43 | # library=shared || component=shared_library |
| 44 | ifeq ($(library), shared) |
| 45 | GYPFLAGS += -Dcomponent=shared_library |
| 46 | endif |
| 47 | ifdef component |
| 48 | GYPFLAGS += -Dcomponent=$(component) |
| 49 | endif |
| 50 | # console=readline |
| 51 | ifdef console |
| 52 | GYPFLAGS += -Dconsole=$(console) |
| 53 | endif |
| 54 | # disassembler=on |
| 55 | ifeq ($(disassembler), on) |
| 56 | GYPFLAGS += -Dv8_enable_disassembler=1 |
| 57 | endif |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 58 | # objectprint=on |
| 59 | ifeq ($(objectprint), on) |
| 60 | GYPFLAGS += -Dv8_object_print=1 |
| 61 | endif |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 62 | # verifyheap=on |
| 63 | ifeq ($(verifyheap), on) |
| 64 | GYPFLAGS += -Dv8_enable_verify_heap=1 |
| 65 | endif |
yangguo@chromium.org | a6bbcc8 | 2012-12-21 12:35:02 +0000 | [diff] [blame] | 66 | # backtrace=off |
| 67 | ifeq ($(backtrace), off) |
| 68 | GYPFLAGS += -Dv8_enable_backtrace=0 |
| 69 | else |
| 70 | GYPFLAGS += -Dv8_enable_backtrace=1 |
| 71 | endif |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 72 | # snapshot=off |
| 73 | ifeq ($(snapshot), off) |
| 74 | GYPFLAGS += -Dv8_use_snapshot='false' |
| 75 | endif |
jkummerow@chromium.org | 67255be | 2012-09-05 16:44:50 +0000 | [diff] [blame] | 76 | # extrachecks=on/off |
| 77 | ifeq ($(extrachecks), on) |
| 78 | GYPFLAGS += -Dv8_enable_extra_checks=1 |
| 79 | endif |
| 80 | ifeq ($(extrachecks), off) |
| 81 | GYPFLAGS += -Dv8_enable_extra_checks=0 |
| 82 | endif |
machenbach@chromium.org | c1789ee | 2013-07-05 07:09:57 +0000 | [diff] [blame] | 83 | # gdbjit=on/off |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 84 | ifeq ($(gdbjit), on) |
| 85 | GYPFLAGS += -Dv8_enable_gdbjit=1 |
| 86 | endif |
machenbach@chromium.org | c1789ee | 2013-07-05 07:09:57 +0000 | [diff] [blame] | 87 | ifeq ($(gdbjit), off) |
| 88 | GYPFLAGS += -Dv8_enable_gdbjit=0 |
| 89 | endif |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 90 | # vtunejit=on |
| 91 | ifeq ($(vtunejit), on) |
| 92 | GYPFLAGS += -Dv8_enable_vtunejit=1 |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 93 | endif |
jkummerow@chromium.org | 1048047 | 2013-07-17 08:22:15 +0000 | [diff] [blame^] | 94 | # optdebug=on |
| 95 | ifeq ($(optdebug), on) |
| 96 | GYPFLAGS += -Dv8_optimized_debug=1 |
| 97 | endif |
erik.corry@gmail.com | bbceb57 | 2012-03-09 10:52:05 +0000 | [diff] [blame] | 98 | # debuggersupport=off |
| 99 | ifeq ($(debuggersupport), off) |
| 100 | GYPFLAGS += -Dv8_enable_debugger_support=0 |
| 101 | endif |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 102 | # unalignedaccess=on |
| 103 | ifeq ($(unalignedaccess), on) |
| 104 | GYPFLAGS += -Dv8_can_use_unaligned_accesses=true |
| 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 |
machenbach@chromium.org | c1789ee | 2013-07-05 07:09:57 +0000 | [diff] [blame] | 126 | # i18nsupport=on |
| 127 | ifeq ($(i18nsupport), on) |
| 128 | GYPFLAGS += -Dv8_enable_i18n_support=1 |
| 129 | endif |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 130 | # arm specific flags. |
| 131 | # armv7=false/true |
yangguo@chromium.org | 4cd70b4 | 2013-01-04 08:57:54 +0000 | [diff] [blame] | 132 | ifeq ($(armv7), false) |
| 133 | GYPFLAGS += -Darmv7=0 |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 134 | else |
| 135 | ifeq ($(armv7), true) |
| 136 | GYPFLAGS += -Darmv7=1 |
| 137 | endif |
| 138 | endif |
| 139 | # vfp2=off. Deprecated, use armfpu= |
| 140 | # vfp3=off. Deprecated, use armfpu= |
| 141 | ifeq ($(vfp3), off) |
| 142 | GYPFLAGS += -Darm_fpu=vfp |
| 143 | endif |
| 144 | # hardfp=on/off. Deprecated, use armfloatabi |
| 145 | ifeq ($(hardfp),on) |
| 146 | GYPFLAGS += -Darm_float_abi=hard |
| 147 | else |
| 148 | ifeq ($(hardfp),off) |
| 149 | GYPFLAGS += -Darm_float_abi=softfp |
| 150 | endif |
| 151 | endif |
| 152 | # armneon=on/off |
| 153 | ifeq ($(armneon), on) |
| 154 | GYPFLAGS += -Darm_neon=1 |
| 155 | endif |
| 156 | # fpu: armfpu=xxx |
| 157 | # xxx: vfp, vfpv3-d16, vfpv3, neon. |
| 158 | ifeq ($(armfpu),) |
| 159 | ifneq ($(vfp3), off) |
| 160 | GYPFLAGS += -Darm_fpu=default |
| 161 | endif |
| 162 | else |
| 163 | GYPFLAGS += -Darm_fpu=$(armfpu) |
| 164 | endif |
| 165 | # float abi: armfloatabi=softfp/hard |
| 166 | ifeq ($(armfloatabi),) |
| 167 | ifeq ($(hardfp),) |
| 168 | GYPFLAGS += -Darm_float_abi=default |
| 169 | endif |
| 170 | else |
| 171 | GYPFLAGS += -Darm_float_abi=$(armfloatabi) |
| 172 | endif |
| 173 | # armthumb=on/off |
| 174 | ifeq ($(armthumb), off) |
| 175 | GYPFLAGS += -Darm_thumb=0 |
| 176 | else |
| 177 | ifeq ($(armthumb), on) |
| 178 | GYPFLAGS += -Darm_thumb=1 |
| 179 | endif |
| 180 | endif |
| 181 | # armtest=on |
| 182 | # With this flag set, by default v8 will only use features implied |
| 183 | # by the compiler (no probe). This is done by modifying the default |
| 184 | # values of enable_armv7, enable_vfp2, enable_vfp3 and enable_32dregs. |
| 185 | # Modifying these flags when launching v8 will enable the probing for |
| 186 | # the specified values. |
| 187 | # When using the simulator, this flag is implied. |
| 188 | ifeq ($(armtest), on) |
| 189 | GYPFLAGS += -Darm_test=on |
yangguo@chromium.org | 4cd70b4 | 2013-01-04 08:57:54 +0000 | [diff] [blame] | 190 | endif |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 191 | |
| 192 | # ----------------- available targets: -------------------- |
ricow@chromium.org | 55ee807 | 2011-09-08 16:33:10 +0000 | [diff] [blame] | 193 | # - "dependencies": pulls in external dependencies (currently: GYP) |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 194 | # - any arch listed in ARCHES (see below) |
| 195 | # - any mode listed in MODES |
| 196 | # - every combination <arch>.<mode>, e.g. "ia32.release" |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 197 | # - "native": current host's architecture, release mode |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 198 | # - 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] | 199 | # - "android": cross-compile for Android/ARM |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 200 | # - "nacl" : cross-compile for Native Client (ia32 and x64) |
danno@chromium.org | c612e02 | 2011-11-10 11:38:15 +0000 | [diff] [blame] | 201 | # - default (no target specified): build all DEFAULT_ARCHES and MODES |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 202 | # - "check": build all targets and run all tests |
| 203 | # - "<arch>.clean" for any <arch> in ARCHES |
| 204 | # - "clean": clean all ARCHES |
| 205 | |
| 206 | # ----------------- internal stuff ------------------------ |
| 207 | |
| 208 | # Architectures and modes to be compiled. Consider these to be internal |
| 209 | # variables, don't override them (use the targets instead). |
rossberg@chromium.org | 657d53b | 2012-07-12 11:06:03 +0000 | [diff] [blame] | 210 | ARCHES = ia32 x64 arm mipsel |
danno@chromium.org | c612e02 | 2011-11-10 11:38:15 +0000 | [diff] [blame] | 211 | DEFAULT_ARCHES = ia32 x64 arm |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 212 | MODES = release debug |
mstarzinger@chromium.org | 71fc346 | 2013-02-27 09:34:27 +0000 | [diff] [blame] | 213 | ANDROID_ARCHES = android_ia32 android_arm android_mipsel |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 214 | NACL_ARCHES = nacl_ia32 nacl_x64 |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 215 | |
| 216 | # List of files that trigger Makefile regeneration: |
danno@chromium.org | bee5199 | 2013-07-10 14:57:15 +0000 | [diff] [blame] | 217 | GYPFILES = build/all.gyp build/features.gypi build/standalone.gypi \ |
| 218 | build/toolchain.gypi preparser/preparser.gyp samples/samples.gyp \ |
| 219 | src/d8.gyp test/cctest/cctest.gyp tools/gyp/v8.gyp |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 220 | |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 221 | # If vtunejit=on, the v8vtune.gyp will be appended. |
| 222 | ifeq ($(vtunejit), on) |
| 223 | GYPFILES += src/third_party/vtune/v8vtune.gyp |
| 224 | endif |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 225 | # Generates all combinations of ARCHES and MODES, e.g. "ia32.release". |
| 226 | BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 227 | ANDROID_BUILDS = $(foreach mode,$(MODES), \ |
| 228 | $(addsuffix .$(mode),$(ANDROID_ARCHES))) |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 229 | NACL_BUILDS = $(foreach mode,$(MODES), \ |
| 230 | $(addsuffix .$(mode),$(NACL_ARCHES))) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 231 | # Generates corresponding test targets, e.g. "ia32.release.check". |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 232 | CHECKS = $(addsuffix .check,$(BUILDS)) |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 233 | ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS)) |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 234 | NACL_CHECKS = $(addsuffix .check,$(NACL_BUILDS)) |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 235 | # File where previously used GYPFLAGS are stored. |
| 236 | ENVFILE = $(OUTDIR)/environment |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 237 | |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 238 | .PHONY: all check clean dependencies $(ENVFILE).new native \ |
fschneider@chromium.org | 1805e21 | 2011-09-05 10:49:12 +0000 | [diff] [blame] | 239 | $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 240 | $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \ |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 241 | $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \ |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 242 | must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN \ |
| 243 | $(NACL_ARCHES) $(NACL_BUILDS) $(NACL_CHECKS) \ |
| 244 | must-set-NACL_SDK_ROOT |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 245 | |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 246 | # Target definitions. "all" is the default. |
| 247 | all: $(MODES) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 248 | |
jkummerow@chromium.org | 212d964 | 2012-05-11 15:02:09 +0000 | [diff] [blame] | 249 | # Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile |
| 250 | # having been created before. |
| 251 | buildbot: |
| 252 | $(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \ |
| 253 | builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)" |
| 254 | |
rossberg@chromium.org | 657d53b | 2012-07-12 11:06:03 +0000 | [diff] [blame] | 255 | mips mips.release mips.debug: |
| 256 | @echo "V8 does not support big-endian MIPS builds at the moment," \ |
| 257 | "please use little-endian builds (mipsel)." |
| 258 | |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 259 | # Compile targets. MODES and ARCHES are convenience targets. |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 260 | .SECONDEXPANSION: |
danno@chromium.org | c612e02 | 2011-11-10 11:38:15 +0000 | [diff] [blame] | 261 | $(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES)) |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 262 | |
| 263 | $(ARCHES): $(addprefix $$@.,$(MODES)) |
| 264 | |
| 265 | # Defines how to build a particular target (e.g. ia32.release). |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 266 | $(BUILDS): $(OUTDIR)/Makefile.$$(basename $$@) |
| 267 | @$(MAKE) -C "$(OUTDIR)" -f Makefile.$(basename $@) \ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 268 | CXX="$(CXX)" LINK="$(LINK)" \ |
| 269 | BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ |
| 270 | python -c "print raw_input().capitalize()") \ |
| 271 | builddir="$(shell pwd)/$(OUTDIR)/$@" |
| 272 | |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 273 | native: $(OUTDIR)/Makefile.native |
| 274 | @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \ |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 275 | CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \ |
| 276 | builddir="$(shell pwd)/$(OUTDIR)/$@" |
| 277 | |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 278 | $(ANDROID_ARCHES): $(addprefix $$@.,$(MODES)) |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 279 | |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 280 | $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \ |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 281 | must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN Makefile.android |
ulan@chromium.org | ea52b5f | 2012-07-30 13:05:33 +0000 | [diff] [blame] | 282 | @$(MAKE) -f Makefile.android $@ \ |
| 283 | ARCH="$(basename $@)" \ |
| 284 | MODE="$(subst .,,$(suffix $@))" \ |
| 285 | OUTDIR="$(OUTDIR)" \ |
| 286 | GYPFLAGS="$(GYPFLAGS)" |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 287 | |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 288 | $(NACL_ARCHES): $(addprefix $$@.,$(MODES)) |
| 289 | |
| 290 | $(NACL_BUILDS): $(GYPFILES) $(ENVFILE) \ |
| 291 | Makefile.nacl must-set-NACL_SDK_ROOT |
| 292 | @$(MAKE) -f Makefile.nacl $@ \ |
| 293 | ARCH="$(basename $@)" \ |
| 294 | MODE="$(subst .,,$(suffix $@))" \ |
| 295 | OUTDIR="$(OUTDIR)" \ |
| 296 | GYPFLAGS="$(GYPFLAGS)" |
| 297 | |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 298 | # Test targets. |
| 299 | check: all |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 300 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
danno@chromium.org | c612e02 | 2011-11-10 11:38:15 +0000 | [diff] [blame] | 301 | --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 302 | $(TESTFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 303 | |
| 304 | $(addsuffix .check,$(MODES)): $$(basename $$@) |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 305 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 306 | --mode=$(basename $@) $(TESTFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 307 | |
| 308 | $(addsuffix .check,$(ARCHES)): $$(basename $$@) |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 309 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 310 | --arch=$(basename $@) $(TESTFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 311 | |
| 312 | $(CHECKS): $$(basename $$@) |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 313 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 314 | --arch-and-mode=$(basename $@) $(TESTFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 315 | |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 316 | $(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@) |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 317 | @tools/android-sync.sh $(basename $@) $(OUTDIR) \ |
| 318 | $(shell pwd) $(ANDROID_V8) |
| 319 | |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 320 | $(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 321 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 322 | --arch-and-mode=$(basename $@) \ |
mstarzinger@chromium.org | 471f2f1 | 2012-08-10 14:46:33 +0000 | [diff] [blame] | 323 | --timeout=600 \ |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 324 | --command-prefix="tools/android-run.py" |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 325 | |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 326 | $(addsuffix .check, $(ANDROID_ARCHES)): \ |
| 327 | $(addprefix $$(basename $$@).,$(MODES)).check |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 328 | |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 329 | $(addsuffix .check, $(NACL_BUILDS)): $$(basename $$@) |
| 330 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
| 331 | --arch-and-mode=$(basename $@) \ |
| 332 | --timeout=600 --nopresubmit \ |
| 333 | --command-prefix="tools/nacl-run.py" |
| 334 | |
| 335 | $(addsuffix .check, $(NACL_ARCHES)): \ |
| 336 | $(addprefix $$(basename $$@).,$(MODES)).check |
| 337 | |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 338 | native.check: native |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 339 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 340 | --arch-and-mode=. $(TESTFLAGS) |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 341 | |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 342 | # Clean targets. You can clean each architecture individually, or everything. |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 343 | $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)): |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 344 | rm -f $(OUTDIR)/Makefile.$(basename $@) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 345 | rm -rf $(OUTDIR)/$(basename $@).release |
| 346 | rm -rf $(OUTDIR)/$(basename $@).debug |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 347 | find $(OUTDIR) -regex '.*\(host\|target\).$(basename $@)\.mk' -delete |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 348 | |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 349 | native.clean: |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 350 | rm -f $(OUTDIR)/Makefile.native |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 351 | rm -rf $(OUTDIR)/native |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 352 | find $(OUTDIR) -regex '.*\(host\|target\).native\.mk' -delete |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 353 | |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 354 | clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)) native.clean |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 355 | |
| 356 | # GYP file generation targets. |
ulan@chromium.org | ea52b5f | 2012-07-30 13:05:33 +0000 | [diff] [blame] | 357 | OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ARCHES)) |
| 358 | $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE) |
jkummerow@chromium.org | 1048047 | 2013-07-17 08:22:15 +0000 | [diff] [blame^] | 359 | PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \ |
jkummerow@chromium.org | 1456e70 | 2012-03-30 08:38:13 +0000 | [diff] [blame] | 360 | GYP_GENERATORS=make \ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 361 | build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 362 | -Ibuild/standalone.gypi --depth=. \ |
| 363 | -Dv8_target_arch=$(subst .,,$(suffix $@)) \ |
| 364 | -S.$(subst .,,$(suffix $@)) $(GYPFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 365 | |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 366 | $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) |
jkummerow@chromium.org | 1048047 | 2013-07-17 08:22:15 +0000 | [diff] [blame^] | 367 | PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \ |
jkummerow@chromium.org | 1456e70 | 2012-03-30 08:38:13 +0000 | [diff] [blame] | 368 | GYP_GENERATORS=make \ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 369 | build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 370 | -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 371 | |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 372 | must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN: |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 373 | ifndef ANDROID_NDK_ROOT |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 374 | ifndef ANDROID_TOOLCHAIN |
| 375 | $(error ANDROID_NDK_ROOT or ANDROID_TOOLCHAIN must be set)) |
| 376 | endif |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 377 | endif |
| 378 | |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 379 | # Note that NACL_SDK_ROOT must be set to point to an appropriate |
| 380 | # Native Client SDK before using this makefile. You can download |
| 381 | # an SDK here: |
| 382 | # https://developers.google.com/native-client/sdk/download |
| 383 | # The path indicated by NACL_SDK_ROOT will typically end with |
| 384 | # a folder for a pepper version such as "pepper_25" that should |
| 385 | # have "tools" and "toolchain" subdirectories. |
| 386 | must-set-NACL_SDK_ROOT: |
| 387 | ifndef NACL_SDK_ROOT |
| 388 | $(error NACL_SDK_ROOT must be set) |
| 389 | endif |
| 390 | |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 391 | # Replaces the old with the new environment file if they're different, which |
| 392 | # will trigger GYP to regenerate Makefiles. |
| 393 | $(ENVFILE): $(ENVFILE).new |
| 394 | @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \ |
| 395 | then rm $(ENVFILE).new; \ |
| 396 | else mv $(ENVFILE).new $(ENVFILE); fi |
| 397 | |
| 398 | # Stores current GYPFLAGS in a file. |
| 399 | $(ENVFILE).new: |
jkummerow@chromium.org | 28faa98 | 2012-04-13 09:58:30 +0000 | [diff] [blame] | 400 | @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ |
| 401 | echo "CXX=$(CXX)" >> $(ENVFILE).new |
ricow@chromium.org | 55ee807 | 2011-09-08 16:33:10 +0000 | [diff] [blame] | 402 | |
| 403 | # Dependencies. |
verwaest@chromium.org | 33e09c8 | 2012-10-10 17:07:22 +0000 | [diff] [blame] | 404 | # Remember to keep these in sync with the DEPS file. |
ricow@chromium.org | 55ee807 | 2011-09-08 16:33:10 +0000 | [diff] [blame] | 405 | dependencies: |
| 406 | svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ |
jkummerow@chromium.org | 93a47f4 | 2013-07-02 14:43:41 +0000 | [diff] [blame] | 407 | --revision 1656 |
| 408 | svn checkout --force \ |
| 409 | https://src.chromium.org/chrome/trunk/deps/third_party/icu46 \ |
danno@chromium.org | 169691d | 2013-07-15 08:01:13 +0000 | [diff] [blame] | 410 | third_party/icu --revision 210659 |