-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
49 lines (35 loc) · 803 Bytes
/
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
NODE = node
NPM = npm
PEGJS = node_modules/.bin/pegjs
BROWSERIFY = node_modules/.bin/browserify
UGLIFY = node_modules/.bin/uglifyjs
LINTER = node_modules/.bin/eslint
MOCHA = node_modules/.bin/mocha
all: build browser
install:
$(NPM) install
build:
@make peg lint test-silent
browser:
@make pack minify
peg: src/uson.pegjs
$(PEGJS) -O speed -o dist/parser.js $<
pack: dist/uson.pack.js
$(BROWSERIFY) --standalone USON -o $< index.js
minify: dist/uson.pack.js
$(UGLIFY) -m -o dist/uson.min.js $<
bench: benchmark/benchmark.js
$(NODE) $<
lint:
$(LINTER) index.js bin/cli.js
test: test/*
$(MOCHA)
test-silent:
$(MOCHA) -R dot
help:
@echo ""
@echo " Available commands:"
@echo " all install build browser peg pack minify"
@echo " bench lint test-silent"
@echo ""
.PHONY: all