forked from google/traceur-compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
93 lines (67 loc) · 2.36 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
93
SRC = \
src/traceur.js \
src/runtime/runtime.js
GENSRC = \
src/codegeneration/ParseTreeTransformer.js \
src/outputgeneration/SourceMapIntegration.js \
src/syntax/trees/ParseTreeType.js \
src/syntax/trees/ParseTrees.js \
src/syntax/ParseTreeVisitor.js
TFLAGS = --
build: bin/traceur.js
min: bin/traceur.min.js
# Uses uglifyjs to compress. Make sure you have it installed
# npm install uglify-js -g
ugly: bin/traceur.ugly.js
test: build test/test-list.js
node test/testfeatures.js --errsfile test/errsfile.json
test-list: test/test-list.js
test/test-list.js: build/build-test-list.js
git ls-files test/feature | node $? > $@
boot: clean build
clean:
git checkout bin
touch -t 197001010000.00 bin/traceur.js
distclean: clean
rm -f build/dep.mk
rm -f $(GENSRC)
initbench:
rm -rf test/bench/esprima
git clone https://github.com/ariya/esprima.git test/bench/esprima
cd test/bench/esprima; git reset --hard 1ddd7e0524d09475
git apply test/bench/esprima-compare.patch
bin/traceur.min.js: bin/traceur.js
node build/minifier.js $? $@
bin/traceur.js force:
./traceur --out bin/traceur.js $(TFLAGS) $(SRC)
# Prerequisites following '|' are rebuilt just like ordinary prerequisites.
# However, they don't cause remakes if they're newer than the target. See:
# http://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html
build/dep.mk: | $(GENSRC) node_modules
node build/makedep.js --depTarget bin/traceur.js $(TFLAGS) $(SRC) > $@
src/syntax/trees/ParseTrees.js: \
build/build-parse-trees.js src/syntax/trees/trees.json
node $^ > $@
src/syntax/trees/ParseTreeType.js: \
build/build-parse-tree-type.js src/syntax/trees/trees.json
node $^ > $@
src/syntax/ParseTreeVisitor.js: \
build/build-parse-tree-visitor.js src/syntax/trees/trees.json
node $^ > $@
src/codegeneration/ParseTreeTransformer.js: \
build/build-parse-tree-transformer.js src/syntax/trees/trees.json
node $^ > $@
%.js: %.js-template.js
node build/expand-js-template.js $< $@
src/outputgeneration/SourceMapIntegration.js: \
node_modules/source-map/lib/source-map/*.js
NPM_INSTALL = npm install --local && touch node_modules
node_modules/%:
$(NPM_INSTALL)
node_modules: package.json
$(NPM_INSTALL)
bin/traceur.ugly.js: bin/traceur.js
uglifyjs bin/traceur.js --compress -m -o $@
.PHONY: build min test test-list force boot clean distclean
-include build/dep.mk
-include build/local.mk