diff options
-rwxr-xr-x | tools/configure | 49 |
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 | ||
11 | target=$1 | 11 | target=$1 |
12 | debug=$2 | ||
12 | 13 | ||
13 | input() { | 14 | input() { |
14 | read response | 15 | read response |
@@ -19,6 +20,17 @@ echo "Setup your Rockbox build environment." | |||
19 | echo "http://bjorn.haxx.se/rockbox/" | 20 | echo "http://bjorn.haxx.se/rockbox/" |
20 | echo "" | 21 | echo "" |
21 | 22 | ||
23 | if [ "$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 | ||
32 | fi | ||
33 | |||
22 | if [ -z "$target" ]; then | 34 | if [ -z "$target" ]; then |
23 | 35 | ||
24 | ################################################################## | 36 | ################################################################## |
@@ -53,23 +65,26 @@ if [ -z "$target" ]; then | |||
53 | fi | 65 | fi |
54 | 66 | ||
55 | 67 | ||
56 | ################################################################## | 68 | if [ -z "$debug" ]; then |
57 | # Figure out debug on/off | 69 | ################################################################## |
58 | # | 70 | # Figure out debug on/off |
59 | echo "" | 71 | # |
60 | echo "Build DEBUG version? (y/N)" | 72 | echo "" |
73 | echo "Build DEBUG version? (y/N)" | ||
61 | 74 | ||
62 | option=`input`; | 75 | option=`input`; |
63 | 76 | ||
64 | case $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 | ||
86 | fi | ||
71 | 87 | ||
72 | esac | ||
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 | |||
123 | FIRMDIR=@FIRMDIR@ | 140 | FIRMDIR=@FIRMDIR@ |
124 | APPSDIR=@APPSDIR@ | 141 | APPSDIR=@APPSDIR@ |
125 | DEBUG=@DEBUG@ | 142 | DEBUG=@DEBUG@ |
@@ -127,8 +144,8 @@ TARGET=@TARGET@ | |||
127 | THISDIR="@PWD@" | 144 | THISDIR="@PWD@" |
128 | 145 | ||
129 | all: | 146 | all: |
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 | ||
133 | EOF | 150 | EOF |
134 | 151 | ||