help-make
[Top][All Lists]
Advanced

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

Re: recursively expanded variables as functions


From: Noel Yap
Subject: Re: recursively expanded variables as functions
Date: Sat, 21 May 2005 19:20:12 -0400
User-agent: Mozilla Thunderbird 0.5 (Windows/20040212)

IIRC, $(warning) is executed during makefile parse.

HTH,
Noel

Ken Smith wrote:

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


_______________________________________________
Help-make mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-make




reply via email to

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