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