forked from moment/moment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (49 loc) · 1.33 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
LANG_ALL = $(wildcard lang/*.js)
MIN_LANG_ALL = $(addprefix min/,$(LANG_ALL))
.PHONY: all
all: moment langs
min/:
mkdir min/
min/lang/:
mkdir -p min/lang/
.PHONY: moment pretty
moment: min/ min/moment.min.js pretty
pretty: min/ min/moment.min.pretty.js
min/moment.min.js: moment.js
node_modules/.bin/uglifyjs -o $@ $<
min/moment.min.pretty.js: moment.js
node_modules/.bin/uglifyjs -b -o $@ $<
min/lang/%: lang/%
node_modules/.bin/uglifyjs -o $@ $<
min/lang-all.min.js: $(LANG_ALL)
cat $^ | node_modules/.bin/uglifyjs -o $@
.PHONY: langs
langs: min/lang/ $(MIN_LANG_ALL) min/lang-all.min.js
.PHONY: size
size: moment langs
# FILESIZE FOR ALL LANGS
cp min/lang-all.min.js min/lang-all.min.gzip.js
gzip min/lang-all.min.gzip.js
gzip -l min/lang-all.min.gzip.js.gz
rm min/lang-all.min.gzip.js.gz
# FILESIZE FOR LIBRARY
cp min/moment.min.js min/moment.min.gzip.js
gzip min/moment.min.gzip.js
gzip -l min/moment.min.gzip.js.gz
rm min/moment.min.gzip.js.gz
.PHONY: size-history
size-history: moment
node test/filesize-history.js
size-diff: moment
node test/filesize-diff.js
.PHONY: test hint test-moment test-lang
test: hint test-moment test-lang
hint:
node_modules/.bin/jshint moment.js
test-moment:
node_modules/.bin/nodeunit ./test/moment
test-lang:
node_modules/.bin/nodeunit ./test/lang
.PHONY: clean
clean:
rm -rf min/