summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtools/configure49
1 files changed, 33 insertions, 16 deletions
diff --git a/tools/configure b/tools/configure
index 282b625b9b..5f08c658f6 100755
--- a/tools/configure
+++ b/tools/configure
@@ -9,6 +9,7 @@
9# 9#
10 10
11target=$1 11target=$1
12debug=$2
12 13
13input() { 14input() {
14 read response 15 read response
@@ -19,6 +20,17 @@ echo "Setup your Rockbox build environment."
19echo "http://bjorn.haxx.se/rockbox/" 20echo "http://bjorn.haxx.se/rockbox/"
20echo "" 21echo ""
21 22
23if [ "$target" = "update" ]; then
24 target=""
25 if [ -f Makefile ]; then
26 if { grep "^## Auto" Makefile >/dev/null 2>&1 ; } then
27 echo "Existing generated Makefile found. Getting defaults from it."
28 target=`grep "^TARGET=" Makefile | cut -d= -f2-`
29 debug=`grep "^DEBUG=" Makefile | cut -d= -f2-`
30 fi
31 fi
32fi
33
22if [ -z "$target" ]; then 34if [ -z "$target" ]; then
23 35
24################################################################## 36##################################################################
@@ -53,23 +65,26 @@ if [ -z "$target" ]; then
53fi 65fi
54 66
55 67
56################################################################## 68if [ -z "$debug" ]; then
57# Figure out debug on/off 69 ##################################################################
58# 70 # Figure out debug on/off
59echo "" 71 #
60echo "Build DEBUG version? (y/N)" 72 echo ""
73 echo "Build DEBUG version? (y/N)"
61 74
62option=`input`; 75 option=`input`;
63 76
64case $option in 77 case $option in
65 [Yy]) 78 [Yy])
66 debug="DEBUG=1" 79 debug="DEBUG=1"
67 ;; 80 ;;
68 *) 81 *)
69 debug="" 82 debug=""
70 ;; 83 ;;
84
85 esac
86fi
71 87
72esac
73 88
74################################################################## 89##################################################################
75# Figure out where the firmware code is! 90# Figure out where the firmware code is!
@@ -120,6 +135,8 @@ sed > Makefile \
120 -e "s,@TARGET@,${target},g" \ 135 -e "s,@TARGET@,${target},g" \
121 -e "s,@PWD@,${pwd},g" \ 136 -e "s,@PWD@,${pwd},g" \
122<<EOF 137<<EOF
138## Automaticly generated. http://bjorn.haxx.se/rockbox/
139
123FIRMDIR=@FIRMDIR@ 140FIRMDIR=@FIRMDIR@
124APPSDIR=@APPSDIR@ 141APPSDIR=@APPSDIR@
125DEBUG=@DEBUG@ 142DEBUG=@DEBUG@
@@ -127,8 +144,8 @@ TARGET=@TARGET@
127THISDIR="@PWD@" 144THISDIR="@PWD@"
128 145
129all: 146all:
130 make -C \$(FIRMDIR) TARGET=\$(TARGET) $(DEBUG) OBJDIR=\$(THISDIR) 147 make -C \$(FIRMDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR)
131 make -C \$(APPSDIR) TARGET=\$(TARGET) $(DEBUG) OBJDIR=\$(THISDIR) 148 make -C \$(APPSDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR)
132 149
133EOF 150EOF
134 151