Dmitry, thank you. Version 4.4.1 indeed has much more detailed and
understandable debug output. (my previous version was 4.3 — the
default on Ubuntu 24.04.3 LTS.)

Now, with the following makefile:


```
foo.o:

%.o: aaa
        @echo $@ 1111

%aa :
        @echo $@ 2222
```
I get the output:
```
.......................
1  : Updating goal targets....
2  : Considering target file 'foo.o'.
3  :  File 'foo.o' does not exist.
4  :  Looking for an implicit rule for 'foo.o'.
5  :   Trying pattern rule '%.o: aaa' with stem 'foo'.
6  :   Trying rule prerequisite 'aaa'.
7  :   Not found 'aaa'.
8  :   Trying harder.
9  :   Trying pattern rule '%.o: aaa' with stem 'foo'.
10 :   Trying rule prerequisite 'aaa'.
11 :   Looking for a rule with explicit file 'aaa'.
12 :    Avoiding implicit rule recursion for rule '%.o: aaa'.
13 :    Trying pattern rule '%aa:' with stem 'a'.
.......................
```
Here everything clear for me except line 12: Avoiding implicit rule
recursion for rule '%.o: aaa'.
After line 7 we've completed with point 5 of search algorithm and move
to point 6 (searching for aaa in implicit rules).
But I can't understand why we again see rule '%.o: aaa' and reject it
as recursion?
For aaa there is only suitable rule here - '%aa :'

Everything here is clear to me except line 12: “Avoiding implicit rule
recursion for rule '%.o: aaa'.”

After line 7, we finish step 5 of the search algorithm and move to
step 6 (searching for aaa in implicit rules). But I can’t understand
why we see the rule '%.o: aaa' again and  rejected it as recursion.

As far as I can see, for aaa the only applicable rule here is '%aa:'

regards, Dmitry

On Sat, Oct 18, 2025 at 11:41 PM Dmitry Goncharov
<[email protected]> wrote:
>
> On Sat, Oct 18, 2025 at 3:11 AM Dmitry <[email protected]> wrote:
>
> > Updating goal targets....
> > Considering target file 'foo.o'.
> >  File 'foo.o' does not exist.
> >  Looking for an implicit rule for 'foo.o'.
> >  Trying pattern rule with stem 'foo'.
> >  Trying rule prerequisite 'aaa'.
> >  Trying pattern rule with stem 'foo'.
> >  Trying rule prerequisite 'aaa'.
> >  Looking for a rule with intermediate file 'aaa'.
>
> This output is from an old version of make. If you try a recent make,
> you'll see much more detailed output from implicit search. That'll
> hopefully clarify the behavior. But, if not, post that detailed output
> here.
>
> regards, Dmitry



-- 
--
  Dmitry

Reply via email to