From c8e1ba69ad3ce0296418a216e9f36e2cf1b58c98 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Fri, 23 Aug 2013 14:28:41 +0200 Subject: [PATCH] Addition of a small script to easily rebuild all targets --- rebuildall.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 rebuildall.sh diff --git a/rebuildall.sh b/rebuildall.sh new file mode 100755 index 0000000..d12da51 --- /dev/null +++ b/rebuildall.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +function cd { + if (("$#" > 0)); then + if [ "$1" == "-" ]; then + popd &> /dev/null + return $? + else + pushd "$@" &> /dev/null + return $? + fi + else + cd $HOME + return $? + fi +} + +for z in Debug Release Final +do + cd $z + retCode=$? + if [ $retCode != 0 ]; then + mkdir $z && cd $z + retCode=$? + fi + + if [ $retCode == 0 ]; then + rm -rf * + cmake ../../ -DCMAKE_BUILD_TYPE=$z + make -j2 + cd .. + fi +done