2 ms·
Also this: >The explicit list of phony targets, written separately from the recipe definitions, also introduces the risk of accidentally defining a new non-pho
by Arnavion 2y ago
Also this:
>The explicit list of phony targets, written separately from the recipe definitions, also introduces the risk of accidentally defining a new non-phony target.
... seems to think the only way to define phony targets is:
.PHONY: foo bar
foo:
...
bar:
...
... which has the problem that bar's definition is distant from its declaration as a phony target. But this form is equivalent and doesn't have that problem:
.PHONY: foo
foo:
...
.PHONY: bar
bar:
...
This ability to declare dependencies of a target over multiple definitions isn't even unique to `.PHONY`.