help-make
[Top][All Lists]
Advanced

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

Re: Tricky problem filtering out commas from a string.


From: Paul Smith
Subject: Re: Tricky problem filtering out commas from a string.
Date: Thu, 19 Apr 2007 09:05:55 -0400

On Thu, 2007-04-19 at 13:15 +0100, Dave Korn wrote:

> The obvious first approach - escape the comma so that filter-out doesn't
> think it's the separator between its two arguments - just doesn't work.  I
> can't quite see how to achieve this in make....

Using backslashes as an escape character in make is pretty ad hoc; it
definitely does not work everywhere you expect it to (unfortunately).

However, you should be able to do it with variables:

    COMMA = ,
    LIST_WITHOUT_COMMAS:=$(filter-out $(COMMA),$(LIST_WITH_COMMAS))

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "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]