help-make
[Top][All Lists]
Advanced

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

Call with computed variable names


From: Dave
Subject: Call with computed variable names
Date: Thu, 16 Sep 2004 05:25:44 -0700 (PDT)

This is a resend - it's been a couple hours and I don't see the original message
appearing in the list. Apologies if this is just noise

--------------------

I've distilled a problem that I'm seeing to a minimal test case, see below.

Essentially, when using the call function, the computed variable name does not
appear to be evaluated correctly.

Is this expected?

Thanks,

Dave.

PS. I'm running on cygwin (DLL 1.5.10) on winXP, with make in unix mode


dkilroy
$ cat Makefile


define TEMPLATE
$(1)_VAR1=abc

$(1)_VAR2=$($(1)_VAR1)_def
endef

$(eval $(call TEMPLATE,FOO))

all:
        @echo Expect FOO_VAR1 to be abc
        @echo FOO_VAR1 is $(FOO_VAR1)
        @echo Expect FOO_VAR2 to be abc_def
        @echo FOO_VAR2 is $(FOO_VAR2)

dkilroy
$ make -v
GNU Make 3.80
Copyright (C) 2002  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

dkilroy
$ make
Expect FOO_VAR1 to be abc
FOO_VAR1 is abc
Expect FOO_VAR2 to be abc_def
FOO_VAR2 is _def

dkilroy
$ 



                
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com




reply via email to

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