From a80a6a26d8e11429883112f6dba3bdc7be96f479 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Mon, 27 Jun 2022 07:35:04 +0200 Subject: [PATCH] add more scripts and move them to a new scripts directory, also add a shell environment to make dealing with this project more convenient --- build.sh => scripts/build.sh | 2 +- clean.sh => scripts/clean.sh | 2 ++ scripts/clean_dependencies.sh | 0 scripts/setup_project.sh | 0 setupenv.bashrc | 14 ++++++++++++++ 5 files changed, 17 insertions(+), 1 deletion(-) rename build.sh => scripts/build.sh (98%) rename clean.sh => scripts/clean.sh (76%) create mode 100755 scripts/clean_dependencies.sh create mode 100755 scripts/setup_project.sh create mode 100644 setupenv.bashrc 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