1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Improve the Makefile

Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
Chris Cummer 2019-12-13 16:23:41 -08:00
parent 5a6424839d
commit 746ead5747

View File

@ -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 # detect GOPATH if not set
ifndef $(GOPATH) ifndef $(GOPATH)
@ -26,15 +26,12 @@ THIS_FILE := $(lastword $(MAKEFILE_LIST))
APP=wtfutil APP=wtfutil
binary_msg:
@echo "Install path: "
# -------------------- Actions -------------------- # # -------------------- Actions -------------------- #
## build: builds a local version ## build: builds a local version
build: build:
go build -o bin/${APP} go build -o bin/${APP}
@$(MAKE) -f $(THIS_FILE) binary_msg @echo "Done"
## clean: removes old build cruft ## clean: removes old build cruft
clean: clean:
@ -65,8 +62,8 @@ install:
@go clean @go clean
@go install -ldflags="-s -w -X main.version=$(shell git describe --always --abbrev=6) -X main.date=$(shell date +%FT%T%z)" @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} @mv ~/go/bin/wtf ~/go/bin/${APP}
@$(MAKE) -f $(THIS_FILE) binary_msg $(eval INSTALLPATH = $(shell which ${APP}))
@which ${APP} || echo "Could not find ${APP} in PATH" && exit 0 @echo "${APP} installed into ${INSTALLPATH}"
## lint: runs a number of code quality checks against the source code ## lint: runs a number of code quality checks against the source code
lint: lint: