Skip to content

Commit 282a968

Browse files
committed
Merge branch 'en/make-libgit-a'
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 4253630 + f3b4c89 commit 282a968

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 += replace-object.o
12531264
LIB_OBJS += repo-settings.o
@@ -1322,6 +1333,13 @@ LIB_OBJS += write-or-die.o
13221333
LIB_OBJS += ws.o
13231334
LIB_OBJS += wt-status.o
13241335
LIB_OBJS += xdiff-interface.o
1336+
LIB_OBJS += xdiff/xdiffi.o
1337+
LIB_OBJS += xdiff/xemit.o
1338+
LIB_OBJS += xdiff/xhistogram.o
1339+
LIB_OBJS += xdiff/xmerge.o
1340+
LIB_OBJS += xdiff/xpatience.o
1341+
LIB_OBJS += xdiff/xprepare.o
1342+
LIB_OBJS += xdiff/xutils.o
13251343

13261344
BUILTIN_OBJS += builtin/add.o
13271345
BUILTIN_OBJS += builtin/am.o
@@ -2756,31 +2774,6 @@ reconfigure config.mak.autogen: config.status
27562774
.PHONY: reconfigure # This is a convenience target.
27572775
endif
27582776

2759-
XDIFF_OBJS += xdiff/xdiffi.o
2760-
XDIFF_OBJS += xdiff/xemit.o
2761-
XDIFF_OBJS += xdiff/xhistogram.o
2762-
XDIFF_OBJS += xdiff/xmerge.o
2763-
XDIFF_OBJS += xdiff/xpatience.o
2764-
XDIFF_OBJS += xdiff/xprepare.o
2765-
XDIFF_OBJS += xdiff/xutils.o
2766-
.PHONY: xdiff-objs
2767-
xdiff-objs: $(XDIFF_OBJS)
2768-
2769-
REFTABLE_OBJS += reftable/basics.o
2770-
REFTABLE_OBJS += reftable/block.o
2771-
REFTABLE_OBJS += reftable/blocksource.o
2772-
REFTABLE_OBJS += reftable/error.o
2773-
REFTABLE_OBJS += reftable/fsck.o
2774-
REFTABLE_OBJS += reftable/iter.o
2775-
REFTABLE_OBJS += reftable/merged.o
2776-
REFTABLE_OBJS += reftable/pq.o
2777-
REFTABLE_OBJS += reftable/record.o
2778-
REFTABLE_OBJS += reftable/stack.o
2779-
REFTABLE_OBJS += reftable/system.o
2780-
REFTABLE_OBJS += reftable/table.o
2781-
REFTABLE_OBJS += reftable/tree.o
2782-
REFTABLE_OBJS += reftable/writer.o
2783-
27842777
TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))
27852778

27862779
.PHONY: test-objs
@@ -2801,9 +2794,8 @@ OBJECTS += $(GIT_OBJS)
28012794
OBJECTS += $(SCALAR_OBJS)
28022795
OBJECTS += $(PROGRAM_OBJS)
28032796
OBJECTS += $(TEST_OBJS)
2804-
OBJECTS += $(XDIFF_OBJS)
28052797
OBJECTS += $(FUZZ_OBJS)
2806-
OBJECTS += $(REFTABLE_OBJS) $(REFTABLE_TEST_OBJS)
2798+
OBJECTS += $(REFTABLE_TEST_OBJS)
28072799
OBJECTS += $(UNIT_TEST_OBJS)
28082800
OBJECTS += $(CLAR_TEST_OBJS)
28092801
OBJECTS += $(patsubst %,$(UNIT_TEST_DIR)/%.o,$(UNIT_TEST_PROGRAMS))
@@ -2961,12 +2953,6 @@ $(RUST_LIB): Cargo.toml $(RUST_SOURCES)
29612953
.PHONY: rust
29622954
rust: $(RUST_LIB)
29632955

2964-
$(XDIFF_LIB): $(XDIFF_OBJS)
2965-
$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
2966-
2967-
$(REFTABLE_LIB): $(REFTABLE_OBJS)
2968-
$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
2969-
29702956
export DEFAULT_EDITOR DEFAULT_PAGER
29712957

29722958
Documentation/GIT-EXCLUDED-PROGRAMS: FORCE
@@ -3805,7 +3791,7 @@ clean: profile-clean coverage-clean cocciclean
38053791
$(RM) git.rc git.res
38063792
$(RM) $(OBJECTS)
38073793
$(RM) headless-git.o
3808-
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB)
3794+
$(RM) $(LIB_FILE)
38093795
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)
38103796
$(RM) $(TEST_PROGRAMS)
38113797
$(RM) $(FUZZ_PROGRAMS)
@@ -3999,8 +3985,6 @@ endif
39993985

40003986
LIBGIT_PUB_OBJS += contrib/libgit-sys/public_symbol_export.o
40013987
LIBGIT_PUB_OBJS += libgit.a
4002-
LIBGIT_PUB_OBJS += reftable/libreftable.a
4003-
LIBGIT_PUB_OBJS += xdiff/lib.a
40043988

40053989
LIBGIT_PARTIAL_EXPORT = contrib/libgit-sys/partial_symbol_export.o
40063990

0 commit comments

Comments
 (0)