automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH v3] new option: object-shortname


From: Jim Meyering
Subject: Re: [PATCH v3] new option: object-shortname
Date: Thu, 5 Jan 2017 15:31:56 +0100

On Mon, Aug 29, 2016 at 11:05 PM, Thomas Martitz <address@hidden> wrote:
> This option is intended to be used in conjunction with subdir-objects and
> Automake-time substitutions for included makefile fragments (%C%, %D%).
> Enabling the option shortens the file name of object files such that the
> prefix
> derived (after canonicalization) from the path is not included.
>
> Enabling the option is basically equivalent to setting foo_SHORTNAME =
> foo. However, it also works flawlessly if a Makefile fragment is
> conditionally included. Note that actually setting foo_SHORTNAME
> still overrides the object name, regardless of this option. This can improve
> the modularity of Automake-using projects.
>
> Example:
> without object-shortname
>   sub/Makefile.am:
>   bin_PROGRAMS += %D%/foo
>   %C%_foo_CFLAGS = $(AM_CFLAGS) -g
>
> results in objects:
>   sub/sub_foo-foo.o
>
> with object-shortname the object file name is:
>   sub/foo-foo.o
>
> And it allows the following in $(top_srcdir)/Makefile.am (not possible with
> foo_SHORTNAME=foo)
>
>   if ENABLE_SUB
>   include sub/Makefile.am
>   endif

Hi Thomas,

Thanks for the addition.

I've only spent a few minutes reading discussion about this patch and
even less looking at the actual code, but so far, I have seen no
addition to the test suite. I suggest you copy an existing test as a
starting point, add something like the above in its Makefile.am
section, and then ensure that the new artifacts appear in the
generated Makefile.in.

Automake is at a point in its development for which we should ensure
(whenever possible) that any nontrivial change includes a test suite
addition to exercise the new behavior. If it's a bug fix, the new
test(s) should fail before the fix and pass once it is applied. For a
feature addition like this, it is often similar: the new test should
exercise/demonstrate the new code, and should usually fail without the
patch.

Jim



reply via email to

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