Hello there, I wonder if anyone can help me out,

I tried my hand at a little Makefile meta-programming only to have the
Makefile give me an error:

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

I get the error:

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

I *know* it references itself but I use the Makefile $(if statement to
prevent infinite loops. (in a similar way to specialization in c++ template
meta-programming)

It seems that this error is a little over-zealous in its scope and if
removed would increase the ability of Makefiles enormously.

Regards

---------------------------------
Q-Games, Dylan Cuthbert.
http://www.q-games.com


_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to