summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorlhchavez <[email protected]>2020-02-23 14:49:04 +0000
committerlhchavez <[email protected]>2020-02-23 14:49:04 +0000
commit627447092fa24035ed3cd4cf31932dbef6f5a57f (patch)
tree48a9122be45522cf1ec72535cec18fd701db55d2 /Makefile
parent03339f731aba66baacab3fd67e7b2d185cdacb33 (diff)
parent06764f48dce903bf95701c6ef75ad0fe46c0dedf (diff)
Merge remote-tracking branch 'upstream/master' into more-annotated-commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile51
1 files changed, 43 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index cf00cef..182c53e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,53 @@
default: test
-test: build-libgit2
+# System library
+# ==============
+# This uses whatever version of libgit2 can be found in the system.
+test:
go run script/check-MakeGitError-thread-lock.go
- go test ./...
+ go test --count=1 ./...
-install: build-libgit2
+install:
go install ./...
-build-libgit2:
+# 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 \
+ go test --count=1 ./...
+
+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:
./script/build-libgit2-static.sh
-install-static: build-libgit2
- go install --tags "static" ./...
+static-build/install/lib/libgit2.a:
+ ./script/build-libgit2-static.sh
-test-static: build-libgit2
+test-static: static-build/install/lib/libgit2.a
go run script/check-MakeGitError-thread-lock.go
- go test --tags "static" ./...
+ go test --count=1 --tags "static" ./...
+
+install-static: static-build/install/lib/libgit2.a
+ go install --tags "static" ./...