git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 0/4] make: precompile "git-compat-util.h"

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Sep 15, 2026, 06:09 UTC
Message-ID
<20260915060952.569535-1-szeder.dev@gmail.com>
In-Reply-To
<20260909195006.2179119-1-szeder.dev@gmail.com>

Update our Makefile to make use of the recently introduced precompiled header to make builds faster (on my setup by about 35%).

Changes since v1:
  - Update the commit message of patch 3/4 per Junio's suggestion.
SZEDER Gábor (4):
  Makefile: remove XDIFF_OBJS initialization
  cmake: remove any "$(*_OBJS)" variables when parsing Makefile for
    sources
  Makefile: reintroduce REFTABLE_OBJS
  Makefile: precompile "git-compat-util.h"
 .gitignore                          |  1 +
 Makefile                            | 59 +++++++++++++++++++----------
 contrib/buildsystems/CMakeLists.txt |  6 ++-
 3 files changed, 45 insertions(+), 21 deletions(-)
Range-diff against v1:
1:  d52a1476d1 = 1:  d52a1476d1 Makefile: remove XDIFF_OBJS initialization
2:  5d60181efd = 2:  5d60181efd cmake: remove any "$(*_OBJS)" variables when parsing Makefile for sources
3:  0296c6cffc ! 3:  cfc77c0b2c Makefile: reintroduce REFTABLE_OBJS
    @@ Metadata
      ## Commit message ##
         Makefile: reintroduce REFTABLE_OBJS
     
    -    Object files under "reftable/" used to be listed in the REFTABLE_OBJS
    -    Makefile variable so we could build a static library from them.  This
    -    static library was removed in f3b4c89d59 (make: delete REFTABLE_LIB,
    -    add reftable to LIB_OBJS, 2025-10-02), along with filling
    -    REFTALBE_OBJS with object files.
    +    In the next commit we are about to precompile "git-compat-util.h" with
    +    "make" to reduce build times.  But using the precompiled header should
    +    not change what actually gets compiled, therefore a source file can
    +    only be compiled using the precompiled header if the first included
    +    header file is "git-compat-util.h".
     
    -    However, the reftable source files are kind of special, because the
    -    reftable implementation is supposed to be easily includable in other
    -    projects.  Therefore, the reftable source files don't include
    +    The reftable source files are kind of special, because the reftable
    +    implementation is supposed to be easily includable in other projects.
    +    Therefore, the reftable source files don't include
         "git-compat-util.h", with the sole exception of the purposefully
         project-specific "reftable/system.c".  Consequently, they shouldn't be
    -    compiled with our precompiled header, as it does include
    -    "git-compat-util.h".
    +    compiled with our precompiled header.
    +
    +    List object files under "reftable" in the REFTABLE_OBJS Makefile
    +    variable, so in the next commit we'll be able to easily filter them
    +    out and keep building them the old way, without the precompiled
    +    header.
     
    -    Resurrect listing object files under "reftable/" in REFTABLE_OBJS (but
    -    not the static library), so in the next commit we'll be able to easily
    -    filter them out and keep building them the old way, without the
    -    precompiled header.
    +    Note that object files under "reftable/" used to be listed in
    +    REFTABLE_OBJS so we could build a static library from them.  This
    +    static library was removed in f3b4c89d59 (make: delete REFTABLE_LIB,
    +    add reftable to LIB_OBJS, 2025-10-02), along with filling
    +    REFTALBE_OBJS with object files.  This change essentially reverts the
    +    removal of REFTABLE_OBJS, but not the building of that static library.
     
         Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
     
4:  ce9fd91413 = 4:  a933be0664 Makefile: precompile "git-compat-util.h"
-- 
2.56.0.rc0.467.ge054dd0dd6
Previous: SZEDER GáborNext: SZEDER Gábor
Message 8 of 15 in “make: precompile "git-compat-util.h"”
  1. 0/4 make: precompile "git-compat-util.h"SZEDER Gábor, Sep 9, 2026
  2. 1/4 Makefile: remove XDIFF_OBJS initializationSZEDER Gábor, Sep 9, 2026
  3. 2/4 cmake: remove any "$(*_OBJS)" variables when parsing Makefile for sourcesSZEDER Gábor, Sep 9, 2026
  4. 3/4 Makefile: reintroduce REFTABLE_OBJSSZEDER Gábor, Sep 9, 2026
  5. Junio C HamanoSep 9, 2026
  6. 4/4 Makefile: precompile "git-compat-util.h"SZEDER Gábor, Sep 9, 2026
  7. SZEDER GáborSep 9, 2026
  8. 0/4 make: precompile "git-compat-util.h"SZEDER Gábor, Sep 15, 2026
  9. 1/4 Makefile: remove XDIFF_OBJS initializationSZEDER Gábor, Sep 15, 2026
  10. 2/4 cmake: remove any "$(*_OBJS)" variables when parsing Makefile for sourcesSZEDER Gábor, Sep 15, 2026
  11. 3/4 Makefile: reintroduce REFTABLE_OBJSSZEDER Gábor, Sep 15, 2026
  12. 4/4 Makefile: precompile "git-compat-util.h"SZEDER Gábor, Sep 15, 2026
  13. Jeff KingSep 24, 2026
  14. SZEDER GáborSep 25, 2026
  15. SZEDER GáborOct 3, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.