On 6 January 2016 at 09:17, Thomas Martitz <ku...@rockbox.org> 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. > + # 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".