bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #40657] Suffix rules and prerequisites


From: Martin Dorey
Subject: [bug #40657] Suffix rules and prerequisites
Date: Sun, 6 Oct 2019 19:21:03 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Follow-up Comment #2, bug #40657 (project make):

This is now in the NEWS file as:

* WARNING: Backward-incompatibility!
  Contrary to the documentation, suffix rules with prerequisites were being
  treated BOTH as simple targets AND as pattern rules.  Behavior now matches
  the documentation, and pattern rules are no longer created in this case.

The documentation being
https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html which
says:

Suffix rules cannot have any prerequisites of their own. If they have any,
they are treated as normal files with funny names, not as suffix rules.

To my surprise, I find myself maintaining a Makefile which now knows only how
to build a file implausibly called .c.o (to use the documentation's example). 
I was in the unusually lucky position of having read the NEWS file recently. 
I fear we're in for some griping here from those who spend more than the five
minutes of head scratching it took me.

I wonder about a diagnostic.  Famous last words but, by the look of the
code-change that accompanied the NEWS one, it doesn't look like it would be
too hard.  If this never bites anyone but me, then it won't have been worth
even that effort.  The chances that anyone has created a rule that looks like
a suffix rule but intentionally isn't one are, at the moment, very close to
zero, because they'd have to be using an unreleased version of Make.  If we
leave it now, though, but come to add a diagnostic when the moans get too
loud, then someone might have used it.  Then we might feel bound to add a flag
to silence the warning, which is surely more trouble than this is worth.

The OP here shows that the prerequisites were being attached to the file with
the funny name, which is clearly not what the author intended, at least in the
example I'm faced with.  Attaching the prerequisites to the generated pattern
rule, wouldn't that be the best of all worlds?  He said, idly, not
volunteering a patch.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?40657>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]