-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (26 loc) · 685 Bytes
/
Makefile
File metadata and controls
34 lines (26 loc) · 685 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
BINARY=consul-kv-search
VERSION=1.1.0
BUILD_TIME=`date +%FT%T%z`
GOX_OSARCH="darwin/amd64 linux/386 linux/amd64 windows/386 windows/amd64"
default: build
clean:
rm -rf ./bin
build:
GO111MODULE=on \
CGO_ENABLED=0 \
go build -a -o ./bin/${BINARY}-${VERSION} *.go
build-linux:
GO111MODULE=on \
CGO_ENABLED=0 \
GOARCH=amd64 \
GOOS=linux \
go build -ldflags "-X main.Version=${VERSION}" -a -o ./bin/${BINARY}-${VERSION} *.go
build-gox:
GO111MODULE=on \
gox -ldflags "-X main.Version=${VERSION}" -osarch=${GOX_OSARCH} -output="bin/${VERSION}/{{.Dir}}_{{.OS}}_{{.Arch}}"
deps:
go get;
release:
ghr -u pteich -r consul-kv-search ${VERSION} bin/${VERSION}/;
test:
go test