In a well refined Makefile, it's recommended to mark non-generated targets as .PHONY.
Now, the process is pretty simple : suppose there is target1 that must be run any time it's invoked, irrespective of any previous build, then just :
.PHONY : target1
target1 :
<TAB> ...recipe...
Ok, what about 2 targets? simple enough:
.PHONY : target1
target1 :
<TAB> ...recipe...
.PHONY : target2
target2 :
<TAB> ...recipe...
etc.
What about 100 targets ? Well, just repeat the process.
So, yeah, it works, but it's annoying.
It adds one line in front of each target declaration.
That's fine for a few lines, but when there is a large section of the Makefile which consist solely of .PHONY targets, one has to wonder if it could be done in a more efficient way, both reducing the risk of forgetting a .PHONY statement, and improving Makefile readability.
So, for example, let's say the bottom half of the Makefile consists solely of .PHONY targets, all of the form : test-something.
Attempted : .PHONY : test-%
but it did not work.
Looking around for documentation, and there is simply no example anywhere of such kind of "mass .PHONYfication". All targets are always expressly named. I vaguely remember a statement about .PHONY being incompatible with wildcard characters, though make doesn't flag that as an error.
The question is : is it possible to mass .PHONY the bottom half of the Makefile, by taking advantage either of the stable name scheme (test-%), or the position of targets in the file ?