Skip to content

Commit 76f1fea

Browse files
calvin-wan-googlegitster
authored andcommitted
Makefile: add option to build and test libgit-rs and libgit-rs-sys
Add libgitrs, libgitrs-sys, libgitrs-test, and libgitrs-sys-test targets to their respective Makefiles so they can be built and tested without having to run cargo build/test. Add environment variable, INCLUDE_LIBGIT_RS, that when set, automatically builds and tests libgit-rs and libgit-rs-sys when `make all` is ran. Signed-off-by: Calvin Wan <[email protected]> Signed-off-by: Josh Steadmon <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e6b7507 commit 76f1fea

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3870,6 +3870,22 @@ build-unit-tests: $(UNIT_TEST_PROGS)
38703870
unit-tests: $(UNIT_TEST_PROGS) t/helper/test-tool$X
38713871
$(MAKE) -C t/ unit-tests
38723872

3873+
.PHONY: libgitrs-sys
3874+
libgitrs-sys:
3875+
$(QUIET)(\
3876+
cd contrib/libgit-rs/libgit-sys && \
3877+
cargo build \
3878+
)
3879+
.PHONY: libgitrs
3880+
libgitrs:
3881+
$(QUIET)(\
3882+
cd contrib/libgit-rs && \
3883+
cargo build \
3884+
)
3885+
ifdef INCLUDE_LIBGIT_RS
3886+
all:: libgitrs
3887+
endif
3888+
38733889
contrib/libgit-rs/libgit-sys/partial_symbol_export.o: contrib/libgit-rs/libgit-sys/public_symbol_export.o libgit.a reftable/libreftable.a xdiff/lib.a
38743890
$(LD) -r $^ -o $@
38753891

t/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,19 @@ perf:
169169

170170
.PHONY: pre-clean $(T) aggregate-results clean valgrind perf \
171171
check-chainlint clean-chainlint test-chainlint $(UNIT_TESTS)
172+
173+
.PHONY: libgitrs-sys-test
174+
libgitrs-sys-test:
175+
$(QUIET)(\
176+
cd ../contrib/libgit-rs/libgit-sys && \
177+
cargo test \
178+
)
179+
.PHONY: libgitrs-test
180+
libgitrs-test:
181+
$(QUIET)(\
182+
cd ../contrib/libgit-rs && \
183+
cargo test \
184+
)
185+
ifdef INCLUDE_LIBGIT_RS
186+
all:: libgitrs-sys-test libgitrs-test
187+
endif

0 commit comments

Comments
 (0)