automake-patches
[Top][All Lists]
Advanced

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

[PATCH] Shorter object file names under subdir-objects


From: Thomas Martitz
Subject: [PATCH] Shorter object file names under subdir-objects
Date: Mon, 13 Mar 2017 14:19:36 +0100

Mathieu, based on your reaction on the other thread, I reworked my patch.

This supersedes my other patch, "[PATCH] new option: object-shortname". It is functionally the same but does not introduce a new option, but ties the behavior to subdir-objects instead. In
addition I made an additional bug fix and extended the test suite.

Please merge.
Commit message follows:

With the %reldir% feature, object file names can become very long, because the file names are prefixed with the %canon_reldir% substitution. The reason is to achieve unique object file names when target-specific CFLAGS or similar are used. When subdir-objects is also in effect, these long file names are also placed in potentially deep subdirectories.

But with subdir-objects this is unecessary, since uniqueness of the object file names
is already achieved by placing them next to the unique source files.

Therefore, this changes strips paths components, that are caused by %canon_reldir% or otherwise, from the object file names. The object file name is prefixed by the target in case of target-specific CFLAGS. As a result, the build tree looks less scary and many cases where $var_SHORTNAME was necessary can now be avoided. Remember that the use of $var_SHORTNAME is discouraged (and is not always an option since it does not work inside
conditionals).

Example:
previously:
    sub/Makefile.am:
    AUTOMAKE_OPTIONS = subdir-objects
    bin_PROGRAMS += %D%/foo
    %C%_foo_CFLAGS = $(AM_CFLAGS) -g

resulted in objects:
    sub/sub_foo-foo.o

now object file name is:
    sub/foo-foo.o


Attachment: 0001-Shorter-object-file-names-under-subdir-objects.patch
Description: Source code patch


reply via email to

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