From 7f0ec14704af8b5a64a5d7aa22ca5e56899f39d8 Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 11 Sep 2020 18:17:01 +0800 Subject: [PATCH] update goctl makefile --- tools/goctl/Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/goctl/Makefile b/tools/goctl/Makefile index 8f6f9001..ed786728 100644 --- a/tools/goctl/Makefile +++ b/tools/goctl/Makefile @@ -1,10 +1,14 @@ version := $(shell /bin/date "+%Y-%m-%d %H:%M") build: - go build -ldflags="-s -w" -ldflags="-X 'main.BuildTime=$(version)'" goctl.go && upx goctl + 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 && upx goctl-darwin + 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 && upx goctl.exe + 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 && upx goctl-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