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

Jim Meyering <[email protected]>
Newsgroups gmane.comp.sysutils.automake.patches
Message-ID <CA+8g5KFH8QBd9LLAF0Moqxa439DV_fi-9+EKZsNRG=z-bwkpUg@mail.gmail.com>
On Mon, Aug 29, 2016 at 11:05 PM, Thomas Martitz <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.