Commit FS#10234 - Spacerocks respawn invulnerability by Eric Clayton. Gives you...
[kugel-rb.git] / tools / configure
blobc5fcb84b3473ea398b9a82e1d0c1bd6510a55966
1 #!/bin/sh
2 # __________ __ ___.
3 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 # \/ \/ \/ \/ \/
8 # $Id$
11 # global CC options for all platforms
12 CCOPTS="-W -Wall -Wundef -O -nostdlib -ffreestanding -Wstrict-prototypes"
14 use_logf="#undef ROCKBOX_HAS_LOGF"
16 scriptver=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'`
18 rbdir=".rockbox"
21 # Begin Function Definitions
23 input() {
24 read response
25 echo $response
28 prefixtools () {
29 prefix="$1"
30 CC=${prefix}gcc
31 WINDRES=${prefix}windres
32 DLLTOOL=${prefix}dlltool
33 DLLWRAP=${prefix}dllwrap
34 RANLIB=${prefix}ranlib
35 LD=${prefix}ld
36 AR=${prefix}ar
37 AS=${prefix}as
38 OC=${prefix}objcopy
41 crosswincc () {
42 # naive approach to selecting a mingw cross-compiler on linux/*nix
43 echo "Enabling win32 crosscompiling"
45 prefixtools i586-mingw32msvc-
47 # add cross-compiler option(s)
48 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
49 LDOPTS="`sdl-config --libs` -mconsole"
51 output="rockboxui.exe" # use this as output binary name
52 crosscompile="yes"
53 endian="little" # windows is little endian
56 # scan the $PATH for the given command
57 findtool(){
58 file="$1"
60 IFS=":"
61 for path in $PATH
63 # echo "checks for $file in $path" >&2
64 if test -f "$path/$file"; then
65 echo "$path/$file"
66 return
68 done
69 # check whether caller wants literal return value if not found
70 if [ "$2" = "--lit" ]; then
71 echo "$file"
75 # parse the argument list, returns the value after the = in case of a
76 # option=value type option, returns 0 in case of --ccache or --no-ccache,
77 # returns 1 if the searched argument type wasn't fount in the argument list
78 # Usage [var = ]`parse_args <argumenttype>`, e.g. `parse_args --target`
80 # var definitons below are needed so that parse_args can see the arguments
81 arg1=$1 arg2=$2 arg3=$3 arg4=$4 arg5=$5 arg6=$6 arg7=$7 arg8=$8 arg9=$9
83 parse_args() {
84 ret="1"
85 for i in $arg1 $arg2 $arg3 $arg4 $arg5 $arg6 $arg7 $arg8 $arg9
87 if [ "$1" = "--ccache" ]; then
88 if [ "$i" = "--ccache" ]; then
89 ret="0"
91 elif [ "$1" = "--no-ccache" ]; then
92 if [ "$i" = "--no-ccache" ]; then
93 ret="0"
95 elif [ "$1" = `echo $i|cut -d'=' -f1` ]; then
96 ret=`echo $i|cut -d'=' -f2`
98 done
99 echo "$ret"
102 simcc () {
104 # default tool setup for native building
105 prefixtools ""
107 simver=sdl
108 GCCOPTS='-W -Wall -g -fno-builtin'
110 output="rockboxui" # use this as default output binary name
112 # generic sdl-config checker
113 sdl=`findtool sdl-config`
115 if [ -z "$sdl" ]; then
116 echo "configure didn't find sdl-config, which indicates that you"
117 echo "don't have SDL (properly) installed. Please correct and"
118 echo "re-run configure!"
119 exit 1
122 # default share option, override below if needed
123 SHARED_FLAG="-shared"
125 case $uname in
126 CYGWIN*)
127 echo "Cygwin host detected"
129 # sdl version
130 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
131 LDOPTS="`sdl-config --libs` -mconsole"
133 output="rockboxui.exe" # use this as output binary name
136 MINGW*)
137 echo "MinGW host detected"
139 # sdl version
140 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
141 LDOPTS="`sdl-config --libs` -mconsole"
143 output="rockboxui.exe" # use this as output binary name
146 Linux)
147 echo "Linux host detected"
148 if [ "0" != `sdl-config --libs |grep -c mwindows` ]; then
149 # Enable crosscompiling if sdl-config is from Windows SDL
150 crosswincc
151 else
152 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
153 LDOPTS="`sdl-config --libs`"
157 FreeBSD)
158 echo "FreeBSD host detected"
159 # sdl version
160 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
161 LDOPTS="`sdl-config --libs`"
164 Darwin)
165 echo "Darwin host detected"
166 # sdl version
167 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
168 LDOPTS="`sdl-config --libs`"
169 SHARED_FLAG="-dynamiclib -Wl\,-single_module"
173 echo "Unsupported system: $uname, fix configure and retry"
174 exit 2
176 esac
178 GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
180 if test "X$crosscompile" != "Xyes"; then
181 if [ "`uname -m`" = "x86_64" ] || [ "`uname -m`" = "amd64" ]; then
182 # fPIC is needed to make shared objects link
183 # setting visibility to hidden is necessary to avoid strange crashes
184 # due to symbol clashing
185 GCCOPTS="$GCCOPTS -fPIC -fvisibility=hidden"
188 id=$$
189 cat >/tmp/conftest-$id.c <<EOF
190 #include <stdio.h>
191 int main(int argc, char **argv)
193 int var=0;
194 char *varp = (char *)&var;
195 *varp=1;
197 printf("%d\n", var);
198 return 0;
202 $CC -o /tmp/conftest-$id /tmp/conftest-$id.c 2>/dev/null
204 if test `/tmp/conftest-$id 2>/dev/null` -gt "1"; then
205 # big endian
206 endian="big"
207 else
208 # little endian
209 endian="little"
211 echo "Simulator environment deemed $endian endian"
213 # use wildcard here to make it work even if it was named *.exe like
214 # on cygwin
215 rm -f /tmp/conftest-$id*
220 # functions for setting up cross-compiler names and options
221 # also set endianess and what the exact recommended gcc version is
222 # the gcc version should most likely match what versions we build with
223 # rockboxdev.sh
225 shcc () {
226 prefixtools sh-elf-
227 GCCOPTS="$CCOPTS -m1"
228 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
229 endian="big"
230 gccchoice="4.0.3"
233 calmrisccc () {
234 prefixtools calmrisc16-unknown-elf-
235 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
236 GCCOPTIMIZE="-fomit-frame-pointer"
237 endian="big"
240 coldfirecc () {
241 prefixtools m68k-elf-
242 GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
243 GCCOPTIMIZE="-fomit-frame-pointer"
244 endian="big"
245 gccchoice="3.4.6"
248 arm7tdmicc () {
249 prefixtools arm-elf-
250 GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
251 if test "X$1" != "Xshort"; then
252 GCCOPTS="$GCCOPTS -mlong-calls"
254 GCCOPTIMIZE="-fomit-frame-pointer"
255 endian="little"
256 gccchoice="4.0.3"
259 arm9tdmicc () {
260 prefixtools arm-elf-
261 GCCOPTS="$CCOPTS -mcpu=arm9tdmi"
262 if test "$modelname" != "gigabeatf"; then
263 GCCOPTS="$GCCOPTS -mlong-calls"
265 GCCOPTIMIZE="-fomit-frame-pointer"
266 endian="little"
267 gccchoice="4.0.3"
270 arm940tbecc () {
271 prefixtools arm-elf-
272 GCCOPTS="$CCOPTS -mbig-endian -mcpu=arm940t -mlong-calls"
273 GCCOPTIMIZE="-fomit-frame-pointer"
274 endian="big"
275 gccchoice="4.0.3"
278 arm946cc () {
279 prefixtools arm-elf-
280 GCCOPTS="$CCOPTS -mcpu=arm9e -mlong-calls"
281 GCCOPTIMIZE="-fomit-frame-pointer"
282 endian="little"
283 gccchoice="4.0.3"
286 arm926ejscc () {
287 prefixtools arm-elf-
288 GCCOPTS="$CCOPTS -mcpu=arm926ej-s -mlong-calls"
289 GCCOPTIMIZE="-fomit-frame-pointer"
290 endian="little"
291 gccchoice="4.0.3"
294 arm1136jfscc () {
295 prefixtools arm-elf-
296 GCCOPTS="$CCOPTS -mcpu=arm1136jf-s"
297 if test "$modelname" != "gigabeats"; then
298 GCCOPTS="$GCCOPTS -mlong-calls"
300 GCCOPTIMIZE="-fomit-frame-pointer"
301 endian="little"
302 gccchoice="4.0.3"
305 mipselcc () {
306 prefixtools mipsel-elf-
307 GCCOPTS="$CCOPTS -march=mips32 -mtune=r4600 -mno-mips16 -mno-abicalls -mno-long-calls -Wno-parentheses"
308 GCCOPTIMIZE="-fomit-frame-pointer"
309 GCCOPTS="$GCCOPTS -fno-pic -fno-builtin -fno-exceptions -ffunction-sections -msoft-float -G 0"
310 endian="little"
311 gccchoice="4.1.2"
314 whichadvanced () {
315 ##################################################################
316 # Prompt for specific developer options
318 echo ""
319 echo "Enter your developer options (press enter when done)"
320 printf "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice"
321 if [ "$memory" = "2" ]; then
322 printf ", (8)MB MOD"
324 if [ "$modelname" = "h120" ]; then
325 printf ", (R)TC MOD"
327 echo ""
329 cont=1
331 while [ $cont = "1" ]; do
333 option=`input`;
335 case $option in
336 [Dd])
337 if [ "yes" = "$profile" ]; then
338 echo "Debug is incompatible with profiling"
339 else
340 echo "define DEBUG"
341 use_debug="yes"
344 [Ll])
345 echo "logf() support enabled"
346 logf="yes"
348 [Ss])
349 echo "Simulator build enabled"
350 simulator="yes"
352 [Pp])
353 if [ "yes" = "$use_debug" ]; then
354 echo "Profiling is incompatible with debug"
355 else
356 echo "Profiling support is enabled"
357 profile="yes"
360 [Vv])
361 echo "Voice build selected"
362 voice="yes"
365 if [ "$memory" = "2" ]; then
366 memory="8"
367 echo "Memory size selected: 8MB"
368 else
369 cont=0
372 [Rr])
373 if [ "$modelname" = "h120" ]; then
374 config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231"
375 have_rtc_alarm="#define HAVE_RTC_ALARM"
376 echo "RTC functions enabled (DS1339/DS3231)"
377 else
378 cont=0
382 cont=0
384 esac
385 done
386 echo "done"
388 if [ "yes" = "$voice" ]; then
389 # Ask about languages to build
390 echo "Select a number for the language to use (default is english)"
391 # The multiple-language feature is currently broken
392 # echo "You may enter a comma-separated list of languages to build"
394 picklang
395 voicelanguage=`whichlang`
397 if [ -z "$voicelanguage" ]; then
398 # pick a default
399 voicelanguage="english"
401 echo "Voice language set to $voicelanguage"
403 # Configure encoder and TTS engine for each language
404 for thislang in `echo $voicelanguage | sed 's/,/ /g'`; do
405 voiceconfig "$thislang"
406 done
408 if [ "yes" = "$use_debug" ]; then
409 debug="-DDEBUG"
410 GCCOPTS="$GCCOPTS -g -DDEBUG"
412 if [ "yes" = "$logf" ]; then
413 use_logf="#define ROCKBOX_HAS_LOGF 1"
415 if [ "yes" = "$simulator" ]; then
416 debug="-DDEBUG"
417 extradefines="$extradefines -DSIMULATOR"
418 archosrom=""
419 flash=""
421 if [ "yes" = "$profile" ]; then
422 extradefines="$extradefines -DRB_PROFILE"
423 PROFILE_OPTS="-finstrument-functions"
427 # Configure voice settings
428 voiceconfig () {
429 thislang=$1
430 echo "Building $thislang voice for $modelname. Select options"
431 echo ""
433 if [ -n "`findtool flite`" ]; then
434 FLITE="F(l)ite "
435 FLITE_OPTS=""
436 DEFAULT_TTS="flite"
437 DEFAULT_TTS_OPTS=$FLITE_OPTS
438 DEFAULT_NOISEFLOOR="500"
439 DEFAULT_CHOICE="L"
441 if [ -n "`findtool espeak`" ]; then
442 ESPEAK="(e)Speak "
443 ESPEAK_OPTS=""
444 DEFAULT_TTS="espeak"
445 DEFAULT_TTS_OPTS=$ESPEAK_OPTS
446 DEFAULT_NOISEFLOOR="500"
447 DEFAULT_CHOICE="e"
449 if [ -n "`findtool festival`" ]; then
450 FESTIVAL="(F)estival "
451 case "$thislang" in
452 "italiano")
453 FESTIVAL_OPTS="--language italian"
455 "espanol")
456 FESTIVAL_OPTS="--language spanish"
458 "finnish")
459 FESTIVAL_OPTS="--language finnish"
461 "czech")
462 FESTIVAL_OPTS="--language czech"
465 FESTIVAL_OPTS=""
467 esac
468 DEFAULT_TTS="festival"
469 DEFAULT_TTS_OPTS=$FESTIVAL_OPTS
470 DEFAULT_NOISEFLOOR="500"
471 DEFAULT_CHOICE="F"
473 if [ -n "`findtool swift`" ]; then
474 SWIFT="S(w)ift "
475 SWIFT_OPTS=""
476 DEFAULT_TTS="swift"
477 DEFAULT_TTS_OPTS=$SWIFT_OPTS
478 DEFAULT_NOISEFLOOR="500"
479 DEFAULT_CHOICE="w"
481 # Allow SAPI if Windows is in use
482 if [ -n "`findtool winver`" ]; then
483 SAPI="(S)API "
484 SAPI_OPTS=""
485 DEFAULT_TTS="sapi"
486 DEFAULT_TTS_OPTS=$SAPI_OPTS
487 DEFAULT_NOISEFLOOR="500"
488 DEFAULT_CHOICE="S"
491 if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ] && [ "$ESPEAK" = "$SAPI" ] && [ "$SAPI" = "$SWIFT" ]; then
492 echo "You need Festival, eSpeak or Flite in your path, or SAPI available to build voice files"
493 exit 3
496 echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?"
497 option=`input`
498 case "$option" in
499 [Ll])
500 TTS_ENGINE="flite"
501 NOISEFLOOR="500" # TODO: check this value
502 TTS_OPTS=$FLITE_OPTS
504 [Ee])
505 TTS_ENGINE="espeak"
506 NOISEFLOOR="500"
507 TTS_OPTS=$ESPEAK_OPTS
509 [Ff])
510 TTS_ENGINE="festival"
511 NOISEFLOOR="500"
512 TTS_OPTS=$FESTIVAL_OPTS
514 [Ss])
515 TTS_ENGINE="sapi"
516 NOISEFLOOR="500"
517 TTS_OPTS=$SAPI_OPTS
519 [Ww])
520 TTS_ENGINE="swift"
521 NOISEFLOOR="500"
522 TTS_OPTS=$SWIFT_OPTS
525 TTS_ENGINE=$DEFAULT_TTS
526 TTS_OPTS=$DEFAULT_TTS_OPTS
527 NOISEFLOOR=$DEFAULT_NOISEFLOOR
528 esac
529 echo "Using $TTS_ENGINE for TTS"
531 # Select which voice to use for Festival
532 if [ "$TTS_ENGINE" = "festival" ]; then
534 for voice in `echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1/'|sort`; do
535 if [ "$i" = "1" ]; then
536 TTS_FESTIVAL_VOICE="$voice" # Default choice
538 printf "%3d. %s\n" "$i" "$voice"
539 i=`expr $i + 1`
540 done
541 printf "Please select which Festival voice to use (default is $TTS_FESTIVAL_VOICE): "
542 CHOICE=`input`
544 for voice in `echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1/'|sort`; do
545 if [ "$i" = "$CHOICE" -o "$voice" = "$CHOICE" ]; then
546 TTS_FESTIVAL_VOICE="$voice"
548 i=`expr $i + 1`
549 done
550 echo "Festival voice set to $TTS_FESTIVAL_VOICE"
551 echo "(voice_$TTS_FESTIVAL_VOICE)" > festival-prolog.scm
554 # Allow the user to input manual commandline options
555 printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): "
556 USER_TTS_OPTS=`input`
557 if [ -n "$USER_TTS_OPTS" ]; then
558 TTS_OPTS="$USER_TTS_OPTS"
561 echo ""
563 if [ "$swcodec" = "yes" ]; then
564 ENCODER="rbspeexenc"
565 ENC_CMD="rbspeexenc"
566 ENC_OPTS="-q 4 -c 10"
567 else
568 if [ -n "`findtool lame`" ]; then
569 ENCODER="lame"
570 ENC_CMD="lame"
571 ENC_OPTS="--resample 12 -t -m m -h -V 9 -S -B 64 --vbr-new"
572 else
573 echo "You need LAME in the system path to build voice files for"
574 echo "HWCODEC targets."
575 exit 4
579 echo "Using $ENCODER for encoding voice clips"
581 # Allow the user to input manual commandline options
582 printf "Enter $ENCODER options (enter for defaults \"$ENC_OPTS\"): "
583 USER_ENC_OPTS=`input`
584 if [ -n "$USER_ENC_OPTS" ]; then
585 ENC_OPTS=$USER_ENC_OPTS
588 TEMPDIR="${pwd}"
589 if [ -n "`findtool cygpath`" ]; then
590 TEMPDIR=`cygpath . -a -w`
594 picklang() {
595 # figure out which languages that are around
596 for file in $rootdir/apps/lang/*.lang; do
597 clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
598 langs="$langs $clean"
599 done
601 num=1
602 for one in $langs; do
603 echo "$num. $one"
604 num=`expr $num + 1`
605 done
607 read pick
610 whichlang() {
611 output=""
612 # Allow the user to pass a comma-separated list of langauges
613 for thispick in `echo $pick | sed 's/,/ /g'`; do
614 num=1
615 for one in $langs; do
616 # Accept both the language number and name
617 if [ "$num" = "$thispick" ] || [ "$thispick" = "$one" ]; then
618 if [ "$output" = "" ]; then
619 output=$one
620 else
621 output=$output,$one
624 num=`expr $num + 1`
625 done
626 done
627 echo $output
630 opt=$1
632 if test "$opt" = "--help"; then
633 echo "Rockbox configure script."
634 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
635 echo "Do *NOT* run this within the tools directory!"
636 echo ""
637 cat <<EOF
638 Usage: configure [OPTION]...
639 Options:
640 --target=TARGET Sets the target, TARGET can be either the target ID or
641 corresponding string. Run without this option to see all
642 available targets.
644 --ram=RAM Sets the RAM for certain targets. Even though any number
645 is accepted, not every number is correct. The default
646 value will be applied, if you entered a wrong number
647 (which depends on the target). Watch the output. Run
648 without this option if you are not sure which the right
649 number is.
651 --type=TYPE Sets the build type. The shortcut is also valid.
652 Run without this option to see available types.
654 --rbdir=dir Use alternative rockbox directory (default: ${rbdir}).
655 This is useful for having multiple alternate builds on
656 your device that you can load with ROLO. However as the
657 bootloader looks for .rockbox you won't be able to boot
658 into this build.
660 --ccache Enable ccache use (done by default these days)
661 --no-ccache Disable ccache use
662 --help Shows this message (must not be used with other options)
666 exit
669 if test -r "configure"; then
670 # this is a check for a configure script in the current directory, it there
671 # is one, try to figure out if it is this one!
673 if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
674 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
675 echo "It will only cause you pain and grief. Instead do this:"
676 echo ""
677 echo " cd .."
678 echo " mkdir build-dir"
679 echo " cd build-dir"
680 echo " ../tools/configure"
681 echo ""
682 echo "Much happiness will arise from this. Enjoy"
683 exit 5
687 # get our current directory
688 pwd=`pwd`;
690 if { echo $pwd | grep " "; } then
691 echo "You're running this script in a path that contains space. The build"
692 echo "system is unfortunately not clever enough to deal with this. Please"
693 echo "run the script from a different path, rename the path or fix the build"
694 echo "system!"
695 exit 6
698 if [ -z "$rootdir" ]; then
699 ##################################################################
700 # Figure out where the source code root is!
702 rootdir=`dirname $0`/../
704 #####################################################################
705 # Convert the possibly relative directory name to an absolute version
707 now=`pwd`
708 cd $rootdir
709 rootdir=`pwd`
711 # cd back to the build dir
712 cd $now
715 apps="apps"
716 appsdir='\$(ROOTDIR)/apps'
717 firmdir='\$(ROOTDIR)/firmware'
718 toolsdir='\$(ROOTDIR)/tools'
721 ##################################################################
722 # Figure out target platform
725 if [ "1" != `parse_args --target` ]; then
726 buildfor=`parse_args --target`;
727 else
728 echo "Enter target platform:"
729 cat <<EOF
730 ==Archos== ==iriver== ==Apple iPod==
731 0) Player/Studio 10) H120/H140 20) Color/Photo
732 1) Recorder 11) H320/H340 21) Nano
733 2) FM Recorder 12) iHP-100/110/115 22) Video
734 3) Recorder v2 13) iFP-790 23) 3G
735 4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
736 5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
737 6) AV300 26) Mini 2G
738 ==Toshiba== 27) 1G, 2G
739 40) Gigabeat F
740 ==Cowon/iAudio== 41) Gigabeat S ==SanDisk==
741 30) X5/X5V/X5L 50) Sansa e200
742 31) M5/M5L ==Tatung== 51) Sansa e200R
743 32) 7 60) Elio TPJ-1022 52) Sansa c200
744 33) D2 53) Sansa m200
745 34) M3/M3L ==Olympus== 54) Sansa c100
746 70) M:Robe 500 55) Sansa Clip
747 ==Creative== 71) M:Robe 100 56) Sansa e200v2
748 90) Zen Vision:M 30GB 57) Sansa m200v4
749 91) Zen Vision:M 60GB ==Philips== 58) Sansa Fuze
750 92) Zen Vision 100) GoGear SA9200 59) Sansa c200v2
751 101) GoGear HDD1630/
752 HDD1830 ==Logik==
753 ==Onda== 80) DAX 1GB MP3/DAB
754 120) VX747 ==Meizu==
755 121) VX767 110) M6SL ==Lyre project==
756 122) VX747+ 111) M6SP 130) Lyre proto 1
757 112) M3
760 buildfor=`input`;
763 # Set of tools built for all target platforms:
764 toolset="rdf2binary convbdf codepages"
766 # Toolsets for some target families:
767 archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
768 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
769 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
770 ipodbitmaptools="$toolset scramble bmp2rb"
771 gigabeatbitmaptools="$toolset scramble descramble bmp2rb"
772 tccbitmaptools="$toolset scramble mktccboot bmp2rb"
773 # generic is used by IFP, Meizu and Onda
774 genericbitmaptools="$toolset bmp2rb"
775 # scramble is used by all other targets
776 scramblebitmaptools="$genericbitmaptools scramble"
779 # ---- For each target ----
781 # *Variables*
782 # target_id: a unique number identifying this target, IS NOT the menu number.
783 # Just use the currently highest number+1 when you add a new
784 # target.
785 # modelname: short model name used all over to identify this target
786 # memory: number of megabytes of RAM this target has. If the amount can
787 # be selected by the size prompt, let memory be unset here
788 # target: -Ddefine passed to the build commands to make the correct
789 # config-*.h file get included etc
790 # tool: the tool that takes a plain binary and converts that into a
791 # working "firmware" file for your target
792 # output: the final output file name
793 # boottool: the tool that takes a plain binary and generates a bootloader
794 # file for your target (or blank to use $tool)
795 # bootoutput:the final output file name for the bootloader (or blank to use
796 # $output)
797 # appextra: passed to the APPEXTRA variable in the Makefiles.
798 # TODO: add proper explanation
799 # archosrom: used only for Archos targets that build a special flashable .ucl
800 # image.
801 # flash: name of output for flashing, for targets where there's a special
802 # file output for this.
803 # plugins: set to 'yes' to build the plugins. Early development builds can
804 # set this to no in the early stages to have an easier life for a
805 # while
806 # swcodec: set 'yes' on swcodec targets
807 # toolset: lists what particular tools in the tools/ directory that this
808 # target needs to have built prior to building Rockbox
810 # *Functions*
811 # *cc: sets up gcc and compiler options for your target builds. Note
812 # that if you select a simulator build, the compiler selection is
813 # overridden later in the script.
815 case $buildfor in
817 0|player)
818 target_id=1
819 modelname="player"
820 target="-DARCHOS_PLAYER"
821 shcc
822 tool="$rootdir/tools/scramble"
823 output="archos.mod"
824 appextra="player:gui"
825 archosrom="$pwd/rombox.ucl"
826 flash="$pwd/rockbox.ucl"
827 plugins="yes"
828 swcodec=""
830 # toolset is the tools within the tools directory that we build for
831 # this particular target.
832 toolset="$toolset scramble descramble sh2d player_unifont uclpack"
834 # Note: the convbdf is present in the toolset just because: 1) the
835 # firmware/Makefile assumes it is present always, and 2) we will need it when we
836 # build the player simulator
838 t_cpu="sh"
839 t_manufacturer="archos"
840 t_model="player"
843 1|recorder)
844 target_id=2
845 modelname="recorder"
846 target="-DARCHOS_RECORDER"
847 shcc
848 tool="$rootdir/tools/scramble"
849 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
850 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
851 output="ajbrec.ajz"
852 appextra="recorder:gui"
853 #archosrom="$pwd/rombox.ucl"
854 flash="$pwd/rockbox.ucl"
855 plugins="yes"
856 swcodec=""
857 # toolset is the tools within the tools directory that we build for
858 # this particular target.
859 toolset=$archosbitmaptools
860 t_cpu="sh"
861 t_manufacturer="archos"
862 t_model="recorder"
865 2|fmrecorder)
866 target_id=3
867 modelname="fmrecorder"
868 target="-DARCHOS_FMRECORDER"
869 shcc
870 tool="$rootdir/tools/scramble -fm"
871 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
872 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
873 output="ajbrec.ajz"
874 appextra="recorder:gui"
875 #archosrom="$pwd/rombox.ucl"
876 flash="$pwd/rockbox.ucl"
877 plugins="yes"
878 swcodec=""
879 # toolset is the tools within the tools directory that we build for
880 # this particular target.
881 toolset=$archosbitmaptools
882 t_cpu="sh"
883 t_manufacturer="archos"
884 t_model="fm_v2"
887 3|recorderv2)
888 target_id=4
889 modelname="recorderv2"
890 target="-DARCHOS_RECORDERV2"
891 shcc
892 tool="$rootdir/tools/scramble -v2"
893 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
894 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
895 output="ajbrec.ajz"
896 appextra="recorder:gui"
897 #archosrom="$pwd/rombox.ucl"
898 flash="$pwd/rockbox.ucl"
899 plugins="yes"
900 swcodec=""
901 # toolset is the tools within the tools directory that we build for
902 # this particular target.
903 toolset=$archosbitmaptools
904 t_cpu="sh"
905 t_manufacturer="archos"
906 t_model="fm_v2"
909 4|ondiosp)
910 target_id=7
911 modelname="ondiosp"
912 target="-DARCHOS_ONDIOSP"
913 shcc
914 tool="$rootdir/tools/scramble -osp"
915 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
916 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
917 output="ajbrec.ajz"
918 appextra="recorder:gui"
919 archosrom="$pwd/rombox.ucl"
920 flash="$pwd/rockbox.ucl"
921 plugins="yes"
922 swcodec=""
923 # toolset is the tools within the tools directory that we build for
924 # this particular target.
925 toolset=$archosbitmaptools
926 t_cpu="sh"
927 t_manufacturer="archos"
928 t_model="ondio"
931 5|ondiofm)
932 target_id=8
933 modelname="ondiofm"
934 target="-DARCHOS_ONDIOFM"
935 shcc
936 tool="$rootdir/tools/scramble -ofm"
937 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
938 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
939 output="ajbrec.ajz"
940 appextra="recorder:gui"
941 #archosrom="$pwd/rombox.ucl"
942 flash="$pwd/rockbox.ucl"
943 plugins="yes"
944 swcodec=""
945 toolset=$archosbitmaptools
946 t_cpu="sh"
947 t_manufacturer="archos"
948 t_model="ondio"
951 6|av300)
952 target_id=38
953 modelname="av300"
954 target="-DARCHOS_AV300"
955 memory=16 # always
956 arm7tdmicc
957 tool="$rootdir/tools/scramble -mm=C"
958 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
959 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
960 output="cjbm.ajz"
961 appextra="recorder:gui"
962 plugins="yes"
963 swcodec=""
964 # toolset is the tools within the tools directory that we build for
965 # this particular target.
966 toolset="$toolset scramble descramble bmp2rb"
967 # architecture, manufacturer and model for the target-tree build
968 t_cpu="arm"
969 t_manufacturer="archos"
970 t_model="av300"
973 10|h120)
974 target_id=9
975 modelname="h120"
976 target="-DIRIVER_H120"
977 memory=32 # always
978 coldfirecc
979 tool="$rootdir/tools/scramble -add=h120"
980 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
981 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
982 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
983 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
984 output="rockbox.iriver"
985 appextra="recorder:gui"
986 flash="$pwd/rombox.iriver"
987 plugins="yes"
988 swcodec="yes"
989 # toolset is the tools within the tools directory that we build for
990 # this particular target.
991 toolset=$iriverbitmaptools
992 t_cpu="coldfire"
993 t_manufacturer="iriver"
994 t_model="h100"
997 11|h300)
998 target_id=10
999 modelname="h300"
1000 target="-DIRIVER_H300"
1001 memory=32 # always
1002 coldfirecc
1003 tool="$rootdir/tools/scramble -add=h300"
1004 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1005 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1006 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1007 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1008 output="rockbox.iriver"
1009 appextra="recorder:gui"
1010 plugins="yes"
1011 swcodec="yes"
1012 # toolset is the tools within the tools directory that we build for
1013 # this particular target.
1014 toolset=$iriverbitmaptools
1015 t_cpu="coldfire"
1016 t_manufacturer="iriver"
1017 t_model="h300"
1020 12|h100)
1021 target_id=11
1022 modelname="h100"
1023 target="-DIRIVER_H100"
1024 memory=16 # always
1025 coldfirecc
1026 tool="$rootdir/tools/scramble -add=h100"
1027 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1028 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1029 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1030 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1031 output="rockbox.iriver"
1032 appextra="recorder:gui"
1033 flash="$pwd/rombox.iriver"
1034 plugins="yes"
1035 swcodec="yes"
1036 # toolset is the tools within the tools directory that we build for
1037 # this particular target.
1038 toolset=$iriverbitmaptools
1039 t_cpu="coldfire"
1040 t_manufacturer="iriver"
1041 t_model="h100"
1044 13|ifp7xx)
1045 target_id=19
1046 modelname="ifp7xx"
1047 target="-DIRIVER_IFP7XX"
1048 memory=1
1049 arm7tdmicc short
1050 tool="cp"
1051 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1052 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1053 output="rockbox.wma"
1054 appextra="recorder:gui"
1055 plugins="yes"
1056 swcodec="yes"
1057 # toolset is the tools within the tools directory that we build for
1058 # this particular target.
1059 toolset=$genericbitmaptools
1060 t_cpu="arm"
1061 t_manufacturer="pnx0101"
1062 t_model="iriver-ifp7xx"
1065 14|h10)
1066 target_id=22
1067 modelname="h10"
1068 target="-DIRIVER_H10"
1069 memory=32 # always
1070 arm7tdmicc
1071 tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
1072 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1073 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1074 output="rockbox.mi4"
1075 appextra="recorder:gui"
1076 plugins="yes"
1077 swcodec="yes"
1078 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
1079 bootoutput="H10_20GC.mi4"
1080 # toolset is the tools within the tools directory that we build for
1081 # this particular target.
1082 toolset=$scramblebitmaptools
1083 # architecture, manufacturer and model for the target-tree build
1084 t_cpu="arm"
1085 t_manufacturer="iriver"
1086 t_model="h10"
1089 15|h10_5gb)
1090 target_id=24
1091 modelname="h10_5gb"
1092 target="-DIRIVER_H10_5GB"
1093 memory=32 # always
1094 arm7tdmicc
1095 tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
1096 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1097 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1098 output="rockbox.mi4"
1099 appextra="recorder:gui"
1100 plugins="yes"
1101 swcodec="yes"
1102 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
1103 bootoutput="H10.mi4"
1104 # toolset is the tools within the tools directory that we build for
1105 # this particular target.
1106 toolset=$scramblebitmaptools
1107 # architecture, manufacturer and model for the target-tree build
1108 t_cpu="arm"
1109 t_manufacturer="iriver"
1110 t_model="h10"
1113 20|ipodcolor)
1114 target_id=13
1115 modelname="ipodcolor"
1116 target="-DIPOD_COLOR"
1117 memory=32 # always
1118 arm7tdmicc
1119 tool="$rootdir/tools/scramble -add=ipco"
1120 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1121 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1122 output="rockbox.ipod"
1123 appextra="recorder:gui"
1124 plugins="yes"
1125 swcodec="yes"
1126 bootoutput="bootloader-$modelname.ipod"
1127 # toolset is the tools within the tools directory that we build for
1128 # this particular target.
1129 toolset=$ipodbitmaptools
1130 # architecture, manufacturer and model for the target-tree build
1131 t_cpu="arm"
1132 t_manufacturer="ipod"
1133 t_model="color"
1136 21|ipodnano)
1137 target_id=14
1138 modelname="ipodnano"
1139 target="-DIPOD_NANO"
1140 memory=32 # always
1141 arm7tdmicc
1142 tool="$rootdir/tools/scramble -add=nano"
1143 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1144 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1145 output="rockbox.ipod"
1146 appextra="recorder:gui"
1147 plugins="yes"
1148 swcodec="yes"
1149 bootoutput="bootloader-$modelname.ipod"
1150 # toolset is the tools within the tools directory that we build for
1151 # this particular target.
1152 toolset=$ipodbitmaptools
1153 # architecture, manufacturer and model for the target-tree build
1154 t_cpu="arm"
1155 t_manufacturer="ipod"
1156 t_model="nano"
1159 22|ipodvideo)
1160 target_id=15
1161 modelname="ipodvideo"
1162 target="-DIPOD_VIDEO"
1163 arm7tdmicc
1164 tool="$rootdir/tools/scramble -add=ipvd"
1165 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1166 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1167 output="rockbox.ipod"
1168 appextra="recorder:gui"
1169 plugins="yes"
1170 swcodec="yes"
1171 bootoutput="bootloader-$modelname.ipod"
1172 # toolset is the tools within the tools directory that we build for
1173 # this particular target.
1174 toolset=$ipodbitmaptools
1175 # architecture, manufacturer and model for the target-tree build
1176 t_cpu="arm"
1177 t_manufacturer="ipod"
1178 t_model="video"
1181 23|ipod3g)
1182 target_id=16
1183 modelname="ipod3g"
1184 target="-DIPOD_3G"
1185 memory=32 # always
1186 arm7tdmicc
1187 tool="$rootdir/tools/scramble -add=ip3g"
1188 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1189 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1190 output="rockbox.ipod"
1191 appextra="recorder:gui"
1192 plugins="yes"
1193 swcodec="yes"
1194 bootoutput="bootloader-$modelname.ipod"
1195 # toolset is the tools within the tools directory that we build for
1196 # this particular target.
1197 toolset=$ipodbitmaptools
1198 # architecture, manufacturer and model for the target-tree build
1199 t_cpu="arm"
1200 t_manufacturer="ipod"
1201 t_model="3g"
1204 24|ipod4g)
1205 target_id=17
1206 modelname="ipod4g"
1207 target="-DIPOD_4G"
1208 memory=32 # always
1209 arm7tdmicc
1210 tool="$rootdir/tools/scramble -add=ip4g"
1211 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1212 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1213 output="rockbox.ipod"
1214 appextra="recorder:gui"
1215 plugins="yes"
1216 swcodec="yes"
1217 bootoutput="bootloader-$modelname.ipod"
1218 # toolset is the tools within the tools directory that we build for
1219 # this particular target.
1220 toolset=$ipodbitmaptools
1221 # architecture, manufacturer and model for the target-tree build
1222 t_cpu="arm"
1223 t_manufacturer="ipod"
1224 t_model="4g"
1227 25|ipodmini)
1228 target_id=18
1229 modelname="ipodmini"
1230 target="-DIPOD_MINI"
1231 memory=32 # always
1232 arm7tdmicc
1233 tool="$rootdir/tools/scramble -add=mini"
1234 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1235 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1236 output="rockbox.ipod"
1237 appextra="recorder:gui"
1238 plugins="yes"
1239 swcodec="yes"
1240 bootoutput="bootloader-$modelname.ipod"
1241 # toolset is the tools within the tools directory that we build for
1242 # this particular target.
1243 toolset=$ipodbitmaptools
1244 # architecture, manufacturer and model for the target-tree build
1245 t_cpu="arm"
1246 t_manufacturer="ipod"
1247 t_model="mini"
1250 26|ipodmini2g)
1251 target_id=21
1252 modelname="ipodmini2g"
1253 target="-DIPOD_MINI2G"
1254 memory=32 # always
1255 arm7tdmicc
1256 tool="$rootdir/tools/scramble -add=mn2g"
1257 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1258 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1259 output="rockbox.ipod"
1260 appextra="recorder:gui"
1261 plugins="yes"
1262 swcodec="yes"
1263 bootoutput="bootloader-$modelname.ipod"
1264 # toolset is the tools within the tools directory that we build for
1265 # this particular target.
1266 toolset=$ipodbitmaptools
1267 # architecture, manufacturer and model for the target-tree build
1268 t_cpu="arm"
1269 t_manufacturer="ipod"
1270 t_model="mini2g"
1273 27|ipod1g2g)
1274 target_id=29
1275 modelname="ipod1g2g"
1276 target="-DIPOD_1G2G"
1277 memory=32 # always
1278 arm7tdmicc
1279 tool="$rootdir/tools/scramble -add=1g2g"
1280 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1281 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1282 output="rockbox.ipod"
1283 appextra="recorder:gui"
1284 plugins="yes"
1285 swcodec="yes"
1286 bootoutput="bootloader-$modelname.ipod"
1287 # toolset is the tools within the tools directory that we build for
1288 # this particular target.
1289 toolset=$ipodbitmaptools
1290 # architecture, manufacturer and model for the target-tree build
1291 t_cpu="arm"
1292 t_manufacturer="ipod"
1293 t_model="1g2g"
1296 30|x5)
1297 target_id=12
1298 modelname="x5"
1299 target="-DIAUDIO_X5"
1300 memory=16 # always
1301 coldfirecc
1302 tool="$rootdir/tools/scramble -add=iax5"
1303 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1304 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1305 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1306 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1307 output="rockbox.iaudio"
1308 appextra="recorder:gui"
1309 plugins="yes"
1310 swcodec="yes"
1311 # toolset is the tools within the tools directory that we build for
1312 # this particular target.
1313 toolset="$iaudiobitmaptools"
1314 # architecture, manufacturer and model for the target-tree build
1315 t_cpu="coldfire"
1316 t_manufacturer="iaudio"
1317 t_model="x5"
1320 31|m5)
1321 target_id=28
1322 modelname="m5"
1323 target="-DIAUDIO_M5"
1324 memory=16 # always
1325 coldfirecc
1326 tool="$rootdir/tools/scramble -add=iam5"
1327 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1328 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1329 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1330 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1331 output="rockbox.iaudio"
1332 appextra="recorder:gui"
1333 plugins="yes"
1334 swcodec="yes"
1335 # toolset is the tools within the tools directory that we build for
1336 # this particular target.
1337 toolset="$iaudiobitmaptools"
1338 # architecture, manufacturer and model for the target-tree build
1339 t_cpu="coldfire"
1340 t_manufacturer="iaudio"
1341 t_model="m5"
1344 32|iaudio7)
1345 target_id=32
1346 modelname="iaudio7"
1347 target="-DIAUDIO_7"
1348 memory=16 # always
1349 arm946cc
1350 tool="$rootdir/tools/scramble -add=i7"
1351 boottool="$rootdir/tools/scramble -tcc=crc"
1352 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1353 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1354 output="rockbox.iaudio"
1355 appextra="recorder:gui"
1356 plugins="yes"
1357 swcodec="yes"
1358 bootoutput="I7_FW.BIN"
1359 # toolset is the tools within the tools directory that we build for
1360 # this particular target.
1361 toolset="$tccbitmaptools"
1362 # architecture, manufacturer and model for the target-tree build
1363 t_cpu="arm"
1364 t_manufacturer="tcc77x"
1365 t_model="iaudio7"
1368 33|cowond2)
1369 target_id=34
1370 modelname="cowond2"
1371 target="-DCOWON_D2"
1372 memory=32
1373 arm926ejscc
1374 tool="$rootdir/tools/scramble -add=d2"
1375 boottool="$rootdir/tools/scramble -tcc=crc"
1376 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1377 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1378 output="rockbox.d2"
1379 appextra="recorder:gui"
1380 plugins="yes"
1381 swcodec="yes"
1382 toolset="$tccbitmaptools"
1383 # architecture, manufacturer and model for the target-tree build
1384 t_cpu="arm"
1385 t_manufacturer="tcc780x"
1386 t_model="cowond2"
1389 34|m3)
1390 target_id=37
1391 modelname="m3"
1392 target="-DIAUDIO_M3"
1393 memory=16 # always
1394 coldfirecc
1395 tool="$rootdir/tools/scramble -add=iam3"
1396 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1397 bmp2rb_native="$rootdir/tools/bmp2rb -f 7"
1398 output="rockbox.iaudio"
1399 appextra="recorder:gui"
1400 plugins="yes"
1401 swcodec="yes"
1402 # toolset is the tools within the tools directory that we build for
1403 # this particular target.
1404 toolset="$iaudiobitmaptools"
1405 # architecture, manufacturer and model for the target-tree build
1406 t_cpu="coldfire"
1407 t_manufacturer="iaudio"
1408 t_model="m3"
1411 40|gigabeatf)
1412 target_id=20
1413 modelname="gigabeatf"
1414 target="-DGIGABEAT_F"
1415 memory=32 # always
1416 arm9tdmicc
1417 tool="$rootdir/tools/scramble -add=giga"
1418 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1419 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1420 output="rockbox.gigabeat"
1421 appextra="recorder:gui"
1422 plugins="yes"
1423 swcodec="yes"
1424 toolset=$gigabeatbitmaptools
1425 boottool="$rootdir/tools/scramble -gigabeat"
1426 bootoutput="FWIMG01.DAT"
1427 # architecture, manufacturer and model for the target-tree build
1428 t_cpu="arm"
1429 t_manufacturer="s3c2440"
1430 t_model="gigabeat-fx"
1433 41|gigabeats)
1434 target_id=26
1435 modelname="gigabeats"
1436 target="-DGIGABEAT_S"
1437 memory=64
1438 arm1136jfscc
1439 tool="$rootdir/tools/scramble -add=gigs"
1440 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1441 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1442 output="rockbox.gigabeat"
1443 appextra="recorder:gui"
1444 plugins="yes"
1445 swcodec="yes"
1446 toolset="$gigabeatbitmaptools mknkboot"
1447 boottool="$rootdir/tools/scramble -gigabeats"
1448 bootoutput="nk.bin"
1449 # architecture, manufacturer and model for the target-tree build
1450 t_cpu="arm"
1451 t_manufacturer="imx31"
1452 t_model="gigabeat-s"
1455 70|mrobe500)
1456 target_id=36
1457 modelname="mrobe500"
1458 target="-DMROBE_500"
1459 memory=64 # always
1460 arm926ejscc
1461 tool="$rootdir/tools/scramble -add=m500"
1462 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1463 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1464 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1465 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1466 output="rockbox.mrobe500"
1467 appextra="recorder:gui"
1468 plugins="yes"
1469 swcodec="yes"
1470 toolset=$gigabeatbitmaptools
1471 boottool="cp "
1472 bootoutput="rockbox.mrboot"
1473 # architecture, manufacturer and model for the target-tree build
1474 t_cpu="arm"
1475 t_manufacturer="tms320dm320"
1476 t_model="mrobe-500"
1479 71|mrobe100)
1480 target_id=33
1481 modelname="mrobe100"
1482 target="-DMROBE_100"
1483 memory=32 # always
1484 arm7tdmicc
1485 tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS"
1486 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1487 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1488 output="rockbox.mi4"
1489 appextra="recorder:gui"
1490 plugins="yes"
1491 swcodec="yes"
1492 boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL"
1493 bootoutput="pp5020.mi4"
1494 # toolset is the tools within the tools directory that we build for
1495 # this particular target.
1496 toolset=$scramblebitmaptools
1497 # architecture, manufacturer and model for the target-tree build
1498 t_cpu="arm"
1499 t_manufacturer="olympus"
1500 t_model="mrobe-100"
1503 80|logikdax)
1504 target_id=31
1505 modelname="logikdax"
1506 target="-DLOGIK_DAX"
1507 memory=2 # always
1508 arm946cc
1509 tool="$rootdir/tools/scramble -add=ldax"
1510 boottool="$rootdir/tools/scramble -tcc=crc"
1511 bootoutput="player.rom"
1512 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1513 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1514 output="rockbox.logik"
1515 appextra="recorder:gui"
1516 plugins=""
1517 swcodec="yes"
1518 # toolset is the tools within the tools directory that we build for
1519 # this particular target.
1520 toolset=$tccbitmaptools
1521 # architecture, manufacturer and model for the target-tree build
1522 t_cpu="arm"
1523 t_manufacturer="tcc77x"
1524 t_model="logikdax"
1527 90|creativezvm30gb)
1528 target_id=35
1529 modelname="creativezvm30"
1530 target="-DCREATIVE_ZVM"
1531 memory=64
1532 arm926ejscc
1533 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1534 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1535 tool="$rootdir/tools/scramble -creative=zvm"
1536 USE_ELF="yes"
1537 output="rockbox.zvm"
1538 appextra="recorder:gui"
1539 plugins="yes"
1540 swcodec="yes"
1541 toolset=$ipodbitmaptools
1542 boottool="$rootdir/tools/scramble -creative=zvm -no-ciff"
1543 bootoutput="rockbox.zvmboot"
1544 # architecture, manufacturer and model for the target-tree build
1545 t_cpu="arm"
1546 t_manufacturer="tms320dm320"
1547 t_model="creative-zvm"
1550 91|creativezvm60gb)
1551 target_id=40
1552 modelname="creativezvm60"
1553 target="-DCREATIVE_ZVM60GB"
1554 memory=64
1555 arm926ejscc
1556 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1557 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1558 tool="$rootdir/tools/scramble -creative=zvm60 -no-ciff"
1559 USE_ELF="yes"
1560 output="rockbox.zvm60"
1561 appextra="recorder:gui"
1562 plugins="yes"
1563 swcodec="yes"
1564 toolset=$ipodbitmaptools
1565 boottool="$rootdir/tools/scramble -creative=zvm60"
1566 bootoutput="rockbox.zvm60boot"
1567 # architecture, manufacturer and model for the target-tree build
1568 t_cpu="arm"
1569 t_manufacturer="tms320dm320"
1570 t_model="creative-zvm"
1573 92|creativezenvision)
1574 target_id=39
1575 modelname="creativezv"
1576 target="-DCREATIVE_ZV"
1577 memory=64
1578 arm926ejscc
1579 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1580 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1581 tool="$rootdir/tools/scramble -creative=zenvision -no-ciff"
1582 USE_ELF="yes"
1583 output="rockbox.zv"
1584 appextra="recorder:gui"
1585 plugins=""
1586 swcodec="yes"
1587 toolset=$ipodbitmaptools
1588 boottool="$rootdir/tools/scramble -creative=zenvision"
1589 bootoutput="rockbox.zvboot"
1590 # architecture, manufacturer and model for the target-tree build
1591 t_cpu="arm"
1592 t_manufacturer="tms320dm320"
1593 t_model="creative-zvm"
1596 50|e200)
1597 target_id=23
1598 modelname="e200"
1599 target="-DSANSA_E200"
1600 memory=32 # supposedly
1601 arm7tdmicc
1602 tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1603 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1604 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1605 output="rockbox.mi4"
1606 appextra="recorder:gui"
1607 plugins="yes"
1608 swcodec="yes"
1609 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1610 bootoutput="PP5022.mi4"
1611 # toolset is the tools within the tools directory that we build for
1612 # this particular target.
1613 toolset=$scramblebitmaptools
1614 # architecture, manufacturer and model for the target-tree build
1615 t_cpu="arm"
1616 t_manufacturer="sandisk"
1617 t_model="sansa-e200"
1620 51|e200r)
1621 # the e200R model is pretty much identical to the e200, it only has a
1622 # different option to the scramble tool when building a bootloader and
1623 # makes the bootloader output file name in all lower case.
1624 target_id=27
1625 modelname="e200r"
1626 target="-DSANSA_E200"
1627 memory=32 # supposedly
1628 arm7tdmicc
1629 tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1630 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1631 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1632 output="rockbox.mi4"
1633 appextra="recorder:gui"
1634 plugins="yes"
1635 swcodec="yes"
1636 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1637 bootoutput="pp5022.mi4"
1638 # toolset is the tools within the tools directory that we build for
1639 # this particular target.
1640 toolset=$scramblebitmaptools
1641 # architecture, manufacturer and model for the target-tree build
1642 t_cpu="arm"
1643 t_manufacturer="sandisk"
1644 t_model="sansa-e200"
1647 52|c200)
1648 target_id=30
1649 modelname="c200"
1650 target="-DSANSA_C200"
1651 memory=32 # supposedly
1652 arm7tdmicc
1653 tool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBOS"
1654 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1655 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1656 output="rockbox.mi4"
1657 appextra="recorder:gui"
1658 plugins="yes"
1659 swcodec="yes"
1660 boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
1661 bootoutput="firmware.mi4"
1662 # toolset is the tools within the tools directory that we build for
1663 # this particular target.
1664 toolset=$scramblebitmaptools
1665 # architecture, manufacturer and model for the target-tree build
1666 t_cpu="arm"
1667 t_manufacturer="sandisk"
1668 t_model="sansa-c200"
1671 53|m200)
1672 target_id=48
1673 modelname="m200"
1674 target="-DSANSA_M200"
1675 memory=1 # always
1676 arm946cc
1677 tool="$rootdir/tools/scramble -add=m200"
1678 boottool="$rootdir/tools/scramble -tcc=crc"
1679 bootoutput="player.rom"
1680 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1681 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1682 output="rockbox.m200"
1683 appextra="recorder:gui"
1684 plugins=""
1685 swcodec="yes"
1686 # toolset is the tools within the tools directory that we build for
1687 # this particular target.
1688 toolset=$tccbitmaptools
1689 # architecture, manufacturer and model for the target-tree build
1690 t_cpu="arm"
1691 t_manufacturer="tcc77x"
1692 t_model="m200"
1695 54|c100)
1696 target_id=42
1697 modelname="c100"
1698 target="-DSANSA_C100"
1699 memory=32 # unsure, must check
1700 arm946cc
1701 tool="$rootdir/tools/scramble -add=c100"
1702 boottool="$rootdir/tools/scramble -tcc=crc"
1703 bootoutput="player.rom"
1704 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1705 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1706 output="rockbox.c100"
1707 appextra="recorder:gui"
1708 plugins=""
1709 # toolset is the tools within the tools directory that we build for
1710 # this particular target.
1711 toolset=$tccbitmaptools
1712 # architecture, manufacturer and model for the target-tree build
1713 t_cpu="arm"
1714 t_manufacturer="tcc77x"
1715 t_model="c100"
1718 55|Clip|clip)
1719 target_id=50
1720 modelname="clip"
1721 target="-DSANSA_CLIP"
1722 memory=2
1723 arm9tdmicc
1724 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1725 bmp2rb_native="$bmp2rb_mono"
1726 tool="$rootdir/tools/scramble -add=clip"
1727 output="rockbox.sansa"
1728 bootoutput="bootloader-clip.sansa"
1729 appextra="recorder:gui"
1730 plugins="yes"
1731 swcodec="yes"
1732 toolset=$scramblebitmaptools
1733 t_cpu="arm"
1734 t_manufacturer="as3525"
1735 t_model="sansa-clip"
1739 56|e200v2)
1740 target_id=51
1741 modelname="e200v2"
1742 target="-DSANSA_E200V2"
1743 memory=8
1744 arm9tdmicc
1745 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1746 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1747 tool="$rootdir/tools/scramble -add=e2v2"
1748 output="rockbox.sansa"
1749 bootoutput="bootloader-e200v2.sansa"
1750 appextra="recorder:gui"
1751 plugins="yes"
1752 swcodec="yes"
1753 toolset=$scramblebitmaptools
1754 t_cpu="arm"
1755 t_manufacturer="as3525"
1756 t_model="sansa-e200v2"
1760 57|m200v4)
1761 target_id=52
1762 modelname="m200v4"
1763 target="-DSANSA_M200V4"
1764 memory=2
1765 arm9tdmicc
1766 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1767 bmp2rb_native="$bmp2rb_mono"
1768 tool="$rootdir/tools/scramble -add=m2v4"
1769 output="rockbox.sansa"
1770 bootoutput="bootloader-m200v4.sansa"
1771 appextra="recorder:gui"
1772 plugins="yes"
1773 swcodec="yes"
1774 toolset=$scramblebitmaptools
1775 t_cpu="arm"
1776 t_manufacturer="as3525"
1777 t_model="sansa-m200v4"
1781 58|fuze)
1782 target_id=53
1783 modelname="fuze"
1784 target="-DSANSA_FUZE"
1785 memory=8
1786 arm9tdmicc
1787 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1788 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1789 tool="$rootdir/tools/scramble -add=fuze"
1790 output="rockbox.sansa"
1791 bootoutput="bootloader-fuze.sansa"
1792 appextra="recorder:gui"
1793 plugins="yes"
1794 swcodec="yes"
1795 toolset=$scramblebitmaptools
1796 t_cpu="arm"
1797 t_manufacturer="as3525"
1798 t_model="sansa-fuze"
1802 59|c200v2)
1803 target_id=55
1804 modelname="c200v2"
1805 target="-DSANSA_C200V2"
1806 memory=2 # as per OF diagnosis mode
1807 arm9tdmicc
1808 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1809 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1810 tool="$rootdir/tools/scramble -add=c2v2"
1811 output="rockbox.sansa"
1812 bootoutput="bootloader-c200v2.sansa"
1813 appextra="recorder:gui"
1814 plugins="yes"
1815 swcodec="yes"
1816 # toolset is the tools within the tools directory that we build for
1817 # this particular target.
1818 toolset=$scramblebitmaptools
1819 # architecture, manufacturer and model for the target-tree build
1820 t_cpu="arm"
1821 t_manufacturer="as3525"
1822 t_model="sansa-c200v2"
1825 60|tpj1022)
1826 target_id=25
1827 modelname="tpj1022"
1828 target="-DELIO_TPJ1022"
1829 memory=32 # always
1830 arm7tdmicc
1831 tool="$rootdir/tools/scramble -add tpj2"
1832 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1833 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1834 output="rockbox.elio"
1835 appextra="recorder:gui"
1836 plugins="yes"
1837 swcodec="yes"
1838 boottool="$rootdir/tools/scramble -mi4v2"
1839 bootoutput="pp5020.mi4"
1840 # toolset is the tools within the tools directory that we build for
1841 # this particular target.
1842 toolset=$scramblebitmaptools
1843 # architecture, manufacturer and model for the target-tree build
1844 t_cpu="arm"
1845 t_manufacturer="tatung"
1846 t_model="tpj1022"
1849 100|sa9200)
1850 target_id=41
1851 modelname="sa9200"
1852 target="-DPHILIPS_SA9200"
1853 memory=32 # supposedly
1854 arm7tdmicc
1855 tool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBOS"
1856 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1857 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1858 output="rockbox.mi4"
1859 appextra="recorder:gui"
1860 plugins=""
1861 swcodec="yes"
1862 boottool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBBL"
1863 bootoutput="FWImage.ebn"
1864 # toolset is the tools within the tools directory that we build for
1865 # this particular target.
1866 toolset=$scramblebitmaptools
1867 # architecture, manufacturer and model for the target-tree build
1868 t_cpu="arm"
1869 t_manufacturer="philips"
1870 t_model="sa9200"
1873 101|hdd1630)
1874 target_id=43
1875 modelname="hdd1630"
1876 target="-DPHILIPS_HDD1630"
1877 memory=32 # supposedly
1878 arm7tdmicc
1879 tool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBOS"
1880 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1881 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1882 output="rockbox.mi4"
1883 appextra="recorder:gui"
1884 plugins="yes"
1885 swcodec="yes"
1886 boottool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBBL"
1887 bootoutput="FWImage.ebn"
1888 # toolset is the tools within the tools directory that we build for
1889 # this particular target.
1890 toolset=$scramblebitmaptools
1891 # architecture, manufacturer and model for the target-tree build
1892 t_cpu="arm"
1893 t_manufacturer="philips"
1894 t_model="hdd1630"
1897 110|meizum6sl)
1898 target_id=49
1899 modelname="meizum6sl"
1900 target="-DMEIZU_M6SL"
1901 memory=16 # always
1902 arm940tbecc
1903 tool="cp"
1904 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1905 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1906 output="rockbox.meizu"
1907 appextra="recorder:gui"
1908 plugins="no" #FIXME
1909 swcodec="yes"
1910 toolset=$genericbitmaptools
1911 boottool="cp"
1912 bootoutput="rockboot.ebn"
1913 # architecture, manufacturer and model for the target-tree build
1914 t_cpu="arm"
1915 t_manufacturer="s5l8700"
1916 t_model="meizu-m6sl"
1919 111|meizum6sp)
1920 target_id=46
1921 modelname="meizum6sp"
1922 target="-DMEIZU_M6SP"
1923 memory=16 # always
1924 arm940tbecc
1925 tool="cp"
1926 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1927 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1928 output="rockbox.meizu"
1929 appextra="recorder:gui"
1930 plugins="no" #FIXME
1931 swcodec="yes"
1932 toolset=$genericbitmaptools
1933 boottool="cp"
1934 bootoutput="rockboot.ebn"
1935 # architecture, manufacturer and model for the target-tree build
1936 t_cpu="arm"
1937 t_manufacturer="s5l8700"
1938 t_model="meizu-m6sp"
1941 112|meizum3)
1942 target_id=47
1943 modelname="meizum3"
1944 target="-DMEIZU_M3"
1945 memory=16 # always
1946 arm940tbecc
1947 tool="cp"
1948 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1949 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1950 output="rockbox.meizu"
1951 appextra="recorder:gui"
1952 plugins="no" #FIXME
1953 swcodec="yes"
1954 toolset=$genericbitmaptools
1955 boottool="cp"
1956 bootoutput="rockboot.ebn"
1957 # architecture, manufacturer and model for the target-tree build
1958 t_cpu="arm"
1959 t_manufacturer="s5l8700"
1960 t_model="meizu-m3"
1963 120|ondavx747)
1964 target_id=44
1965 modelname="ondavx747"
1966 target="-DONDA_VX747"
1967 memory=16
1968 mipselcc
1969 tool="$rootdir/tools/scramble -add=x747"
1970 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1971 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1972 output="rockbox.vx747"
1973 appextra="recorder:gui"
1974 plugins="yes"
1975 swcodec="yes"
1976 toolset=$genericbitmaptools
1977 boottool="cp"
1978 bootoutput="rockboot.vx747"
1979 # architecture, manufacturer and model for the target-tree build
1980 t_cpu="mips"
1981 t_manufacturer="ingenic_jz47xx"
1982 t_model="onda_vx747"
1985 121|ondavx767)
1986 target_id=45
1987 modelname="ondavx767"
1988 target="-DONDA_VX767"
1989 memory=16 #FIXME
1990 mipselcc
1991 tool="cp"
1992 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1993 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1994 output="rockbox.vx767"
1995 appextra="recorder:gui"
1996 plugins="" #FIXME
1997 swcodec="yes"
1998 toolset=$genericbitmaptools
1999 boottool="cp"
2000 bootoutput="rockboot.vx767"
2001 # architecture, manufacturer and model for the target-tree build
2002 t_cpu="mips"
2003 t_manufacturer="ingenic_jz47xx"
2004 t_model="onda_vx767"
2007 122|ondavx747p)
2008 target_id=54
2009 modelname="ondavx747p"
2010 target="-DONDA_VX747P"
2011 memory=16 #FIXME
2012 mipselcc
2013 tool="cp"
2014 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2015 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2016 output="rockbox.vx747p"
2017 appextra="recorder:gui"
2018 plugins="" #FIXME
2019 swcodec="yes"
2020 toolset=$genericbitmaptools
2021 boottool="cp"
2022 bootoutput="rockboot.vx747p"
2023 # architecture, manufacturer and model for the target-tree build
2024 t_cpu="mips"
2025 t_manufacturer="ingenic_jz47xx"
2026 t_model="onda_vx747"
2029 130|lyre_proto1)
2030 target_id=56
2031 modelname="lyre_proto1"
2032 target="-DLYRE_PROTO1"
2033 memory=64
2034 arm926ejscc
2035 tool="cp"
2036 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2037 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2038 output="rockbox.lyre"
2039 appextra="recorder:gui"
2040 plugins=""
2041 swcodec="yes"
2042 toolset=$scramblebitmaptools
2043 boottool="cp"
2044 bootoutput="bootloader-proto1.lyre"
2045 # architecture, manufacturer and model for the target-tree build
2046 t_cpu="arm"
2047 t_manufacturer="at91sam"
2048 t_model="lyre_proto1"
2052 echo "Please select a supported target platform!"
2053 exit 7
2056 esac
2058 echo "Platform set to $modelname"
2061 #remove start
2062 ############################################################################
2063 # Amount of memory, for those that can differ. They have $memory unset at
2064 # this point.
2067 if [ -z "$memory" ]; then
2068 case $target_id in
2070 echo "Enter size of your RAM (in MB): (Defaults to 32)"
2071 if [ "1" != `parse_args --ram` ]; then
2072 size=`parse_args --ram`;
2073 else
2074 size=`input`;
2076 case $size in
2077 60|64)
2078 memory="64"
2081 memory="32"
2083 esac
2086 echo "Enter size of your RAM (in MB): (Defaults to 2)"
2087 if [ "1" != `parse_args --ram` ]; then
2088 size=`parse_args --ram`;
2089 else
2090 size=`input`;
2092 case $size in
2094 memory="8"
2097 memory="2"
2099 esac
2101 esac
2102 echo "Memory size selected: $memory MB"
2103 echo ""
2105 #remove end
2107 ##################################################################
2108 # Figure out build "type"
2111 # the ifp7x0 is the only platform that supports building a gdb stub like
2112 # this
2113 case $modelname in
2114 ifp7xx)
2115 gdbstub="(G)DB stub, "
2117 e200r|e200)
2118 gdbstub="(I)nstaller, "
2120 c200)
2121 gdbstub="(E)raser, "
2125 esac
2126 if [ "1" != `parse_args --type` ]; then
2127 btype=`parse_args --type`;
2128 else
2129 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, $gdbstub(M)anual: (Defaults to N)"
2130 btype=`input`;
2133 case $btype in
2134 [Ii])
2135 appsdir='\$(ROOTDIR)/bootloader'
2136 apps="bootloader"
2137 extradefines="-DBOOTLOADER -DE200R_INSTALLER -ffunction-sections -fdata-sections"
2138 bootloader="1"
2139 echo "e200R-installer build selected"
2141 [Ee])
2142 appsdir='\$(ROOTDIR)/bootloader'
2143 apps="bootloader"
2144 echo "C2(4)0 or C2(5)0"
2145 variant=`input`
2146 case $variant in
2148 extradefines="-DBOOTLOADER -DC200_ERASE -DC240_ERASE -ffunction-sections -fdata-sections"
2149 echo "c240 eraser build selected"
2152 extradefines="-DBOOTLOADER -DC200_ERASE -DC250_ERASE -ffunction-sections -fdata-sections"
2153 echo "c240 eraser build selected"
2155 esac
2156 bootloader="1"
2157 echo "c200 eraser build selected"
2159 [Bb])
2160 if test $t_manufacturer = "archos"; then
2161 # Archos SH-based players do this somewhat differently for
2162 # some reason
2163 appsdir='\$(ROOTDIR)/flash/bootbox'
2164 apps="bootbox"
2165 else
2166 appsdir='\$(ROOTDIR)/bootloader'
2167 apps="bootloader"
2168 flash=""
2169 if test -n "$boottool"; then
2170 tool="$boottool"
2172 if test -n "$bootoutput"; then
2173 output=$bootoutput
2176 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
2177 bootloader="1"
2178 echo "Bootloader build selected"
2180 [Ss])
2181 debug="-DDEBUG"
2182 simulator="yes"
2183 extradefines="-DSIMULATOR"
2184 archosrom=""
2185 flash=""
2186 echo "Simulator build selected"
2188 [Aa])
2189 echo "Advanced build selected"
2190 whichadvanced
2192 [Gg])
2193 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
2194 appsdir='\$(ROOTDIR)/gdb'
2195 apps="stub"
2196 case $modelname in
2197 ifp7xx)
2198 output="stub.wma"
2202 esac
2203 echo "GDB stub build selected"
2205 [Mm])
2206 toolset='';
2207 apps="manual"
2208 echo "Manual build selected"
2211 if [ "$modelname" = "e200r" ]; then
2212 echo "Do not use the e200R target for regular builds. Use e200 instead."
2213 exit 8
2215 debug=""
2216 btype="N" # set it explicitly since RET only gets here as well
2217 echo "Normal build selected"
2220 esac
2221 # to be able running "make manual" from non-manual configuration
2222 case $modelname in
2223 fmrecorder)
2224 manualdev="recorderv2fm"
2226 recorderv2)
2227 manualdev="recorderv2fm"
2229 h1??)
2230 manualdev="h100"
2232 ipodmini2g)
2233 manualdev="ipodmini"
2236 manualdev=$modelname
2238 esac
2240 if [ -z "$debug" ]; then
2241 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
2244 echo "Using source code root directory: $rootdir"
2246 # this was once possible to change at build-time, but no more:
2247 language="english"
2249 uname=`uname`
2251 if [ "yes" = "$simulator" ]; then
2252 # setup compiler and things for simulator
2253 simcc
2255 if [ -d "simdisk" ]; then
2256 echo "Subdirectory 'simdisk' already present"
2257 else
2258 mkdir simdisk
2259 echo "Created a 'simdisk' subdirectory for simulating the hard disk"
2263 # Now, figure out version number of the (gcc) compiler we are about to use
2264 gccver=`$CC -dumpversion`;
2266 # figure out the binutil version too and display it, mostly for the build
2267 # system etc to be able to see it easier
2268 if [ $uname = "Darwin" ]; then
2269 ldver=`$LD -v 2>&1 | sed -e 's/[^0-9.-]//g'`
2270 else
2271 ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
2274 if [ -z "$gccver" ]; then
2275 echo "WARNING: The compiler you must use ($CC) is not in your path!"
2276 echo "WARNING: this may cause your build to fail since we cannot do the"
2277 echo "WARNING: checks we want now."
2278 else
2280 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
2281 # DEPEND on it
2283 num1=`echo $gccver | cut -d . -f1`
2284 num2=`echo $gccver | cut -d . -f2`
2285 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
2287 # This makes:
2288 # 3.3.X => 303
2289 # 3.4.X => 304
2290 # 2.95.3 => 295
2292 echo "Using $CC $gccver ($gccnum)"
2294 if test "$gccnum" -ge "400"; then
2295 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
2296 # so we ignore that warnings for now
2297 # -Wno-pointer-sign
2298 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
2301 if test "$gccnum" -ge "401"; then
2302 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
2303 # will break strict-aliasing rules"
2305 GCCOPTS="$GCCOPTS -fno-strict-aliasing"
2308 if test "$gccnum" -ge "402"; then
2309 # disable warning about "warning: initialized field overwritten" as gcc 4.2
2310 # and later would throw it for several valid cases
2311 GCCOPTS="$GCCOPTS -Wno-override-init"
2314 case $prefix in
2316 # simulator
2318 i586-mingw32msvc-)
2319 # cross-compile for win32
2322 # Verify that the cross-compiler is of a recommended version!
2323 if test "$gccver" != "$gccchoice"; then
2324 echo "WARNING: Your cross-compiler $CC $gccver is not of the recommended"
2325 echo "WARNING: version $gccchoice!"
2326 echo "WARNING: This may cause your build to fail since it may be a version"
2327 echo "WARNING: that isn't functional or known to not be the best choice."
2328 echo "WARNING: If you suffer from build problems, you know that this is"
2329 echo "WARNING: a likely source for them..."
2332 esac
2337 echo "Using $LD $ldver"
2339 # check the compiler for SH platforms
2340 if test "$CC" = "sh-elf-gcc"; then
2341 if test "$gccnum" -lt "400"; then
2342 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
2343 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2344 else
2345 # figure out patch status
2346 gccpatch=`$CC --version`;
2348 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
2349 echo "gcc $gccver is rockbox patched"
2350 # then convert -O to -Os to get smaller binaries!
2351 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2352 else
2353 echo "WARNING: You use an unpatched gcc compiler: $gccver"
2354 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2359 if test "$CC" = "m68k-elf-gcc"; then
2360 # convert -O to -Os to get smaller binaries!
2361 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2364 if [ "1" != `parse_args --ccache` ]; then
2365 echo "Enable ccache for building"
2366 ccache="ccache"
2367 else
2368 if [ "1" = `parse_args --no-ccache` ]; then
2369 ccache=`findtool ccache`
2370 if test -n "$ccache"; then
2371 echo "Found and uses ccache ($ccache)"
2376 # figure out the full path to the various commands if possible
2377 HOSTCC=`findtool gcc --lit`
2378 HOSTAR=`findtool ar --lit`
2379 CC=`findtool ${CC} --lit`
2380 LD=`findtool ${AR} --lit`
2381 AR=`findtool ${AR} --lit`
2382 AS=`findtool ${AS} --lit`
2383 OC=`findtool ${OC} --lit`
2384 WINDRES=`findtool ${WINDRES} --lit`
2385 DLLTOOL=`findtool ${DLLTOOL} --lit`
2386 DLLWRAP=`findtool ${DLLWRAP} --lit`
2387 RANLIB=`findtool ${RANLIB} --lit`
2389 if test -n "$ccache"; then
2390 CC="$ccache $CC"
2393 if test "X$endian" = "Xbig"; then
2394 defendian="ROCKBOX_BIG_ENDIAN"
2395 else
2396 defendian="ROCKBOX_LITTLE_ENDIAN"
2399 if [ "1" != `parse_args --rbdir` ]; then
2400 rbdir=`parse_args --rbdir`;
2401 echo "Using alternate rockbox dir: ${rbdir}"
2404 sed > autoconf.h \
2405 -e "s,@ENDIAN@,${defendian},g" \
2406 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
2407 -e "s,@config_rtc@,$config_rtc,g" \
2408 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
2409 -e "s,@RBDIR@,${rbdir},g" \
2410 <<EOF
2411 /* This header was made by configure */
2412 #ifndef __BUILD_AUTOCONF_H
2413 #define __BUILD_AUTOCONF_H
2415 /* Define endianess for the target or simulator platform */
2416 #define @ENDIAN@ 1
2418 /* Define this if you build rockbox to support the logf logging and display */
2419 #undef ROCKBOX_HAS_LOGF
2421 /* optional defines for RTC mod for h1x0 */
2422 @config_rtc@
2423 @have_rtc_alarm@
2425 /* root of Rockbox */
2426 #define ROCKBOX_DIR "/@RBDIR@"
2428 #endif /* __BUILD_AUTOCONF_H */
2431 if test -n "$t_cpu"; then
2432 TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
2433 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
2434 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
2435 GCCOPTS="$GCCOPTS"
2438 if test "$simulator" = "yes"; then
2439 # add simul make stuff on the #SIMUL# line
2440 simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
2441 simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
2442 else
2443 # delete the lines that match
2444 simmagic1='/@SIMUL1@/D'
2445 simmagic2='/@SIMUL2@/D'
2448 if test "$swcodec" = "yes"; then
2449 voicetoolset="rbspeexenc voicefont wavtrim"
2450 else
2451 voicetoolset="voicefont wavtrim"
2454 if test "$apps" = "apps"; then
2455 # only when we build "real" apps we build the .lng files
2456 buildlangs="langs"
2459 #### Fix the cmdline ###
2460 if test -n "$ccache"; then
2461 cmdline="--ccache"
2464 cmdline="$cmdline --target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype"
2467 ### end of cmdline
2469 sed > Makefile \
2470 -e "s,@ROOTDIR@,${rootdir},g" \
2471 -e "s,@DEBUG@,${debug},g" \
2472 -e "s,@MEMORY@,${memory},g" \
2473 -e "s,@TARGET_ID@,${target_id},g" \
2474 -e "s,@TARGET@,${target},g" \
2475 -e "s,@CPU@,${t_cpu},g" \
2476 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
2477 -e "s,@MODELNAME@,${modelname},g" \
2478 -e "s,@LANGUAGE@,${language},g" \
2479 -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
2480 -e "s,@PWD@,${pwd},g" \
2481 -e "s,@HOSTCC@,${HOSTCC},g" \
2482 -e "s,@HOSTAR@,${HOSTAR},g" \
2483 -e "s,@CC@,${CC},g" \
2484 -e "s,@LD@,${LD},g" \
2485 -e "s,@AR@,${AR},g" \
2486 -e "s,@AS@,${AS},g" \
2487 -e "s,@OC@,${OC},g" \
2488 -e "s,@WINDRES@,${WINDRES},g" \
2489 -e "s,@DLLTOOL@,${DLLTOOL},g" \
2490 -e "s,@DLLWRAP@,${DLLWRAP},g" \
2491 -e "s,@RANLIB@,${RANLIB},g" \
2492 -e "s,@TOOL@,${tool},g" \
2493 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
2494 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
2495 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
2496 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
2497 -e "s,@OUTPUT@,${output},g" \
2498 -e "s,@APPEXTRA@,${appextra},g" \
2499 -e "s,@ARCHOSROM@,${archosrom},g" \
2500 -e "s,@FLASHFILE@,${flash},g" \
2501 -e "s,@PLUGINS@,${plugins},g" \
2502 -e "s,@CODECS@,${swcodec},g" \
2503 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
2504 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
2505 -e "s,@GCCOPTS@,${GCCOPTS},g" \
2506 -e "s,@TARGET_INC@,${TARGET_INC},g" \
2507 -e "s!@LDOPTS@!${LDOPTS}!g" \
2508 -e "s,@LOADADDRESS@,${loadaddress},g" \
2509 -e "s,@EXTRADEF@,${extradefines},g" \
2510 -e "s,@APPSDIR@,${appsdir},g" \
2511 -e "s,@FIRMDIR@,${firmdir},g" \
2512 -e "s,@TOOLSDIR@,${toolsdir},g" \
2513 -e "s,@APPS@,${apps},g" \
2514 -e "s,@SIMVER@,${simver},g" \
2515 -e "s,@GCCVER@,${gccver},g" \
2516 -e "s,@GCCNUM@,${gccnum},g" \
2517 -e "s,@UNAME@,${uname},g" \
2518 -e "s,@ENDIAN@,${defendian},g" \
2519 -e "s,@TOOLSET@,${toolset},g" \
2520 -e "${simmagic1}" \
2521 -e "${simmagic2}" \
2522 -e "s,@MANUALDEV@,${manualdev},g" \
2523 -e "s,@ENCODER@,${ENC_CMD},g" \
2524 -e "s,@ENC_OPTS@,${ENC_OPTS},g" \
2525 -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
2526 -e "s,@TTS_OPTS@,${TTS_OPTS},g" \
2527 -e "s,@VOICETOOLSET@,${voicetoolset},g" \
2528 -e "s,@LANGS@,${buildlangs},g" \
2529 -e "s,@USE_ELF@,${USE_ELF},g" \
2530 -e "s,@RBDIR@,${rbdir},g" \
2531 -e "s,@PREFIX@,$PREFIX,g" \
2532 -e "s,@CMDLINE@,$cmdline,g" \
2533 <<EOF
2534 ## Automatically generated. http://www.rockbox.org/
2536 export ROOTDIR=@ROOTDIR@
2537 export FIRMDIR=@FIRMDIR@
2538 export APPSDIR=@APPSDIR@
2539 export TOOLSDIR=@TOOLSDIR@
2540 export DOCSDIR=\$(ROOTDIR)/docs
2541 export MANUALDIR=\${ROOTDIR}/manual
2542 export DEBUG=@DEBUG@
2543 export MODELNAME=@MODELNAME@
2544 export ARCHOSROM=@ARCHOSROM@
2545 export FLASHFILE=@FLASHFILE@
2546 export TARGET_ID=@TARGET_ID@
2547 export TARGET=@TARGET@
2548 export CPU=@CPU@
2549 export MANUFACTURER=@MANUFACTURER@
2550 export OBJDIR=@PWD@
2551 export BUILDDIR=@PWD@
2552 export LANGUAGE=@LANGUAGE@
2553 export VOICELANGUAGE=@VOICELANGUAGE@
2554 export MEMORYSIZE=@MEMORY@
2555 export VERSION:=\$(shell \$(ROOTDIR)/tools/version.sh \$(ROOTDIR))
2556 export BUILDDATE:=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
2557 export MKFIRMWARE=@TOOL@
2558 export BMP2RB_MONO=@BMP2RB_MONO@
2559 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
2560 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
2561 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
2562 export BINARY=@OUTPUT@
2563 export APPEXTRA=@APPEXTRA@
2564 export ENABLEDPLUGINS=@PLUGINS@
2565 export SOFTWARECODECS=@CODECS@
2566 export EXTRA_DEFINES=@EXTRADEF@
2567 export HOSTCC=@HOSTCC@
2568 export HOSTAR=@HOSTAR@
2569 export CC=@CC@
2570 export LD=@LD@
2571 export AR=@AR@
2572 export AS=@AS@
2573 export OC=@OC@
2574 export WINDRES=@WINDRES@
2575 export DLLTOOL=@DLLTOOL@
2576 export DLLWRAP=@DLLWRAP@
2577 export RANLIB=@RANLIB@
2578 export PREFIX=@PREFIX@
2579 export PROFILE_OPTS=@PROFILE_OPTS@
2580 export SIMVER=@SIMVER@
2581 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
2582 export GCCOPTS=@GCCOPTS@
2583 export TARGET_INC=@TARGET_INC@
2584 export LOADADDRESS=@LOADADDRESS@
2585 export SHARED_FLAG=@SHARED_FLAG@
2586 export LDOPTS=@LDOPTS@
2587 export GCCVER=@GCCVER@
2588 export GCCNUM=@GCCNUM@
2589 export UNAME=@UNAME@
2590 export MANUALDEV=@MANUALDEV@
2591 export TTS_OPTS=@TTS_OPTS@
2592 export TTS_ENGINE=@TTS_ENGINE@
2593 export ENC_OPTS=@ENC_OPTS@
2594 export ENCODER=@ENCODER@
2595 export USE_ELF=@USE_ELF@
2596 export RBDIR=@RBDIR@
2598 CONFIGURE_OPTIONS=@CMDLINE@
2600 include \$(TOOLSDIR)/root.make
2604 echo "Created Makefile"