summaryrefslogtreecommitdiff
path: root/src/navigation/rebuild_all.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/navigation/rebuild_all.sh')
-rwxr-xr-xsrc/navigation/rebuild_all.sh35
1 files changed, 30 insertions, 5 deletions
diff --git a/src/navigation/rebuild_all.sh b/src/navigation/rebuild_all.sh
index a1c5bde..06c2249 100755
--- a/src/navigation/rebuild_all.sh
+++ b/src/navigation/rebuild_all.sh
@@ -1,9 +1,28 @@
#!/bin/bash
-echo 'clean up the build folder'
-if [ -d "./build" ]
+clean=0
+
+while getopts c opt
+do
+ case $opt in
+ c)
+ clean=1
+ ;;
+ \?)
+ echo "Usage:"
+ echo "$0 [-c ]"
+ echo "-c: Rebuild with clean"
+ exit 1
+ esac
+done
+
+if [ "$clean" = 1 ]
then
- find ./build ! -name '*.cbp' -type f -exec rm -f {} +
+ echo 'clean up the build folder'
+ if [ -d "./build" ]
+ then
+ find ./build ! -name '*.cbp' -type f -exec rm -f {} +
+ fi
fi
mkdir -p build
@@ -13,11 +32,17 @@ cd navit
mkdir -p navit
cd navit
echo 'build navit'
-cmake -DDISABLE_QT=1 -DSAMPLE_MAP=0 -Dvehicle/null=1 -Dgraphics/qt_qpainter=0 ../../../navit/navit/
+if [ "$clean" = 1 ]
+then
+ cmake -DDISABLE_QT=1 -DSAMPLE_MAP=0 -Dvehicle/null=1 -Dgraphics/qt_qpainter=0 ../../../navit/navit/
+fi
make
cd ../../
echo 'build navigation'
-cmake ../
+if [ "$clean" = 1 ]
+then
+ cmake ../
+fi
make
cd ..