-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
26 lines (18 loc) · 897 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
VERSION=$(shell git describe --abbrev=0 --tags)
BUILD=$(shell git rev-parse HEAD)
DIRBASE=./bin
DIR=${DIRBASE}/${VERSION}
LDFLAGS=-ldflags "-s -w -buildid=${BUILD}"
$(shell mkdir -p ${DIR})
windows:
env CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build ${LDFLAGS} -trimpath -o ${DIR}/tsk-windows_amd64.exe
env CGO_ENABLED=1 GOOS=windows GOARCH=386 go build ${LDFLAGS} -trimpath -o ${DIR}/tsk-windows-386.exe
linux:
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath ${LDFLAGS} -o ${DIR}/tsk-linux_amd64
env CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -trimpath ${LDFLAGS} -o ${DIR}/tsk-linux-386
darwin:
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -trimpath ${LDFLAGS} -o ${DIR}/tsk-darwin_amd64
env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -trimpath ${LDFLAGS} -o ${DIR}/tsk-darwin-arm64
clean:
rm -rf ${DIRBASE}
.PHONY: windows linux darwin android clean