-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
39 lines (26 loc) · 700 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
VERSION=0.1.6
BUILD=`git rev-parse --short=8 HEAD`
.PHONY: all fmt static precommit arm64 amd64 fmt static test release release_dir
LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD}"
BINARY=wg-cmd
all:
go build ${LDFLAGS}
arm64: export GOOS=linux
arm64: export GOARCH=arm64
arm64: release_dir
go build ${LDFLAGS} -o release/${BINARY}-${VERSION}-${GOOS}-${GOARCH}
amd64: export GOOS=linux
amd64: export GOARCH=amd64
amd64: release_dir
go build ${LDFLAGS} -o release/${BINARY}-${VERSION}-${GOOS}-${GOARCH}
fmt:
gofumpt -l -w .
static:
go vet ./...
staticcheck ./...
test:
go test ./...
release_dir:
mkdir -p release
release: arm64 amd64
precommit: fmt static test