-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
70 lines (61 loc) · 1.43 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
NODE?=node
NPM?=npm
NODE_MODULES?=./node_modules
JS_MIN?=$(NODE_MODULES)/uglify-js/bin/uglifyjs
MOCHA?=$(NODE_MODULES)/mocha/bin/mocha
MOCHA_OPTS?=-R spec
PEGJS?=$(NODE_MODULES)/pegjs/bin/pegjs
all: \
package.json \
dig.js \
dig.min.js
src/dig/dot/grammar.js:
$(PEGJS) -e dig_dot_parser src/dig/dot/grammar.pegjs $@
.INTERMEDIATE dig.js: \
src/pre.js \
src/version.js \
src/dig/polyfill.js \
src/dig/util.js \
src/dig/data.js \
src/dig/data/priority-queue.js \
src/dig/data/queue.js \
src/dig/data/stack.js \
src/dig/digraph.js \
src/dig/ugraph.js \
src/dig/alg.js \
src/dig/alg/components.js \
src/dig/alg/dijkstra.js \
src/dig/alg/floyd-warshall.js \
src/dig/alg/levels.js \
src/dig/alg/prim.js \
src/dig/alg/tarjan.js \
src/dig/alg/topsort.js \
src/dig/dot.js \
src/dig/dot/layout.js \
src/dig/dot/layout/cross-count.js \
src/dig/dot/layout/order.js \
src/dig/dot/layout/position.js \
src/dig/dot/layout/rank.js \
src/dig/dot/read.js \
src/dig/dot/write.js \
src/dig/dot/grammar.js \
src/post.js
dig.js: Makefile $(NODE_MODULES)
@rm -f $@
cat $(filter %.js,$^) > $@
@chmod a-w $@
dig.min.js: dig.js
@rm -f $@
$(JS_MIN) dig.js > dig.min.js
@chmod a-w $@
$(NODE_MODULES): package.json
$(NPM) install
package.json: src/version.js package.js
@rm -f $@
$(NODE) package.js > $@
@chmod a-w $@
.PHONY: test
test: dig.js dig.min.js
$(MOCHA) $(MOCHA_OPTS) --recursive test
clean:
rm -f dig.js dig.min.js package.json