[Top][All Lists]

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

Re: [RFC] new option: object-shortname

From: Gavin Smith
Subject: Re: [RFC] new option: object-shortname
Date: Fri, 8 Jan 2016 15:55:16 +0000

On 6 January 2016 at 09:17, Thomas Martitz <address@hidden> wrote:
> It should equivalent to setting %C%_foo_SHORTNAME=foo, except it can work if
> the makefile fragment is conditionally included, which improves the modularity
> of Automake-using projects.
> Example:
> without object-shortname
>   root/path/to/
>   bin_PROGRAMS += foo
>   %C%_foo_CFLAGS = $(CFLAGS)
> results in objects:
>   root/path/to/root_path_to_foo-foo.o
> with object-shortname the object filename is:
>   root/path/to/foo-foo.o

If you can get this to work, I can't think of a reason why it
shouldn't be done all the time, unconditionally, without an option.

> +                       # If object-shortname is enabled the object's 
> filename shall not contain the parts
> +                       # derived from its path (e.g. if %C% is used), but 
> just the name of the object's target
> +                       # e.g. instead of path_to_binary-object.o just 
> binary-object
> +                       $dname = split ('_', $derived)[-1];
> +               }

This isn't completely correct. From the Automake manual:

   For example, if a program is named 'sniff-glue', this would be
canonicalized as 'sniff_glue'.  An example of a derived variable name is
'sniff_glue_SOURCES' (not 'sniff-glue_SOURCES'.)  Similarly, the sources
for a library named 'libmumble++.a' would be listed in the
'libmumble___a_SOURCES' variable.

The code you've given here would set the "short name" as "glue", not

reply via email to

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