diff --git a/build.sh b/scripts/build.sh similarity index 98% rename from build.sh rename to scripts/build.sh index d5941b1..a794283 100755 --- a/build.sh +++ b/scripts/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ -z "$CXX" ]; then CXX="c++" diff --git a/clean.sh b/scripts/clean.sh similarity index 76% rename from clean.sh rename to scripts/clean.sh index 14d5399..17cbae8 100755 --- a/clean.sh +++ b/scripts/clean.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + rm -rv ./bin mkdir -v ./bin set -v diff --git a/scripts/clean_dependencies.sh b/scripts/clean_dependencies.sh new file mode 100755 index 0000000..e69de29 diff --git a/scripts/setup_project.sh b/scripts/setup_project.sh new file mode 100755 index 0000000..e69de29 diff --git a/setupenv.bashrc b/setupenv.bashrc new file mode 100644 index 0000000..a652a50 --- /dev/null +++ b/setupenv.bashrc @@ -0,0 +1,14 @@ +PROJECT_BASE_DIR="$( cd -- "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 ; pwd -P )" + +alias build="pushd \"$PROJECT_BASE_DIR\"; scripts/build.sh; popd" +alias clean="pushd \"$PROJECT_BASE_DIR\"; scripts/clean.sh; popd" +alias clean_dependencies="pushd \"$PROJECT_BASE_DIR\"; scripts/clean_dependencies.sh; popd" +alias setup_project="pushd \"$PROJECT_BASE_DIR\"; scripts/setup_project.sh; popd" + +if [ -z "$LD_LIBRARY_PATH" ]; then + export LD_LIBRARY_PATH="$PROJECT_BASE_DIR"/bin/lib +else + export LD_LIBRARY_PATH="$PROJECT_BASE_DIR"/bin/lib:"LD_LIBRARY_PATH" +fi + +unset PROJECT_BASE_DIR