forked from CoolSpring8/rwppa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (28 loc) · 928 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
# Binary name
BINARY=rwppa
VERSION=1.0
# Builds
build:
GO111MODULE=on go build -o ${BINARY} -ldflags "-X main.Version=${VERSION}"
GO111MODULE=on go test -v
# Installs to $GOPATH/bin
install:
GO111MODULE=on go install
release_mac:
go clean
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 GO111MODULE=on go build -ldflags "-s -w -X main.Version=${VERSION}"
mv ./${BINARY} ${BINARY}-mac64
release_linux:
go clean
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -ldflags "-s -w -X main.Version=${VERSION}"
mv ./${BINARY} ${BINARY}-linux64
release_windows:
go clean
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 GO111MODULE=on go build -ldflags "-s -w -X main.Version=${VERSION}"
mv ./${BINARY}.exe ${BINARY}-win64.exe
# Release for different platforms
release: release_mac release_linux release_windows
clean:
go clean
rm ${BINARY}*
.PHONY: clean build release_mac release_linux release_windows