help-make
[Top][All Lists]
Advanced

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

Call with computed variable names


From: David Kilroy
Subject: Call with computed variable names
Date: Thu, 16 Sep 2004 11:08:03 +0100

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


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
$ 




reply via email to

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