aboutsummaryrefslogtreecommitdiff
path: root/scripts/build.sh
blob: a08b9b7d927c0baae934ef9ec00986fcc7faf7f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash -e

PREFIX="${PREFIX:-$(pwd)/build}"
SRC_DIR="$(dirname "${BASH_SOURCE[0]}")"

source "${SRC_DIR}/env.sh"

if [[ "$OSTYPE" == "linux-gnu" ]]; then
    go get -u -d "github.com/$SALTICIDAE_ORG/salticidae-go"
    cd "$SALTICIDAE_GO_PATH"
    git submodule update --init --recursive
    cd "$SALTICIDAE_PATH"
    cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$SALTICIDAE_PATH/build" .
    make -j4
    make install
    cd -
    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
    echo "Your system is not supported yet."
    exit 1
fi