summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorlhchavez <[email protected]>2020-02-22 23:07:08 +0000
committerlhchavez <[email protected]>2020-02-22 18:21:38 -0800
commit26edffd5f57618d2927926fde4c4ac1fcba5d84a (patch)
tree94f5e540a09001b7733e3fcfa64da48f00e2e068 /Makefile
parent419bac9075cd0967b09f4e0f9884a1d87298c2e3 (diff)
Update CI configuration
This change: * Updates the GitHub actions so that they run different commands for the dynamic and static flavors of libgit2. * Updates the .travis.yml file so that it does roughly the same as the GitHub actions. * Adds the release-* branches to the CI configurations.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile47
1 files changed, 41 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 4dffce0..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 --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 --count=1 --tags "static" ./...
+
+install-static: static-build/install/lib/libgit2.a
+ go install --tags "static" ./...