forked from commonmark/commonmark.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (31 loc) · 1.06 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
SPEC=test/spec.txt
SPECVERSION=$(shell perl -ne 'print $$1 if /^version: *([0-9.]+)/' $(SPEC))
BENCHINP?=bench/samples/README.md
VERSION?=$(SPECVERSION)
JSMODULES=$(wildcard lib/*.js)
UGLIFYJS=node_modules/.bin/uglifyjs
LICENSETEXT="/* commonmark $(VERSION) https://github.com/commonmark/commonmark.js @license BSD3 */"
.PHONY: dingus dist test bench bench-detailed npm lint clean update-spec
lint:
npm run lint
dist: dist/commonmark.js dist/commonmark.min.js
dist/commonmark.js: lib/index.js ${JSMODULES}
npm run build
(echo $(LICENSETEXT) && cat $@) > [email protected] && mv [email protected] $@
dist/commonmark.min.js: dist/commonmark.js
(echo $(LICENSETEXT) && cat $@) > [email protected] && mv [email protected] $@
update-spec:
curl 'https://raw.githubusercontent.com/jgm/CommonMark/master/spec.txt' > $(SPEC)
test: $(SPEC)
npm test
bench:
node -r esm bench/bench.js ${BENCHINP}
bench-detailed:
sudo renice -10 $$$$; \
for x in bench/samples/*.md; do echo $$x; node -r esm bench/bench.js $$x; done | \
awk -f bench/format_benchmarks.awk
npm:
cd js; npm publish
dingus:
make -C dingus dingus
clean: