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