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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 endif | 134 endif |
134 | 135 |
135 # ----------------- available targets: -------------------- | 136 # ----------------- available targets: -------------------- |
136 # - "dependencies": pulls in external dependencies (currently: GYP) | 137 # - "dependencies": pulls in external dependencies (currently: GYP) |
137 # - any arch listed in ARCHES (see below) | 138 # - any arch listed in ARCHES (see below) |
138 # - any mode listed in MODES | 139 # - any mode listed in MODES |
139 # - every combination <arch>.<mode>, e.g. "ia32.release" | 140 # - every combination <arch>.<mode>, e.g. "ia32.release" |
140 # - "native": current host's architecture, release mode | 141 # - "native": current host's architecture, release mode |
141 # - any of the above with .check appended, e.g. "ia32.release.check" | 142 # - any of the above with .check appended, e.g. "ia32.release.check" |
142 # - "android": cross-compile for Android/ARM | 143 # - "android": cross-compile for Android/ARM |
| 144 # - "nacl" : cross-compile for Native Client (ia32 and x64) |
143 # - default (no target specified): build all DEFAULT_ARCHES and MODES | 145 # - default (no target specified): build all DEFAULT_ARCHES and MODES |
144 # - "check": build all targets and run all tests | 146 # - "check": build all targets and run all tests |
145 # - "<arch>.clean" for any <arch> in ARCHES | 147 # - "<arch>.clean" for any <arch> in ARCHES |
146 # - "clean": clean all ARCHES | 148 # - "clean": clean all ARCHES |
147 | 149 |
148 # ----------------- internal stuff ------------------------ | 150 # ----------------- internal stuff ------------------------ |
149 | 151 |
150 # Architectures and modes to be compiled. Consider these to be internal | 152 # Architectures and modes to be compiled. Consider these to be internal |
151 # variables, don't override them (use the targets instead). | 153 # variables, don't override them (use the targets instead). |
152 ARCHES = ia32 x64 arm mipsel | 154 ARCHES = ia32 x64 arm mipsel |
153 DEFAULT_ARCHES = ia32 x64 arm | 155 DEFAULT_ARCHES = ia32 x64 arm |
154 MODES = release debug | 156 MODES = release debug |
155 ANDROID_ARCHES = android_ia32 android_arm android_mipsel | 157 ANDROID_ARCHES = android_ia32 android_arm android_mipsel |
| 158 NACL_ARCHES = nacl_ia32 nacl_x64 |
156 | 159 |
157 # List of files that trigger Makefile regeneration: | 160 # List of files that trigger Makefile regeneration: |
158 GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \ | 161 GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \ |
159 preparser/preparser.gyp samples/samples.gyp src/d8.gyp \ | 162 preparser/preparser.gyp samples/samples.gyp src/d8.gyp \ |
160 test/cctest/cctest.gyp tools/gyp/v8.gyp | 163 test/cctest/cctest.gyp tools/gyp/v8.gyp |
161 | 164 |
162 # If vtunejit=on, the v8vtune.gyp will be appended. | 165 # If vtunejit=on, the v8vtune.gyp will be appended. |
163 ifeq ($(vtunejit), on) | 166 ifeq ($(vtunejit), on) |
164 GYPFILES += src/third_party/vtune/v8vtune.gyp | 167 GYPFILES += src/third_party/vtune/v8vtune.gyp |
165 endif | 168 endif |
166 # Generates all combinations of ARCHES and MODES, e.g. "ia32.release". | 169 # Generates all combinations of ARCHES and MODES, e.g. "ia32.release". |
167 BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) | 170 BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) |
168 ANDROID_BUILDS = $(foreach mode,$(MODES), \ | 171 ANDROID_BUILDS = $(foreach mode,$(MODES), \ |
169 $(addsuffix .$(mode),$(ANDROID_ARCHES))) | 172 $(addsuffix .$(mode),$(ANDROID_ARCHES))) |
| 173 NACL_BUILDS = $(foreach mode,$(MODES), \ |
| 174 $(addsuffix .$(mode),$(NACL_ARCHES))) |
170 # Generates corresponding test targets, e.g. "ia32.release.check". | 175 # Generates corresponding test targets, e.g. "ia32.release.check". |
171 CHECKS = $(addsuffix .check,$(BUILDS)) | 176 CHECKS = $(addsuffix .check,$(BUILDS)) |
172 ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS)) | 177 ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS)) |
| 178 NACL_CHECKS = $(addsuffix .check,$(NACL_BUILDS)) |
173 # File where previously used GYPFLAGS are stored. | 179 # File where previously used GYPFLAGS are stored. |
174 ENVFILE = $(OUTDIR)/environment | 180 ENVFILE = $(OUTDIR)/environment |
175 | 181 |
176 .PHONY: all check clean dependencies $(ENVFILE).new native \ | 182 .PHONY: all check clean dependencies $(ENVFILE).new native \ |
177 $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ | 183 $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ |
178 $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \ | 184 $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \ |
179 $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \ | 185 $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \ |
180 must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN | 186 must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN \ |
| 187 $(NACL_ARCHES) $(NACL_BUILDS) $(NACL_CHECKS) \ |
| 188 must-set-NACL_SDK_ROOT |
181 | 189 |
182 # Target definitions. "all" is the default. | 190 # Target definitions. "all" is the default. |
183 all: $(MODES) | 191 all: $(MODES) |
184 | 192 |
185 # Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile | 193 # Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile |
186 # having been created before. | 194 # having been created before. |
187 buildbot: | 195 buildbot: |
188 $(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \ | 196 $(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \ |
189 builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)" | 197 builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)" |
190 | 198 |
(...skipping 23 matching lines...) Expand all Loading... |
214 $(ANDROID_ARCHES): $(addprefix $$@.,$(MODES)) | 222 $(ANDROID_ARCHES): $(addprefix $$@.,$(MODES)) |
215 | 223 |
216 $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \ | 224 $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \ |
217 must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN Makefile.android | 225 must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN Makefile.android |
218 @$(MAKE) -f Makefile.android $@ \ | 226 @$(MAKE) -f Makefile.android $@ \ |
219 ARCH="$(basename $@)" \ | 227 ARCH="$(basename $@)" \ |
220 MODE="$(subst .,,$(suffix $@))" \ | 228 MODE="$(subst .,,$(suffix $@))" \ |
221 OUTDIR="$(OUTDIR)" \ | 229 OUTDIR="$(OUTDIR)" \ |
222 GYPFLAGS="$(GYPFLAGS)" | 230 GYPFLAGS="$(GYPFLAGS)" |
223 | 231 |
| 232 $(NACL_ARCHES): $(addprefix $$@.,$(MODES)) |
| 233 |
| 234 $(NACL_BUILDS): $(GYPFILES) $(ENVFILE) \ |
| 235 Makefile.nacl must-set-NACL_SDK_ROOT |
| 236 @$(MAKE) -f Makefile.nacl $@ \ |
| 237 ARCH="$(basename $@)" \ |
| 238 MODE="$(subst .,,$(suffix $@))" \ |
| 239 OUTDIR="$(OUTDIR)" \ |
| 240 GYPFLAGS="$(GYPFLAGS)" |
| 241 |
224 # Test targets. | 242 # Test targets. |
225 check: all | 243 check: all |
226 @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 244 @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
227 --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ | 245 --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ |
228 $(TESTFLAGS) | 246 $(TESTFLAGS) |
229 | 247 |
230 $(addsuffix .check,$(MODES)): $$(basename $$@) | 248 $(addsuffix .check,$(MODES)): $$(basename $$@) |
231 @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 249 @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
232 --mode=$(basename $@) $(TESTFLAGS) | 250 --mode=$(basename $@) $(TESTFLAGS) |
233 | 251 |
(...skipping 11 matching lines...) Expand all Loading... |
245 | 263 |
246 $(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync | 264 $(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync |
247 @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 265 @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
248 --arch-and-mode=$(basename $@) \ | 266 --arch-and-mode=$(basename $@) \ |
249 --timeout=600 \ | 267 --timeout=600 \ |
250 --command-prefix="tools/android-run.py" | 268 --command-prefix="tools/android-run.py" |
251 | 269 |
252 $(addsuffix .check, $(ANDROID_ARCHES)): \ | 270 $(addsuffix .check, $(ANDROID_ARCHES)): \ |
253 $(addprefix $$(basename $$@).,$(MODES)).check | 271 $(addprefix $$(basename $$@).,$(MODES)).check |
254 | 272 |
| 273 $(addsuffix .check, $(NACL_BUILDS)): $$(basename $$@) |
| 274 @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
| 275 --arch-and-mode=$(basename $@) \ |
| 276 --timeout=600 --nopresubmit \ |
| 277 --command-prefix="tools/nacl-run.py" |
| 278 |
| 279 $(addsuffix .check, $(NACL_ARCHES)): \ |
| 280 $(addprefix $$(basename $$@).,$(MODES)).check |
| 281 |
255 native.check: native | 282 native.check: native |
256 @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ | 283 @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ |
257 --arch-and-mode=. $(TESTFLAGS) | 284 --arch-and-mode=. $(TESTFLAGS) |
258 | 285 |
259 # Clean targets. You can clean each architecture individually, or everything. | 286 # Clean targets. You can clean each architecture individually, or everything. |
260 $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)): | 287 $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)): |
261 rm -f $(OUTDIR)/Makefile.$(basename $@) | 288 rm -f $(OUTDIR)/Makefile.$(basename $@) |
262 rm -rf $(OUTDIR)/$(basename $@).release | 289 rm -rf $(OUTDIR)/$(basename $@).release |
263 rm -rf $(OUTDIR)/$(basename $@).debug | 290 rm -rf $(OUTDIR)/$(basename $@).debug |
264 find $(OUTDIR) -regex '.*\(host\|target\).$(basename $@)\.mk' -delete | 291 find $(OUTDIR) -regex '.*\(host\|target\).$(basename $@)\.mk' -delete |
265 | 292 |
266 native.clean: | 293 native.clean: |
267 rm -f $(OUTDIR)/Makefile.native | 294 rm -f $(OUTDIR)/Makefile.native |
268 rm -rf $(OUTDIR)/native | 295 rm -rf $(OUTDIR)/native |
269 find $(OUTDIR) -regex '.*\(host\|target\).native\.mk' -delete | 296 find $(OUTDIR) -regex '.*\(host\|target\).native\.mk' -delete |
270 | 297 |
271 clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)) native.clean | 298 clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)) native.cl
ean |
272 | 299 |
273 # GYP file generation targets. | 300 # GYP file generation targets. |
274 OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ARCHES)) | 301 OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ARCHES)) |
275 $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE) | 302 $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE) |
276 GYP_GENERATORS=make \ | 303 GYP_GENERATORS=make \ |
277 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 304 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
278 -Ibuild/standalone.gypi --depth=. \ | 305 -Ibuild/standalone.gypi --depth=. \ |
279 -Dv8_target_arch=$(subst .,,$(suffix $@)) \ | 306 -Dv8_target_arch=$(subst .,,$(suffix $@)) \ |
280 -S.$(subst .,,$(suffix $@)) $(GYPFLAGS) | 307 -S.$(subst .,,$(suffix $@)) $(GYPFLAGS) |
281 | 308 |
282 $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) | 309 $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) |
283 GYP_GENERATORS=make \ | 310 GYP_GENERATORS=make \ |
284 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 311 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
285 -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS) | 312 -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS) |
286 | 313 |
287 must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN: | 314 must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN: |
288 ifndef ANDROID_NDK_ROOT | 315 ifndef ANDROID_NDK_ROOT |
289 ifndef ANDROID_TOOLCHAIN | 316 ifndef ANDROID_TOOLCHAIN |
290 $(error ANDROID_NDK_ROOT or ANDROID_TOOLCHAIN must be set)) | 317 $(error ANDROID_NDK_ROOT or ANDROID_TOOLCHAIN must be set)) |
291 endif | 318 endif |
292 endif | 319 endif |
293 | 320 |
| 321 # Note that NACL_SDK_ROOT must be set to point to an appropriate |
| 322 # Native Client SDK before using this makefile. You can download |
| 323 # an SDK here: |
| 324 # https://developers.google.com/native-client/sdk/download |
| 325 # The path indicated by NACL_SDK_ROOT will typically end with |
| 326 # a folder for a pepper version such as "pepper_25" that should |
| 327 # have "tools" and "toolchain" subdirectories. |
| 328 must-set-NACL_SDK_ROOT: |
| 329 ifndef NACL_SDK_ROOT |
| 330 $(error NACL_SDK_ROOT must be set) |
| 331 endif |
| 332 |
294 # Replaces the old with the new environment file if they're different, which | 333 # Replaces the old with the new environment file if they're different, which |
295 # will trigger GYP to regenerate Makefiles. | 334 # will trigger GYP to regenerate Makefiles. |
296 $(ENVFILE): $(ENVFILE).new | 335 $(ENVFILE): $(ENVFILE).new |
297 @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \ | 336 @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \ |
298 then rm $(ENVFILE).new; \ | 337 then rm $(ENVFILE).new; \ |
299 else mv $(ENVFILE).new $(ENVFILE); fi | 338 else mv $(ENVFILE).new $(ENVFILE); fi |
300 | 339 |
301 # Stores current GYPFLAGS in a file. | 340 # Stores current GYPFLAGS in a file. |
302 $(ENVFILE).new: | 341 $(ENVFILE).new: |
303 @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ | 342 @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ |
304 echo "CXX=$(CXX)" >> $(ENVFILE).new | 343 echo "CXX=$(CXX)" >> $(ENVFILE).new |
305 | 344 |
306 # Dependencies. | 345 # Dependencies. |
307 # Remember to keep these in sync with the DEPS file. | 346 # Remember to keep these in sync with the DEPS file. |
308 dependencies: | 347 dependencies: |
309 svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ | 348 svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ |
310 --revision 1501 | 349 --revision 1501 |
OLD | NEW |