mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 01:30:25 +08:00
15 lines
650 B
Makefile
15 lines
650 B
Makefile
version := $(shell /bin/date "+%Y-%m-%d %H:%M")
|
|
|
|
build:
|
|
go build -ldflags="-s -w" -ldflags="-X 'main.BuildTime=$(version)'" goctl.go
|
|
command -v upx &> /dev/null && upx goctl
|
|
mac:
|
|
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
|
|
win:
|
|
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
|
|
linux:
|
|
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
|