-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
92 lines (70 loc) · 1.79 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Makefile
#
# usage: 'make [package]'
#
# This makefile can by used to perform common actions such as building
# all ports, building a give port, running a webserver to test the ports.
# Each port has a dependency on its own sentinel file, which can be found
# at out/sentinels/*
PYLINT = build_tools/python_wrapper -m pylint
NODE ?= nodejs
JSHINT := $(NODE) node_modules/.bin/jshint
JSLINT := $(NODE) node_modules/.bin/jslint
COVERAGE := bin/coverage
COVERAGE_ARGS := --fail-under=60
COVERAGE_VER := $(shell $(COVERAGE) --version 2>/dev/null)
ifeq ($(V),1)
VERBOSE ?= 1
endif
ifeq ($(F),1)
FORCE ?= 1
endif
ifeq ($(V),2)
VERBOSE ?= 1
VERBOSE_BUILD ?= 1
endif
ifeq ($(VERBOSE),1)
BUILD_FLAGS += -v
endif
ifeq ($(VERBOSE_BUILD),1)
BUILD_FLAGS += --verbose-build
endif
ifeq ($(FORCE),1)
BUILD_FLAGS += -f
endif
ifeq ($(FROM_SOURCE),1)
BUILD_FLAGS += --from-source
endif
export NACL_ARCH
export TOOLCHAIN
all:
bin/webports --all install $(BUILD_FLAGS)
run:
./build_tools/httpd.py
clean:
bin/webports --all clean
reallyclean: clean
rm -rf $(NACL_OUT)
check: test
JS_FILES := $(shell git ls-files "*.js")
lint: pylint jshint jslint
pylint:
$(PYLINT) --rcfile=.pylintrc lib/webports lib/webports/tests/*.py
jshint:
$(JSHINT) $(JS_FILES)
jslint:
$(JSLINT) build_tools/naclprocess.js build_tools/naclterm.js
test:
$(COVERAGE) run --include=lib/webports/*,build_tools/* -m nose \
--rednose build_tools lib
@rm -rf out/coverage_html
$(COVERAGE) html
$(COVERAGE) report $(COVERAGE_ARGS)
%:
bin/webports install $* $(BUILD_FLAGS)
.PHONY: all run clean sdklibs sdklibs_list reallyclean check test
.PHONY: lint pylint jshint jslint