This option is intended to be used in conjunction with subdir-objects and Automake-time substitutions for included makefile fragments (%C%, %D%). It suppresses the generation path components in object filenames.
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 And it allows the following in root/Makefile.am (not possible with foo_SHORTNAME=foo) if ENABLE_FOO include path/too/Makefile.am endif --- bin/automake.in | 6 ++++++ lib/Automake/Options.pm | 1 + 2 files changed, 7 insertions(+) diff --git a/bin/automake.in b/bin/automake.in index eedc8bc..1b40992 100644 --- a/bin/automake.in +++ b/bin/automake.in @@ -1691,6 +1691,12 @@ sub handle_single_transform # override. my $dname = $derived; + if (option 'object-shortname') { + # 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]; + } my $var = var ($derived . '_SHORTNAME'); if ($var) { diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm index 7d782c3..819c5ff 100644 --- a/lib/Automake/Options.pm +++ b/lib/Automake/Options.pm @@ -293,6 +293,7 @@ sub _is_valid_easy_option ($) silent-rules std-options subdir-objects + object-shortname ); } -- 2.6.4