GNU Make supports a number of special built-in target names
<https://www.gnu.org/software/make/manual/make.html#Special-Targets>.
I think it'd be helpful if some special target names could be listed as
*prerequisites* (foo: .PHONY) and doing so would have the same effect
as listing them as targets with those as the prerequisites (.PHONY. foo).
The current approach can lead to wordiness & it's easy to accidentally swap
them.
Also, having *separate* lines to set these attributes makes it easy
to not see that these are set.
Here's what you must currently do:
~~~~
foo:
echo > foo
.PHONY: foo
~~~~
I propose also allowing:
~~~~
foo: .PHONY
echo > foo
~~~~
Examples where this might be useful:
.PHONY, .PRECIOUS, .INTERMEDIATE, .NOTINTERMEDIATE,
.SECONDARY, .IGNORE, .SILENT, .NOTPARALLEL,
.ONESHELL
Thoughts?
--- David A. Wheeler