go-zero/tools/goctl/Makefile

15 lines
650 B
Makefile
Raw Normal View History

2020-07-29 17:11:41 +08:00
version := $(shell /bin/date "+%Y-%m-%d %H:%M")
build:
2020-09-11 18:17:01 +08:00
go build -ldflags="-s -w" -ldflags="-X 'main.BuildTime=$(version)'" goctl.go
command -v upx &> /dev/null && upx goctl
2020-08-30 18:22:46 +08:00
mac:
2020-09-11 18:17:01 +08:00
GOOS=darwin go build -ldflags="-s -w" -ldflags="-X 'main.BuildTime=$(version)'" -o goctl-darwin goctl.go
command -v upx &> /dev/null && upx goctl-darwin
2020-08-30 18:22:46 +08:00
win:
2020-09-11 18:17:01 +08:00
GOOS=windows go build -ldflags="-s -w" -ldflags="-X 'main.BuildTime=$(version)'" -o goctl.exe goctl.go
command -v upx &> /dev/null && upx goctl.exe
2020-08-30 18:22:46 +08:00
linux:
2020-09-11 18:17:01 +08:00
GOOS=linux go build -ldflags="-s -w" -ldflags="-X 'main.BuildTime=$(version)'" -o goctl-linux goctl.go
command -v upx &> /dev/null && upx goctl-linux