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.
This commit is contained in:
Christos Kontas 2018-02-01 10:06:05 +01:00
parent 295f0d024a
commit f8a7c65bf3
1 changed files with 2 additions and 3 deletions

View File

@ -22,8 +22,7 @@ test:
go test ./... go test ./...
go vet ./... go vet ./...
release: bindata.go release: bin bindata.go
@echo mkdir bin 2>/dev/null || true
go build -ldflags "-X main.Version=$(VERSION)" -o bin/pomo-$(VERSION)-linux go build -ldflags "-X main.Version=$(VERSION)" -o bin/pomo-$(VERSION)-linux
docs: readme docs: readme
@ -32,5 +31,5 @@ docs: readme
readme: www/data readme: www/data
cat README.md | python -c 'import json,sys; print(json.dumps({"content": sys.stdin.read()}))' > www/data/readme.json 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 $@ mkdir -p $@