Re: Order of static pattern rules is significant while IMHO it should not be
Paul Smith <[email protected]>
| Newsgroups | gmane.comp.gnu.make.bugs |
|---|---|
| Organization | GNU's Not UNIX! |
| Message-ID | <[email protected]> |
On Thu, 2025-06-05 at 21:43 +0200, Denis Excoffier wrote: > jupiter% touch foo100.z0 bar200.z0; rm -f foo100.z1 bar200.z1 > jupiter% make > foo100 (foo100 is expected and foo100 is obtained) > 200 (bar200 is expected but 200 is obtained instead) > jupiter% make --version | head -1 > GNU Make 4.4.1 > jupiter% > > The output of 'make -p' seems to infer that > '$*' is filled with the last pattern rule encountered, > even if this is not the one with the recipe. > > Is it intended behavior? I think you are correct that this is a bug. Certainly, it doesn't accord with my understanding of how GNU Make should work nor the documentation as I read it. I think static pattern rules without recipes are rare (at least I've never seen or used one) and so the details of handling them might have been overlooked.