[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
recursively expanded variables as functions
From: |
Ken Smith |
Subject: |
recursively expanded variables as functions |
Date: |
Fri, 20 May 2005 22:18:22 -0400 |
User-agent: |
Mutt/1.5.9i |
First, my environment.
zsh(0)% gmake -v
GNU Make 3.81beta2
Copyright (C) 2003 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.
This program built for i686-pc-linux-gnu
I was under the impression that I could count on being able to call a
function before its definition because of the recursive expansion of
variables. Here is an example.
GNUmakefile
$(warning result=$(call function,hello there))
function = $(findstring hello,$(1))
$(warning result=$(call function,hello there))
zsh(0)% gmake
GNUmakefile:1: result=
GNUmakefile:5: result=hello
gmake: *** No targets. Stop.
Here is a similar example with similar results which doesn't use
$(call).
GNUmakefile
$(warning $(variable))
variable = hi
$(warning $(variable))
zsh(0)% gmake
GNUmakefile:1:
GNUmakefile:3: hi
gmake: *** No targets. Stop.
Can anyone offer an explanation for this behavior? Since "function" in
the first example, and variable in the second example are recursively
expanded variables, I would have thought $(call)ing or referencing them
would retrieve their eventual values.
Many thanks,
Ken Smith
- recursively expanded variables as functions,
Ken Smith <=