help-make
[Top][All Lists]
Advanced

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

Re: recursive functions in a Makefile


From: Paul D. Smith
Subject: Re: recursive functions in a Makefile
Date: Wed, 22 May 2002 21:13:49 -0400

%% "Dylan Cuthbert" <address@hidden> writes:

Pls. try to choose a proper charset for your messages.  iso-2022-jp is
not always a viewable charset.

  dc> reverse_words  = $(if $(1),$(call reverse_words,$(wordlist 2,$(words
  dc> $(1)),$(1))) $(firstword $(1)))
  dc> MESSAGE = this is a message to be reversed
  dc> REVERSE = $(call reverse_words, $(MESSAGE))

  dc> I get the error:

  dc> *** Recursive variable `reverse_words' references itself (eventually).
  dc> Stop.

  dc> I *know* it references itself but I use the Makefile $(if statement to
  dc> prevent infinite loops.

There has already been a fix made to the CVS source which allows the
first argument to $(call ...) to expand recursively.  No other functions
or variables are allowed to recurse.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist



reply via email to

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