On Sun, Oct 19, 2025 at 9:06 AM Dmitry <[email protected]> wrote: > ``` > 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'.
Make figures out that prerequisite 'aaa' is needed to use rule '%.o: aaa'. Make discovers there is no file 'aaa'. At that point make calls pattern_search recursively to find a rule to build 'aaa'. This recursive call cannot itself use rule '%.o: aaa'. So, line 12 tells you that this recursive call of pattern_search is skipping rule '%.o: aaa'. See "Chains of Implicit Rules" in the manual. regards, Dmitry
