From 3ebb1e02215cd5117fa31e39a6362a41f062e4c2 Mon Sep 17 00:00:00 2001 From: voidint Date: Fri, 27 Nov 2020 23:40:07 +0800 Subject: [PATCH] Improve Makefile robustness (#224) --- tools/goctl/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/goctl/Makefile b/tools/goctl/Makefile index ed786728..8581c31d 100644 --- a/tools/goctl/Makefile +++ b/tools/goctl/Makefile @@ -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 - command -v upx &> /dev/null && 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 - command -v upx &> /dev/null && 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 - command -v upx &> /dev/null && 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 - command -v upx &> /dev/null && upx goctl-linux + $(if $(shell command -v upx),upx goctl-linux)