Move some logic into the Makefile
This should provide a nice compromise between the scripts and comon commands.
This commit is contained in:
parent
29a983b68f
commit
0646294282
|
@ -0,0 +1,15 @@
|
||||||
|
default: test
|
||||||
|
|
||||||
|
build-libgit2:
|
||||||
|
./script/build-libgit2-static.sh
|
||||||
|
|
||||||
|
update-libgit2:
|
||||||
|
cd vendor/libgit2 && \
|
||||||
|
git fetch origin development && \
|
||||||
|
git checkout -qf FETCH_HEAD
|
||||||
|
|
||||||
|
test: build-libgit2
|
||||||
|
./script/with-static.sh go test ./...
|
||||||
|
|
||||||
|
install: build-libgit2
|
||||||
|
./script/with-static.sh go install ./...
|
|
@ -2,21 +2,19 @@
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
VENDORED_PATH=vendor/libgit2
|
||||||
|
|
||||||
# Make sure we have the latest libgit2
|
# Make sure we have the latest libgit2
|
||||||
if [ -d libgit2 ]; then
|
if [ ! -d $VENDORED_PATH ]; then
|
||||||
cd libgit2
|
git clone --depth 1 --single-branch git://github.com/libgit2/libgit2 $VENDORED_PATH
|
||||||
git fetch origin development
|
|
||||||
git checkout FETCH_HEAD
|
|
||||||
cd ..
|
|
||||||
else
|
|
||||||
git clone --depth 1 --single-branch git://github.com/libgit2/libgit2 libgit2
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd libgit2
|
cd $VENDORED_PATH
|
||||||
|
|
||||||
cmake -DTHREADSAFE=ON \
|
cmake -DTHREADSAFE=ON \
|
||||||
-DBUILD_CLAR=OFF \
|
-DBUILD_CLAR=OFF \
|
||||||
-DBUILD_SHARED_LIBS=OFF \
|
-DBUILD_SHARED_LIBS=OFF \
|
||||||
-DCMAKE_INSTALL_PREFIX=$PWD/install \
|
-DCMAKE_INSTALL_PREFIX=../install \
|
||||||
.
|
.
|
||||||
|
|
||||||
make install
|
make install
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
git clone --depth 1 --single-branch git://github.com/libgit2/libgit2 libgit2
|
|
||||||
|
|
||||||
cd libgit2
|
|
||||||
cmake -DTHREADSAFE=ON \
|
|
||||||
-DBUILD_CLAR=OFF \
|
|
||||||
-DCMAKE_INSTALL_PREFIX=$PWD/install \
|
|
||||||
.
|
|
||||||
|
|
||||||
make install
|
|
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
export LIBGIT2_LOCATION=$PWD/libgit2/install
|
export INSTALL_LOCATION=$PWD/vendor/install
|
||||||
export PKG_CONFIG_PATH=$LIBGIT2_LOCATION/lib/pkgconfig
|
export PKG_CONFIG_PATH=$INSTALL_LOCATION/lib/pkgconfig
|
||||||
export LIBGIT2_A=$LIBGIT2_LOCATION/lib/libgit2.a
|
|
||||||
export CGO_LDFLAGS="$LIBGIT2_A $(pkg-config --static --libs libgit2)"
|
|
||||||
|
|
||||||
$@
|
$@
|
||||||
|
|
Loading…
Reference in New Issue