bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #28456] Expansion of $$< is incorrect


From: Kirill Smelkov
Subject: [bug #28456] Expansion of $$< is incorrect
Date: Wed, 10 Feb 2010 16:34:42 +0000
User-agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.10 (like Gecko) (Debian)

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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]