浏览代码

Improve Makefile robustness (#224)

voidint 4 年之前
父节点
当前提交
3ebb1e0221
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      tools/goctl/Makefile

+ 4 - 4
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)