Re: [bug #31002] make picks wrong pattern rule

Boris Kolpackov <[email protected]>
Newsgroups gmane.comp.gnu.make.devel
Organization Code Synthesis Tools CC
Message-ID <[email protected]>
[CC'ed make-alpha]

Hi Edward,

Edward Welbourne <[email protected]> writes:

> The down-side of the new rule is that there's no way to bypass it: the 
> longest-stem rule is always going to select the longest-stem rule 
> applicable, there's nothing the makefile author can do to cause the 
> less-frequently-desired rule to be applied, when it happens to be what 
> they need.

Can you show an example of this? As far as I can see, given two rules,
the first more general and the second more specific, you can get the
old behavior (in a backwards-compatible way) by inserting a third
rule between them that is constructed like this: Take the left hand
side part from the second rule. Take the right hand side part from
the first rule. Add the stem difference between the first and the
second rule to the right hand side of the newly created rule.

Here is an example:

%.o: %.S
  ...

foo-%.o: %.c
  ...

Here is the third rule that should be inserted between the two:

foo-%.o: foo-%.S
  ...

Boris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.