Daniel Stenberg | 3aacd2e | 2002-05-23 09:11:35 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # __________ __ ___. |
| 3 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | # \/ \/ \/ \/ \/ |
| 8 | # $Id$ |
| 9 | # |
| 10 | |
Daniel Stenberg | 235b50b | 2004-10-04 13:02:41 +0000 | [diff] [blame] | 11 | # global CC options for all platforms |
| 12 | CCOPTS="-W -Wall -O -nostdlib -ffreestanding -Wstrict-prototypes" |
Daniel Stenberg | 3aacd2e | 2002-05-23 09:11:35 +0000 | [diff] [blame] | 13 | |
Robert Hak | c3320ae | 2002-10-17 09:08:05 +0000 | [diff] [blame] | 14 | # |
| 15 | # Begin Function Definitions |
| 16 | # |
Daniel Stenberg | 3aacd2e | 2002-05-23 09:11:35 +0000 | [diff] [blame] | 17 | input() { |
| 18 | read response |
| 19 | echo $response |
| 20 | } |
| 21 | |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 22 | shcc () { |
| 23 | CC=sh-elf-gcc |
| 24 | LD=sh-elf-ld |
| 25 | AR=sh-elf-ar |
| 26 | AS=sh-elf-as |
| 27 | OC=sh-elf-objcopy |
Daniel Stenberg | 235b50b | 2004-10-04 13:02:41 +0000 | [diff] [blame] | 28 | GCCOPTS="$CCOPTS -m1" |
Linus Nielsen Feltzing | c21e7e7 | 2004-10-07 07:08:57 +0000 | [diff] [blame] | 29 | GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 30 | } |
| 31 | |
Daniel Stenberg | 72fdf37 | 2005-01-04 15:00:06 +0000 | [diff] [blame] | 32 | calmrisccc () { |
| 33 | CC=calmrisc16-unknown-elf-gcc |
| 34 | LD=calmrisc16-unknown-elf-ld |
| 35 | AR=calmrisc16-unknown-elf-ar |
| 36 | AS=calmrisc16-unknown-elf-as |
| 37 | OC=calmrisc16-unknown-elf-objcopy |
Daniel Stenberg | 11f6988 | 2005-01-09 23:02:39 +0000 | [diff] [blame] | 38 | GCCOPTS="$CCOPTS" |
Daniel Stenberg | 72fdf37 | 2005-01-04 15:00:06 +0000 | [diff] [blame] | 39 | GCCOPTIMIZE="-fomit-frame-pointer" |
| 40 | } |
| 41 | |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 42 | coldfirecc () { |
| 43 | CC=m68k-elf-gcc |
| 44 | LD=m68k-elf-ld |
| 45 | AR=m68k-elf-ar |
| 46 | AS=m68k-elf-as |
| 47 | OC=m68k-elf-objcopy |
Linus Nielsen Feltzing | bb4872e | 2004-11-19 00:44:07 +0000 | [diff] [blame] | 48 | GCCOPTS="$CCOPTS -g -m5200 -Wa\,-m5249" |
Linus Nielsen Feltzing | c21e7e7 | 2004-10-07 07:08:57 +0000 | [diff] [blame] | 49 | GCCOPTIMIZE="-fomit-frame-pointer" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 50 | } |
| 51 | |
Robert Hak | 672b0e2 | 2002-10-17 09:19:34 +0000 | [diff] [blame] | 52 | whichsim () { |
Daniel Stenberg | 60fe9df | 2002-08-02 12:06:07 +0000 | [diff] [blame] | 53 | |
| 54 | if [ -z "$simver" ]; then |
| 55 | |
| 56 | ################################################################## |
| 57 | # Figure out win32/x11 GUI |
| 58 | # |
| 59 | echo "" |
| 60 | echo "Build (W)in32 or (X)11 GUI version? (X)" |
| 61 | |
| 62 | option=`input`; |
| 63 | |
| 64 | case $option in |
| 65 | [Ww]) |
| 66 | simver="win32" |
| 67 | ;; |
| 68 | *) |
| 69 | simver="x11" |
| 70 | ;; |
| 71 | esac |
Daniel Stenberg | ea9c5bb | 2003-02-26 09:13:47 +0000 | [diff] [blame] | 72 | echo "Selected $simver simulator" |
Daniel Stenberg | 60fe9df | 2002-08-02 12:06:07 +0000 | [diff] [blame] | 73 | fi |
Robert Hak | 672b0e2 | 2002-10-17 09:19:34 +0000 | [diff] [blame] | 74 | } |
| 75 | |
| 76 | |
| 77 | simul () { |
Daniel Stenberg | 60fe9df | 2002-08-02 12:06:07 +0000 | [diff] [blame] | 78 | |
Daniel Stenberg | 58f4d0d | 2002-05-31 07:22:38 +0000 | [diff] [blame] | 79 | sed > Makefile \ |
Daniel Stenberg | 5c9c16f | 2004-05-26 11:07:16 +0000 | [diff] [blame] | 80 | -e "s,@ROOTDIR@,${rootdir},g" \ |
Daniel Stenberg | f092920 | 2003-01-16 14:37:30 +0000 | [diff] [blame] | 81 | -e "s,@ARCHOS@,${archos},g" \ |
Daniel Stenberg | 58f4d0d | 2002-05-31 07:22:38 +0000 | [diff] [blame] | 82 | -e "s,@DEBUG@,${debug},g" \ |
Daniel Stenberg | 58f4d0d | 2002-05-31 07:22:38 +0000 | [diff] [blame] | 83 | -e "s,@KEYPAD@,${keypad},g" \ |
| 84 | -e "s,@PWD@,${pwd},g" \ |
Daniel Stenberg | ebe963d | 2002-09-20 06:38:38 +0000 | [diff] [blame] | 85 | -e "s,@LANGUAGE@,${language},g" \ |
Daniel Stenberg | f69c703 | 2004-06-14 15:05:58 +0000 | [diff] [blame] | 86 | -e "s,@TARGET@,${target},g" \ |
Daniel Stenberg | c9d41b4 | 2004-11-24 16:45:08 +0000 | [diff] [blame] | 87 | -e "s,@PLUGINS@,${plugins},g" \ |
Daniel Stenberg | 60fe9df | 2002-08-02 12:06:07 +0000 | [diff] [blame] | 88 | -e "s,@SIMVER@,${simver},g" \ |
Daniel Stenberg | 58f4d0d | 2002-05-31 07:22:38 +0000 | [diff] [blame] | 89 | <<EOF |
Björn Stenberg | cd22573 | 2002-08-11 09:17:47 +0000 | [diff] [blame] | 90 | ## Automaticly generated. http://rockbox.haxx.se |
Daniel Stenberg | 58f4d0d | 2002-05-31 07:22:38 +0000 | [diff] [blame] | 91 | |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 92 | export ARCHOS=@ARCHOS@ |
| 93 | export ROOTDIR=@ROOTDIR@ |
| 94 | export FIRMDIR=\$(ROOTDIR)/firmware |
| 95 | export APPSDIR=\$(ROOTDIR)/apps |
| 96 | export TOOLSDIR=\$(ROOTDIR)/tools |
| 97 | export DOCSDIR=\$(ROOTDIR)/docs |
| 98 | export APPSDIR=@ROOTDIR@/apps |
| 99 | export SIMDIR=\$(ROOTDIR)/uisimulator/@SIMVER@ |
| 100 | export DEBUG=@DEBUG@ |
| 101 | export KEYPAD=@KEYPAD@ |
| 102 | export OBJDIR=@PWD@ |
| 103 | export SIMVER=@SIMVER@ |
| 104 | export TARGET=@TARGET@ |
| 105 | export LANGUAGE=@LANGUAGE@ |
| 106 | export VERSION=\$(shell date +%y%m%d-%H%M) |
Daniel Stenberg | c9d41b4 | 2004-11-24 16:45:08 +0000 | [diff] [blame] | 107 | export ENABLEDPLUGINS=@PLUGINS@ |
Daniel Stenberg | 58f4d0d | 2002-05-31 07:22:38 +0000 | [diff] [blame] | 108 | |
Linus Nielsen Feltzing | e53bdf0 | 2002-07-26 14:13:03 +0000 | [diff] [blame] | 109 | .PHONY: |
Daniel Stenberg | 58f4d0d | 2002-05-31 07:22:38 +0000 | [diff] [blame] | 110 | |
| 111 | all: sim |
| 112 | |
| 113 | sim: |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 114 | \$(MAKE) -C \$(SIMDIR) |
Daniel Stenberg | 58f4d0d | 2002-05-31 07:22:38 +0000 | [diff] [blame] | 115 | |
Daniel Stenberg | 6246ce5 | 2002-08-15 10:07:27 +0000 | [diff] [blame] | 116 | clean: |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 117 | \$(MAKE) -C \$(SIMDIR) clean |
Daniel Stenberg | e8cad94 | 2004-08-24 09:37:30 +0000 | [diff] [blame] | 118 | rm -rf rockbox.zip |
Daniel Stenberg | 58f4d0d | 2002-05-31 07:22:38 +0000 | [diff] [blame] | 119 | |
Daniel Stenberg | 6246ce5 | 2002-08-15 10:07:27 +0000 | [diff] [blame] | 120 | tags: |
| 121 | @rm -f TAGS |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 122 | make -C \$(SIMDIR) tags |
Daniel Stenberg | 58f4d0d | 2002-05-31 07:22:38 +0000 | [diff] [blame] | 123 | |
Daniel Stenberg | f69c703 | 2004-06-14 15:05:58 +0000 | [diff] [blame] | 124 | zip: |
Daniel Stenberg | d1851e3 | 2004-08-24 15:13:08 +0000 | [diff] [blame] | 125 | \$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" sim\$(TARGET) |
Daniel Stenberg | f69c703 | 2004-06-14 15:05:58 +0000 | [diff] [blame] | 126 | |
| 127 | install: |
| 128 | @echo "installing a full setup in your archos dir" |
| 129 | @(make zip && cd archos && unzip -oq ../rockbox.zip) |
Daniel Stenberg | 58f4d0d | 2002-05-31 07:22:38 +0000 | [diff] [blame] | 130 | EOF |
| 131 | |
Daniel Stenberg | e45a8f5 | 2002-06-06 13:33:38 +0000 | [diff] [blame] | 132 | echo "Created Makefile" |
Daniel Stenberg | 45abe61 | 2002-05-31 08:38:35 +0000 | [diff] [blame] | 133 | |
Daniel Stenberg | e45a8f5 | 2002-06-06 13:33:38 +0000 | [diff] [blame] | 134 | if [ -d "archos" ]; then |
| 135 | echo "sub directory archos already present" |
| 136 | else |
| 137 | mkdir archos |
| 138 | echo "created an archos subdirectory for simulating the hard disk" |
| 139 | fi |
Daniel Stenberg | 45abe61 | 2002-05-31 08:38:35 +0000 | [diff] [blame] | 140 | |
Daniel Stenberg | 58f4d0d | 2002-05-31 07:22:38 +0000 | [diff] [blame] | 141 | } |
| 142 | |
Robert Hak | c3320ae | 2002-10-17 09:08:05 +0000 | [diff] [blame] | 143 | picklang() { |
| 144 | # figure out which languages that are around |
Daniel Stenberg | 5c9c16f | 2004-05-26 11:07:16 +0000 | [diff] [blame] | 145 | for file in $rootdir/apps/lang/*.lang; do |
Robert Hak | c3320ae | 2002-10-17 09:08:05 +0000 | [diff] [blame] | 146 | clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1` |
| 147 | langs="$langs $clean" |
| 148 | done |
| 149 | |
| 150 | num=1 |
| 151 | for one in $langs; do |
| 152 | echo "$num. $one" |
| 153 | num=`expr $num + 1` |
| 154 | done |
| 155 | |
| 156 | read pick |
| 157 | return $pick; |
| 158 | } |
| 159 | |
| 160 | whichlang() { |
| 161 | num=1 |
| 162 | for one in $langs; do |
| 163 | if [ "$num" = "$pick" ]; then |
| 164 | echo $one |
| 165 | return |
| 166 | fi |
| 167 | num=`expr $num + 1` |
| 168 | done |
| 169 | } |
| 170 | |
Robert Hak | c3320ae | 2002-10-17 09:08:05 +0000 | [diff] [blame] | 171 | target=$1 |
| 172 | debug=$2 |
| 173 | |
| 174 | if test "$1" = "--help"; then |
| 175 | echo "Rockbox configure script." |
| 176 | echo "Invoke this in a directory to generate a Makefile to build Rockbox" |
| 177 | echo "Do *NOT* run this within the tools directory!" |
| 178 | exit |
| 179 | fi |
| 180 | |
| 181 | if test -r "configure"; then |
| 182 | # this is a check for a configure script in the current directory, it there |
| 183 | # is one, try to figure out if it is this one! |
| 184 | |
| 185 | if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then |
| 186 | echo "WEEEEEEEEP. Don't run this configure script within the tools directory." |
| 187 | echo "It will only cause you pain and grief. Instead do this:" |
| 188 | echo "" |
| 189 | echo " cd .." |
| 190 | echo " mkdir build-dir" |
| 191 | echo " cd build-dir" |
| 192 | echo " ../tools/configure" |
| 193 | echo "" |
| 194 | echo "Much happiness will arise from this. Enjoy" |
| 195 | exit |
| 196 | fi |
| 197 | fi |
| 198 | |
Daniel Stenberg | c38ccba | 2002-05-31 08:21:20 +0000 | [diff] [blame] | 199 | if [ "$target" = "--help" -o \ |
| 200 | "$target" = "-h" ]; then |
| 201 | echo "Just invoke the script and answer the questions." |
| 202 | echo "This script will write a Makefile for you" |
| 203 | exit |
| 204 | fi |
| 205 | |
Daniel Stenberg | 58f4d0d | 2002-05-31 07:22:38 +0000 | [diff] [blame] | 206 | # get our current directory |
| 207 | pwd=`pwd`; |
Daniel Stenberg | 3aacd2e | 2002-05-23 09:11:35 +0000 | [diff] [blame] | 208 | |
Daniel Stenberg | 6709658 | 2002-05-23 10:10:44 +0000 | [diff] [blame] | 209 | if [ "$target" = "update" ]; then |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 210 | echo "configure update is unfortunately no longer supported" |
| 211 | exit |
Daniel Stenberg | 58f4d0d | 2002-05-31 07:22:38 +0000 | [diff] [blame] | 212 | else |
| 213 | |
Daniel Stenberg | ea9c5bb | 2003-02-26 09:13:47 +0000 | [diff] [blame] | 214 | echo "This script will setup your Rockbox build environment." |
| 215 | echo "Further docs here: http://rockbox.haxx.se/docs/" |
Daniel Stenberg | 58f4d0d | 2002-05-31 07:22:38 +0000 | [diff] [blame] | 216 | echo "" |
| 217 | |
Daniel Stenberg | 6709658 | 2002-05-23 10:10:44 +0000 | [diff] [blame] | 218 | fi |
| 219 | |
Daniel Stenberg | 5c9c16f | 2004-05-26 11:07:16 +0000 | [diff] [blame] | 220 | if [ -z "$rootdir" ]; then |
| 221 | ################################################################## |
| 222 | # Figure out where the source code root is! |
| 223 | # |
Daniel Stenberg | 3aacd2e | 2002-05-23 09:11:35 +0000 | [diff] [blame] | 224 | |
Daniel Stenberg | 5c9c16f | 2004-05-26 11:07:16 +0000 | [diff] [blame] | 225 | firmfile="crt0.S" # a file to check for in the firmware root dir |
Daniel Stenberg | 3aacd2e | 2002-05-23 09:11:35 +0000 | [diff] [blame] | 226 | |
Daniel Stenberg | 052d21a | 2004-05-26 11:18:40 +0000 | [diff] [blame] | 227 | for dir in . .. ../.. ../rockbox*; do |
Daniel Stenberg | 5c9c16f | 2004-05-26 11:07:16 +0000 | [diff] [blame] | 228 | if [ -f $dir/firmware/$firmfile ]; then |
| 229 | rootdir=$dir |
| 230 | break |
Daniel Stenberg | 31e0cd6 | 2003-04-22 22:18:57 +0000 | [diff] [blame] | 231 | fi |
| 232 | done |
| 233 | |
Daniel Stenberg | 5c9c16f | 2004-05-26 11:07:16 +0000 | [diff] [blame] | 234 | if [ -z "$rootdir" ]; then |
| 235 | echo "This script couldn't find your source code root directory. Please enter the" |
| 236 | echo "full path to the source code directory here:" |
| 237 | |
| 238 | firmdir=`input` |
| 239 | fi |
| 240 | |
| 241 | ##################################################################### |
| 242 | # Convert the possibly relative directory name to an absolute version |
| 243 | # |
| 244 | now=`pwd` |
| 245 | cd $rootdir |
| 246 | rootdir=`pwd` |
| 247 | |
Daniel Stenberg | 052d21a | 2004-05-26 11:18:40 +0000 | [diff] [blame] | 248 | echo "Using this source code root directory:" |
| 249 | echo $rootdir |
| 250 | echo "" |
| 251 | |
Daniel Stenberg | 5c9c16f | 2004-05-26 11:07:16 +0000 | [diff] [blame] | 252 | # cd back to the build dir |
| 253 | cd $now |
Daniel Stenberg | 31e0cd6 | 2003-04-22 22:18:57 +0000 | [diff] [blame] | 254 | fi |
| 255 | |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 256 | if [ -z "$archos" ]; then |
| 257 | |
| 258 | ################################################################## |
| 259 | # Figure out target platform |
| 260 | # |
| 261 | |
| 262 | echo "Enter target platform: (default is Archos Recorder)" |
| 263 | |
| 264 | echo "1 - Archos Player/Studio" |
| 265 | echo "2 - Archos Recorder" |
| 266 | echo "3 - Archos FM Recorder" |
| 267 | echo "4 - Archos Recorder v2" |
Daniel Stenberg | 72fdf37 | 2005-01-04 15:00:06 +0000 | [diff] [blame] | 268 | echo "5 - Archos Gmini 120" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 269 | echo "7 - Archos Ondio SP" |
| 270 | echo "8 - Archos Ondio FM" |
| 271 | echo "9 - Iriver H100" |
| 272 | |
| 273 | getit=`input`; |
| 274 | |
| 275 | case $getit in |
| 276 | |
| 277 | 1) |
| 278 | archos="player" |
| 279 | target="-DARCHOS_PLAYER" |
| 280 | shcc |
Daniel Stenberg | a97fe25 | 2004-10-07 08:08:05 +0000 | [diff] [blame] | 281 | tool="$rootdir/tools/scramble" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 282 | output="archos.mod" |
| 283 | appextra="player" |
Jens Arnold | 4820177 | 2004-11-20 00:55:25 +0000 | [diff] [blame] | 284 | archosrom="$pwd/rombox.ucl" |
| 285 | flash="$pwd/rockbox.ucl" |
Daniel Stenberg | 8e55d0c | 2004-09-22 21:40:45 +0000 | [diff] [blame] | 286 | plugins="yes" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 287 | ;; |
| 288 | |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 289 | 3) |
| 290 | archos="fmrecorder" |
| 291 | target="-DARCHOS_FMRECORDER" |
| 292 | shcc |
Daniel Stenberg | a97fe25 | 2004-10-07 08:08:05 +0000 | [diff] [blame] | 293 | tool="$rootdir/tools/scramble -fm" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 294 | output="ajbrec.ajz" |
| 295 | appextra="recorder" |
Linus Nielsen Feltzing | 8737b37 | 2004-11-23 07:47:35 +0000 | [diff] [blame] | 296 | archosrom="" |
Daniel Stenberg | 59bec2e | 2004-10-07 08:20:25 +0000 | [diff] [blame] | 297 | flash="$pwd/rockbox.ucl" |
Daniel Stenberg | 8e55d0c | 2004-09-22 21:40:45 +0000 | [diff] [blame] | 298 | plugins="yes" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 299 | ;; |
| 300 | |
| 301 | 4) |
| 302 | archos="recorderv2" |
| 303 | target="-DARCHOS_RECORDERV2" |
| 304 | shcc |
Daniel Stenberg | a97fe25 | 2004-10-07 08:08:05 +0000 | [diff] [blame] | 305 | tool="$rootdir/tools/scramble -v2" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 306 | output="ajbrec.ajz" |
| 307 | appextra="recorder" |
| 308 | archosrom="$pwd/rombox.ucl" |
Daniel Stenberg | 59bec2e | 2004-10-07 08:20:25 +0000 | [diff] [blame] | 309 | flash="$pwd/rockbox.ucl" |
Daniel Stenberg | 8e55d0c | 2004-09-22 21:40:45 +0000 | [diff] [blame] | 310 | plugins="yes" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 311 | ;; |
| 312 | |
Daniel Stenberg | 72fdf37 | 2005-01-04 15:00:06 +0000 | [diff] [blame] | 313 | 5) |
| 314 | archos="gmini120" |
| 315 | target="-DARCHOS_GMINI120" |
| 316 | memory=16 # fixed size (16 is a guess, remove comment when checked) |
| 317 | calmrisccc |
| 318 | tool="$rootdir/tools/scramble" # not correct but... |
| 319 | output="rockboxgmini" |
| 320 | appextra="recorder" |
| 321 | archosrom="" |
| 322 | flash="" |
| 323 | plugins="no" # disabled for now, enable later on |
| 324 | ;; |
| 325 | |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 326 | 7) |
| 327 | archos="ondiosp" |
| 328 | target="-DARCHOS_ONDIOSP" |
| 329 | shcc |
Daniel Stenberg | a97fe25 | 2004-10-07 08:08:05 +0000 | [diff] [blame] | 330 | tool="$rootdir/tools/scramble -osp" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 331 | output="ajbrec.ajz" |
| 332 | appextra="recorder" |
Jörg Hohensohn | 8642585 | 2004-10-07 06:51:22 +0000 | [diff] [blame] | 333 | archosrom="$pwd/rombox.ucl" |
Daniel Stenberg | 59bec2e | 2004-10-07 08:20:25 +0000 | [diff] [blame] | 334 | flash="$pwd/rockbox.ucl" |
Jörg Hohensohn | 8642585 | 2004-10-07 06:51:22 +0000 | [diff] [blame] | 335 | plugins="yes" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 336 | ;; |
| 337 | |
| 338 | 8) |
| 339 | archos="ondiofm" |
| 340 | target="-DARCHOS_ONDIOFM" |
| 341 | shcc |
Daniel Stenberg | a97fe25 | 2004-10-07 08:08:05 +0000 | [diff] [blame] | 342 | tool="$rootdir/tools/scramble -ofm" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 343 | output="ajbrec.ajz" |
| 344 | appextra="recorder" |
Jörg Hohensohn | 8642585 | 2004-10-07 06:51:22 +0000 | [diff] [blame] | 345 | archosrom="$pwd/rombox.ucl" |
Daniel Stenberg | 59bec2e | 2004-10-07 08:20:25 +0000 | [diff] [blame] | 346 | flash="$pwd/rockbox.ucl" |
Jörg Hohensohn | 8642585 | 2004-10-07 06:51:22 +0000 | [diff] [blame] | 347 | plugins="yes" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 348 | ;; |
| 349 | |
| 350 | 9) |
| 351 | archos="h100" |
| 352 | target="-DIRIVER_H100" |
| 353 | memory=32 # always |
| 354 | coldfirecc |
Daniel Stenberg | a97fe25 | 2004-10-07 08:08:05 +0000 | [diff] [blame] | 355 | tool="cp" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 356 | output="rockbox.iriver" |
Linus Nielsen Feltzing | bb4872e | 2004-11-19 00:44:07 +0000 | [diff] [blame] | 357 | appextra="recorder" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 358 | archosrom="" |
Daniel Stenberg | 59bec2e | 2004-10-07 08:20:25 +0000 | [diff] [blame] | 359 | flash="" |
Linus Nielsen Feltzing | 44898af | 2004-10-07 08:36:25 +0000 | [diff] [blame] | 360 | plugins="" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 361 | ;; |
| 362 | |
Linus Nielsen Feltzing | ba05650 | 2004-09-22 09:29:58 +0000 | [diff] [blame] | 363 | *) |
| 364 | archos="recorder" |
| 365 | target="-DARCHOS_RECORDER" |
| 366 | shcc |
Daniel Stenberg | a97fe25 | 2004-10-07 08:08:05 +0000 | [diff] [blame] | 367 | tool="$rootdir/tools/scramble" |
Linus Nielsen Feltzing | ba05650 | 2004-09-22 09:29:58 +0000 | [diff] [blame] | 368 | output="ajbrec.ajz" |
| 369 | appextra="recorder" |
| 370 | archosrom="$pwd/rombox.ucl" |
Daniel Stenberg | 59bec2e | 2004-10-07 08:20:25 +0000 | [diff] [blame] | 371 | flash="$pwd/rockbox.ucl" |
Daniel Stenberg | 8e55d0c | 2004-09-22 21:40:45 +0000 | [diff] [blame] | 372 | plugins="yes" |
Linus Nielsen Feltzing | ba05650 | 2004-09-22 09:29:58 +0000 | [diff] [blame] | 373 | ;; |
| 374 | |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 375 | esac |
| 376 | |
| 377 | echo "Platform set to $archos" |
| 378 | |
| 379 | fi |
| 380 | |
| 381 | if [ -z "$memory" ]; then |
| 382 | size="2" |
| 383 | if [ -z "$update" ]; then |
| 384 | echo "Enter size of your RAM (in MB): (defaults to 2)" |
| 385 | size=`input`; |
| 386 | fi |
| 387 | |
| 388 | case $size in |
| 389 | 8) |
| 390 | memory="8" |
| 391 | ;; |
| 392 | *) |
| 393 | memory="2" |
| 394 | ;; |
| 395 | |
| 396 | esac |
| 397 | echo "Memory size selected: $memory MB" |
| 398 | fi |
| 399 | |
| 400 | if [ -z "$debug" ]; then |
| 401 | ################################################################## |
| 402 | # Figure out debug on/off |
| 403 | # |
| 404 | echo "Build (N)ormal, (D)ebug or (S)imulated version? (N)" |
| 405 | |
| 406 | option=`input`; |
| 407 | |
| 408 | case $option in |
| 409 | [Ss]) |
| 410 | debug="1" |
| 411 | simulator="yes" |
| 412 | echo "Simulator build selected" |
| 413 | whichsim |
| 414 | ;; |
| 415 | [Dd]) |
| 416 | debug="1" |
| 417 | echo "Debug build selected" |
Daniel Stenberg | 235b50b | 2004-10-04 13:02:41 +0000 | [diff] [blame] | 418 | GCCOPTS="$GCCOPTS -g -DDEBUG" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 419 | ;; |
| 420 | *) |
| 421 | debug="" |
| 422 | echo "Normal build selected" |
Linus Nielsen Feltzing | c21e7e7 | 2004-10-07 07:08:57 +0000 | [diff] [blame] | 423 | GCCOPTS="$GCCOPTS $GCCOPTIMIZE" |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 424 | ;; |
| 425 | |
| 426 | esac |
| 427 | fi |
| 428 | |
Daniel Stenberg | 31e0cd6 | 2003-04-22 22:18:57 +0000 | [diff] [blame] | 429 | |
Daniel Stenberg | ebe963d | 2002-09-20 06:38:38 +0000 | [diff] [blame] | 430 | if [ -z "$language" ]; then |
| 431 | |
| 432 | echo "Select a number for the language to use (default is english)" |
| 433 | |
| 434 | picklang |
| 435 | language=`whichlang` |
| 436 | |
| 437 | if [ -z "$language" ]; then |
| 438 | # pick a default |
| 439 | language="english" |
| 440 | fi |
Daniel Stenberg | ea9c5bb | 2003-02-26 09:13:47 +0000 | [diff] [blame] | 441 | echo "Language set to $language" |
Daniel Stenberg | ebe963d | 2002-09-20 06:38:38 +0000 | [diff] [blame] | 442 | fi |
| 443 | |
Robert Hak | 9465d4e | 2002-10-17 09:14:57 +0000 | [diff] [blame] | 444 | if [ "yes" = "$simulator" ]; then |
| 445 | # we have already dealt with the simulator Makefile separately |
Robert Hak | 672b0e2 | 2002-10-17 09:19:34 +0000 | [diff] [blame] | 446 | simul |
Robert Hak | 9465d4e | 2002-10-17 09:14:57 +0000 | [diff] [blame] | 447 | exit |
| 448 | fi |
| 449 | |
Daniel Stenberg | e0c12af | 2002-05-23 09:39:31 +0000 | [diff] [blame] | 450 | sed > Makefile \ |
Daniel Stenberg | 5c9c16f | 2004-05-26 11:07:16 +0000 | [diff] [blame] | 451 | -e "s,@ROOTDIR@,${rootdir},g" \ |
Daniel Stenberg | e0c12af | 2002-05-23 09:39:31 +0000 | [diff] [blame] | 452 | -e "s,@DEBUG@,${debug},g" \ |
Daniel Stenberg | ea9c5bb | 2003-02-26 09:13:47 +0000 | [diff] [blame] | 453 | -e "s,@MEMORY@,${memory},g" \ |
Daniel Stenberg | e0c12af | 2002-05-23 09:39:31 +0000 | [diff] [blame] | 454 | -e "s,@TARGET@,${target},g" \ |
Daniel Stenberg | f092920 | 2003-01-16 14:37:30 +0000 | [diff] [blame] | 455 | -e "s,@ARCHOS@,${archos},g" \ |
Daniel Stenberg | ebe963d | 2002-09-20 06:38:38 +0000 | [diff] [blame] | 456 | -e "s,@LANGUAGE@,${language},g" \ |
Daniel Stenberg | e0c12af | 2002-05-23 09:39:31 +0000 | [diff] [blame] | 457 | -e "s,@PWD@,${pwd},g" \ |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 458 | -e "s,@CC@,${CC},g" \ |
| 459 | -e "s,@LD@,${LD},g" \ |
| 460 | -e "s,@AR@,${AR},g" \ |
| 461 | -e "s,@AS@,${AS},g" \ |
| 462 | -e "s,@OC@,${OC},g" \ |
| 463 | -e "s,@TOOL@,${tool},g" \ |
| 464 | -e "s,@OUTPUT@,${output},g" \ |
| 465 | -e "s,@APPEXTRA@,${appextra},g" \ |
| 466 | -e "s,@ARCHOSROM@,${archosrom},g" \ |
Daniel Stenberg | 59bec2e | 2004-10-07 08:20:25 +0000 | [diff] [blame] | 467 | -e "s,@FLASHFILE@,${flash},g" \ |
Daniel Stenberg | 8e55d0c | 2004-09-22 21:40:45 +0000 | [diff] [blame] | 468 | -e "s,@PLUGINS@,${plugins},g" \ |
Daniel Stenberg | 235b50b | 2004-10-04 13:02:41 +0000 | [diff] [blame] | 469 | -e "s,@GCCOPTS@,${GCCOPTS},g" \ |
Daniel Stenberg | e0c12af | 2002-05-23 09:39:31 +0000 | [diff] [blame] | 470 | <<EOF |
Björn Stenberg | cd22573 | 2002-08-11 09:17:47 +0000 | [diff] [blame] | 471 | ## Automaticly generated. http://rockbox.haxx.se |
Daniel Stenberg | 6709658 | 2002-05-23 10:10:44 +0000 | [diff] [blame] | 472 | |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 473 | export ROOTDIR=@ROOTDIR@ |
| 474 | export FIRMDIR=\$(ROOTDIR)/firmware |
| 475 | export APPSDIR=\$(ROOTDIR)/apps |
| 476 | export TOOLSDIR=\$(ROOTDIR)/tools |
| 477 | export DOCSDIR=\$(ROOTDIR)/docs |
| 478 | export DEBUG=@DEBUG@ |
| 479 | export ARCHOS=@ARCHOS@ |
| 480 | export ARCHOSROM=@ARCHOSROM@ |
Daniel Stenberg | 59bec2e | 2004-10-07 08:20:25 +0000 | [diff] [blame] | 481 | export FLASHFILE=@FLASHFILE@ |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 482 | export TARGET=@TARGET@ |
| 483 | export OBJDIR=@PWD@ |
| 484 | export LANGUAGE=@LANGUAGE@ |
| 485 | export MEMORYSIZE=@MEMORY@ |
| 486 | export VERSION=\$(shell date +%y%m%d-%H%M) |
Daniel Stenberg | a97fe25 | 2004-10-07 08:08:05 +0000 | [diff] [blame] | 487 | export MKFIRMWARE=@TOOL@ |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 488 | export BINARY=@OUTPUT@ |
| 489 | export APPEXTRA=@APPEXTRA@ |
Daniel Stenberg | 8e55d0c | 2004-09-22 21:40:45 +0000 | [diff] [blame] | 490 | export ENABLEDPLUGINS=@PLUGINS@ |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 491 | export CC=@CC@ |
| 492 | export LD=@LD@ |
| 493 | export AR=@AR@ |
| 494 | export AS=@AS@ |
| 495 | export OC=@OC@ |
Daniel Stenberg | 235b50b | 2004-10-04 13:02:41 +0000 | [diff] [blame] | 496 | export GCCOPTS=@GCCOPTS@ |
Daniel Stenberg | 3aacd2e | 2002-05-23 09:11:35 +0000 | [diff] [blame] | 497 | |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 498 | .PHONY: all clean tags zip |
Daniel Stenberg | 3c286ec | 2002-05-23 13:55:26 +0000 | [diff] [blame] | 499 | |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 500 | all: |
| 501 | @\$(MAKE) -C \$(FIRMDIR) |
| 502 | @\$(MAKE) -C \$(APPSDIR) |
Daniel Stenberg | 40c6129 | 2002-05-24 09:33:37 +0000 | [diff] [blame] | 503 | |
Daniel Stenberg | 3c286ec | 2002-05-23 13:55:26 +0000 | [diff] [blame] | 504 | clean: |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 505 | @\$(MAKE) -C \$(FIRMDIR) clean |
| 506 | @\$(MAKE) -C \$(APPSDIR) clean |
| 507 | @rm -f rockbox.zip TAGS |
Daniel Stenberg | bc35ae3 | 2002-08-15 09:32:59 +0000 | [diff] [blame] | 508 | |
| 509 | tags: |
| 510 | @rm -f TAGS |
Daniel Stenberg | fc1e925 | 2004-09-22 08:58:50 +0000 | [diff] [blame] | 511 | \$(MAKE) -C \$(FIRMDIR) tags |
| 512 | \$(MAKE) -C \$(APPSDIR) tags |
| 513 | \$(MAKE) -C \$(APPSDIR)/plugins tags |
| 514 | \$(MAKE) -C \$(APPSDIR)/plugins/lib tags |
Daniel Stenberg | 3d9f774 | 2004-05-21 19:05:47 +0000 | [diff] [blame] | 515 | |
| 516 | zip: |
Daniel Stenberg | d1851e3 | 2004-08-24 15:13:08 +0000 | [diff] [blame] | 517 | \$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" \$(TARGET) |
Daniel Stenberg | 3aacd2e | 2002-05-23 09:11:35 +0000 | [diff] [blame] | 518 | EOF |
Daniel Stenberg | e0c12af | 2002-05-23 09:39:31 +0000 | [diff] [blame] | 519 | |
| 520 | echo "Created Makefile" |