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 |
machenbach@chromium.org | ddf3811 | 2013-12-04 09:42:52 +0000 | [diff] [blame] | 223 | MODES = release debug optdebug |
| 224 | DEFAULT_MODES = release debug |
mstarzinger@chromium.org | 71fc346 | 2013-02-27 09:34:27 +0000 | [diff] [blame] | 225 | ANDROID_ARCHES = android_ia32 android_arm android_mipsel |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 226 | NACL_ARCHES = nacl_ia32 nacl_x64 |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 227 | |
| 228 | # List of files that trigger Makefile regeneration: |
danno@chromium.org | bee5199 | 2013-07-10 14:57:15 +0000 | [diff] [blame] | 229 | GYPFILES = build/all.gyp build/features.gypi build/standalone.gypi \ |
mvstanton@chromium.org | 63ea3d2 | 2013-10-10 09:24:12 +0000 | [diff] [blame] | 230 | build/toolchain.gypi samples/samples.gyp src/d8.gyp \ |
| 231 | test/cctest/cctest.gyp tools/gyp/v8.gyp |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 232 | |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 233 | # If vtunejit=on, the v8vtune.gyp will be appended. |
| 234 | ifeq ($(vtunejit), on) |
| 235 | GYPFILES += src/third_party/vtune/v8vtune.gyp |
| 236 | endif |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 237 | # Generates all combinations of ARCHES and MODES, e.g. "ia32.release". |
| 238 | BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 239 | ANDROID_BUILDS = $(foreach mode,$(MODES), \ |
| 240 | $(addsuffix .$(mode),$(ANDROID_ARCHES))) |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 241 | NACL_BUILDS = $(foreach mode,$(MODES), \ |
| 242 | $(addsuffix .$(mode),$(NACL_ARCHES))) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 243 | # Generates corresponding test targets, e.g. "ia32.release.check". |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 244 | CHECKS = $(addsuffix .check,$(BUILDS)) |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 245 | ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS)) |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 246 | NACL_CHECKS = $(addsuffix .check,$(NACL_BUILDS)) |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 247 | # File where previously used GYPFLAGS are stored. |
| 248 | ENVFILE = $(OUTDIR)/environment |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 249 | |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 250 | .PHONY: all check clean dependencies $(ENVFILE).new native \ |
machenbach@chromium.org | ddf3811 | 2013-12-04 09:42:52 +0000 | [diff] [blame] | 251 | qc quickcheck \ |
fschneider@chromium.org | 1805e21 | 2011-09-05 10:49:12 +0000 | [diff] [blame] | 252 | $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 253 | $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \ |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 254 | $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \ |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 255 | must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN \ |
| 256 | $(NACL_ARCHES) $(NACL_BUILDS) $(NACL_CHECKS) \ |
| 257 | must-set-NACL_SDK_ROOT |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 258 | |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 259 | # Target definitions. "all" is the default. |
machenbach@chromium.org | ddf3811 | 2013-12-04 09:42:52 +0000 | [diff] [blame] | 260 | all: $(DEFAULT_MODES) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 261 | |
jkummerow@chromium.org | 212d964 | 2012-05-11 15:02:09 +0000 | [diff] [blame] | 262 | # Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile |
| 263 | # having been created before. |
| 264 | buildbot: |
| 265 | $(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \ |
| 266 | builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)" |
| 267 | |
rossberg@chromium.org | 657d53b | 2012-07-12 11:06:03 +0000 | [diff] [blame] | 268 | mips mips.release mips.debug: |
| 269 | @echo "V8 does not support big-endian MIPS builds at the moment," \ |
| 270 | "please use little-endian builds (mipsel)." |
| 271 | |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 272 | # Compile targets. MODES and ARCHES are convenience targets. |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 273 | .SECONDEXPANSION: |
danno@chromium.org | c612e02 | 2011-11-10 11:38:15 +0000 | [diff] [blame] | 274 | $(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES)) |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 275 | |
machenbach@chromium.org | afbdadc | 2013-12-09 16:12:18 +0000 | [diff] [blame^] | 276 | $(ARCHES): $(addprefix $$@.,$(DEFAULT_MODES)) |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 277 | |
| 278 | # Defines how to build a particular target (e.g. ia32.release). |
machenbach@chromium.org | ddf3811 | 2013-12-04 09:42:52 +0000 | [diff] [blame] | 279 | $(BUILDS): $(OUTDIR)/Makefile.$$@ |
| 280 | @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 281 | CXX="$(CXX)" LINK="$(LINK)" \ |
| 282 | BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ |
machenbach@chromium.org | ddf3811 | 2013-12-04 09:42:52 +0000 | [diff] [blame] | 283 | python -c "print \ |
| 284 | raw_input().replace('opt', '').capitalize()") \ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 285 | builddir="$(shell pwd)/$(OUTDIR)/$@" |
| 286 | |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 287 | native: $(OUTDIR)/Makefile.native |
| 288 | @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \ |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 289 | CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \ |
| 290 | builddir="$(shell pwd)/$(OUTDIR)/$@" |
| 291 | |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 292 | $(ANDROID_ARCHES): $(addprefix $$@.,$(MODES)) |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 293 | |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 294 | $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \ |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 295 | must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN Makefile.android |
ulan@chromium.org | ea52b5f | 2012-07-30 13:05:33 +0000 | [diff] [blame] | 296 | @$(MAKE) -f Makefile.android $@ \ |
| 297 | ARCH="$(basename $@)" \ |
| 298 | MODE="$(subst .,,$(suffix $@))" \ |
| 299 | OUTDIR="$(OUTDIR)" \ |
| 300 | GYPFLAGS="$(GYPFLAGS)" |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 301 | |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 302 | $(NACL_ARCHES): $(addprefix $$@.,$(MODES)) |
| 303 | |
| 304 | $(NACL_BUILDS): $(GYPFILES) $(ENVFILE) \ |
| 305 | Makefile.nacl must-set-NACL_SDK_ROOT |
| 306 | @$(MAKE) -f Makefile.nacl $@ \ |
| 307 | ARCH="$(basename $@)" \ |
| 308 | MODE="$(subst .,,$(suffix $@))" \ |
| 309 | OUTDIR="$(OUTDIR)" \ |
| 310 | GYPFLAGS="$(GYPFLAGS)" |
| 311 | |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 312 | # Test targets. |
| 313 | check: all |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 314 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
danno@chromium.org | c612e02 | 2011-11-10 11:38:15 +0000 | [diff] [blame] | 315 | --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 316 | $(TESTFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 317 | |
| 318 | $(addsuffix .check,$(MODES)): $$(basename $$@) |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 319 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 320 | --mode=$(basename $@) $(TESTFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 321 | |
| 322 | $(addsuffix .check,$(ARCHES)): $$(basename $$@) |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 323 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 324 | --arch=$(basename $@) $(TESTFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 325 | |
| 326 | $(CHECKS): $$(basename $$@) |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 327 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 328 | --arch-and-mode=$(basename $@) $(TESTFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 329 | |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 330 | $(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@) |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 331 | @tools/android-sync.sh $(basename $@) $(OUTDIR) \ |
| 332 | $(shell pwd) $(ANDROID_V8) |
| 333 | |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 334 | $(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 335 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 336 | --arch-and-mode=$(basename $@) \ |
mstarzinger@chromium.org | 471f2f1 | 2012-08-10 14:46:33 +0000 | [diff] [blame] | 337 | --timeout=600 \ |
bmeurer@chromium.org | e94b5ff | 2013-10-25 09:22:31 +0000 | [diff] [blame] | 338 | --command-prefix="tools/android-run.py" $(TESTFLAGS) |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 339 | |
yangguo@chromium.org | 304cc33 | 2012-07-24 07:59:48 +0000 | [diff] [blame] | 340 | $(addsuffix .check, $(ANDROID_ARCHES)): \ |
| 341 | $(addprefix $$(basename $$@).,$(MODES)).check |
mstarzinger@chromium.org | c6d9cee | 2012-07-03 10:03:19 +0000 | [diff] [blame] | 342 | |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 343 | $(addsuffix .check, $(NACL_BUILDS)): $$(basename $$@) |
| 344 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
| 345 | --arch-and-mode=$(basename $@) \ |
machenbach@chromium.org | 528ce02 | 2013-09-23 14:09:36 +0000 | [diff] [blame] | 346 | --timeout=600 --nopresubmit --noi18n \ |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 347 | --command-prefix="tools/nacl-run.py" |
| 348 | |
| 349 | $(addsuffix .check, $(NACL_ARCHES)): \ |
| 350 | $(addprefix $$(basename $$@).,$(MODES)).check |
| 351 | |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 352 | native.check: native |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 353 | @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ |
svenpanne@chromium.org | a8bb4d9 | 2011-10-10 13:20:40 +0000 | [diff] [blame] | 354 | --arch-and-mode=. $(TESTFLAGS) |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 355 | |
machenbach@chromium.org | ddf3811 | 2013-12-04 09:42:52 +0000 | [diff] [blame] | 356 | FASTTESTMODES = ia32.release,x64.release,ia32.optdebug,x64.optdebug,arm.optdebug |
machenbach@chromium.org | 9f18d91 | 2013-11-28 13:42:41 +0000 | [diff] [blame] | 357 | |
machenbach@chromium.org | ddf3811 | 2013-12-04 09:42:52 +0000 | [diff] [blame] | 358 | COMMA = , |
| 359 | EMPTY = |
| 360 | SPACE = $(EMPTY) $(EMPTY) |
| 361 | quickcheck: $(subst $(COMMA),$(SPACE),$(FASTTESTMODES)) |
| 362 | tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
| 363 | --arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) --quickcheck |
machenbach@chromium.org | 9f18d91 | 2013-11-28 13:42:41 +0000 | [diff] [blame] | 364 | qc: quickcheck |
| 365 | |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 366 | # Clean targets. You can clean each architecture individually, or everything. |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 367 | $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)): |
machenbach@chromium.org | ddf3811 | 2013-12-04 09:42:52 +0000 | [diff] [blame] | 368 | rm -f $(OUTDIR)/Makefile.$(basename $@)* |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 369 | rm -rf $(OUTDIR)/$(basename $@).release |
| 370 | rm -rf $(OUTDIR)/$(basename $@).debug |
machenbach@chromium.org | afbdadc | 2013-12-09 16:12:18 +0000 | [diff] [blame^] | 371 | rm -rf $(OUTDIR)/$(basename $@).optdebug |
machenbach@chromium.org | ddf3811 | 2013-12-04 09:42:52 +0000 | [diff] [blame] | 372 | find $(OUTDIR) -regex '.*\(host\|target\)\.$(basename $@).*\.mk' -delete |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 373 | |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 374 | native.clean: |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 375 | rm -f $(OUTDIR)/Makefile.native |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 376 | rm -rf $(OUTDIR)/native |
machenbach@chromium.org | ddf3811 | 2013-12-04 09:42:52 +0000 | [diff] [blame] | 377 | find $(OUTDIR) -regex '.*\(host\|target\)\.native\.mk' -delete |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 378 | |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 379 | clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)) native.clean |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 380 | |
| 381 | # GYP file generation targets. |
machenbach@chromium.org | ddf3811 | 2013-12-04 09:42:52 +0000 | [diff] [blame] | 382 | OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(BUILDS)) |
ulan@chromium.org | ea52b5f | 2012-07-30 13:05:33 +0000 | [diff] [blame] | 383 | $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE) |
jkummerow@chromium.org | 1048047 | 2013-07-17 08:22:15 +0000 | [diff] [blame] | 384 | PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \ |
jkummerow@chromium.org | 1456e70 | 2012-03-30 08:38:13 +0000 | [diff] [blame] | 385 | GYP_GENERATORS=make \ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 386 | build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 387 | -Ibuild/standalone.gypi --depth=. \ |
machenbach@chromium.org | ddf3811 | 2013-12-04 09:42:52 +0000 | [diff] [blame] | 388 | -Dv8_target_arch=$(subst .,,$(suffix $(basename $@))) \ |
| 389 | -Dv8_optimized_debug=$(if $(findstring optdebug,$@),2,0) \ |
| 390 | -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 391 | |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 392 | $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) |
jkummerow@chromium.org | 1048047 | 2013-07-17 08:22:15 +0000 | [diff] [blame] | 393 | PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \ |
jkummerow@chromium.org | 1456e70 | 2012-03-30 08:38:13 +0000 | [diff] [blame] | 394 | GYP_GENERATORS=make \ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 395 | build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
danno@chromium.org | 2c26cb1 | 2012-05-03 09:06:43 +0000 | [diff] [blame] | 396 | -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS) |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 397 | |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 398 | must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN: |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 399 | ifndef ANDROID_NDK_ROOT |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 400 | ifndef ANDROID_TOOLCHAIN |
| 401 | $(error ANDROID_NDK_ROOT or ANDROID_TOOLCHAIN must be set)) |
| 402 | endif |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 403 | endif |
| 404 | |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 405 | # Note that NACL_SDK_ROOT must be set to point to an appropriate |
| 406 | # Native Client SDK before using this makefile. You can download |
| 407 | # an SDK here: |
| 408 | # https://developers.google.com/native-client/sdk/download |
| 409 | # The path indicated by NACL_SDK_ROOT will typically end with |
| 410 | # a folder for a pepper version such as "pepper_25" that should |
| 411 | # have "tools" and "toolchain" subdirectories. |
| 412 | must-set-NACL_SDK_ROOT: |
| 413 | ifndef NACL_SDK_ROOT |
| 414 | $(error NACL_SDK_ROOT must be set) |
| 415 | endif |
| 416 | |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 417 | # Replaces the old with the new environment file if they're different, which |
| 418 | # will trigger GYP to regenerate Makefiles. |
| 419 | $(ENVFILE): $(ENVFILE).new |
danno@chromium.org | 5940060 | 2013-08-13 17:09:37 +0000 | [diff] [blame] | 420 | @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) > /dev/null; \ |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 421 | then rm $(ENVFILE).new; \ |
| 422 | else mv $(ENVFILE).new $(ENVFILE); fi |
| 423 | |
| 424 | # Stores current GYPFLAGS in a file. |
| 425 | $(ENVFILE).new: |
jkummerow@chromium.org | 28faa98 | 2012-04-13 09:58:30 +0000 | [diff] [blame] | 426 | @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ |
| 427 | echo "CXX=$(CXX)" >> $(ENVFILE).new |
ricow@chromium.org | 55ee807 | 2011-09-08 16:33:10 +0000 | [diff] [blame] | 428 | |
danno@chromium.org | 5940060 | 2013-08-13 17:09:37 +0000 | [diff] [blame] | 429 | # Heap constants for grokdump. |
| 430 | DUMP_FILE = tools/v8heapconst.py |
| 431 | grokdump: ia32.release |
| 432 | @cat $(DUMP_FILE).tmpl > $(DUMP_FILE) |
| 433 | @$(OUTDIR)/ia32.release/d8 --dump-heap-constants >> $(DUMP_FILE) |
| 434 | |
ricow@chromium.org | 55ee807 | 2011-09-08 16:33:10 +0000 | [diff] [blame] | 435 | # Dependencies. |
verwaest@chromium.org | 33e09c8 | 2012-10-10 17:07:22 +0000 | [diff] [blame] | 436 | # Remember to keep these in sync with the DEPS file. |
ricow@chromium.org | 55ee807 | 2011-09-08 16:33:10 +0000 | [diff] [blame] | 437 | dependencies: |
| 438 | svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ |
danno@chromium.org | d3c4210 | 2013-08-01 16:58:23 +0000 | [diff] [blame] | 439 | --revision 1685 |
jkummerow@chromium.org | 93a47f4 | 2013-07-02 14:43:41 +0000 | [diff] [blame] | 440 | svn checkout --force \ |
| 441 | https://src.chromium.org/chrome/trunk/deps/third_party/icu46 \ |
danno@chromium.org | d3c4210 | 2013-08-01 16:58:23 +0000 | [diff] [blame] | 442 | third_party/icu --revision 214189 |