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