automake
[Top][All Lists]
Advanced

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

Re: [RFC] new option: object-shortname


From: Thomas Martitz
Subject: Re: [RFC] new option: object-shortname
Date: Fri, 8 Jan 2016 17:05:48 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

Am 08.01.2016 um 16:55 schrieb Gavin Smith:
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/Makefile.am:
   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.

I agree, as I have no use for the current naming scheme. I was just uneasy about changing current behaviour like this, maybe someone depends on the naming (perhaps for custom rules)?


+                       # 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
"sniff_glue".


You are right. Thanks for noticing. I'll see if I can fix that.

Best regards



reply via email to

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