[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to add comma to a list?
From: |
Boris Kolpackov |
Subject: |
Re: How to add comma to a list? |
Date: |
Tue, 12 Jul 2005 17:43:59 +0000 (UTC) |
User-agent: |
nn/6.6.5+RFC1522 |
Ted Stern <address@hidden> writes:
> Hi all,
Your post belongs to help-make, not bug-make.
>
> 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.
Use an indirection:
comma :=,
FOO := $(patsubst %,-Wl$(comma)-y$(comma)%_,$(FOO))
-boris