From 746ead574787b93698b0aab8c537c867c43fa47b Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 13 Dec 2019 16:23:41 -0800 Subject: [PATCH] Improve the Makefile Signed-off-by: Chris Cummer --- Makefile | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 5f7e1843..32cb3f5e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: build clean contrib_check coverage help install isntall binary_msg lint run size test uninstall +.PHONY: build clean contrib_check coverage help install isntall lint run size test uninstall # detect GOPATH if not set ifndef $(GOPATH) @@ -26,15 +26,12 @@ THIS_FILE := $(lastword $(MAKEFILE_LIST)) APP=wtfutil -binary_msg: - @echo "Install path: " - # -------------------- Actions -------------------- # ## build: builds a local version build: go build -o bin/${APP} - @$(MAKE) -f $(THIS_FILE) binary_msg + @echo "Done" ## clean: removes old build cruft clean: @@ -65,8 +62,8 @@ install: @go clean @go install -ldflags="-s -w -X main.version=$(shell git describe --always --abbrev=6) -X main.date=$(shell date +%FT%T%z)" @mv ~/go/bin/wtf ~/go/bin/${APP} - @$(MAKE) -f $(THIS_FILE) binary_msg - @which ${APP} || echo "Could not find ${APP} in PATH" && exit 0 + $(eval INSTALLPATH = $(shell which ${APP})) + @echo "${APP} installed into ${INSTALLPATH}" ## lint: runs a number of code quality checks against the source code lint: