You are not logged in

Curiously, this particular bug also triggers circular dependencies. More surprising, the test case is simply the snippet found straight in the info page (make.info, section 3.10, "Secondary Expansion of Implicit Rules").

The snippet is (blank lines ommited):

.SECONDEXPANSION:
foo: bar
foo foz: fo%: bo%
%oo: $$< $$^ $$+ $$*

One might have to "touch bar boo f" before running make. The output is:

It seems current make behaviour is inconsisten with its manual. I quote `Secondary Expansion of Implicit Rules':

"""
As `make' searches for an implicit rule, it substitutes the stem and
then performs secondary expansion for every rule with a matching target
pattern. The value of the automatic variables is derived in the same
fashion as for static pattern rules. As an example:

.SECONDEXPANSION:

foo: bar

foo foz: fo%: bo%

%oo: $$< $$^ $$+ $$*

When the implicit rule is tried for target `foo', `$$<' expands to
`bar', `$$^' expands to `bar boo', `$$+' also expands to `bar boo', and
`$$*' expands to `f'.
"""

Take a closer look to first 5 output lines starting with `$@ : foo'. The manual says "When the implicit rule is tried for
target `foo', `$$<' expands to `bar', `$$^' expands to `bar
boo', `$$+' also expands to `bar boo', and `$$*' expands to `f'"

But it seems we have $$< = foo (!= bar).

Could please anyone clarify, what is the right behaviour and how (if whether) we need to fix it.