bug-make
[Top][All Lists]
Advanced

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

Re: How to add comma to a list?


From: Mike Shal
Subject: Re: How to add comma to a list?
Date: Tue, 12 Jul 2005 13:34:49 -0400

On 7/12/05, Ted Stern <address@hidden> wrote:
> Hi all,
> 
> What is the proper way to insert commas into each word of a GNU Make
> variable?
> 
> I want to change FOO something like this:
> 
>      FOO := a b c d e
>      FOO := $(patsubst %,-Wl,-y,%_,$(FOO))
> 
> to get
> 
>      -Wl,-y,a_ -Wl,-y,b_ -Wl,-y,c_ -Wl,-y,d_ -Wl,-y,e_
> 
> Somehow I need to comment the comma so that it is not interpreted as a
> MAKE function argument separator.  I don't see any reference to this
> in the info pages.  I'm using 3.80.

Hi Ted,

You can just put the comma in another variable. It doesn't exactly
look pretty, but it seems to work:

FOO := a b c d e
comma=,
FOO := $(patsubst %,-Wl$(comma)-y$(comma)%_,$(FOO))

-Mike




reply via email to

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