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:
parent
f8a7c65bf3
commit
858872bab8
5
Makefile
5
Makefile
|
@ -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 $@
|
||||
|
|
Loading…
Reference in New Issue