OLD | NEW |
1 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 1 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 # | 4 # |
5 # Makefile | 5 # Makefile |
6 # | 6 # |
7 # usage: 'make [package]' | 7 # usage: 'make [package]' |
8 # | 8 # |
9 # This makefile can by used to perform common actions such as building | 9 # This makefile can by used to perform common actions such as building |
10 # all ports, building a give port, running a webserver to test the ports. | 10 # all ports, building a give port, running a webserver to test the ports. |
11 # Each port has a dependency on its own sentinel file, which can be found | 11 # Each port has a dependency on its own sentinel file, which can be found |
12 # at out/sentinels/* | 12 # at out/sentinels/* |
13 | 13 |
14 PYLINT = build_tools/python_wrapper -m pylint | 14 PYLINT = build_tools/python_wrapper -m pylint |
15 JSHINT = nodejs node_modules/.bin/jshint | 15 NODE ?= nodejs |
16 COVERAGE = bin/coverage | 16 JSHINT := $(NODE) node_modules/.bin/jshint |
17 COVERAGE_ARGS = --fail-under=60 | 17 JSLINT := $(NODE) node_modules/.bin/jslint |
| 18 COVERAGE := bin/coverage |
| 19 COVERAGE_ARGS := --fail-under=60 |
18 COVERAGE_VER := $(shell $(COVERAGE) --version 2>/dev/null) | 20 COVERAGE_VER := $(shell $(COVERAGE) --version 2>/dev/null) |
19 | 21 |
20 ifeq ($(V),1) | 22 ifeq ($(V),1) |
21 VERBOSE ?= 1 | 23 VERBOSE ?= 1 |
22 endif | 24 endif |
23 | 25 |
24 ifeq ($(F),1) | 26 ifeq ($(F),1) |
25 FORCE ?= 1 | 27 FORCE ?= 1 |
26 endif | 28 endif |
27 | 29 |
(...skipping 30 matching lines...) Expand all Loading... |
58 clean: | 60 clean: |
59 bin/naclports --all clean | 61 bin/naclports --all clean |
60 | 62 |
61 reallyclean: clean | 63 reallyclean: clean |
62 rm -rf $(NACL_OUT) | 64 rm -rf $(NACL_OUT) |
63 | 65 |
64 check: test | 66 check: test |
65 | 67 |
66 JS_FILES := $(shell git ls-files "*.js") | 68 JS_FILES := $(shell git ls-files "*.js") |
67 | 69 |
68 lint: pylint jshint | 70 lint: pylint jshint jslint |
69 | 71 |
70 pylint: | 72 pylint: |
71 $(PYLINT) --rcfile=.pylintrc lib/naclports lib/naclports/tests/*.py | 73 $(PYLINT) --rcfile=.pylintrc lib/naclports lib/naclports/tests/*.py |
72 | 74 |
73 jshint: | 75 jshint: |
74 $(JSHINT) $(JS_FILES) | 76 $(JSHINT) $(JS_FILES) |
75 | 77 |
| 78 jslint: |
| 79 $(JSLINT) build_tools/naclprocess.js build_tools/naclterm.js |
| 80 |
76 test: | 81 test: |
77 $(COVERAGE) run --include=lib/naclports/*,build_tools/* -m nose \ | 82 $(COVERAGE) run --include=lib/naclports/*,build_tools/* -m nose \ |
78 --rednose build_tools lib | 83 --rednose build_tools lib |
79 @rm -rf out/coverage_html | 84 @rm -rf out/coverage_html |
80 $(COVERAGE) html | 85 $(COVERAGE) html |
81 $(COVERAGE) report $(COVERAGE_ARGS) | 86 $(COVERAGE) report $(COVERAGE_ARGS) |
82 | 87 |
83 %: | 88 %: |
84 bin/naclports install $* $(BUILD_FLAGS) | 89 bin/naclports install $* $(BUILD_FLAGS) |
85 | 90 |
86 .PHONY: all run clean sdklibs sdklibs_list reallyclean check test | 91 .PHONY: all run clean sdklibs sdklibs_list reallyclean check test |
87 .PHONY: lint pylint jshint | 92 .PHONY: lint pylint jshint jslint |
OLD | NEW |