On Mon, Oct 20, 2025 at 3:57 PM Dmitry <[email protected]> wrote:
> > At that point make calls pattern_search recursively to find a rule to build 
> > 'aaa'.
> So now our new target is ‘aaa’, and we must start searching implicit
> rules from the beginning.

Make is still working on figuring out whether rule '%.o: aaa' is
suitable to build foo.o.
This recursive call is needed to find if there is a rule to build
prerequisite 'aaa'.
Rule '%.o: aaa' itself cannot be used for the reasons explained in the
chained rules chapter.

> We take the pattern rule ‘%.o : aaa’ and discard it not because of
> recursion, but because its target ‘%.o’ doesn’t match ‘aaa’.

Who deceived you like that?
Make discards rule '%.o: aaa', because this rule is already in use in
this chain.

> And the message “Avoiding implicit rule recursion for rule '%.o: aaa'”
> doesn’t appear at all.

Make indeed prints "Avoiding implicit rule recursion for rule '%.o: aaa'."
The output, that you yourself posted a couple of emails ago, has this line.
Which makes me puzzled why you say this message does not appear.

> Where am I missing the point?

This rule-is-already-in-use check (that accompanies " Avoiding
implicit rule recursion for rule...")
takes place before checking whether a rule matches the target.
It is cheaper to check rule-is-already-in-use than to figure out if a
rule matches.

regards, Dmitry

Reply via email to