-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (30 loc) · 896 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
default: bcl test
generated = tokentype_string.go opcode_string.go typecode_string.go testapi_test.go
src: stringer $(generated) go.mod go.sum *.go cmd/bcl/*.go
bcl: src
go build ./cmd/bcl
tokentype_string.go: token.go
go generate token.go
opcode_string.go: opcode.go
go generate opcode.go
typecode_string.go: typecode.go
go generate typecode.go
testapi_test.go: test.py api_test.go
go generate api_test.go && go fmt testapi_test.go
clean:
rm -f bcl
sel=.
cnt=6
test: src
go test -cover -run=$(sel) .
race: src
go test -race .
bench: src
go test -bench=$(sel) -count=$(cnt) -benchmem .
cov: src
go test -coverprofile=cov -run=$(sel) .
go tool cover -html=cov -o cov.html
stringer: $(shell go env GOPATH)/bin/stringer
$(shell go env GOPATH)/bin/stringer:
go install golang.org/x/tools/cmd/stringer@latest
.PHONY: default generated src clean test race bench cov stringer