This change can easily let us expand the rule by adding more files as a
dependency. Even better, we can define a variable to hold all these
external, binary resources.
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'.
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.
There is a special rule in make(1) to denote that we don't care about
the result of a command. Additionally, we can also instruct rm(1) not
to complain when it didn't find a file/directory to remove.
As a final touch, there is no point of having 2 shell executions to
remove 2 or more files. We can compress these 2 recipes into a single
one.
Reference:
https://www.gnu.org/software/make/manual/html_node/Errors.html