-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake
executable file
·77 lines (72 loc) · 1.37 KB
/
make
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
#!/bin/bash -e
GOFLAGS="-tags proj"
GEN_GO="app/ops/*.go app/vols/*.go app/test/docs/*.go app/test/ops/*.go"
GEN_MD="doc/ops/*.md"
function ops {
rm -rf $GEN_GO $GEN_MD
(
set -x
go generate internal/gen-ops/gen-ops.go
go generate internal/gen-doc-tests/gen-doc-tests.go
go generate internal/gen-about/gen-about.go
)
goimports -w $GEN_GO
gofmt -w $GEN_GO
}
function wasm {
(ops)
set -x
GOOS=js GOARCH=wasm go build -o web/zc.wasm cmd/wasm/main.go
}
function install {
ops
set -x
go install $GOFLAGS ./...
}
case "$1" in
ops)
ops
;;
install)
install
;;
run)
shift
go run cmd/zc/main.go $@
;;
serve)
(wasm)
set -x
go run cmd/server/main.go
;;
test)
shift
(ops)
set -x
go test $GOFLAGS $@ ./...
;;
bench)
shift
(ops)
set -x
go test $@ -benchmem -run=^$ -bench . github.com/blackchip-org/zc/v6/bench
;;
wasm)
wasm
;;
emoji)
set -x
go generate internal/gen-emoji/gen-emoji.go
;;
entity)
set -x
go generate internal/gen-entity/gen-entity.go
;;
tz)
set -x
go generate internal/gen-tz/gen-tz.go
;;
*)
install
;;
esac