Makefile: split the target from the PHONY rule

A PHONY rule is executed always.  The target of the `readme' rule is to
create the `www/data/readme.json', which depends only on `README.md'.
If we specify these dependencies separately, make(1) won't build the
`readme.json', if it's not necessary.  And yet, we can refer to this
creation by typing `make readme'.
This commit is contained in:
Christos Kontas 2018-02-01 10:10:24 +01:00
parent f8a7c65bf3
commit 858872bab8
1 changed files with 3 additions and 2 deletions

View File

@ -28,8 +28,9 @@ release: bin bindata.go
docs: readme
cd www && hugo -d ../docs
readme: www/data
cat README.md | python -c 'import json,sys; print(json.dumps({"content": sys.stdin.read()}))' > www/data/readme.json
readme: www/data/readme.json
www/data/readme.json: www/data README.md
cat README.md | python -c 'import json,sys; print(json.dumps({"content": sys.stdin.read()}))' > www/data/readme.json
www/data bin:
mkdir -p $@