From 670965876893d9e5a0dbe7b9392622ac6977e38f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 23 May 2002 10:10:44 +0000 Subject: escape $ properly, added 'update' support git-svn-id: svn://svn.rockbox.org/rockbox/trunk@662 a1c6a512-1295-4272-9138-f99709370657 --- tools/configure | 49 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/tools/configure b/tools/configure index 282b625..5f08c65 100755 --- a/tools/configure +++ b/tools/configure @@ -9,6 +9,7 @@ # target=$1 +debug=$2 input() { read response @@ -19,6 +20,17 @@ echo "Setup your Rockbox build environment." echo "http://bjorn.haxx.se/rockbox/" echo "" +if [ "$target" = "update" ]; then + target="" + if [ -f Makefile ]; then + if { grep "^## Auto" Makefile >/dev/null 2>&1 ; } then + echo "Existing generated Makefile found. Getting defaults from it." + target=`grep "^TARGET=" Makefile | cut -d= -f2-` + debug=`grep "^DEBUG=" Makefile | cut -d= -f2-` + fi + fi +fi + if [ -z "$target" ]; then ################################################################## @@ -53,23 +65,26 @@ if [ -z "$target" ]; then fi -################################################################## -# Figure out debug on/off -# -echo "" -echo "Build DEBUG version? (y/N)" +if [ -z "$debug" ]; then + ################################################################## + # Figure out debug on/off + # + echo "" + echo "Build DEBUG version? (y/N)" -option=`input`; + option=`input`; -case $option in - [Yy]) - debug="DEBUG=1" - ;; - *) - debug="" - ;; + case $option in + [Yy]) + debug="DEBUG=1" + ;; + *) + debug="" + ;; + + esac +fi -esac ################################################################## # Figure out where the firmware code is! @@ -120,6 +135,8 @@ sed > Makefile \ -e "s,@TARGET@,${target},g" \ -e "s,@PWD@,${pwd},g" \ <