-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
36 lines (27 loc) · 884 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
.PHONY: demo deps test build_mac build_windows build_linux init
demo:
go run cmd/shifu/main.go run demo
deps:
go get -u -t ./...
go mod vendor
test:
go test -cover ./pkg/cfg
go test -cover -race $$(go list ./pkg/... | grep -v /cfg)
benchmark:
go test -bench=. ./pkg/...
build_mac: test
GOOS=darwin go build -a -installsuffix cgo -ldflags "-s -w" cmd/shifu/main.go
mv main shifu
build_windows: test
GOOS=windows GOARCH=amd64 go build -a -installsuffix cgo -ldflags "-s -w" -o shifu.exe cmd/shifu/main.go
mv main.exe shifu.exe
build_linux: test
GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags "-s -w" cmd/shifu/main.go
mv main shifu
build_arm64: test
GOOS=linux GOARCH=arm64 go build -a -installsuffix cgo -ldflags "-s -w" cmd/shifu/main.go
mv main shifu
init:
rm -r -f test
go run cmd/shifu/main.go init test
go run cmd/shifu/main.go run test