OLD | NEW |
---|---|
1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 18 matching lines...) Expand all Loading... | |
29 # Variable default definitions. Override them by exporting them in your shell. | 29 # Variable default definitions. Override them by exporting them in your shell. |
30 CXX ?= g++ | 30 CXX ?= g++ |
31 LINK ?= g++ | 31 LINK ?= g++ |
32 OUTDIR ?= out | 32 OUTDIR ?= out |
33 TESTJOBS ?= | 33 TESTJOBS ?= |
34 GYPFLAGS ?= | 34 GYPFLAGS ?= |
35 TESTFLAGS ?= | 35 TESTFLAGS ?= |
36 ANDROID_NDK_ROOT ?= | 36 ANDROID_NDK_ROOT ?= |
37 ANDROID_TOOLCHAIN ?= | 37 ANDROID_TOOLCHAIN ?= |
38 ANDROID_V8 ?= /data/local/v8 | 38 ANDROID_V8 ?= /data/local/v8 |
39 NACL_SDK_ROOT ?= | |
39 | 40 |
40 # Special build flags. Use them like this: "make library=shared" | 41 # Special build flags. Use them like this: "make library=shared" |
41 | 42 |
42 # library=shared || component=shared_library | 43 # library=shared || component=shared_library |
43 ifeq ($(library), shared) | 44 ifeq ($(library), shared) |
44 GYPFLAGS += -Dcomponent=shared_library | 45 GYPFLAGS += -Dcomponent=shared_library |
45 endif | 46 endif |
46 ifdef component | 47 ifdef component |
47 GYPFLAGS += -Dcomponent=$(component) | 48 GYPFLAGS += -Dcomponent=$(component) |
48 endif | 49 endif |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 endif | 130 endif |
130 | 131 |
131 # ----------------- available targets: -------------------- | 132 # ----------------- available targets: -------------------- |
132 # - "dependencies": pulls in external dependencies (currently: GYP) | 133 # - "dependencies": pulls in external dependencies (currently: GYP) |
133 # - any arch listed in ARCHES (see below) | 134 # - any arch listed in ARCHES (see below) |
134 # - any mode listed in MODES | 135 # - any mode listed in MODES |
135 # - every combination <arch>.<mode>, e.g. "ia32.release" | 136 # - every combination <arch>.<mode>, e.g. "ia32.release" |
136 # - "native": current host's architecture, release mode | 137 # - "native": current host's architecture, release mode |
137 # - any of the above with .check appended, e.g. "ia32.release.check" | 138 # - any of the above with .check appended, e.g. "ia32.release.check" |
138 # - "android": cross-compile for Android/ARM | 139 # - "android": cross-compile for Android/ARM |
140 # - "nacl" : cross-compile for Native Client (ia32 and x64) | |
139 # - default (no target specified): build all DEFAULT_ARCHES and MODES | 141 # - default (no target specified): build all DEFAULT_ARCHES and MODES |
140 # - "check": build all targets and run all tests | 142 # - "check": build all targets and run all tests |
141 # - "<arch>.clean" for any <arch> in ARCHES | 143 # - "<arch>.clean" for any <arch> in ARCHES |
142 # - "clean": clean all ARCHES | 144 # - "clean": clean all ARCHES |
143 | 145 |
144 # ----------------- internal stuff ------------------------ | 146 # ----------------- internal stuff ------------------------ |
145 | 147 |
146 # Architectures and modes to be compiled. Consider these to be internal | 148 # Architectures and modes to be compiled. Consider these to be internal |
147 # variables, don't override them (use the targets instead). | 149 # variables, don't override them (use the targets instead). |
148 ARCHES = ia32 x64 arm mipsel | 150 ARCHES = ia32 x64 arm mipsel |
149 DEFAULT_ARCHES = ia32 x64 arm | 151 DEFAULT_ARCHES = ia32 x64 arm |
150 MODES = release debug | 152 MODES = release debug |
151 ANDROID_ARCHES = android_ia32 android_arm android_mipsel | 153 ANDROID_ARCHES = android_ia32 android_arm android_mipsel |
154 NACL_ARCHES = nacl_ia32 nacl_x64 | |
152 | 155 |
153 # List of files that trigger Makefile regeneration: | 156 # List of files that trigger Makefile regeneration: |
154 GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \ | 157 GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \ |
155 preparser/preparser.gyp samples/samples.gyp src/d8.gyp \ | 158 preparser/preparser.gyp samples/samples.gyp src/d8.gyp \ |
156 test/cctest/cctest.gyp tools/gyp/v8.gyp | 159 test/cctest/cctest.gyp tools/gyp/v8.gyp |
157 | 160 |
158 # Generates all combinations of ARCHES and MODES, e.g. "ia32.release". | 161 # Generates all combinations of ARCHES and MODES, e.g. "ia32.release". |
159 BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) | 162 BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) |
160 ANDROID_BUILDS = $(foreach mode,$(MODES), \ | 163 ANDROID_BUILDS = $(foreach mode,$(MODES), \ |
161 $(addsuffix .$(mode),$(ANDROID_ARCHES))) | 164 $(addsuffix .$(mode),$(ANDROID_ARCHES))) |
165 NACL_BUILDS = $(foreach mode,$(MODES), \ | |
166 $(addsuffix .$(mode),$(NACL_ARCHES))) | |
162 # Generates corresponding test targets, e.g. "ia32.release.check". | 167 # Generates corresponding test targets, e.g. "ia32.release.check". |
163 CHECKS = $(addsuffix .check,$(BUILDS)) | 168 CHECKS = $(addsuffix .check,$(BUILDS)) |
164 ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS)) | 169 ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS)) |
170 NACL_CHECKS = $(addsuffix .check,$(NACL_BUILDS)) | |
165 # File where previously used GYPFLAGS are stored. | 171 # File where previously used GYPFLAGS are stored. |
166 ENVFILE = $(OUTDIR)/environment | 172 ENVFILE = $(OUTDIR)/environment |
167 | 173 |
168 .PHONY: all check clean dependencies $(ENVFILE).new native \ | 174 .PHONY: all check clean dependencies $(ENVFILE).new native \ |
169 $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ | 175 $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ |
170 $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \ | 176 $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \ |
171 $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \ | 177 $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \ |
172 must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN | 178 must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN \ |
179 $(NACL_ARCHES) $(NACL_BUILDS) $(NACL_CHECKS) \ | |
180 must-set-NACL_SDK_ROOT | |
173 | 181 |
174 # Target definitions. "all" is the default. | 182 # Target definitions. "all" is the default. |
175 all: $(MODES) | 183 all: $(MODES) |
176 | 184 |
177 # Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile | 185 # Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile |
178 # having been created before. | 186 # having been created before. |
179 buildbot: | 187 buildbot: |
180 $(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \ | 188 $(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \ |
181 builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)" | 189 builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)" |
182 | 190 |
(...skipping 23 matching lines...) Expand all Loading... | |
206 $(ANDROID_ARCHES): $(addprefix $$@.,$(MODES)) | 214 $(ANDROID_ARCHES): $(addprefix $$@.,$(MODES)) |
207 | 215 |
208 $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \ | 216 $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \ |
209 must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN Makefile.android | 217 must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN Makefile.android |
210 @$(MAKE) -f Makefile.android $@ \ | 218 @$(MAKE) -f Makefile.android $@ \ |
211 ARCH="$(basename $@)" \ | 219 ARCH="$(basename $@)" \ |
212 MODE="$(subst .,,$(suffix $@))" \ | 220 MODE="$(subst .,,$(suffix $@))" \ |
213 OUTDIR="$(OUTDIR)" \ | 221 OUTDIR="$(OUTDIR)" \ |
214 GYPFLAGS="$(GYPFLAGS)" | 222 GYPFLAGS="$(GYPFLAGS)" |
215 | 223 |
224 $(NACL_ARCHES): $(addprefix $$@.,$(MODES)) | |
225 | |
226 $(NACL_BUILDS): $(GYPFILES) $(ENVFILE) \ | |
227 Makefile.nacl must-set-NACL_SDK_ROOT | |
228 @$(MAKE) -f Makefile.nacl $@ \ | |
229 ARCH="$(basename $@)" \ | |
230 MODE="$(subst .,,$(suffix $@))" \ | |
231 OUTDIR="$(OUTDIR)" \ | |
232 GYPFLAGS="$(GYPFLAGS)" | |
233 | |
216 # Test targets. | 234 # Test targets. |
217 check: all | 235 check: all |
218 @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 236 @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
219 --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ | 237 --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ |
220 $(TESTFLAGS) | 238 $(TESTFLAGS) |
221 | 239 |
222 $(addsuffix .check,$(MODES)): $$(basename $$@) | 240 $(addsuffix .check,$(MODES)): $$(basename $$@) |
223 @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 241 @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
224 --mode=$(basename $@) $(TESTFLAGS) | 242 --mode=$(basename $@) $(TESTFLAGS) |
225 | 243 |
(...skipping 11 matching lines...) Expand all Loading... | |
237 | 255 |
238 $(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync | 256 $(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync |
239 @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 257 @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
240 --arch-and-mode=$(basename $@) \ | 258 --arch-and-mode=$(basename $@) \ |
241 --timeout=600 \ | 259 --timeout=600 \ |
242 --command-prefix="tools/android-run.py" | 260 --command-prefix="tools/android-run.py" |
243 | 261 |
244 $(addsuffix .check, $(ANDROID_ARCHES)): \ | 262 $(addsuffix .check, $(ANDROID_ARCHES)): \ |
245 $(addprefix $$(basename $$@).,$(MODES)).check | 263 $(addprefix $$(basename $$@).,$(MODES)).check |
246 | 264 |
265 $(addsuffix .check, $(NACL_BUILDS)): $$(basename $$@) | |
266 @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ | |
267 --arch-and-mode=$(basename $@) \ | |
268 --timeout=600 --nopresubmit \ | |
269 --command-prefix="tools/nacl-run.py" | |
270 | |
271 $(addsuffix .check, $(NACL_ARCHES)): \ | |
272 $(addprefix $$(basename $$@).,$(MODES)).check | |
273 | |
247 native.check: native | 274 native.check: native |
248 » @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ | 275 » tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ |
Jakob Kummerow
2013/04/12 09:13:32
accidental edit?
Brad Chen
2013/04/12 18:37:00
Oops; thanks for catching this. Fixed.
| |
249 --arch-and-mode=. $(TESTFLAGS) | 276 --arch-and-mode=. $(TESTFLAGS) |
250 | 277 |
251 # Clean targets. You can clean each architecture individually, or everything. | 278 # Clean targets. You can clean each architecture individually, or everything. |
252 $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)): | 279 $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)): |
253 rm -f $(OUTDIR)/Makefile.$(basename $@) | 280 rm -f $(OUTDIR)/Makefile.$(basename $@) |
254 rm -rf $(OUTDIR)/$(basename $@).release | 281 rm -rf $(OUTDIR)/$(basename $@).release |
255 rm -rf $(OUTDIR)/$(basename $@).debug | 282 rm -rf $(OUTDIR)/$(basename $@).debug |
256 find $(OUTDIR) -regex '.*\(host\|target\).$(basename $@)\.mk' -delete | 283 find $(OUTDIR) -regex '.*\(host\|target\).$(basename $@)\.mk' -delete |
257 | 284 |
258 native.clean: | 285 native.clean: |
259 rm -f $(OUTDIR)/Makefile.native | 286 rm -f $(OUTDIR)/Makefile.native |
260 rm -rf $(OUTDIR)/native | 287 rm -rf $(OUTDIR)/native |
261 find $(OUTDIR) -regex '.*\(host\|target\).native\.mk' -delete | 288 find $(OUTDIR) -regex '.*\(host\|target\).native\.mk' -delete |
262 | 289 |
263 clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)) native.clean | 290 clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)) native.cl ean |
264 | 291 |
265 # GYP file generation targets. | 292 # GYP file generation targets. |
266 OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ARCHES)) | 293 OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ARCHES)) |
267 $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE) | 294 $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE) |
268 GYP_GENERATORS=make \ | 295 GYP_GENERATORS=make \ |
269 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 296 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
270 -Ibuild/standalone.gypi --depth=. \ | 297 -Ibuild/standalone.gypi --depth=. \ |
271 -Dv8_target_arch=$(subst .,,$(suffix $@)) \ | 298 -Dv8_target_arch=$(subst .,,$(suffix $@)) \ |
272 -S.$(subst .,,$(suffix $@)) $(GYPFLAGS) | 299 -S.$(subst .,,$(suffix $@)) $(GYPFLAGS) |
273 | 300 |
274 $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) | 301 $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) |
275 GYP_GENERATORS=make \ | 302 GYP_GENERATORS=make \ |
276 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 303 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
277 -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS) | 304 -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS) |
278 | 305 |
279 must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN: | 306 must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN: |
280 ifndef ANDROID_NDK_ROOT | 307 ifndef ANDROID_NDK_ROOT |
281 ifndef ANDROID_TOOLCHAIN | 308 ifndef ANDROID_TOOLCHAIN |
282 $(error ANDROID_NDK_ROOT or ANDROID_TOOLCHAIN must be set)) | 309 $(error ANDROID_NDK_ROOT or ANDROID_TOOLCHAIN must be set)) |
283 endif | 310 endif |
284 endif | 311 endif |
285 | 312 |
313 # Note that NACL_SDK_ROOT must be set to point to an appropriate | |
314 # Native Client SDK before using this makefile. You can download | |
315 # an SDK here: | |
316 # https://developers.google.com/native-client/sdk/download | |
317 # The pathindicated by NACL_SDK_ROOT will typically end with | |
Jakob Kummerow
2013/04/12 09:13:32
nit: s/pathindicated/path indicated/
Brad Chen
2013/04/12 18:37:00
Done.
| |
318 # a folder for a pepper version such as "pepper_25" that should | |
319 # have "tools" and "toolchain" subdirectories. | |
320 must-set-NACL_SDK_ROOT: | |
321 ifndef NACL_SDK_ROOT | |
322 $(error NACL_SDK_ROOT must be set) | |
323 endif | |
324 | |
286 # Replaces the old with the new environment file if they're different, which | 325 # Replaces the old with the new environment file if they're different, which |
287 # will trigger GYP to regenerate Makefiles. | 326 # will trigger GYP to regenerate Makefiles. |
288 $(ENVFILE): $(ENVFILE).new | 327 $(ENVFILE): $(ENVFILE).new |
289 @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \ | 328 @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \ |
290 then rm $(ENVFILE).new; \ | 329 then rm $(ENVFILE).new; \ |
291 else mv $(ENVFILE).new $(ENVFILE); fi | 330 else mv $(ENVFILE).new $(ENVFILE); fi |
292 | 331 |
293 # Stores current GYPFLAGS in a file. | 332 # Stores current GYPFLAGS in a file. |
294 $(ENVFILE).new: | 333 $(ENVFILE).new: |
295 @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ | 334 @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ |
296 echo "CXX=$(CXX)" >> $(ENVFILE).new | 335 echo "CXX=$(CXX)" >> $(ENVFILE).new |
297 | 336 |
298 # Dependencies. | 337 # Dependencies. |
299 # Remember to keep these in sync with the DEPS file. | 338 # Remember to keep these in sync with the DEPS file. |
300 dependencies: | 339 dependencies: |
301 svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ | 340 svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ |
302 --revision 1501 | 341 --revision 1501 |
OLD | NEW |