From 36e6d45c4a54eb3df7071bbad39143c913738f71 Mon Sep 17 00:00:00 2001 From: Determinant Date: Sat, 7 Dec 2019 17:55:50 -0500 Subject: ... --- Makefile | 6 +----- scripts/build.sh | 7 ++++--- setup.sh | 2 +- 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 -- cgit v1.2.3-70-g09d2