help-make
[Top][All Lists]
Advanced

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

Re: Question function "call" and "%"


From: RusMor
Subject: Re: Question function "call" and "%"
Date: Wed, 24 Mar 2010 02:12:10 -0700 (PDT)

  Dear Paul Smith-20,

  Many thanks (for the RTFM =) ).

  To close this thread and honour your tip, below is how I got what I
wanted:

blaat:
blaat.blaat:

TEST = $(1).$(1)

.SECONDEXPANSION:

test/%: $$(call TEST,%)
        @echo "Args = $^"

print/%: %
        @echo $(call TEST,$<) 

address@hidden:~/scratch> make test/blaat
Args = blaat.blaat

  Note the use of ".SECONDEXPANSION:" and the extra "$" in the prerequisite
list for "test/%".
  
  After the first expansion, there is still only one "%" in the expression,
which is replaced by "blaat", so make sees:

$(call TEST,blaat)

  At the second expansion, this is evaluated to "blaat.blaat", as I wished.

  Cheers,

Ytsen.

-- 
View this message in context: 
http://old.nabble.com/Question-function-%22call%22-and-%22-%22-tp28003847p28012322.html
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.





reply via email to

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