Follow-up Comment #3, bug #28456 (project make): Update:
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'. """ So let's verify that: $ cat se-manual.mk .SECONDEXPANSION: foo: bar foo foz: fo%: bo% show-vars = $(info $$@ : $@) $(info $$< : $<) $(info $$^ : $^) $(info $$+ : $+) $(info $$* : $*) %oo: $$(show-vars) touch $@ $ touch bar && make -f se-manual.mk foo $@ : foo $< : foo $^ : bar boo $+ : bar boo $* : f $@ : boo $< : boo $^ : $+ : $* : b touch foo 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. Thanks beforehand, Kirill _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?28456> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make