simplify code, format makefile (#233)

This commit is contained in:
Kevin Wan
2020-11-28 22:27:58 +08:00
committed by GitHub
parent bed494d904
commit e5c560e8ba
2 changed files with 8 additions and 7 deletions

View File

@@ -2,13 +2,13 @@ version := $(shell /bin/date "+%Y-%m-%d %H:%M")
build:
go build -ldflags="-s -w" -ldflags="-X 'main.BuildTime=$(version)'" goctl.go
$(if $(shell command -v upx),upx goctl)
$(if $(shell command -v upx), upx goctl)
mac:
GOOS=darwin go build -ldflags="-s -w" -ldflags="-X 'main.BuildTime=$(version)'" -o goctl-darwin goctl.go
$(if $(shell command -v upx),upx goctl-darwin)
$(if $(shell command -v upx), upx goctl-darwin)
win:
GOOS=windows go build -ldflags="-s -w" -ldflags="-X 'main.BuildTime=$(version)'" -o goctl.exe goctl.go
$(if $(shell command -v upx),upx goctl.exe)
$(if $(shell command -v upx), upx goctl.exe)
linux:
GOOS=linux go build -ldflags="-s -w" -ldflags="-X 'main.BuildTime=$(version)'" -o goctl-linux goctl.go
$(if $(shell command -v upx),upx goctl-linux)
$(if $(shell command -v upx), upx goctl-linux)