make the build alias accept environment variables, add information about them to the README

BodgeMaster-unfinished
BodgeMaster 2022-06-27 09:01:52 +02:00
parent 5b5f876cad
commit 1cc0cc5e12
2 changed files with 9 additions and 1 deletions

View File

@ -52,3 +52,5 @@ point to `bin/lib`.
To build the project, just use the `build` alias or invoke the `build.sh` To build the project, just use the `build` alias or invoke the `build.sh`
script from the project's base directory. script from the project's base directory.
`build` and `build.sh` accept the environment variables `CXX` and `CXXFLAGS`. `CXXFLAGS` must at least specify the C++ version.

View File

@ -1,10 +1,16 @@
PROJECT_BASE_DIR="$( cd -- "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 ; pwd -P )" PROJECT_BASE_DIR="$( cd -- "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 ; pwd -P )"
alias build="pushd \"$PROJECT_BASE_DIR\" >/dev/null 2>&1; scripts/build.sh; popd >/dev/null 2>&1"
alias clean="pushd \"$PROJECT_BASE_DIR\" >/dev/null 2>&1; scripts/clean.sh; popd >/dev/null 2>&1" alias clean="pushd \"$PROJECT_BASE_DIR\" >/dev/null 2>&1; scripts/clean.sh; popd >/dev/null 2>&1"
alias clean_dependencies="pushd \"$PROJECT_BASE_DIR\" >/dev/null 2>&1; scripts/clean_dependencies.sh; popd >/dev/null 2>&1" alias clean_dependencies="pushd \"$PROJECT_BASE_DIR\" >/dev/null 2>&1; scripts/clean_dependencies.sh; popd >/dev/null 2>&1"
alias setup_project="pushd \"$PROJECT_BASE_DIR\" >/dev/null 2>&1; scripts/setup_project.sh; popd >/dev/null 2>&1" alias setup_project="pushd \"$PROJECT_BASE_DIR\" >/dev/null 2>&1; scripts/setup_project.sh; popd >/dev/null 2>&1"
function build {
pushd "$PROJECT_BASE_DIR" >/dev/null 2>&1
CXX="$CXX" CXXFLAGS="$CXXFLAGS" scripts/build.sh
popd >/dev/null 2>&1
}
if [ -z "$LD_LIBRARY_PATH" ]; then if [ -z "$LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH="$PROJECT_BASE_DIR"/bin/lib export LD_LIBRARY_PATH="$PROJECT_BASE_DIR"/bin/lib
else else