Add "native" target to Makefile for the benefit of Linux distros

TEST=make native; make native.check; make native.clean

Review URL: http://codereview.chromium.org/7891045

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9292 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5a33daf6
......@@ -78,6 +78,7 @@ endif
# - any arch listed in ARCHES (see below)
# - any mode listed in MODES
# - every combination <arch>.<mode>, e.g. "ia32.release"
# - "native": current host's architecture, release mode
# - any of the above with .check appended, e.g. "ia32.release.check"
# - default (no target specified): build all ARCHES and MODES
# - "check": build all targets and run all tests
......@@ -103,7 +104,7 @@ CHECKS = $(addsuffix .check,$(BUILDS))
# File where previously used GYPFLAGS are stored.
ENVFILE = $(OUTDIR)/environment
.PHONY: all check clean dependencies $(ENVFILE).new \
.PHONY: all check clean dependencies $(ENVFILE).new native \
$(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \
$(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES))
......@@ -124,6 +125,11 @@ $(BUILDS): $(OUTDIR)/Makefile-$$(basename $$@)
python -c "print raw_input().capitalize()") \
builddir="$(shell pwd)/$(OUTDIR)/$@"
native: $(OUTDIR)/Makefile-native
@$(MAKE) -C "$(OUTDIR)" -f Makefile-native \
CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \
builddir="$(shell pwd)/$(OUTDIR)/$@"
# Test targets.
check: all
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR)
......@@ -140,6 +146,10 @@ $(CHECKS): $$(basename $$@)
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(basename $@)
native.check: native
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR)/native \
--arch-and-mode=.
# Clean targets. You can clean each architecture individually, or everything.
$(addsuffix .clean,$(ARCHES)):
rm -f $(OUTDIR)/Makefile-$(basename $@)
......@@ -147,7 +157,12 @@ $(addsuffix .clean,$(ARCHES)):
rm -rf $(OUTDIR)/$(basename $@).debug
find $(OUTDIR) -regex '.*\(host\|target\)-$(basename $@)\.mk' -delete
clean: $(addsuffix .clean,$(ARCHES))
native.clean:
rm -f $(OUTDIR)/Makefile-native
rm -rf $(OUTDIR)/native
find $(OUTDIR) -regex '.*\(host\|target\)-native\.mk' -delete
clean: $(addsuffix .clean,$(ARCHES)) native.clean
# GYP file generation targets.
$(OUTDIR)/Makefile-ia32: $(GYPFILES) $(ENVFILE)
......@@ -165,6 +180,10 @@ $(OUTDIR)/Makefile-arm: $(GYPFILES) $(ENVFILE)
-Ibuild/standalone.gypi --depth=. -Ibuild/armu.gypi \
-S-arm $(GYPFLAGS)
$(OUTDIR)/Makefile-native: $(GYPFILES) $(ENVFILE)
build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-Ibuild/standalone.gypi --depth=. -S-native $(GYPFLAGS)
# Replaces the old with the new environment file if they're different, which
# will trigger GYP to regenerate Makefiles.
$(ENVFILE): $(ENVFILE).new
......
......@@ -35,20 +35,24 @@
'msvs_multi_core_compile%': '1',
'variables': {
'variables': {
'conditions': [
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
# This handles the Linux platforms we generally deal with. Anything
# else gets passed through, which probably won't work very well; such
# hosts should pass an explicit target_arch to gyp.
'host_arch%':
'<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/")',
}, { # OS!="linux" and OS!="freebsd" and OS!="openbsd"
'host_arch%': 'ia32',
}],
],
'variables': {
'conditions': [
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
# This handles the Linux platforms we generally deal with. Anything
# else gets passed through, which probably won't work very well; such
# hosts should pass an explicit target_arch to gyp.
'host_arch%':
'<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/")',
}, { # OS!="linux" and OS!="freebsd" and OS!="openbsd"
'host_arch%': 'ia32',
}],
],
},
'host_arch%': '<(host_arch)',
'target_arch%': '<(host_arch)',
},
'host_arch%': '<(host_arch)',
'target_arch%': '<(host_arch)',
'target_arch%': '<(target_arch)',
'v8_target_arch%': '<(target_arch)',
},
'host_arch%': '<(host_arch)',
......
......@@ -131,16 +131,20 @@ def BuildOptions():
def ProcessOptions(options):
if options.arch_and_mode != None and options.arch_and_mode != "":
tokens = options.arch_and_mode.split(".")
options.arch = tokens[0]
options.mode = tokens[1]
options.mode = options.mode.split(',')
if options.arch_and_mode == ".":
options.arch = []
options.mode = []
else:
if options.arch_and_mode != None and options.arch_and_mode != "":
tokens = options.arch_and_mode.split(".")
options.arch = tokens[0]
options.mode = tokens[1]
options.mode = options.mode.split(',')
options.arch = options.arch.split(',')
for mode in options.mode:
if not mode in ['debug', 'release']:
print "Unknown mode %s" % mode
return False
options.arch = options.arch.split(',')
for arch in options.arch:
if not arch in ['ia32', 'x64', 'arm']:
print "Unknown architecture %s" % arch
......@@ -232,6 +236,18 @@ def Main():
env=env)
returncodes += child.wait()
if len(options.mode) == 0 and len(options.arch) == 0:
print ">>> running tests"
shellpath = workspace + '/' + options.outdir
env['LD_LIBRARY_PATH'] = shellpath + '/lib.target'
shell = shellpath + '/d8'
child = subprocess.Popen(' '.join(args_for_children +
['--shell=' + shell]),
shell=True,
cwd=workspace,
env=env)
returncodes = child.wait()
return returncodes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment