-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
53 lines (42 loc) · 1.25 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
REPORTER ?= dot
TESTS ?= $(shell find test -name "*-test.js")
all: \
pseudoloc.js \
pseudoloc.min.js \
component.json \
package.json
.PHONY: clean all test test-cov
test: pseudoloc.js
@NODE_ENV=test ./node_modules/.bin/mocha --reporter $(REPORTER) $(TESTS)
test-cov: pseudoloc-cov.js
@PSEUDOLOC_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
pseudoloc-cov.js: pseudoloc.js
@rm -f $@
@jscoverage --no-highlight src src-cov \
--no-instrument=pseudoloc.js \
--no-instrument=core/index.js \
--no-instrument=start.js \
--no-instrument=end.js \
--no-instrument=component.js \
--no-instrument=package.js
node_modules/.bin/smash src-cov/pseudoloc.js > pseudoloc-cov.js
@chmod a-w $@
benchmark: all
@node benchmark/bench.js
pseudoloc.js: $(shell node_modules/.bin/smash --list src/pseudoloc.js)
@rm -f $@
node_modules/.bin/smash src/pseudoloc.js | node_modules/.bin/uglifyjs -b indent_level=2 -o $@
@chmod a-w $@
pseudoloc.min.js: pseudoloc.js
@rm -f $@
node_modules/.bin/uglifyjs $< -c -m -o $@
component.json: src/component.js pseudoloc.js
@rm -f $@
node src/component.js > $@
@chmod a-w $@
package.json: src/package.js pseudoloc.js
@rm -f $@
node src/package.js > $@
@chmod a-w $@
clean:
rm -f pseudoloc*.js package.json component.json