GNU bug report logs - #13524
Improving user experience for non-recursive builds

Previous Next

Package: automake;

Reported by: Miles Bader <miles <at> gnu.org>

Date: Tue, 22 Jan 2013 09:20:02 UTC

Severity: wishlist

Tags: patch

Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Bert Wesarg <bert.wesarg <at> googlemail.com>
To: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Cc: 13524 <at> debbugs.gnu.org, Peter Rosin <peda <at> lysator.liu.se>, automake-patches <at> gnu.org, Bob Friesenhahn <bfriesen <at> simple.dallas.tx.us>, Eric Blake <eblake <at> redhat.com>, Miles Bader <miles <at> gnu.org>
Subject: bug#13524: [PATCH 1/2] preproc: add support for relative names in included fragments
Date: Thu, 14 Feb 2013 13:20:37 +0100
Hi,

On Thu, Feb 14, 2013 at 11:26 AM, Stefano Lattarini
<stefano.lattarini <at> gmail.com> wrote:
> From: Peter Rosin <peda <at> lysator.liu.se>
>
> The rationale for this change is that it is annoying to have
> to repeat the directory name when including a Makefile fragment.
> For deep directory structures these repeats can generate a lot
> of bloat.  It also hinders reuse and easy directory restructuring
> if all Makefile fragments have to know exactly where they live.
>
> Suggested by Bob Friesenhahn, and later discussed in bug#13524.
>
> In the course of discussion, the following notations were rejected:
> &{reldir}& - to hard to type, {reldir} - interferes with ${reldir},
> {am_reldir} - short form {D} interferes with ${D}, @am_reldir@ - short
> form @D@ interferes with AC_SUBST([D]) as well as invading the
> config.status turf. Other notations were also suggested...
>
> * automake.in (read_am_file): Add third argument specifying the
> relative directory of this Makefile fragment compared to the
> main Makefile.  Replace %reldir% and %canon_reldir% in the
> fragment with this relative directory (with slashes etc, or
> canonicalized).
> (read_main_am_file): Adjust.
> * t/preproc-reldir.sh: New test.
> * t/list-of-tests.mk: Augment.
> * doc/automake.texi (Include): Document the new feature.
> NEWS: Add new feature.
>
> Co-authored-by: Stefano Lattarini <stefano.lattarini <at> gmail.com>
> Signed-off-by: Peter Rosin <peda <at> lysator.liu.se>
> ---
>  NEWS                |  12 +++++
>  automake.in         |  26 ++++++++---
>  doc/automake.texi   |  20 ++++++++
>  t/list-of-tests.mk  |   1 +
>  t/preproc-reldir.sh | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 182 insertions(+), 6 deletions(-)
>  create mode 100755 t/preproc-reldir.sh
>
> diff --git a/NEWS b/NEWS
> index 6dcce72..e27e0cf 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -100,6 +100,18 @@ New in 1.13.2:
>      be longer necessary, so we deprecate it with runtime warnings.  It will
>      likely be removed altogether in Automake 1.14.
>
> +* Relative directory in Makefile fragments:
> +
> +  - The special Automake-time substitutions '%reldir%' and '%canon_reldir%'
> +    (and their short versions, '%D%' and '%C%' respectively) can now be used
> +    in an included Makefile fragment.  The former is substituted with the
> +    relative directory of the included fragment (compared to the top level
> +    including Makefile), and the latter with the canonicalized version of
> +    the same relative directory:
> +
> +        bin_PROGRAMS += %reldir%/foo
> +        %canon_reldir%_foo_SOURCES = {reldir}/bar.c

the rejected '{reldir}' is still used in this example.

Does this substition happens in the whole file, or only in specific
syntactic constructs? What definitily will not work ist something like
this, right?

here = %reldir%
target = %canon_reldir%/foo

        bin_PROGRAMS += ${here}/foo
        ${target}_SOURCES = ${here}/bar.c


Speaking of 'here' wouldn't that also an candidate instead of
'reldir'? and %.% as the shortform of %reldir% does sound:

        bin_PROGRAMS += %.%/foo
        %canon_here%_foo_SOURCES = %.%/bar.c

Regards,
Bert




This bug report was last modified 12 years and 131 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.