Re: Portable $addprefix

2017-09-04 Thread Thomas Jahns
On 08/25/17 04:02, Kip Warner wrote: 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 ... Can you give more context why you need to substitute on the lef

Re: Portable $addprefix

2017-09-02 Thread Kip Warner
On Sat, 2017-09-02 at 20:16 +1000, Peter Johansson wrote: > > On 9/2/2017 1:27 PM, Quinn Grier wrote: > > You can fix this by generating the complete macro definitions > > before > > Automake runs and including them in Makefile.am. > > Another way to do this is to use > > macro `AX_AM_MACROS_STA

Re: Portable $addprefix

2017-09-02 Thread Peter Johansson
On 9/2/2017 1:27 PM, Quinn Grier wrote: You can fix this by generating the complete macro definitions before Automake runs and including them in Makefile.am. Another way to do this is to use macro `AX_AM_MACROS_STATIC' in Autoconf Macro Archive https://www.gnu.org/software/autoconf-archive/a

Re: Portable $addprefix

2017-09-01 Thread Quinn Grier
On 2017-09-01 17:34, Kip Warner wrote: > On Mon, 2017-08-28 at 11:03 -0700, Quinn Grier wrote: >> A portable way to do this is to do the work in configure.ac and >> transfer >> it to the Makefile with AC_SUBST. For example, with an empty >> Makefile.am >> and the following configure.ac: >> >>  

Re: Portable $addprefix

2017-09-01 Thread Kip Warner
On Mon, 2017-08-28 at 11:03 -0700, Quinn Grier wrote: > A portable way to do this is to do the work in configure.ac and > transfer > it to the Makefile with AC_SUBST. For example, with an empty > Makefile.am > and the following configure.ac: > >   AC_INIT([Example], [1.0]) >   AM_INIT_AUTO

Re: Portable $addprefix

2017-09-01 Thread Kip Warner
On Mon, 2017-08-28 at 11:31 +0200, Mathieu Lirzin wrote: > 'files_with_path' will not be interpreted by Automake, it will just > copy the line in the generated Makefile. Since Make variables are > macros the content of the variable will be simply be copied by Make > where $(files_with_path) is used

Re: Portable $addprefix

2017-08-28 Thread Quinn Grier
On 2017-08-24 19:02, Kip Warner wrote: > 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 $addprefi

Re: Portable $addprefix

2017-08-28 Thread Mathieu Lirzin
Kip Warner writes: > On Sun, 2017-08-27 at 19:44 +0200, Mathieu Lirzin wrote: >> Would something like this work for you? >> >>   files_with_path = `for f in $(files_only); do echo "dir/$$f"; done` > > Hey Mathieu, > > Thank you for the suggestion. I'm only hesitant to use that because I'm > not

Re: Portable $addprefix

2017-08-27 Thread Kip Warner
On Sun, 2017-08-27 at 19:44 +0200, Mathieu Lirzin wrote: > Would something like this work for you? > >   files_with_path = `for f in $(files_only); do echo "dir/$$f"; done` Hey Mathieu, Thank you for the suggestion. I'm only hesitant to use that because I'm not sure if Automake needs to initiali

Re: Portable $addprefix

2017-08-27 Thread Mathieu Lirzin
Hello, Kip Warner 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 al

Re: Portable $addprefix

2017-08-25 Thread Kip Warner
On Fri, 2017-08-25 at 11:33 -0400, Nick Bowler wrote: > I'm not aware of any truly portable way to do this directly in make. Hey Nick. Thanks for getting back to me.  Something that I guess I'm still confused about is why after more than a decade does Automake not have a portable way to do these

Re: Portable $addprefix

2017-08-25 Thread Nick Bowler
Hello, On 8/24/17, Kip Warner wrote: > 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 not aware of any truly portable way to do this dire

Portable $addprefix

2017-08-24 Thread Kip Warner
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