aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-12-07 17:55:50 -0500
committerDeterminant <[email protected]>2019-12-07 17:55:50 -0500
commit36e6d45c4a54eb3df7071bbad39143c913738f71 (patch)
tree7557ab0c68d4efb9af8f7b5d85911c52d53b28cf
parent22f7dcda45ed4f7753ac56150d73763857013fea (diff)
-rw-r--r--Makefile6
-rwxr-xr-xscripts/build.sh7
-rw-r--r--setup.sh2
3 files changed, 6 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 243ed40..cb07d1c 100644
--- a/Makefile
+++ b/Makefile
@@ -6,12 +6,8 @@ examples: build/test_msgnet build/test_p2p_stress build/test_msgnet_tls build/be
cdep: build/libsalticidae.a
-build/libsalticidae.a: build
+build/libsalticidae.a:
scripts/build.sh
-
-build:
- mkdir -p build
-
build/test_msgnet: build/libsalticidae.a test_msgnet/main.go
source scripts/env.sh && go build -o $@ github.com/Determinant/salticidae-go/test_msgnet
build/test_msgnet_tls: build/libsalticidae.a test_msgnet_tls/main.go
diff --git a/scripts/build.sh b/scripts/build.sh
index b2df5b9..a08b9b7 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -1,6 +1,6 @@
#!/bin/bash -e
-prefix="${1:-$(pwd)}/build"
+PREFIX="${PREFIX:-$(pwd)/build}"
SRC_DIR="$(dirname "${BASH_SOURCE[0]}")"
source "${SRC_DIR}/env.sh"
@@ -14,8 +14,9 @@ if [[ "$OSTYPE" == "linux-gnu" ]]; then
make -j4
make install
cd -
- rm -f "$prefix/libsalticidae.a"
- ln -sv "$SALTICIDAE_PATH/build/lib/libsalticidae.a" "$prefix/libsalticidae.a"
+ mkdir -p "$PREFIX"
+ rm -f "$PREFIX/libsalticidae.a"
+ ln -sv "$SALTICIDAE_PATH/build/lib/libsalticidae.a" "$PREFIX/libsalticidae.a"
elif [[ "$OSTYPE" == "darwin"* ]]; then
brew install Determinant/salticidae/salticidae
else
diff --git a/setup.sh b/setup.sh
index cac7d45..7acc4ef 100644
--- a/setup.sh
+++ b/setup.sh
@@ -5,7 +5,7 @@ curl -s https://raw.githubusercontent.com/Determinant/salticidae-go/master/scrip
curl -s https://raw.githubusercontent.com/Determinant/salticidae-go/master/scripts/env.sh -o ./env.sh
chmod +x ./build.sh
source ./env.sh
-./build.sh "$SALTICIDAE_GO_PATH"
+./build.sh
cd -
rm -rf "$tmpdir"
unset tmpdir