From f8a7c65bf30f7c59fcc32f0c9b9bd9e8d22be97a Mon Sep 17 00:00:00 2001 From: Christos Kontas Date: Thu, 1 Feb 2018 10:06:05 +0100 Subject: [PATCH] Makefile: explicitly create bin/, if necessary Most of the go(1) tools will create the missing directory. Yet, it is better to define this dependency explicitly to make(1), to avoid unnecessary surprises. Another useful feature of make(1) is the multiple targets per rule. This way, we can have the same action and it is the target the variable of the rule, anymore. --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 669fd55..05bca0e 100644 --- a/Makefile +++ b/Makefile @@ -22,8 +22,7 @@ test: go test ./... go vet ./... -release: bindata.go - @echo mkdir bin 2>/dev/null || true +release: bin bindata.go go build -ldflags "-X main.Version=$(VERSION)" -o bin/pomo-$(VERSION)-linux docs: readme @@ -32,5 +31,5 @@ docs: readme readme: www/data cat README.md | python -c 'import json,sys; print(json.dumps({"content": sys.stdin.read()}))' > www/data/readme.json -www/data: +www/data bin: mkdir -p $@