-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
74 lines (50 loc) · 1.73 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
# Consistent.js Makefile
# To install uglify-js:
# npm install uglify-js -g
# To install jslint:
# brew install jslint
SOURCE=src/consistent.js src/consistent-expressions.js
MINIFIED=$(SOURCE:src/%.js=lib/%.min.js)
GZIPPED=$(MINIFIED:.min.js=.min.js.gz)
PLUGINS=$(shell find src -type f -name "*.consistent.js")
PLUGINS_COMBINED=$(PLUGINS:src/%.consistent.js=lib/consistent-for-%.js)
PLUGINS_MINIFIED=$(PLUGINS:src/%.consistent.js=lib/consistent-for-%.min.js)
PLUGINS_GZIPPED=$(PLUGINS_MINIFIED:.min.js=.min.js.gz)
UGLIFY_FLAGS=-m --comments '/\/*!/'
KARMA=/usr/local/share/npm/bin/karma
all: lib
clean:
rm -f lib/*.js
rm -f lib/*.js.gz
rm -f lib/*.map
lib: libdir $(MINIFIED) $(GZIPPED) $(PLUGINS_COMBINED) $(PLUGINS_MINIFIED) $(PLUGINS_GZIPPED)
ls -l lib
libdir:
mkdir -p lib
lib/%.min.js: src/%.js
uglifyjs $(UGLIFY_FLAGS) -o $@ --source-map [email protected] -p relative -- $<
lib/consistent-for-%.js: src/%.consistent.js $(SOURCE)
cat $(SOURCE) $< > $@
lib/consistent-for-%.min.js: src/%.consistent.js $(SOURCE)
uglifyjs $(UGLIFY_FLAGS) -o $@ --source-map [email protected] -p relative -- $(SOURCE) $<
lib/%.min.js.gz: lib/%.min.js
gzip -c -n $< > $@
lint:
find src -name "*.js" -exec jshint --verbose \{\} \;
test:
$(KARMA) start test/karma/karma.conf.js --single-run
test1:
$(KARMA) start test/karma/karma.conf.js --single-run --browsers PhantomJS
citest:
$(KARMA) start test/karma/karma.conf.js
testie6:
testem -f test/testem/testem.json -l bs_ie_6
testie7:
testem -f test/testem/testem.json -l bs_ie_7
testie8:
testem -f test/testem/testem.json -l bs_ie_8
testie9:
testem -f test/testem/testem.json -l bs_ie_9
testie10:
testem -f test/testem/testem.json -l bs_ie_10
.PHONY: all test test1 citest clean testie6 testie7 testie8 testie9 testie10