2020-12-06 08:13:38 -06:00
|
|
|
TEST_ARGS ?= --count=1
|
|
|
|
|
2014-06-03 11:35:09 -05:00
|
|
|
default: test
|
|
|
|
|
2021-11-09 08:48:36 -06:00
|
|
|
|
|
|
|
generate: static-build/install/lib/libgit2.a
|
|
|
|
go generate --tags "static" ./...
|
|
|
|
|
2020-02-22 17:07:08 -06:00
|
|
|
# System library
|
|
|
|
# ==============
|
|
|
|
# This uses whatever version of libgit2 can be found in the system.
|
|
|
|
test:
|
2014-11-18 07:23:22 -06:00
|
|
|
go run script/check-MakeGitError-thread-lock.go
|
2020-12-06 08:13:38 -06:00
|
|
|
go test $(TEST_ARGS) ./...
|
2014-06-03 11:35:09 -05:00
|
|
|
|
2020-02-22 17:07:08 -06:00
|
|
|
install:
|
2015-12-18 18:30:28 -06:00
|
|
|
go install ./...
|
2016-11-19 08:48:39 -06:00
|
|
|
|
2020-02-22 17:07:08 -06:00
|
|
|
# Bundled dynamic library
|
|
|
|
# =======================
|
|
|
|
# In order to avoid having to manipulate `git_dynamic.go`, which would prevent
|
|
|
|
# the system-wide libgit2.so from being used in a sort of ergonomic way, this
|
|
|
|
# instead moves the complexity of overriding the paths so that the built
|
|
|
|
# libraries can be found by the build and tests.
|
|
|
|
.PHONY: build-libgit2-dynamic
|
|
|
|
build-libgit2-dynamic:
|
|
|
|
./script/build-libgit2-dynamic.sh
|
|
|
|
|
|
|
|
dynamic-build/install/lib/libgit2.so:
|
|
|
|
./script/build-libgit2-dynamic.sh
|
|
|
|
|
|
|
|
test-dynamic: dynamic-build/install/lib/libgit2.so
|
|
|
|
PKG_CONFIG_PATH=dynamic-build/install/lib/pkgconfig \
|
|
|
|
go run script/check-MakeGitError-thread-lock.go
|
|
|
|
PKG_CONFIG_PATH=dynamic-build/install/lib/pkgconfig \
|
|
|
|
LD_LIBRARY_PATH=dynamic-build/install/lib \
|
2020-12-06 08:13:38 -06:00
|
|
|
go test $(TEST_ARGS) ./...
|
2020-02-22 17:07:08 -06:00
|
|
|
|
|
|
|
install-dynamic: dynamic-build/install/lib/libgit2.so
|
|
|
|
PKG_CONFIG_PATH=dynamic-build/install/lib/pkgconfig \
|
|
|
|
go install ./...
|
|
|
|
|
|
|
|
# Bundled static library
|
|
|
|
# ======================
|
|
|
|
# This is mostly used in tests, but can also be used to provide a
|
|
|
|
# statically-linked library with the bundled version of libgit2.
|
|
|
|
.PHONY: build-libgit2-static
|
|
|
|
build-libgit2-static:
|
2016-11-19 08:48:39 -06:00
|
|
|
./script/build-libgit2-static.sh
|
|
|
|
|
2020-02-22 17:07:08 -06:00
|
|
|
static-build/install/lib/libgit2.a:
|
|
|
|
./script/build-libgit2-static.sh
|
2016-11-19 08:48:39 -06:00
|
|
|
|
2020-02-22 17:07:08 -06:00
|
|
|
test-static: static-build/install/lib/libgit2.a
|
2017-07-08 11:24:41 -05:00
|
|
|
go run script/check-MakeGitError-thread-lock.go
|
2020-12-06 08:13:38 -06:00
|
|
|
go test --tags "static" $(TEST_ARGS) ./...
|
2020-02-22 17:07:08 -06:00
|
|
|
|
|
|
|
install-static: static-build/install/lib/libgit2.a
|
|
|
|
go install --tags "static" ./...
|