Add presubmit=no and werror=no flags to Makefile

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9539 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 918922b3
...@@ -32,6 +32,7 @@ LINK ?= "g++" ...@@ -32,6 +32,7 @@ LINK ?= "g++"
OUTDIR ?= out OUTDIR ?= out
TESTJOBS ?= -j16 TESTJOBS ?= -j16
GYPFLAGS ?= GYPFLAGS ?=
TESTFLAGS ?=
# Special build flags. Use them like this: "make library=shared" # Special build flags. Use them like this: "make library=shared"
...@@ -76,6 +77,14 @@ endif ...@@ -76,6 +77,14 @@ endif
ifdef soname_version ifdef soname_version
GYPFLAGS += -Dsoname_version=$(soname_version) GYPFLAGS += -Dsoname_version=$(soname_version)
endif endif
# werror=no
ifeq ($(werror), no)
GYPFLAGS += -Dwerror=''
endif
# presubmit=no
ifeq ($(presubmit), no)
TESTFLAGS += --no-presubmit
endif
# ----------------- available targets: -------------------- # ----------------- available targets: --------------------
# - "dependencies": pulls in external dependencies (currently: GYP) # - "dependencies": pulls in external dependencies (currently: GYP)
...@@ -136,23 +145,24 @@ native: $(OUTDIR)/Makefile-native ...@@ -136,23 +145,24 @@ native: $(OUTDIR)/Makefile-native
# Test targets. # Test targets.
check: all check: all
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \
$(TESTFLAGS)
$(addsuffix .check,$(MODES)): $$(basename $$@) $(addsuffix .check,$(MODES)): $$(basename $$@)
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \
--mode=$(basename $@) --mode=$(basename $@) $(TESTFLAGS)
$(addsuffix .check,$(ARCHES)): $$(basename $$@) $(addsuffix .check,$(ARCHES)): $$(basename $$@)
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch=$(basename $@) --arch=$(basename $@) $(TESTFLAGS)
$(CHECKS): $$(basename $$@) $(CHECKS): $$(basename $$@)
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(basename $@) --arch-and-mode=$(basename $@) $(TESTFLAGS)
native.check: native native.check: native
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR)/native \
--arch-and-mode=. --arch-and-mode=. $(TESTFLAGS)
# Clean targets. You can clean each architecture individually, or everything. # Clean targets. You can clean each architecture individually, or everything.
$(addsuffix .clean,$(ARCHES)): $(addsuffix .clean,$(ARCHES)):
......
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
'v8_use_snapshot%': 'true', 'v8_use_snapshot%': 'true',
'host_os%': '<(OS)', 'host_os%': '<(OS)',
'v8_use_liveobjectlist%': 'false', 'v8_use_liveobjectlist%': 'false',
'werror%': '-Werror',
# For a shared library build, results in "libv8-<(soname_version).so". # For a shared library build, results in "libv8-<(soname_version).so".
'soname_version%': '', 'soname_version%': '',
...@@ -226,7 +227,7 @@ ...@@ -226,7 +227,7 @@
'cflags': [ '-I/usr/local/include' ], 'cflags': [ '-I/usr/local/include' ],
}], }],
['OS=="linux" or OS=="freebsd" or OS=="openbsd"', { ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
'cflags': [ '-Wall', '-Werror', '-W', '-Wno-unused-parameter', 'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
'-Wnon-virtual-dtor' ], '-Wnon-virtual-dtor' ],
}], }],
], ],
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
'host_arch%': '<(host_arch)', 'host_arch%': '<(host_arch)',
'target_arch%': '<(target_arch)', 'target_arch%': '<(target_arch)',
'v8_target_arch%': '<(v8_target_arch)', 'v8_target_arch%': '<(v8_target_arch)',
'werror%': '-Werror',
'conditions': [ 'conditions': [
['(v8_target_arch=="arm" and host_arch!="arm") or \ ['(v8_target_arch=="arm" and host_arch!="arm") or \
(v8_target_arch=="x64" and host_arch!="x64")', { (v8_target_arch=="x64" and host_arch!="x64")', {
...@@ -78,7 +79,7 @@ ...@@ -78,7 +79,7 @@
'conditions': [ 'conditions': [
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
'target_defaults': { 'target_defaults': {
'cflags': [ '-Wall', '-Werror', '-W', '-Wno-unused-parameter', 'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
'-Wnon-virtual-dtor', '-pthread', '-fno-rtti', '-Wnon-virtual-dtor', '-pthread', '-fno-rtti',
'-fno-exceptions', '-pedantic' ], '-fno-exceptions', '-pedantic' ],
'ldflags': [ '-pthread', ], 'ldflags': [ '-pthread', ],
......
...@@ -211,7 +211,12 @@ class CppLintProcessor(SourceFileProcessor): ...@@ -211,7 +211,12 @@ class CppLintProcessor(SourceFileProcessor):
if exists(local_cpplint): if exists(local_cpplint):
command = ['python', local_cpplint, '--filter', filt] + join(files) command = ['python', local_cpplint, '--filter', filt] + join(files)
try:
process = subprocess.Popen(command, stderr=subprocess.PIPE) process = subprocess.Popen(command, stderr=subprocess.PIPE)
except:
print('Error running cpplint.py. Please make sure you have depot_tools' +
' in your $PATH. Lint check skipped.')
return True
LINT_ERROR_PATTERN = re.compile(r'^(.+)[:(]\d+[:)]') LINT_ERROR_PATTERN = re.compile(r'^(.+)[:(]\d+[:)]')
while True: while True:
out_line = process.stderr.readline() out_line = process.stderr.readline()
......
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