forked from cojs/urllib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (44 loc) · 1.01 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
TESTS = test/*.test.js
COV_TESTS = test/index.test.js
REPORTER = spec
TIMEOUT = 20000
MOCHA_OPTS =
BIN = node_modules/.bin/
SRC = $(wildcard lib/*.js)
BUILD = $(subst lib/,build/,$(SRC))
install:
@npm install --registry=http://registry.npm.taobao.org
build:
@mkdir -p build
@$(MAKE) $(BUILD)
build/%.js: lib/%.js
@$(BIN)regenerator --include-runtime $< > $@
jshint: install
@$(BIN)jshint lib
test: install
@NODE_ENV=test $(BIN)mocha \
--harmony \
--require co-mocha \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)
test-cov cov:
@NODE_ENV=test node --harmony \
$(BIN)istanbul cover $(BIN)_mocha \
-- -u exports \
--require co-mocha \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
$(MOCHA_OPTS) \
$(COV_TESTS)
@$(BIN)cov coverage
test-all: install jshint test
autod: install
@$(BIN)autod -w -e example.js,callback_example.js --prefix "~"
@$(MAKE) install
contributors: install
@$(BIN)contributors -f plain -o AUTHORS
clean:
@rm -rf build
.PHONY: test clean