[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Portable $addprefix
From: |
Mathieu Lirzin |
Subject: |
Re: Portable $addprefix |
Date: |
Sun, 27 Aug 2017 19:44:59 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Hello,
Kip Warner <address@hidden> writes:
> Hey list,
>
> I'd like to transform the following variable in my Makefile.am from...
>
> files_only = a.foo b.foo c.foo d.foo ...
>
> Into...
>
> files_with_path = dir/a.foo dir/b.foo dir/c.foo dir/d.foo ...
>
> I'm aware of GNU Make's $addprefix magic. I'm also aware it's naughty
> to use where portability is a concern and a different implementation of
> make may be used behind Automake. I was wondering if anyone has come up
> with a recipe for scenarios like this?
Would something like this work for you?
files_with_path = `for f in $(files_only); do echo "dir/$$f"; done`
--
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37