[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: How to define a variable with {} expansion
From: |
Cook, Malcolm |
Subject: |
RE: How to define a variable with {} expansion |
Date: |
Thu, 28 Jan 2021 17:43:19 +0000 |
>Thanks! That's exactly what I was looking for.
Glad it worked. I use shell assignment exactly for this convenient purpose
myself.
> (Perhaps you should CC the list with this.)
Doh! Of course! Done below:
>On Thu, Jan 28, 2021 at 12:50 AM Cook, Malcolm <mailto:MEC@stowers.org> wrote:
>This is called “brace expansion” in bash manual.
>
>If you are using a newer version of Gnu Make, and Make’s .SHELL is set to
>/bin/bash (or another shell which supports brace expansion), you can use
>Make’s new-ish “shell assignment operator”, !=, like this
>
> x!= echo abc/def/{ghi,kln,opq}.a
>
>(note use commas to separate alternatives to expand, not spaces)
>
>here’s a one-liner demo:
>
>make --eval 'x!=echo abc/def/{ghi,kln,opq}.a' --eval '$(info $x)'
>
>
>>From: Help-make <help-make-bounces+mec=mailto:stowers.org@gnu.org> On Behalf
>>Of Blake McBride
>>Sent: Wednesday, January 27, 2021 12:11
>>To: mailto:help-make@gnu.org
>>Subject: How to define a variable with {} expansion
>>
>>Greetings,
>>
>>Please forgive the basic question.
>>
>>If I want a variable set to: abc/def/ghi.a abc/def/klm.a abc/def/opq.a
>>
>>On other make systems, I would do: abc/def/{ghi kln opq}.a
>>
>>How can I do this in GNU Make?
>>
>>Thank you!
>>
>>Blake McBride