Skip to content

Commit 216485f

Browse files
committed
Merge branch 'en/make-libgit-a' into seen
Instead of three library archives (one for git, one for reftable, and one for xdiff), roll everything into a single libgit.a archive. This would help later effort to FFI into Rust. * en/make-libgit-a: make: delete REFTABLE_LIB, add reftable to LIB_OBJS make: delete XDIFF_LIB, add xdiff to LIB_OBJS
2 parents 0fe6441 + f3b4c89 commit 216485f

File tree

1 file changed

+24
-40
lines changed

1 file changed

+24
-40
lines changed

Makefile

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -927,16 +927,13 @@ export PYTHON_PATH
927927
TEST_SHELL_PATH = $(SHELL_PATH)
928928

929929
LIB_FILE = libgit.a
930-
XDIFF_LIB = xdiff/lib.a
931-
REFTABLE_LIB = reftable/libreftable.a
932930
ifdef DEBUG
933931
RUST_LIB = target/debug/libgitcore.a
934932
else
935933
RUST_LIB = target/release/libgitcore.a
936934
endif
937935

938-
# xdiff and reftable libs may in turn depend on what is in libgit.a
939-
GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(LIB_FILE)
936+
GITLIBS = common-main.o $(LIB_FILE)
940937
EXTLIBS =
941938

942939
GIT_USER_AGENT = git/$(GIT_VERSION)
@@ -1248,6 +1245,20 @@ LIB_OBJS += refs/iterator.o
12481245
LIB_OBJS += refs/packed-backend.o
12491246
LIB_OBJS += refs/ref-cache.o
12501247
LIB_OBJS += refspec.o
1248+
LIB_OBJS += reftable/basics.o
1249+
LIB_OBJS += reftable/block.o
1250+
LIB_OBJS += reftable/blocksource.o
1251+
LIB_OBJS += reftable/error.o
1252+
LIB_OBJS += reftable/fsck.o
1253+
LIB_OBJS += reftable/iter.o
1254+
LIB_OBJS += reftable/merged.o
1255+
LIB_OBJS += reftable/pq.o
1256+
LIB_OBJS += reftable/record.o
1257+
LIB_OBJS += reftable/stack.o
1258+
LIB_OBJS += reftable/system.o
1259+
LIB_OBJS += reftable/table.o
1260+
LIB_OBJS += reftable/tree.o
1261+
LIB_OBJS += reftable/writer.o
12511262
LIB_OBJS += remote.o
12521263
LIB_OBJS += repack.o
12531264
LIB_OBJS += repack-cruft.o
@@ -1329,6 +1340,13 @@ LIB_OBJS += write-or-die.o
13291340
LIB_OBJS += ws.o
13301341
LIB_OBJS += wt-status.o
13311342
LIB_OBJS += xdiff-interface.o
1343+
LIB_OBJS += xdiff/xdiffi.o
1344+
LIB_OBJS += xdiff/xemit.o
1345+
LIB_OBJS += xdiff/xhistogram.o
1346+
LIB_OBJS += xdiff/xmerge.o
1347+
LIB_OBJS += xdiff/xpatience.o
1348+
LIB_OBJS += xdiff/xprepare.o
1349+
LIB_OBJS += xdiff/xutils.o
13321350

13331351
BUILTIN_OBJS += builtin/add.o
13341352
BUILTIN_OBJS += builtin/am.o
@@ -2769,31 +2787,6 @@ reconfigure config.mak.autogen: config.status
27692787
.PHONY: reconfigure # This is a convenience target.
27702788
endif
27712789

2772-
XDIFF_OBJS += xdiff/xdiffi.o
2773-
XDIFF_OBJS += xdiff/xemit.o
2774-
XDIFF_OBJS += xdiff/xhistogram.o
2775-
XDIFF_OBJS += xdiff/xmerge.o
2776-
XDIFF_OBJS += xdiff/xpatience.o
2777-
XDIFF_OBJS += xdiff/xprepare.o
2778-
XDIFF_OBJS += xdiff/xutils.o
2779-
.PHONY: xdiff-objs
2780-
xdiff-objs: $(XDIFF_OBJS)
2781-
2782-
REFTABLE_OBJS += reftable/basics.o
2783-
REFTABLE_OBJS += reftable/block.o
2784-
REFTABLE_OBJS += reftable/blocksource.o
2785-
REFTABLE_OBJS += reftable/error.o
2786-
REFTABLE_OBJS += reftable/fsck.o
2787-
REFTABLE_OBJS += reftable/iter.o
2788-
REFTABLE_OBJS += reftable/merged.o
2789-
REFTABLE_OBJS += reftable/pq.o
2790-
REFTABLE_OBJS += reftable/record.o
2791-
REFTABLE_OBJS += reftable/stack.o
2792-
REFTABLE_OBJS += reftable/system.o
2793-
REFTABLE_OBJS += reftable/table.o
2794-
REFTABLE_OBJS += reftable/tree.o
2795-
REFTABLE_OBJS += reftable/writer.o
2796-
27972790
TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))
27982791

27992792
.PHONY: test-objs
@@ -2814,9 +2807,8 @@ OBJECTS += $(GIT_OBJS)
28142807
OBJECTS += $(SCALAR_OBJS)
28152808
OBJECTS += $(PROGRAM_OBJS)
28162809
OBJECTS += $(TEST_OBJS)
2817-
OBJECTS += $(XDIFF_OBJS)
28182810
OBJECTS += $(FUZZ_OBJS)
2819-
OBJECTS += $(REFTABLE_OBJS) $(REFTABLE_TEST_OBJS)
2811+
OBJECTS += $(REFTABLE_TEST_OBJS)
28202812
OBJECTS += $(UNIT_TEST_OBJS)
28212813
OBJECTS += $(CLAR_TEST_OBJS)
28222814
OBJECTS += $(patsubst %,$(UNIT_TEST_DIR)/%.o,$(UNIT_TEST_PROGRAMS))
@@ -2974,12 +2966,6 @@ $(RUST_LIB): Cargo.toml $(RUST_SOURCES)
29742966
.PHONY: rust
29752967
rust: $(RUST_LIB)
29762968

2977-
$(XDIFF_LIB): $(XDIFF_OBJS)
2978-
$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
2979-
2980-
$(REFTABLE_LIB): $(REFTABLE_OBJS)
2981-
$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
2982-
29832969
export DEFAULT_EDITOR DEFAULT_PAGER
29842970

29852971
Documentation/GIT-EXCLUDED-PROGRAMS: FORCE
@@ -3818,7 +3804,7 @@ clean: profile-clean coverage-clean cocciclean
38183804
$(RM) git.rc git.res
38193805
$(RM) $(OBJECTS)
38203806
$(RM) headless-git.o
3821-
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB)
3807+
$(RM) $(LIB_FILE)
38223808
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)
38233809
$(RM) $(TEST_PROGRAMS)
38243810
$(RM) $(FUZZ_PROGRAMS)
@@ -4012,8 +3998,6 @@ endif
40123998

40133999
LIBGIT_PUB_OBJS += contrib/libgit-sys/public_symbol_export.o
40144000
LIBGIT_PUB_OBJS += libgit.a
4015-
LIBGIT_PUB_OBJS += reftable/libreftable.a
4016-
LIBGIT_PUB_OBJS += xdiff/lib.a
40174001

40184002
LIBGIT_PARTIAL_EXPORT = contrib/libgit-sys/partial_symbol_export.o
40194003

0 commit comments

Comments
 (0)