Hello, On 8/24/17, Kip Warner <k...@thevertigo.com> 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 directly in make. But your example looks like a pretty static list (i.e., this list won't be changed by the user after the package is generated), so the portable way is to just generate both lists in advance, at the same time you run automake (perhaps with a perl script that postprocesses Makefile.in). If the list depends on configure results then another possibility is to have configure generate both lists. Finally, while not portable to all make implementations, expansions like this: $(files_only:%:dir/%) do work in multiple implementations other than GNU make. Cheers, Nick