help-make
[Top][All Lists]
Advanced

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

character substitution loop and eval


From: Dill, John
Subject: character substitution loop and eval
Date: Thu, 6 Jan 2005 15:59:20 -0600

I have a problem I want to create a list of characters to pass to a function 
which calls subst over that list.  I want to do something like this.

my_chars:=1 2 3 4 5 6 7 8 9

my-subst=$(eval temp_variable := $1)$(foreach iter,$(my_chars),$(eval 
temp_variable:=$(subst $(iter),,$(temp_variable))))$(temp_variable)

where my_chars could be simply $2.

I'm new to 3.80 so I'm not very familiar of the capabilities of eval.  Can I 
store temporary state within a foreach loop?  This way I wouldn't need a lot of 
nested subst to implement this in make.  (I can also do this with a program 
easily enough, but I want to try to implement it within make).

Is there a way to make this kind of loop work in 3.80?

Thanks,
John Dill




reply via email to

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