[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Portable $addprefix

From: Quinn Grier
Subject: Re: Portable $addprefix
Date: Mon, 28 Aug 2017 11:03:31 -0700
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 2017-08-24 19:02, Kip Warner wrote:
> Hey list,
> I'd like to transform the following variable in my from...
>     files_only = ...
> Into...
>     files_with_path = dir/ dir/ dir/ dir/ ...
> 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?

A portable way to do this is to do the work in and transfer
it to the Makefile with AC_SUBST. For example, with an empty
and the following

      AC_INIT([Example], [1.0])

      m4_define([m_files_only], [])
      files_with_path='m4_map_args_w(m_files_only, [dir/], [], [ ])'


The desired macros will appear in the resulting Makefile:

      files_only =
      files_with_path = dir/ dir/ dir/

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]