make: delete XDIFF_LIB, add xdiff to LIB_OBJS

In a future patch series the 'xdiff' Rust crate will be added. Delete the creation of the static library file for xdiff to avoid a name conflict. This also moves toward the goal of Rust only needing to link against libgit.a. Changes to Meson are not required as the xdiff library is already included in Meson's libgit.a. xdiff-objs was a historical make target to allow building just the objects in xdiff. Since it was defined in terms of XDIFF_OBJS (which no longer exists) this convenience make target no longer makes sense. Remove it. Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ezekiel Newren committed Oct 2, 2025 at 23:27 UTC cf680cdb9543095bf75eefce7489c34282506353
1 file changed +10 -19
Makefile
+10 -19
@@ -916,7 +916,6 @@ export PYTHON_PATH
916 TEST_SHELL_PATH = $(SHELL_PATH)
917
918 LIB_FILE = libgit.a
919 -XDIFF_LIB = xdiff/lib.a
919 REFTABLE_LIB = reftable/libreftable.a
920
921 GENERATED_H += command-list.h
@@ -1207,6 +1206,13 @@ LIB_OBJS += write-or-die.o
1206 LIB_OBJS += ws.o
1207 LIB_OBJS += wt-status.o
1208 LIB_OBJS += xdiff-interface.o
1209 +LIB_OBJS += xdiff/xdiffi.o
1210 +LIB_OBJS += xdiff/xemit.o
1211 +LIB_OBJS += xdiff/xhistogram.o
1212 +LIB_OBJS += xdiff/xmerge.o
1213 +LIB_OBJS += xdiff/xpatience.o
1214 +LIB_OBJS += xdiff/xprepare.o
1215 +LIB_OBJS += xdiff/xutils.o
1216
1217 BUILTIN_OBJS += builtin/add.o
1218 BUILTIN_OBJS += builtin/am.o
@@ -1388,8 +1394,8 @@ CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/unit-test.o
1394
1395 UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/test-lib.o
1396
1391 -# xdiff and reftable libs may in turn depend on what is in libgit.a
1392 -GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(LIB_FILE)
1397 +# reftable lib may in turn depend on what is in libgit.a
1398 +GITLIBS = common-main.o $(LIB_FILE) $(REFTABLE_LIB) $(LIB_FILE)
1399 EXTLIBS =
1400
1401 GIT_USER_AGENT = git/$(GIT_VERSION)
@@ -2721,16 +2727,6 @@ reconfigure config.mak.autogen: config.status
2727 .PHONY: reconfigure # This is a convenience target.
2728 endif
2729
2724 -XDIFF_OBJS += xdiff/xdiffi.o
2725 -XDIFF_OBJS += xdiff/xemit.o
2726 -XDIFF_OBJS += xdiff/xhistogram.o
2727 -XDIFF_OBJS += xdiff/xmerge.o
2728 -XDIFF_OBJS += xdiff/xpatience.o
2729 -XDIFF_OBJS += xdiff/xprepare.o
2730 -XDIFF_OBJS += xdiff/xutils.o
2731 -.PHONY: xdiff-objs
2732 -xdiff-objs: $(XDIFF_OBJS)
2733 -
2730 REFTABLE_OBJS += reftable/basics.o
2731 REFTABLE_OBJS += reftable/error.o
2732 REFTABLE_OBJS += reftable/block.o
@@ -2765,7 +2761,6 @@ OBJECTS += $(GIT_OBJS)
2761 OBJECTS += $(SCALAR_OBJS)
2762 OBJECTS += $(PROGRAM_OBJS)
2763 OBJECTS += $(TEST_OBJS)
2768 -OBJECTS += $(XDIFF_OBJS)
2764 OBJECTS += $(FUZZ_OBJS)
2765 OBJECTS += $(REFTABLE_OBJS) $(REFTABLE_TEST_OBJS)
2766 OBJECTS += $(UNIT_TEST_OBJS)
@@ -2919,9 +2914,6 @@ scalar$X: scalar.o GIT-LDFLAGS $(GITLIBS)
2914 $(LIB_FILE): $(LIB_OBJS)
2915 $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
2916
2922 -$(XDIFF_LIB): $(XDIFF_OBJS)
2923 - $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
2924 -
2917 $(REFTABLE_LIB): $(REFTABLE_OBJS)
2918 $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
2919
@@ -3763,7 +3755,7 @@ clean: profile-clean coverage-clean cocciclean
3755 $(RM) git.rc git.res
3756 $(RM) $(OBJECTS)
3757 $(RM) headless-git.o
3766 - $(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB)
3758 + $(RM) $(LIB_FILE) $(REFTABLE_LIB)
3759 $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)
3760 $(RM) $(TEST_PROGRAMS)
3761 $(RM) $(FUZZ_PROGRAMS)
@@ -3957,7 +3949,6 @@ endif
3949 LIBGIT_PUB_OBJS += contrib/libgit-sys/public_symbol_export.o
3950 LIBGIT_PUB_OBJS += libgit.a
3951 LIBGIT_PUB_OBJS += reftable/libreftable.a
3960 -LIBGIT_PUB_OBJS += xdiff/lib.a
3952
3953 LIBGIT_PARTIAL_EXPORT = contrib/libgit-sys/partial_symbol_export.o
3954