Makefile: reintroduce REFTABLE_OBJS

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".

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.

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.

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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
next^2
SZEDER Gábor 2026-09-15 08:09:51 +02:00 committed by Junio C Hamano
parent 986cd1cd9e
commit af36bb91f9
2 changed files with 22 additions and 14 deletions

View File

@ -707,6 +707,7 @@ OBJECTS =
OTHER_PROGRAMS =
PROGRAM_OBJS =
PROGRAMS =
REFTABLE_OBJS =
RUST_SOURCES =
EXCLUDED_PROGRAMS =
SCRIPT_PERL =
@ -1284,20 +1285,6 @@ LIB_OBJS += refs/iterator.o
LIB_OBJS += refs/packed-backend.o
LIB_OBJS += refs/ref-cache.o
LIB_OBJS += refspec.o
LIB_OBJS += reftable/basics.o
LIB_OBJS += reftable/block.o
LIB_OBJS += reftable/blocksource.o
LIB_OBJS += reftable/error.o
LIB_OBJS += reftable/fsck.o
LIB_OBJS += reftable/iter.o
LIB_OBJS += reftable/merged.o
LIB_OBJS += reftable/pq.o
LIB_OBJS += reftable/record.o
LIB_OBJS += reftable/stack.o
LIB_OBJS += reftable/system.o
LIB_OBJS += reftable/table.o
LIB_OBJS += reftable/tree.o
LIB_OBJS += reftable/writer.o
LIB_OBJS += remote.o
LIB_OBJS += repack.o
LIB_OBJS += repack-cruft.o
@ -1386,6 +1373,23 @@ LIB_OBJS += xdiff/xpatience.o
LIB_OBJS += xdiff/xprepare.o
LIB_OBJS += xdiff/xutils.o

REFTABLE_OBJS += reftable/basics.o
REFTABLE_OBJS += reftable/block.o
REFTABLE_OBJS += reftable/blocksource.o
REFTABLE_OBJS += reftable/error.o
REFTABLE_OBJS += reftable/fsck.o
REFTABLE_OBJS += reftable/iter.o
REFTABLE_OBJS += reftable/merged.o
REFTABLE_OBJS += reftable/pq.o
REFTABLE_OBJS += reftable/record.o
REFTABLE_OBJS += reftable/stack.o
REFTABLE_OBJS += reftable/system.o
REFTABLE_OBJS += reftable/table.o
REFTABLE_OBJS += reftable/tree.o
REFTABLE_OBJS += reftable/writer.o

LIB_OBJS += $(REFTABLE_OBJS)

BUILTIN_OBJS += builtin/add.o
BUILTIN_OBJS += builtin/am.o
BUILTIN_OBJS += builtin/annotate.o

View File

@ -675,6 +675,10 @@ include_directories(${CMAKE_BINARY_DIR})
#libgit
parse_makefile_for_sources(libgit_SOURCES ${CMAKE_SOURCE_DIR}/Makefile "LIB_OBJS")

#reftable
parse_makefile_for_sources(reftable_SOURCES ${CMAKE_SOURCE_DIR}/Makefile "REFTABLE_OBJS")
list(APPEND libgit_SOURCES ${reftable_SOURCES})

list(TRANSFORM libgit_SOURCES PREPEND "${CMAKE_SOURCE_DIR}/")
list(TRANSFORM compat_SOURCES PREPEND "${CMAKE_SOURCE_DIR}/")