forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·43 lines (30 loc) · 904 Bytes
/
Makefile
File metadata and controls
executable file
·43 lines (30 loc) · 904 Bytes
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
#!/usr/bin/env bash -c make
SRC=./int64-buffer.js
TESTS=*.json ./test/*.js
HINTS=$(SRC) $(TESTS)
DIST=./dist
JSDEST=./dist/int64-buffer.min.js
JSGZIP=./dist/int64-buffer.min.js.gz
all: test $(JSGZIP)
clean:
rm -fr $(JSDEST)
$(DIST):
mkdir -p $(DIST)
$(JSDEST): $(SRC) $(DIST)
./node_modules/.bin/uglifyjs $(SRC) -c -m -o $(JSDEST)
$(JSGZIP): $(JSDEST)
gzip -9 < $(JSDEST) > $(JSGZIP)
ls -l $(JSDEST) $(JSGZIP)
test:
@if [ "x$(BROWSER)" = "x" ]; then make test-node; else make test-browser; fi
test-node: jshint mocha
test-browser:
./node_modules/.bin/zuul -- $(TESTS)
test-browser-local:
node -e 'process.exit(process.platform === "darwin" ? 0 : 1)' && sleep 1 && open http://localhost:4000/__zuul &
./node_modules/.bin/zuul --local 4000 -- $(TESTS)
mocha:
./node_modules/.bin/mocha -R spec $(TESTS)
jshint:
./node_modules/.bin/jshint $(HINTS)
.PHONY: all clean test jshint mocha