fix typo in comment.
[kugel-rb.git] / tools / configure
blob14685fd8e901fe50c5bc43c2386153953e936644
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 -pipe"
14 use_logf="#undef ROCKBOX_HAS_LOGF"
15 use_bootchart="#undef DO_BOOTCHART"
17 scriptver=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'`
19 rbdir=".rockbox"
22 # Begin Function Definitions
24 input() {
25 read response
26 echo $response
29 prefixtools () {
30 prefix="$1"
31 CC=${prefix}gcc
32 WINDRES=${prefix}windres
33 DLLTOOL=${prefix}dlltool
34 DLLWRAP=${prefix}dllwrap
35 RANLIB=${prefix}ranlib
36 LD=${prefix}ld
37 AR=${prefix}ar
38 AS=${prefix}as
39 OC=${prefix}objcopy
42 findarmgcc() {
43 # FIXME: ipod4g buttons do not work
44 [ "$ARG_ARM_EABI" != 1 -a "$modelname" = "ipod4g" ] && ARG_ARM_EABI="0"
46 if [ "$ARG_ARM_EABI" != "0" ]; then
47 prefixtools arm-elf-eabi-
48 gccchoice="4.4.4"
49 else
50 prefixtools arm-elf-
51 gccchoice="4.0.3"
55 # scan the $PATH for the given command
56 findtool(){
57 file="$1"
59 IFS=":"
60 for path in $PATH
62 # echo "checks for $file in $path" >&2
63 if test -f "$path/$file"; then
64 echo "$path/$file"
65 return
67 done
68 # check whether caller wants literal return value if not found
69 if [ "$2" = "--lit" ]; then
70 echo "$file"
74 # scan the $PATH for sdl-config - check whether for a (cross-)win32
75 # sdl as requested
76 findsdl(){
77 file="sdl-config"
78 winbuild="$1"
80 IFS=":"
81 for path in $PATH
83 #echo "checks for $file in $path" >&2
84 if test -f "$path/$file"; then
85 if [ "0" != `$path/$file --libs |grep -c mwindows` ]; then
86 if [ "yes" = "${winbuild}" ]; then
87 echo "$path/$file"
88 return
90 else
91 if [ "yes" != "${winbuild}" ]; then
92 echo "$path/$file"
93 return
97 done
100 simcc () {
102 # default tool setup for native building
103 prefixtools "$CROSS_COMPILE"
104 ARG_ARM_THUMB=0 # can't use thumb in native builds
106 simver=sdl
107 winbuild="$crosscompile"
108 GCCOPTS='-W -Wall -g -fno-builtin'
109 GCCOPTIMIZE=''
110 LDOPTS='-lm' # button-sdl.c uses sqrt()
112 # default output binary name
113 output="rockboxui"
115 # default share option, override below if needed
116 SHARED_FLAG="-shared"
118 case $uname in
119 CYGWIN*)
120 echo "Cygwin host detected"
122 LDOPTS="$LDOPTS -mconsole"
123 output="rockboxui.exe"
124 winbuild="yes"
127 MINGW*)
128 echo "MinGW host detected"
130 LDOPTS="$LDOPTS -mconsole"
131 output="rockboxui.exe"
132 winbuild="yes"
135 Linux)
136 echo "Linux host detected"
137 LDOPTS="$LDOPTS -ldl"
140 FreeBSD)
141 echo "FreeBSD host detected"
142 LDOPTS="$LDOPTS -ldl"
145 Darwin)
146 echo "Darwin host detected"
147 LDOPTS="$LDOPTS -ldl"
149 SHARED_FLAG="-dynamiclib -Wl\,-single_module"
152 SunOS)
153 echo "*Solaris host detected"
155 GCCOPTS="$GCCOPTS -fPIC"
156 LDOPTS="$LDOPTS -ldl"
160 echo "[ERROR] Unsupported system: $uname, fix configure and retry"
161 exit 1
163 esac
165 sdl=`findsdl $winbuild`
167 if [ $1 = "sdl" ]; then
168 if [ -z "$sdl" ]; then
169 echo "configure didn't find sdl-config, which indicates that you"
170 echo "don't have SDL (properly) installed. Please correct and"
171 echo "re-run configure!"
172 exit 2
173 else
174 # generic sdl-config checker
175 GCCOPTS="$GCCOPTS `$sdl --cflags`"
176 LDOPTS="$LDOPTS `$sdl --libs`"
180 GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
182 if test "X$crosscompile" != "Xyes"; then
183 case `uname -m` in
184 x86_64|amd64)
185 # fPIC is needed to make shared objects link
186 # setting visibility to hidden is necessary to avoid strange crashes
187 # due to symbol clashing
188 GCCOPTS="$GCCOPTS -fPIC -fvisibility=hidden"
189 # x86_64 supports MMX by default
192 i686)
193 echo "Enabling MMX support"
194 GCCOPTS="$GCCOPTS -mmmx"
196 esac
198 id=$$
199 cat >$tmpdir/conftest-$id.c <<EOF
200 #include <stdio.h>
201 int main(int argc, char **argv)
203 int var=0;
204 char *varp = (char *)&var;
205 *varp=1;
207 printf("%d\n", var);
208 return 0;
212 $CC -o $tmpdir/conftest-$id $tmpdir/conftest-$id.c 2>/dev/null
214 # when cross compiling, the endianess cannot be detected because the above program doesn't run
215 # on the local machine. assume little endian but print a warning
216 endian=`$tmpdir/conftest-$id 2> /dev/null`
217 if [ "$endian" != "" ] && [ $endian -gt "1" ]; then
218 # big endian
219 endian="big"
220 else
221 # little endian
222 endian="little"
225 if [ "$CROSS_COMPILE" != "" ]; then
226 echo "WARNING: Cross Compiling, cannot detect endianess. Assuming little endian!"
229 if [ $1 = "sdl" ]; then
230 echo "Simulator environment deemed $endian endian"
231 elif [ $1 = "checkwps" ]; then
232 echo "CheckWPS environment deemed $endian endian"
235 # use wildcard here to make it work even if it was named *.exe like
236 # on cygwin
237 rm -f $tmpdir/conftest-$id*
238 else
239 # We are crosscompiling
240 # add cross-compiler option(s)
241 prefixtools i586-mingw32msvc-
242 LDOPTS="$LDOPTS -mconsole"
243 output="rockboxui.exe"
244 endian="little" # windows is little endian
245 echo "Enabling MMX support"
246 GCCOPTS="$GCCOPTS -mmmx"
251 # functions for setting up cross-compiler names and options
252 # also set endianess and what the exact recommended gcc version is
253 # the gcc version should most likely match what versions we build with
254 # rockboxdev.sh
256 shcc () {
257 prefixtools sh-elf-
258 GCCOPTS="$CCOPTS -m1"
259 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
260 endian="big"
261 gccchoice="4.0.3"
264 calmrisccc () {
265 prefixtools calmrisc16-unknown-elf-
266 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
267 GCCOPTIMIZE="-fomit-frame-pointer"
268 endian="big"
271 coldfirecc () {
272 prefixtools m68k-elf-
273 GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
274 GCCOPTIMIZE="-fomit-frame-pointer"
275 endian="big"
276 gccchoice="3.4.6"
279 arm7tdmicc () {
280 findarmgcc
281 GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
282 if test "X$1" != "Xshort" -a "$ARG_ARM_EABI" = "0"; then
283 GCCOPTS="$GCCOPTS -mlong-calls"
285 GCCOPTIMIZE="-fomit-frame-pointer"
286 endian="little"
289 arm9tdmicc () {
290 findarmgcc
291 GCCOPTS="$CCOPTS -mcpu=arm9tdmi"
292 if test "$modelname" != "gigabeatfx" -a "$t_manufacturer" != "as3525" -a "$ARG_ARM_EABI" = "0"; then
293 GCCOPTS="$GCCOPTS -mlong-calls"
295 GCCOPTIMIZE="-fomit-frame-pointer"
296 endian="little"
299 arm940tbecc () {
300 findarmgcc
301 GCCOPTS="$CCOPTS -mbig-endian -mcpu=arm940t"
302 if test "$ARG_ARM_EABI" = "0"; then
303 GCCOPTS="$GCCOPTS -mlong-calls"
305 GCCOPTIMIZE="-fomit-frame-pointer"
306 endian="big"
309 arm940tcc () {
310 findarmgcc
311 GCCOPTS="$CCOPTS -mcpu=arm940t"
312 if test "$ARG_ARM_EABI" = "0"; then
313 GCCOPTS="$GCCOPTS -mlong-calls"
315 GCCOPTIMIZE="-fomit-frame-pointer"
316 endian="little"
319 arm946cc () {
320 findarmgcc
321 GCCOPTS="$CCOPTS -mcpu=arm9e"
322 if test "$ARG_ARM_EABI" = "0"; then
323 GCCOPTS="$GCCOPTS -mlong-calls"
325 GCCOPTIMIZE="-fomit-frame-pointer"
326 endian="little"
329 arm926ejscc () {
330 findarmgcc
331 GCCOPTS="$CCOPTS -mcpu=arm926ej-s"
332 if test "$t_manufacturer" != "as3525" -a "$ARG_ARM_EABI" = "0"; then
333 GCCOPTS="$GCCOPTS -mlong-calls"
335 GCCOPTIMIZE="-fomit-frame-pointer"
336 endian="little"
339 arm1136jfscc () {
340 findarmgcc
341 GCCOPTS="$CCOPTS -mcpu=arm1136jf-s"
342 if test "$modelname" != "gigabeats" -a "$ARG_ARM_EABI" = "0"; then
343 GCCOPTS="$GCCOPTS -mlong-calls"
345 GCCOPTIMIZE="-fomit-frame-pointer"
346 endian="little"
349 arm1176jzscc () {
350 findarmgcc
351 GCCOPTS="$CCOPTS -mcpu=arm1176jz-s"
352 if test "$ARG_ARM_EABI" = "0"; then
353 GCCOPTS="$GCCOPTS -mlong-calls"
355 GCCOPTIMIZE="-fomit-frame-pointer"
356 endian="little"
359 mipselcc () {
360 prefixtools mipsel-elf-
361 GCCOPTS="$CCOPTS -march=mips32 -mtune=r4600 -mno-mips16 -mno-long-calls"
362 GCCOPTS="$GCCOPTS -ffunction-sections -msoft-float -G 0 -Wno-parentheses"
363 GCCOPTIMIZE="-fomit-frame-pointer"
364 endian="little"
365 gccchoice="4.1.2"
368 whichadvanced () {
369 atype=`echo "$1" | cut -c 2-`
370 ##################################################################
371 # Prompt for specific developer options
373 if [ "$atype" ]; then
374 interact=
375 else
376 interact=1
377 echo ""
378 printf "Enter your developer options (press only enter when done)\n\
379 (D)EBUG, (L)ogf, Boot(c)hart, (S)imulator, (P)rofiling, (V)oice, (W)in32 crosscompile,\n\
380 (T)est plugins, S(m)all C lib:"
381 if [ "$memory" = "2" ]; then
382 printf ", (8)MB MOD"
384 if [ "$modelname" = "archosplayer" ]; then
385 printf ", Use (A)TA poweroff"
387 if [ "$t_model" = "ondio" ]; then
388 printf ", (B)acklight MOD"
390 if [ "$modelname" = "iaudiom5" ]; then
391 printf ", (F)M radio MOD"
393 if [ "$modelname" = "iriverh120" ]; then
394 printf ", (R)TC MOD"
396 echo ""
399 cont=1
400 while [ $cont = "1" ]; do
402 if [ "$interact" ]; then
403 option=`input`
404 else
405 option=`echo "$atype" | cut -c 1`
408 case $option in
409 [Dd])
410 if [ "yes" = "$profile" ]; then
411 echo "Debug is incompatible with profiling"
412 else
413 echo "DEBUG build enabled"
414 use_debug="yes"
417 [Ll])
418 echo "logf() support enabled"
419 logf="yes"
421 [Mm])
422 echo "Using Rockbox' small C library"
423 extradefines="$extradefines -DHAVE_ROCKBOX_C_LIBRARY"
425 [Tt])
426 echo "Including test plugins"
427 extradefines="$extradefines -DHAVE_TEST_PLUGINS"
429 [Cc])
430 echo "bootchart enabled (logf also enabled)"
431 bootchart="yes"
432 logf="yes"
434 [Ss])
435 echo "Simulator build enabled"
436 simulator="yes"
438 [Pp])
439 if [ "yes" = "$use_debug" ]; then
440 echo "Profiling is incompatible with debug"
441 else
442 echo "Profiling support is enabled"
443 profile="yes"
446 [Vv])
447 echo "Voice build selected"
448 voice="yes"
451 if [ "$memory" = "2" ]; then
452 memory="8"
453 echo "Memory size selected: 8MB"
456 [Aa])
457 if [ "$modelname" = "archosplayer" ]; then
458 have_ata_poweroff="#define HAVE_ATA_POWER_OFF"
459 echo "ATA power off enabled"
462 [Bb])
463 if [ "$t_model" = "ondio" ]; then
464 have_backlight="#define HAVE_BACKLIGHT"
465 echo "Backlight functions enabled"
468 [Ff])
469 if [ "$modelname" = "iaudiom5" ]; then
470 have_fmradio_in="#define HAVE_FMRADIO_IN"
471 echo "FM radio functions enabled"
474 [Rr])
475 if [ "$modelname" = "iriverh120" ]; then
476 config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231"
477 have_rtc_alarm="#define HAVE_RTC_ALARM"
478 echo "RTC functions enabled (DS1339/DS3231)"
481 [Ww])
482 echo "Enabling Windows 32 cross-compiling"
483 crosscompile="yes"
486 if [ "$interact" ]; then
487 cont=0
488 else
489 echo "[ERROR] Option $option unsupported"
492 esac
493 if [ "$interact" ]; then
494 btype="$btype$option"
495 else
496 atype=`echo "$atype" | cut -c 2-`
497 [ "$atype" ] || cont=0
499 done
500 echo "done"
502 if [ "yes" = "$voice" ]; then
503 # Ask about languages to build
504 picklang
505 voicelanguage=`whichlang`
506 echo "Voice language set to $voicelanguage"
508 # Configure encoder and TTS engine for each language
509 for thislang in `echo $voicelanguage | sed 's/,/ /g'`; do
510 voiceconfig "$thislang"
511 done
513 if [ "yes" = "$use_debug" ]; then
514 debug="-DDEBUG"
515 GCCOPTS="$GCCOPTS -g -DDEBUG"
517 if [ "yes" = "$logf" ]; then
518 use_logf="#define ROCKBOX_HAS_LOGF 1"
520 if [ "yes" = "$bootchart" ]; then
521 use_bootchart="#define DO_BOOTCHART 1"
523 if [ "yes" = "$simulator" ]; then
524 debug="-DDEBUG"
525 extradefines="$extradefines -DSIMULATOR"
526 archosrom=""
527 flash=""
529 if [ "yes" = "$profile" ]; then
530 extradefines="$extradefines -DRB_PROFILE"
531 PROFILE_OPTS="-finstrument-functions"
535 # Configure voice settings
536 voiceconfig () {
537 thislang=$1
538 if [ ! "$ARG_TTS" ]; then
539 echo "Building $thislang voice for $modelname. Select options"
540 echo ""
543 if [ -n "`findtool flite`" ]; then
544 FLITE="F(l)ite "
545 FLITE_OPTS=""
546 DEFAULT_TTS="flite"
547 DEFAULT_TTS_OPTS=$FLITE_OPTS
548 DEFAULT_NOISEFLOOR="500"
549 DEFAULT_CHOICE="L"
551 if [ -n "`findtool espeak`" ]; then
552 ESPEAK="(e)Speak "
553 ESPEAK_OPTS=""
554 DEFAULT_TTS="espeak"
555 DEFAULT_TTS_OPTS=$ESPEAK_OPTS
556 DEFAULT_NOISEFLOOR="500"
557 DEFAULT_CHOICE="e"
559 if [ -n "`findtool festival`" ]; then
560 FESTIVAL="(F)estival "
561 case "$thislang" in
562 "italiano")
563 FESTIVAL_OPTS="--language italian"
565 "espanol")
566 FESTIVAL_OPTS="--language spanish"
568 "finnish")
569 FESTIVAL_OPTS="--language finnish"
571 "czech")
572 FESTIVAL_OPTS="--language czech"
575 FESTIVAL_OPTS=""
577 esac
578 DEFAULT_TTS="festival"
579 DEFAULT_TTS_OPTS=$FESTIVAL_OPTS
580 DEFAULT_NOISEFLOOR="500"
581 DEFAULT_CHOICE="F"
583 if [ -n "`findtool swift`" ]; then
584 SWIFT="S(w)ift "
585 SWIFT_OPTS=""
586 DEFAULT_TTS="swift"
587 DEFAULT_TTS_OPTS=$SWIFT_OPTS
588 DEFAULT_NOISEFLOOR="500"
589 DEFAULT_CHOICE="w"
591 # Allow SAPI if Windows is in use
592 if [ -n "`findtool winver`" ]; then
593 SAPI="(S)API "
594 SAPI_OPTS=""
595 DEFAULT_TTS="sapi"
596 DEFAULT_TTS_OPTS=$SAPI_OPTS
597 DEFAULT_NOISEFLOOR="500"
598 DEFAULT_CHOICE="S"
601 if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ] && [ "$ESPEAK" = "$SAPI" ] && [ "$SAPI" = "$SWIFT" ]; then
602 echo "You need Festival, eSpeak or Flite in your path, or SAPI available to build voice files"
603 exit 3
606 if [ "$ARG_TTS" ]; then
607 option=$ARG_TTS
608 else
609 echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?"
610 option=`input`
612 advopts="$advopts --tts=$option"
613 case "$option" in
614 [Ll])
615 TTS_ENGINE="flite"
616 NOISEFLOOR="500" # TODO: check this value
617 TTS_OPTS=$FLITE_OPTS
619 [Ee])
620 TTS_ENGINE="espeak"
621 NOISEFLOOR="500"
622 TTS_OPTS=$ESPEAK_OPTS
624 [Ff])
625 TTS_ENGINE="festival"
626 NOISEFLOOR="500"
627 TTS_OPTS=$FESTIVAL_OPTS
629 [Ss])
630 TTS_ENGINE="sapi"
631 NOISEFLOOR="500"
632 TTS_OPTS=$SAPI_OPTS
634 [Ww])
635 TTS_ENGINE="swift"
636 NOISEFLOOR="500"
637 TTS_OPTS=$SWIFT_OPTS
640 TTS_ENGINE=$DEFAULT_TTS
641 TTS_OPTS=$DEFAULT_TTS_OPTS
642 NOISEFLOOR=$DEFAULT_NOISEFLOOR
643 esac
644 echo "Using $TTS_ENGINE for TTS"
646 # Select which voice to use for Festival
647 if [ "$TTS_ENGINE" = "festival" ]; then
648 voicelist=`echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1/'|sort`
649 for voice in $voicelist; do
650 TTS_FESTIVAL_VOICE="$voice" # Default choice
651 break
652 done
653 if [ "$ARG_VOICE" ]; then
654 CHOICE=$ARG_VOICE
655 else
657 for voice in $voicelist; do
658 printf "%3d. %s\n" "$i" "$voice"
659 i=`expr $i + 1`
660 done
661 printf "Please select which Festival voice to use (default is $TTS_FESTIVAL_VOICE): "
662 CHOICE=`input`
665 for voice in $voicelist; do
666 if [ "$i" = "$CHOICE" -o "$voice" = "$CHOICE" ]; then
667 TTS_FESTIVAL_VOICE="$voice"
669 i=`expr $i + 1`
670 done
671 advopts="$advopts --voice=$CHOICE"
672 echo "Festival voice set to $TTS_FESTIVAL_VOICE"
673 echo "(voice_$TTS_FESTIVAL_VOICE)" > festival-prolog.scm
676 # Read custom tts options from command line
677 if [ "$ARG_TTSOPTS" ]; then
678 TTS_OPTS="$ARG_TTSOPTS"
679 advopts="$advopts --ttsopts='$TTS_OPTS'"
680 echo "$TTS_ENGINE options set to $TTS_OPTS"
683 if [ "$swcodec" = "yes" ]; then
684 ENCODER="rbspeexenc"
685 ENC_CMD="rbspeexenc"
686 ENC_OPTS="-q 4 -c 10"
687 else
688 if [ -n "`findtool lame`" ]; then
689 ENCODER="lame"
690 ENC_CMD="lame"
691 ENC_OPTS="--resample 12 -t -m m -h -V 9.999 -S -B 64 --vbr-new"
692 else
693 echo "You need LAME in the system path to build voice files for"
694 echo "HWCODEC targets."
695 exit 4
699 echo "Using $ENCODER for encoding voice clips"
701 # Read custom encoder options from command line
702 if [ "$ARG_ENCOPTS" ]; then
703 ENC_OPTS="$ARG_ENCOPTS"
704 advopts="$advopts --encopts='$ENC_OPTS'"
705 echo "$ENCODER options set to $ENC_OPTS"
708 TEMPDIR="${pwd}"
709 if [ -n "`findtool cygpath`" ]; then
710 TEMPDIR=`cygpath . -a -w`
714 picklang() {
715 # figure out which languages that are around
716 for file in $rootdir/apps/lang/*.lang; do
717 clean=`basename $file .lang`
718 langs="$langs $clean"
719 done
721 if [ "$ARG_LANG" ]; then
722 pick=$ARG_LANG
723 else
724 echo "Select a number for the language to use (default is english)"
725 # FIXME The multiple-language feature is currently broken
726 # echo "You may enter a comma-separated list of languages to build"
728 num=1
729 for one in $langs; do
730 echo "$num. $one"
731 num=`expr $num + 1`
732 done
733 pick=`input`
735 advopts="$advopts --language=$pick"
738 whichlang() {
739 output=""
740 # Allow the user to pass a comma-separated list of langauges
741 for thispick in `echo $pick | sed 's/,/ /g'`; do
742 num=1
743 for one in $langs; do
744 # Accept both the language number and name
745 if [ "$num" = "$thispick" ] || [ "$thispick" = "$one" ]; then
746 if [ "$output" = "" ]; then
747 output=$one
748 else
749 output=$output,$one
752 num=`expr $num + 1`
753 done
754 done
755 if [ -z "$output" ]; then
756 # pick a default
757 output="english"
759 echo $output
762 help() {
763 echo "Rockbox configure script."
764 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
765 echo "Do *NOT* run this within the tools directory!"
766 echo ""
767 cat <<EOF
768 Usage: configure [OPTION]...
769 Options:
770 --target=TARGET Sets the target, TARGET can be either the target ID or
771 corresponding string. Run without this option to see all
772 available targets.
774 --ram=RAM Sets the RAM for certain targets. Even though any number
775 is accepted, not every number is correct. The default
776 value will be applied, if you entered a wrong number
777 (which depends on the target). Watch the output. Run
778 without this option if you are not sure which the right
779 number is.
781 --type=TYPE Sets the build type. Shortcuts are also valid.
782 Run without this option to see all available types.
783 Multiple values are allowed and managed in the input
784 order. So --type=b stands for Bootloader build, while
785 --type=ab stands for "Backlight MOD" build.
787 --language=LANG Set the language used for voice generation (used only if
788 TYPE is AV).
790 --tts=ENGINE Set the TTS engine used for voice generation (used only
791 if TYPE is AV).
793 --voice=VOICE Set voice to use with selected TTS (used only if TYPE is
794 AV).
796 --ttsopts=OPTS Set TTS engine manual options (used only if TYPE is AV).
798 --encopts=OPTS Set encoder manual options (used only if ATYPE is AV).
800 --rbdir=dir Use alternative rockbox directory (default: ${rbdir}).
801 This is useful for having multiple alternate builds on
802 your device that you can load with ROLO. However as the
803 bootloader looks for .rockbox you won't be able to boot
804 into this build.
806 --ccache Enable ccache use (done by default these days)
807 --no-ccache Disable ccache use
809 --eabi Make configure prefer toolchains that are able to compile
810 for the new ARM standard abi EABI
811 --no-eabi The opposite of --eabi (prefer old non-eabi toolchains)
812 --thumb Build with -mthumb (for ARM builds)
813 --no-thumb The opposite of --thumb (don't use thumb even for targets
814 where this is the default
815 --help Shows this message (must not be used with other options)
819 exit
822 ARG_CCACHE=
823 ARG_ENCOPTS=
824 ARG_LANG=
825 ARG_RAM=
826 ARG_RBDIR=
827 ARG_TARGET=
828 ARG_TTS=
829 ARG_TTSOPTS=
830 ARG_TYPE=
831 ARG_VOICE=
832 ARG_ARM_EABI=
833 ARG_ARM_THUMB=
834 err=
835 for arg in "$@"; do
836 case "$arg" in
837 --ccache) ARG_CCACHE=1;;
838 --no-ccache) ARG_CCACHE=0;;
839 --encopts=*) ARG_ENCOPTS=`echo "$arg" | cut -d = -f 2`;;
840 --language=*) ARG_LANG=`echo "$arg" | cut -d = -f 2`;;
841 --ram=*) ARG_RAM=`echo "$arg" | cut -d = -f 2`;;
842 --rbdir=*) ARG_RBDIR=`echo "$arg" | cut -d = -f 2`;;
843 --target=*) ARG_TARGET=`echo "$arg" | cut -d = -f 2`;;
844 --tts=*) ARG_TTS=`echo "$arg" | cut -d = -f 2`;;
845 --ttsopts=*) ARG_TTSOPTS=`echo "$arg" | cut -d = -f 2`;;
846 --type=*) ARG_TYPE=`echo "$arg" | cut -d = -f 2`;;
847 --voice=*) ARG_VOICE=`echo "$arg" | cut -d = -f 2`;;
848 --eabi) ARG_ARM_EABI=1;;
849 --no-eabi) ARG_ARM_EABI=0;;
850 --thumb) ARG_ARM_THUMB=1;;
851 --no-thumb) ARG_ARM_THUMB=0;;
852 --help) help;;
853 *) err=1; echo "[ERROR] Option '$arg' unsupported";;
854 esac
855 done
856 [ "$err" ] && exit 1
858 advopts=
860 if [ "$TMPDIR" != "" ]; then
861 tmpdir=$TMPDIR
862 else
863 tmpdir=/tmp
865 echo Using temporary directory $tmpdir
867 if test -r "configure"; then
868 # this is a check for a configure script in the current directory, it there
869 # is one, try to figure out if it is this one!
871 if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
872 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
873 echo "It will only cause you pain and grief. Instead do this:"
874 echo ""
875 echo " cd .."
876 echo " mkdir build-dir"
877 echo " cd build-dir"
878 echo " ../tools/configure"
879 echo ""
880 echo "Much happiness will arise from this. Enjoy"
881 exit 5
885 # get our current directory
886 pwd=`pwd`;
888 if { echo $pwd | grep " "; } then
889 echo "You're running this script in a path that contains space. The build"
890 echo "system is unfortunately not clever enough to deal with this. Please"
891 echo "run the script from a different path, rename the path or fix the build"
892 echo "system!"
893 exit 6
896 if [ -z "$rootdir" ]; then
897 ##################################################################
898 # Figure out where the source code root is!
900 rootdir=`dirname $0`/../
902 #####################################################################
903 # Convert the possibly relative directory name to an absolute version
905 now=`pwd`
906 cd $rootdir
907 rootdir=`pwd`
909 # cd back to the build dir
910 cd $now
913 apps="apps"
914 appsdir='\$(ROOTDIR)/apps'
915 firmdir='\$(ROOTDIR)/firmware'
916 toolsdir='\$(ROOTDIR)/tools'
919 ##################################################################
920 # Figure out target platform
923 if [ "$ARG_TARGET" ]; then
924 buildfor=$ARG_TARGET
925 else
926 echo "Enter target platform:"
927 cat <<EOF
928 ==Archos== ==iriver== ==Apple iPod==
929 0) Player/Studio 10) H120/H140 20) Color/Photo
930 1) Recorder 11) H320/H340 21) Nano 1G
931 2) FM Recorder 12) iHP-100/110/115 22) Video
932 3) Recorder v2 13) iFP-790 23) 3G
933 4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
934 5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
935 6) AV300 26) Mini 2G
936 ==Toshiba== 27) 1G, 2G
937 ==Cowon/iAudio== 40) Gigabeat F/X 28) Nano 2G
938 30) X5/X5V/X5L 41) Gigabeat S
939 31) M5/M5L ==SanDisk==
940 32) 7 ==Olympus= 50) Sansa e200
941 33) D2 70) M:Robe 500 51) Sansa e200R
942 34) M3/M3L 71) M:Robe 100 52) Sansa c200
943 53) Sansa m200
944 ==Creative== ==Philips== 54) Sansa c100
945 90) Zen Vision:M 30GB 100) GoGear SA9200 55) Sansa Clip
946 91) Zen Vision:M 60GB 101) GoGear HDD1630/ 56) Sansa e200v2
947 92) Zen Vision HDD1830 57) Sansa m200v4
948 102) GoGear HDD6330 58) Sansa Fuze
949 ==Onda== 59) Sansa c200v2
950 120) VX747 ==Meizu== 60) Sansa Clipv2
951 121) VX767 110) M6SL 61) Sansa View
952 122) VX747+ 111) M6SP 62) Sansa Clip+
953 123) VX777 112) M3 63) Sansa Fuze v2
955 ==Logik==
956 ==Samsung== ==Tatung== 80) DAX 1GB MP3/DAB
957 140) YH-820 150) Elio TPJ-1022
958 141) YH-920 ==Lyre project==
959 142) YH-925 ==Packard Bell== 130) Lyre proto 1
960 143) YP-S3 160) Vibe 500 131) Mini2440
962 ==MPIO==
963 170) HD200
966 buildfor=`input`;
969 # Set of tools built for all target platforms:
970 toolset="rdf2binary convbdf codepages"
972 # Toolsets for some target families:
973 archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
974 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
975 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
976 ipodbitmaptools="$toolset scramble bmp2rb"
977 gigabeatbitmaptools="$toolset scramble descramble bmp2rb"
978 tccbitmaptools="$toolset scramble bmp2rb"
979 # generic is used by IFP, Meizu and Onda
980 genericbitmaptools="$toolset bmp2rb"
981 # scramble is used by all other targets
982 scramblebitmaptools="$genericbitmaptools scramble"
985 # ---- For each target ----
987 # *Variables*
988 # target_id: a unique number identifying this target, IS NOT the menu number.
989 # Just use the currently highest number+1 when you add a new
990 # target.
991 # modelname: short model name used all over to identify this target
992 # memory: number of megabytes of RAM this target has. If the amount can
993 # be selected by the size prompt, let memory be unset here
994 # target: -Ddefine passed to the build commands to make the correct
995 # config-*.h file get included etc
996 # tool: the tool that takes a plain binary and converts that into a
997 # working "firmware" file for your target
998 # output: the final output file name
999 # boottool: the tool that takes a plain binary and generates a bootloader
1000 # file for your target (or blank to use $tool)
1001 # bootoutput:the final output file name for the bootloader (or blank to use
1002 # $output)
1003 # appextra: passed to the APPEXTRA variable in the Makefiles.
1004 # TODO: add proper explanation
1005 # archosrom: used only for Archos targets that build a special flashable .ucl
1006 # image.
1007 # flash: name of output for flashing, for targets where there's a special
1008 # file output for this.
1009 # plugins: set to 'yes' to build the plugins. Early development builds can
1010 # set this to no in the early stages to have an easier life for a
1011 # while
1012 # swcodec: set 'yes' on swcodec targets
1013 # toolset: lists what particular tools in the tools/ directory that this
1014 # target needs to have built prior to building Rockbox
1016 # *Functions*
1017 # *cc: sets up gcc and compiler options for your target builds. Note
1018 # that if you select a simulator build, the compiler selection is
1019 # overridden later in the script.
1021 case $buildfor in
1023 0|archosplayer)
1024 target_id=1
1025 modelname="archosplayer"
1026 target="-DARCHOS_PLAYER"
1027 shcc
1028 tool="$rootdir/tools/scramble"
1029 output="archos.mod"
1030 appextra="player:gui"
1031 archosrom="$pwd/rombox.ucl"
1032 flash="$pwd/rockbox.ucl"
1033 plugins="yes"
1034 swcodec=""
1036 # toolset is the tools within the tools directory that we build for
1037 # this particular target.
1038 toolset="$toolset scramble descramble sh2d player_unifont uclpack"
1040 # Note: the convbdf is present in the toolset just because: 1) the
1041 # firmware/Makefile assumes it is present always, and 2) we will need it when we
1042 # build the player simulator
1044 t_cpu="sh"
1045 t_manufacturer="archos"
1046 t_model="player"
1049 1|archosrecorder)
1050 target_id=2
1051 modelname="archosrecorder"
1052 target="-DARCHOS_RECORDER"
1053 shcc
1054 tool="$rootdir/tools/scramble"
1055 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1056 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1057 output="ajbrec.ajz"
1058 appextra="recorder:gui:radio"
1059 #archosrom="$pwd/rombox.ucl"
1060 flash="$pwd/rockbox.ucl"
1061 plugins="yes"
1062 swcodec=""
1063 # toolset is the tools within the tools directory that we build for
1064 # this particular target.
1065 toolset=$archosbitmaptools
1066 t_cpu="sh"
1067 t_manufacturer="archos"
1068 t_model="recorder"
1071 2|archosfmrecorder)
1072 target_id=3
1073 modelname="archosfmrecorder"
1074 target="-DARCHOS_FMRECORDER"
1075 shcc
1076 tool="$rootdir/tools/scramble -fm"
1077 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1078 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1079 output="ajbrec.ajz"
1080 appextra="recorder:gui:radio"
1081 #archosrom="$pwd/rombox.ucl"
1082 flash="$pwd/rockbox.ucl"
1083 plugins="yes"
1084 swcodec=""
1085 # toolset is the tools within the tools directory that we build for
1086 # this particular target.
1087 toolset=$archosbitmaptools
1088 t_cpu="sh"
1089 t_manufacturer="archos"
1090 t_model="fm_v2"
1093 3|archosrecorderv2)
1094 target_id=4
1095 modelname="archosrecorderv2"
1096 target="-DARCHOS_RECORDERV2"
1097 shcc
1098 tool="$rootdir/tools/scramble -v2"
1099 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1100 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1101 output="ajbrec.ajz"
1102 appextra="recorder:gui:radio"
1103 #archosrom="$pwd/rombox.ucl"
1104 flash="$pwd/rockbox.ucl"
1105 plugins="yes"
1106 swcodec=""
1107 # toolset is the tools within the tools directory that we build for
1108 # this particular target.
1109 toolset=$archosbitmaptools
1110 t_cpu="sh"
1111 t_manufacturer="archos"
1112 t_model="fm_v2"
1115 4|archosondiosp)
1116 target_id=7
1117 modelname="archosondiosp"
1118 target="-DARCHOS_ONDIOSP"
1119 shcc
1120 tool="$rootdir/tools/scramble -osp"
1121 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1122 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1123 output="ajbrec.ajz"
1124 appextra="recorder:gui:radio"
1125 #archosrom="$pwd/rombox.ucl"
1126 flash="$pwd/rockbox.ucl"
1127 plugins="yes"
1128 swcodec=""
1129 # toolset is the tools within the tools directory that we build for
1130 # this particular target.
1131 toolset=$archosbitmaptools
1132 t_cpu="sh"
1133 t_manufacturer="archos"
1134 t_model="ondio"
1137 5|archosondiofm)
1138 target_id=8
1139 modelname="archosondiofm"
1140 target="-DARCHOS_ONDIOFM"
1141 shcc
1142 tool="$rootdir/tools/scramble -ofm"
1143 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1144 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1145 output="ajbrec.ajz"
1146 appextra="recorder:gui:radio"
1147 #archosrom="$pwd/rombox.ucl"
1148 flash="$pwd/rockbox.ucl"
1149 plugins="yes"
1150 swcodec=""
1151 toolset=$archosbitmaptools
1152 t_cpu="sh"
1153 t_manufacturer="archos"
1154 t_model="ondio"
1157 6|archosav300)
1158 target_id=38
1159 modelname="archosav300"
1160 target="-DARCHOS_AV300"
1161 memory=16 # always
1162 arm7tdmicc
1163 tool="$rootdir/tools/scramble -mm=C"
1164 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1165 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1166 output="cjbm.ajz"
1167 appextra="recorder:gui:radio"
1168 plugins="yes"
1169 swcodec=""
1170 # toolset is the tools within the tools directory that we build for
1171 # this particular target.
1172 toolset="$toolset scramble descramble bmp2rb"
1173 # architecture, manufacturer and model for the target-tree build
1174 t_cpu="arm"
1175 t_manufacturer="archos"
1176 t_model="av300"
1179 10|iriverh120)
1180 target_id=9
1181 modelname="iriverh120"
1182 target="-DIRIVER_H120"
1183 memory=32 # always
1184 coldfirecc
1185 tool="$rootdir/tools/scramble -add=h120"
1186 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1187 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1188 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1189 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1190 output="rockbox.iriver"
1191 bootoutput="bootloader.iriver"
1192 appextra="recorder:gui:radio"
1193 flash="$pwd/rombox.iriver"
1194 plugins="yes"
1195 swcodec="yes"
1196 # toolset is the tools within the tools directory that we build for
1197 # this particular target.
1198 toolset=$iriverbitmaptools
1199 t_cpu="coldfire"
1200 t_manufacturer="iriver"
1201 t_model="h100"
1204 11|iriverh300)
1205 target_id=10
1206 modelname="iriverh300"
1207 target="-DIRIVER_H300"
1208 memory=32 # always
1209 coldfirecc
1210 tool="$rootdir/tools/scramble -add=h300"
1211 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1212 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1213 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1214 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1215 output="rockbox.iriver"
1216 appextra="recorder:gui:radio"
1217 plugins="yes"
1218 swcodec="yes"
1219 # toolset is the tools within the tools directory that we build for
1220 # this particular target.
1221 toolset=$iriverbitmaptools
1222 t_cpu="coldfire"
1223 t_manufacturer="iriver"
1224 t_model="h300"
1227 12|iriverh100)
1228 target_id=11
1229 modelname="iriverh100"
1230 target="-DIRIVER_H100"
1231 memory=16 # always
1232 coldfirecc
1233 tool="$rootdir/tools/scramble -add=h100"
1234 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1235 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1236 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1237 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1238 output="rockbox.iriver"
1239 bootoutput="bootloader.iriver"
1240 appextra="recorder:gui:radio"
1241 flash="$pwd/rombox.iriver"
1242 plugins="yes"
1243 swcodec="yes"
1244 # toolset is the tools within the tools directory that we build for
1245 # this particular target.
1246 toolset=$iriverbitmaptools
1247 t_cpu="coldfire"
1248 t_manufacturer="iriver"
1249 t_model="h100"
1252 13|iriverifp7xx)
1253 target_id=19
1254 modelname="iriverifp7xx"
1255 target="-DIRIVER_IFP7XX"
1256 memory=1
1257 arm7tdmicc short
1258 tool="cp"
1259 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1260 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1261 output="rockbox.wma"
1262 appextra="recorder:gui:radio"
1263 plugins="yes"
1264 swcodec="yes"
1265 # toolset is the tools within the tools directory that we build for
1266 # this particular target.
1267 toolset=$genericbitmaptools
1268 t_cpu="arm"
1269 t_manufacturer="pnx0101"
1270 t_model="iriver-ifp7xx"
1273 14|iriverh10)
1274 target_id=22
1275 modelname="iriverh10"
1276 target="-DIRIVER_H10"
1277 memory=32 # always
1278 arm7tdmicc
1279 tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
1280 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1281 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1282 output="rockbox.mi4"
1283 appextra="recorder:gui:radio"
1284 plugins="yes"
1285 swcodec="yes"
1286 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
1287 bootoutput="H10_20GC.mi4"
1288 # toolset is the tools within the tools directory that we build for
1289 # this particular target.
1290 toolset=$scramblebitmaptools
1291 # architecture, manufacturer and model for the target-tree build
1292 t_cpu="arm"
1293 t_manufacturer="iriver"
1294 t_model="h10"
1297 15|iriverh10_5gb)
1298 target_id=24
1299 modelname="iriverh10_5gb"
1300 target="-DIRIVER_H10_5GB"
1301 memory=32 # always
1302 arm7tdmicc
1303 tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
1304 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1305 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1306 output="rockbox.mi4"
1307 appextra="recorder:gui:radio"
1308 plugins="yes"
1309 swcodec="yes"
1310 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
1311 bootoutput="H10.mi4"
1312 # toolset is the tools within the tools directory that we build for
1313 # this particular target.
1314 toolset=$scramblebitmaptools
1315 # architecture, manufacturer and model for the target-tree build
1316 t_cpu="arm"
1317 t_manufacturer="iriver"
1318 t_model="h10"
1321 20|ipodcolor)
1322 target_id=13
1323 modelname="ipodcolor"
1324 target="-DIPOD_COLOR"
1325 memory=32 # always
1326 arm7tdmicc
1327 tool="$rootdir/tools/scramble -add=ipco"
1328 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1329 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1330 output="rockbox.ipod"
1331 appextra="recorder:gui:radio"
1332 plugins="yes"
1333 swcodec="yes"
1334 bootoutput="bootloader-$modelname.ipod"
1335 # toolset is the tools within the tools directory that we build for
1336 # this particular target.
1337 toolset=$ipodbitmaptools
1338 # architecture, manufacturer and model for the target-tree build
1339 t_cpu="arm"
1340 t_manufacturer="ipod"
1341 t_model="color"
1344 21|ipodnano1g)
1345 target_id=14
1346 modelname="ipodnano1g"
1347 target="-DIPOD_NANO"
1348 memory=32 # always
1349 arm7tdmicc
1350 tool="$rootdir/tools/scramble -add=nano"
1351 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1352 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1353 output="rockbox.ipod"
1354 appextra="recorder:gui:radio"
1355 plugins="yes"
1356 swcodec="yes"
1357 bootoutput="bootloader-$modelname.ipod"
1358 # toolset is the tools within the tools directory that we build for
1359 # this particular target.
1360 toolset=$ipodbitmaptools
1361 # architecture, manufacturer and model for the target-tree build
1362 t_cpu="arm"
1363 t_manufacturer="ipod"
1364 t_model="nano"
1367 22|ipodvideo)
1368 target_id=15
1369 modelname="ipodvideo"
1370 target="-DIPOD_VIDEO"
1371 arm7tdmicc
1372 tool="$rootdir/tools/scramble -add=ipvd"
1373 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1374 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1375 output="rockbox.ipod"
1376 appextra="recorder:gui:radio"
1377 plugins="yes"
1378 swcodec="yes"
1379 bootoutput="bootloader-$modelname.ipod"
1380 # toolset is the tools within the tools directory that we build for
1381 # this particular target.
1382 toolset=$ipodbitmaptools
1383 # architecture, manufacturer and model for the target-tree build
1384 t_cpu="arm"
1385 t_manufacturer="ipod"
1386 t_model="video"
1389 23|ipod3g)
1390 target_id=16
1391 modelname="ipod3g"
1392 target="-DIPOD_3G"
1393 memory=32 # always
1394 arm7tdmicc
1395 tool="$rootdir/tools/scramble -add=ip3g"
1396 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1397 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1398 output="rockbox.ipod"
1399 appextra="recorder:gui:radio"
1400 plugins="yes"
1401 swcodec="yes"
1402 bootoutput="bootloader-$modelname.ipod"
1403 # toolset is the tools within the tools directory that we build for
1404 # this particular target.
1405 toolset=$ipodbitmaptools
1406 # architecture, manufacturer and model for the target-tree build
1407 t_cpu="arm"
1408 t_manufacturer="ipod"
1409 t_model="3g"
1412 24|ipod4g)
1413 target_id=17
1414 modelname="ipod4g"
1415 target="-DIPOD_4G"
1416 memory=32 # always
1417 arm7tdmicc
1418 tool="$rootdir/tools/scramble -add=ip4g"
1419 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1420 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1421 output="rockbox.ipod"
1422 appextra="recorder:gui:radio"
1423 plugins="yes"
1424 swcodec="yes"
1425 bootoutput="bootloader-$modelname.ipod"
1426 # toolset is the tools within the tools directory that we build for
1427 # this particular target.
1428 toolset=$ipodbitmaptools
1429 # architecture, manufacturer and model for the target-tree build
1430 t_cpu="arm"
1431 t_manufacturer="ipod"
1432 t_model="4g"
1435 25|ipodmini1g)
1436 target_id=18
1437 modelname="ipodmini1g"
1438 target="-DIPOD_MINI"
1439 memory=32 # always
1440 arm7tdmicc
1441 tool="$rootdir/tools/scramble -add=mini"
1442 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1443 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1444 output="rockbox.ipod"
1445 appextra="recorder:gui:radio"
1446 plugins="yes"
1447 swcodec="yes"
1448 bootoutput="bootloader-$modelname.ipod"
1449 # toolset is the tools within the tools directory that we build for
1450 # this particular target.
1451 toolset=$ipodbitmaptools
1452 # architecture, manufacturer and model for the target-tree build
1453 t_cpu="arm"
1454 t_manufacturer="ipod"
1455 t_model="mini"
1458 26|ipodmini2g)
1459 target_id=21
1460 modelname="ipodmini2g"
1461 target="-DIPOD_MINI2G"
1462 memory=32 # always
1463 arm7tdmicc
1464 tool="$rootdir/tools/scramble -add=mn2g"
1465 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1466 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1467 output="rockbox.ipod"
1468 appextra="recorder:gui:radio"
1469 plugins="yes"
1470 swcodec="yes"
1471 bootoutput="bootloader-$modelname.ipod"
1472 # toolset is the tools within the tools directory that we build for
1473 # this particular target.
1474 toolset=$ipodbitmaptools
1475 # architecture, manufacturer and model for the target-tree build
1476 t_cpu="arm"
1477 t_manufacturer="ipod"
1478 t_model="mini2g"
1481 27|ipod1g2g)
1482 target_id=29
1483 modelname="ipod1g2g"
1484 target="-DIPOD_1G2G"
1485 memory=32 # always
1486 arm7tdmicc
1487 tool="$rootdir/tools/scramble -add=1g2g"
1488 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1489 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1490 output="rockbox.ipod"
1491 appextra="recorder:gui:radio"
1492 plugins="yes"
1493 swcodec="yes"
1494 bootoutput="bootloader-$modelname.ipod"
1495 # toolset is the tools within the tools directory that we build for
1496 # this particular target.
1497 toolset=$ipodbitmaptools
1498 # architecture, manufacturer and model for the target-tree build
1499 t_cpu="arm"
1500 t_manufacturer="ipod"
1501 t_model="1g2g"
1504 28|ipodnano2g)
1505 target_id=62
1506 modelname="ipodnano2g"
1507 target="-DIPOD_NANO2G"
1508 memory=32 # always
1509 arm940tcc
1510 tool="$rootdir/tools/scramble -add=nn2g"
1511 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1512 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1513 output="rockbox.ipod"
1514 appextra="recorder:gui:radio"
1515 plugins="yes"
1516 swcodec="yes"
1517 bootoutput="bootloader-$modelname.ipod"
1518 # toolset is the tools within the tools directory that we build for
1519 # this particular target.
1520 toolset=$ipodbitmaptools
1521 # architecture, manufacturer and model for the target-tree build
1522 t_cpu="arm"
1523 t_manufacturer="s5l8700"
1524 t_model="ipodnano2g"
1527 30|iaudiox5)
1528 target_id=12
1529 modelname="iaudiox5"
1530 target="-DIAUDIO_X5"
1531 memory=16 # always
1532 coldfirecc
1533 tool="$rootdir/tools/scramble -add=iax5"
1534 boottool="$rootdir/tools/scramble -iaudiox5"
1535 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1536 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1537 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1538 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1539 output="rockbox.iaudio"
1540 bootoutput="x5_fw.bin"
1541 appextra="recorder:gui:radio"
1542 plugins="yes"
1543 swcodec="yes"
1544 # toolset is the tools within the tools directory that we build for
1545 # this particular target.
1546 toolset="$iaudiobitmaptools"
1547 # architecture, manufacturer and model for the target-tree build
1548 t_cpu="coldfire"
1549 t_manufacturer="iaudio"
1550 t_model="x5"
1553 31|iaudiom5)
1554 target_id=28
1555 modelname="iaudiom5"
1556 target="-DIAUDIO_M5"
1557 memory=16 # always
1558 coldfirecc
1559 tool="$rootdir/tools/scramble -add=iam5"
1560 boottool="$rootdir/tools/scramble -iaudiom5"
1561 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1562 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1563 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1564 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1565 output="rockbox.iaudio"
1566 bootoutput="m5_fw.bin"
1567 appextra="recorder:gui:radio"
1568 plugins="yes"
1569 swcodec="yes"
1570 # toolset is the tools within the tools directory that we build for
1571 # this particular target.
1572 toolset="$iaudiobitmaptools"
1573 # architecture, manufacturer and model for the target-tree build
1574 t_cpu="coldfire"
1575 t_manufacturer="iaudio"
1576 t_model="m5"
1579 32|iaudio7)
1580 target_id=32
1581 modelname="iaudio7"
1582 target="-DIAUDIO_7"
1583 memory=16 # always
1584 arm946cc
1585 tool="$rootdir/tools/scramble -add=i7"
1586 boottool="$rootdir/tools/scramble -tcc=crc"
1587 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1588 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1589 output="rockbox.iaudio"
1590 appextra="recorder:gui:radio"
1591 plugins="yes"
1592 swcodec="yes"
1593 bootoutput="I7_FW.BIN"
1594 # toolset is the tools within the tools directory that we build for
1595 # this particular target.
1596 toolset="$tccbitmaptools"
1597 # architecture, manufacturer and model for the target-tree build
1598 t_cpu="arm"
1599 t_manufacturer="tcc77x"
1600 t_model="iaudio7"
1603 33|cowond2)
1604 target_id=34
1605 modelname="cowond2"
1606 target="-DCOWON_D2"
1607 memory=32
1608 arm926ejscc
1609 tool="$rootdir/tools/scramble -add=d2"
1610 boottool="cp "
1611 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1612 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1613 output="rockbox.d2"
1614 bootoutput="bootloader-cowond2.bin"
1615 appextra="recorder:gui:radio"
1616 plugins="yes"
1617 swcodec="yes"
1618 toolset="$tccbitmaptools"
1619 # architecture, manufacturer and model for the target-tree build
1620 t_cpu="arm"
1621 t_manufacturer="tcc780x"
1622 t_model="cowond2"
1625 34|iaudiom3)
1626 target_id=37
1627 modelname="iaudiom3"
1628 target="-DIAUDIO_M3"
1629 memory=16 # always
1630 coldfirecc
1631 tool="$rootdir/tools/scramble -add=iam3"
1632 boottool="$rootdir/tools/scramble -iaudiom3"
1633 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1634 bmp2rb_native="$rootdir/tools/bmp2rb -f 7"
1635 output="rockbox.iaudio"
1636 bootoutput="cowon_m3.bin"
1637 appextra="recorder:gui:radio"
1638 plugins="yes"
1639 swcodec="yes"
1640 # toolset is the tools within the tools directory that we build for
1641 # this particular target.
1642 toolset="$iaudiobitmaptools"
1643 # architecture, manufacturer and model for the target-tree build
1644 t_cpu="coldfire"
1645 t_manufacturer="iaudio"
1646 t_model="m3"
1649 40|gigabeatfx)
1650 target_id=20
1651 modelname="gigabeatfx"
1652 target="-DGIGABEAT_F"
1653 memory=32 # always
1654 arm9tdmicc
1655 tool="$rootdir/tools/scramble -add=giga"
1656 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1657 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1658 output="rockbox.gigabeat"
1659 appextra="recorder:gui:radio"
1660 plugins="yes"
1661 swcodec="yes"
1662 toolset=$gigabeatbitmaptools
1663 boottool="$rootdir/tools/scramble -gigabeat"
1664 bootoutput="FWIMG01.DAT"
1665 # architecture, manufacturer and model for the target-tree build
1666 t_cpu="arm"
1667 t_manufacturer="s3c2440"
1668 t_model="gigabeat-fx"
1671 41|gigabeats)
1672 target_id=26
1673 modelname="gigabeats"
1674 target="-DGIGABEAT_S"
1675 memory=64
1676 arm1136jfscc
1677 tool="$rootdir/tools/scramble -add=gigs"
1678 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1679 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1680 output="rockbox.gigabeat"
1681 appextra="recorder:gui:radio"
1682 plugins="yes"
1683 swcodec="yes"
1684 toolset="$gigabeatbitmaptools"
1685 boottool="$rootdir/tools/scramble -gigabeats"
1686 bootoutput="nk.bin"
1687 # architecture, manufacturer and model for the target-tree build
1688 t_cpu="arm"
1689 t_manufacturer="imx31"
1690 t_model="gigabeat-s"
1693 70|mrobe500)
1694 target_id=36
1695 modelname="mrobe500"
1696 target="-DMROBE_500"
1697 memory=64 # always
1698 arm926ejscc
1699 tool="$rootdir/tools/scramble -add=m500"
1700 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1701 bmp2rb_native="$rootdir/tools/bmp2rb -f 8"
1702 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1703 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1704 output="rockbox.mrobe500"
1705 appextra="recorder:gui:radio"
1706 plugins="yes"
1707 swcodec="yes"
1708 toolset=$gigabeatbitmaptools
1709 boottool="cp "
1710 bootoutput="rockbox.mrboot"
1711 # architecture, manufacturer and model for the target-tree build
1712 t_cpu="arm"
1713 t_manufacturer="tms320dm320"
1714 t_model="mrobe-500"
1717 71|mrobe100)
1718 target_id=33
1719 modelname="mrobe100"
1720 target="-DMROBE_100"
1721 memory=32 # always
1722 arm7tdmicc
1723 tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS"
1724 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1725 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1726 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1727 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1728 output="rockbox.mi4"
1729 appextra="recorder:gui:radio"
1730 plugins="yes"
1731 swcodec="yes"
1732 boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL"
1733 bootoutput="pp5020.mi4"
1734 # toolset is the tools within the tools directory that we build for
1735 # this particular target.
1736 toolset=$scramblebitmaptools
1737 # architecture, manufacturer and model for the target-tree build
1738 t_cpu="arm"
1739 t_manufacturer="olympus"
1740 t_model="mrobe-100"
1743 80|logikdax)
1744 target_id=31
1745 modelname="logikdax"
1746 target="-DLOGIK_DAX"
1747 memory=2 # always
1748 arm946cc
1749 tool="$rootdir/tools/scramble -add=ldax"
1750 boottool="$rootdir/tools/scramble -tcc=crc"
1751 bootoutput="player.rom"
1752 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1753 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1754 output="rockbox.logik"
1755 appextra="recorder:gui:radio"
1756 plugins=""
1757 swcodec="yes"
1758 # toolset is the tools within the tools directory that we build for
1759 # this particular target.
1760 toolset=$tccbitmaptools
1761 # architecture, manufacturer and model for the target-tree build
1762 t_cpu="arm"
1763 t_manufacturer="tcc77x"
1764 t_model="logikdax"
1767 90|zenvisionm30gb)
1768 target_id=35
1769 modelname="zenvisionm30gb"
1770 target="-DCREATIVE_ZVM"
1771 memory=64
1772 arm926ejscc
1773 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1774 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1775 tool="$rootdir/tools/scramble -creative=zvm"
1776 USE_ELF="yes"
1777 output="rockbox.zvm"
1778 appextra="recorder:gui:radio"
1779 plugins="yes"
1780 swcodec="yes"
1781 toolset=$ipodbitmaptools
1782 boottool="$rootdir/tools/scramble -creative=zvm -no-ciff"
1783 bootoutput="rockbox.zvmboot"
1784 # architecture, manufacturer and model for the target-tree build
1785 t_cpu="arm"
1786 t_manufacturer="tms320dm320"
1787 t_model="creative-zvm"
1790 91|zenvisionm60gb)
1791 target_id=40
1792 modelname="zenvisionm60gb"
1793 target="-DCREATIVE_ZVM60GB"
1794 memory=64
1795 arm926ejscc
1796 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1797 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1798 tool="$rootdir/tools/scramble -creative=zvm60 -no-ciff"
1799 USE_ELF="yes"
1800 output="rockbox.zvm60"
1801 appextra="recorder:gui:radio"
1802 plugins="yes"
1803 swcodec="yes"
1804 toolset=$ipodbitmaptools
1805 boottool="$rootdir/tools/scramble -creative=zvm60"
1806 bootoutput="rockbox.zvm60boot"
1807 # architecture, manufacturer and model for the target-tree build
1808 t_cpu="arm"
1809 t_manufacturer="tms320dm320"
1810 t_model="creative-zvm"
1813 92|zenvision)
1814 target_id=39
1815 modelname="zenvision"
1816 target="-DCREATIVE_ZV"
1817 memory=64
1818 arm926ejscc
1819 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1820 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1821 tool="$rootdir/tools/scramble -creative=zenvision -no-ciff"
1822 USE_ELF="yes"
1823 output="rockbox.zv"
1824 appextra="recorder:gui:radio"
1825 plugins=""
1826 swcodec="yes"
1827 toolset=$ipodbitmaptools
1828 boottool="$rootdir/tools/scramble -creative=zenvision"
1829 bootoutput="rockbox.zvboot"
1830 # architecture, manufacturer and model for the target-tree build
1831 t_cpu="arm"
1832 t_manufacturer="tms320dm320"
1833 t_model="creative-zvm"
1836 50|sansae200)
1837 target_id=23
1838 modelname="sansae200"
1839 target="-DSANSA_E200"
1840 memory=32 # supposedly
1841 arm7tdmicc
1842 tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1843 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1844 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1845 output="rockbox.mi4"
1846 appextra="recorder:gui:radio"
1847 plugins="yes"
1848 swcodec="yes"
1849 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1850 bootoutput="PP5022.mi4"
1851 # toolset is the tools within the tools directory that we build for
1852 # this particular target.
1853 toolset=$scramblebitmaptools
1854 # architecture, manufacturer and model for the target-tree build
1855 t_cpu="arm"
1856 t_manufacturer="sandisk"
1857 t_model="sansa-e200"
1860 51|sansae200r)
1861 # the e200R model is pretty much identical to the e200, it only has a
1862 # different option to the scramble tool when building a bootloader and
1863 # makes the bootloader output file name in all lower case.
1864 target_id=27
1865 modelname="sansae200r"
1866 target="-DSANSA_E200"
1867 memory=32 # supposedly
1868 arm7tdmicc
1869 tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1870 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1871 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1872 output="rockbox.mi4"
1873 appextra="recorder:gui:radio"
1874 plugins="yes"
1875 swcodec="yes"
1876 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1877 bootoutput="pp5022.mi4"
1878 # toolset is the tools within the tools directory that we build for
1879 # this particular target.
1880 toolset=$scramblebitmaptools
1881 # architecture, manufacturer and model for the target-tree build
1882 t_cpu="arm"
1883 t_manufacturer="sandisk"
1884 t_model="sansa-e200"
1887 52|sansac200)
1888 target_id=30
1889 modelname="sansac200"
1890 target="-DSANSA_C200"
1891 memory=32 # supposedly
1892 arm7tdmicc
1893 tool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBOS"
1894 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1895 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1896 output="rockbox.mi4"
1897 appextra="recorder:gui:radio"
1898 plugins="yes"
1899 swcodec="yes"
1900 boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
1901 bootoutput="firmware.mi4"
1902 # toolset is the tools within the tools directory that we build for
1903 # this particular target.
1904 toolset=$scramblebitmaptools
1905 # architecture, manufacturer and model for the target-tree build
1906 t_cpu="arm"
1907 t_manufacturer="sandisk"
1908 t_model="sansa-c200"
1911 53|sansam200)
1912 target_id=48
1913 modelname="sansam200"
1914 target="-DSANSA_M200"
1915 memory=1 # always
1916 arm946cc
1917 tool="$rootdir/tools/scramble -add=m200"
1918 boottool="$rootdir/tools/scramble -tcc=crc"
1919 bootoutput="player.rom"
1920 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1921 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1922 output="rockbox.m200"
1923 appextra="recorder:gui:radio"
1924 plugins=""
1925 swcodec="yes"
1926 # toolset is the tools within the tools directory that we build for
1927 # this particular target.
1928 toolset=$tccbitmaptools
1929 # architecture, manufacturer and model for the target-tree build
1930 t_cpu="arm"
1931 t_manufacturer="tcc77x"
1932 t_model="m200"
1935 54|sansac100)
1936 target_id=42
1937 modelname="sansac100"
1938 target="-DSANSA_C100"
1939 memory=2
1940 arm946cc
1941 tool="$rootdir/tools/scramble -add=c100"
1942 boottool="$rootdir/tools/scramble -tcc=crc"
1943 bootoutput="player.rom"
1944 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1945 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1946 output="rockbox.c100"
1947 appextra="recorder:gui:radio"
1948 plugins=""
1949 swcodec="yes"
1950 # toolset is the tools within the tools directory that we build for
1951 # this particular target.
1952 toolset=$tccbitmaptools
1953 # architecture, manufacturer and model for the target-tree build
1954 t_cpu="arm"
1955 t_manufacturer="tcc77x"
1956 t_model="c100"
1959 55|sansaclip)
1960 target_id=50
1961 modelname="sansaclip"
1962 target="-DSANSA_CLIP"
1963 memory=2
1964 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1965 bmp2rb_native="$bmp2rb_mono"
1966 tool="$rootdir/tools/scramble -add=clip"
1967 output="rockbox.sansa"
1968 bootoutput="bootloader-clip.sansa"
1969 appextra="recorder:gui:radio"
1970 plugins="yes"
1971 swcodec="yes"
1972 toolset=$scramblebitmaptools
1973 t_cpu="arm"
1974 t_manufacturer="as3525"
1975 t_model="sansa-clip"
1976 if [ "$ARG_ARM_THUMB" != 0 ]; then ARG_ARM_THUMB=1; fi
1977 arm9tdmicc
1978 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
1982 56|sansae200v2)
1983 target_id=51
1984 modelname="sansae200v2"
1985 target="-DSANSA_E200V2"
1986 memory=8
1987 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1988 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1989 tool="$rootdir/tools/scramble -add=e2v2"
1990 output="rockbox.sansa"
1991 bootoutput="bootloader-e200v2.sansa"
1992 appextra="recorder:gui:radio"
1993 plugins="yes"
1994 swcodec="yes"
1995 toolset=$scramblebitmaptools
1996 t_cpu="arm"
1997 t_manufacturer="as3525"
1998 t_model="sansa-e200v2"
1999 arm9tdmicc
2003 57|sansam200v4)
2004 target_id=52
2005 modelname="sansam200v4"
2006 target="-DSANSA_M200V4"
2007 memory=2
2008 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2009 bmp2rb_native="$bmp2rb_mono"
2010 tool="$rootdir/tools/scramble -add=m2v4"
2011 output="rockbox.sansa"
2012 bootoutput="bootloader-m200v4.sansa"
2013 appextra="recorder:gui:radio"
2014 plugins="yes"
2015 swcodec="yes"
2016 toolset=$scramblebitmaptools
2017 t_cpu="arm"
2018 t_manufacturer="as3525"
2019 t_model="sansa-m200v4"
2020 if [ "$ARG_ARM_THUMB" != 0 ]; then ARG_ARM_THUMB=1; fi
2021 arm9tdmicc
2022 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2026 58|sansafuze)
2027 target_id=53
2028 modelname="sansafuze"
2029 target="-DSANSA_FUZE"
2030 memory=8
2031 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2032 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2033 tool="$rootdir/tools/scramble -add=fuze"
2034 output="rockbox.sansa"
2035 bootoutput="bootloader-fuze.sansa"
2036 appextra="recorder:gui:radio"
2037 plugins="yes"
2038 swcodec="yes"
2039 toolset=$scramblebitmaptools
2040 t_cpu="arm"
2041 t_manufacturer="as3525"
2042 t_model="sansa-fuze"
2043 arm9tdmicc
2047 59|sansac200v2)
2048 target_id=55
2049 modelname="sansac200v2"
2050 target="-DSANSA_C200V2"
2051 memory=2 # as per OF diagnosis mode
2052 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2053 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2054 tool="$rootdir/tools/scramble -add=c2v2"
2055 output="rockbox.sansa"
2056 bootoutput="bootloader-c200v2.sansa"
2057 appextra="recorder:gui:radio"
2058 plugins="yes"
2059 swcodec="yes"
2060 # toolset is the tools within the tools directory that we build for
2061 # this particular target.
2062 toolset=$scramblebitmaptools
2063 # architecture, manufacturer and model for the target-tree build
2064 t_cpu="arm"
2065 t_manufacturer="as3525"
2066 t_model="sansa-c200v2"
2067 if [ "$ARG_ARM_THUMB" != 0 ]; then ARG_ARM_THUMB=1; fi
2068 arm9tdmicc
2069 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2072 60|sansaclipv2)
2073 target_id=60
2074 modelname="sansaclipv2"
2075 target="-DSANSA_CLIPV2"
2076 memory=8
2077 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2078 bmp2rb_native="$bmp2rb_mono"
2079 tool="$rootdir/tools/scramble -add=clv2"
2080 output="rockbox.sansa"
2081 bootoutput="bootloader-clipv2.sansa"
2082 appextra="recorder:gui:radio"
2083 plugins="yes"
2084 swcodec="yes"
2085 toolset=$scramblebitmaptools
2086 t_cpu="arm"
2087 t_manufacturer="as3525"
2088 t_model="sansa-clipv2"
2089 arm926ejscc
2092 61|sansaview)
2093 echo "Sansa View is not yet supported!"
2094 exit 1
2095 target_id=63
2096 modelname="sansaview"
2097 target="-DSANSA_VIEW"
2098 memory=32
2099 arm1176jzscc
2100 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2101 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2102 output="rockbox.mi4"
2103 appextra="gui"
2104 plugins=""
2105 swcodec="yes"
2106 boottool="$rootdir/tools/scramble -mi4v3 -model=view -type=RBBL"
2107 bootoutput="firmware.mi4"
2108 # toolset is the tools within the tools directory that we build for
2109 # this particular target.
2110 toolset=$scramblebitmaptools
2111 t_cpu="arm"
2112 t_manufacturer="sandisk"
2113 t_model="sansa-view"
2116 62|sansaclipplus)
2117 target_id=66
2118 modelname="sansaclipplus"
2119 target="-DSANSA_CLIPPLUS"
2120 memory=8
2121 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2122 bmp2rb_native="$bmp2rb_mono"
2123 tool="$rootdir/tools/scramble -add=cli+"
2124 output="rockbox.sansa"
2125 bootoutput="bootloader-clipplus.sansa"
2126 appextra="recorder:gui:radio"
2127 plugins="yes"
2128 swcodec="yes"
2129 toolset=$scramblebitmaptools
2130 t_cpu="arm"
2131 t_manufacturer="as3525"
2132 t_model="sansa-clipplus"
2133 arm926ejscc
2136 63|sansafuzev2)
2137 target_id=68
2138 modelname="sansafuzev2"
2139 target="-DSANSA_FUZEV2"
2140 memory=8 # not sure
2141 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2142 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
2143 tool="$rootdir/tools/scramble -add=fuz2"
2144 output="rockbox.sansa"
2145 bootoutput="bootloader-fuzev2.sansa"
2146 appextra="recorder:gui:radio"
2147 plugins="yes"
2148 swcodec="yes"
2149 toolset=$scramblebitmaptools
2150 t_cpu="arm"
2151 t_manufacturer="as3525"
2152 t_model="sansa-fuzev2"
2153 arm926ejscc
2156 150|tatungtpj1022)
2157 target_id=25
2158 modelname="tatungtpj1022"
2159 target="-DTATUNG_TPJ1022"
2160 memory=32 # always
2161 arm7tdmicc
2162 tool="$rootdir/tools/scramble -add tpj2"
2163 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2164 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
2165 output="rockbox.elio"
2166 appextra="recorder:gui:radio"
2167 plugins="yes"
2168 swcodec="yes"
2169 boottool="$rootdir/tools/scramble -mi4v2"
2170 bootoutput="pp5020.mi4"
2171 # toolset is the tools within the tools directory that we build for
2172 # this particular target.
2173 toolset=$scramblebitmaptools
2174 # architecture, manufacturer and model for the target-tree build
2175 t_cpu="arm"
2176 t_manufacturer="tatung"
2177 t_model="tpj1022"
2180 100|gogearsa9200)
2181 target_id=41
2182 modelname="gogearsa9200"
2183 target="-DPHILIPS_SA9200"
2184 memory=32 # supposedly
2185 arm7tdmicc
2186 tool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBOS"
2187 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2188 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2189 output="rockbox.mi4"
2190 appextra="recorder:gui:radio"
2191 plugins=""
2192 swcodec="yes"
2193 boottool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBBL"
2194 bootoutput="FWImage.ebn"
2195 # toolset is the tools within the tools directory that we build for
2196 # this particular target.
2197 toolset=$scramblebitmaptools
2198 # architecture, manufacturer and model for the target-tree build
2199 t_cpu="arm"
2200 t_manufacturer="philips"
2201 t_model="sa9200"
2204 101|gogearhdd1630)
2205 target_id=43
2206 modelname="gogearhdd1630"
2207 target="-DPHILIPS_HDD1630"
2208 memory=32 # supposedly
2209 arm7tdmicc
2210 tool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBOS"
2211 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2212 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2213 output="rockbox.mi4"
2214 appextra="recorder:gui:radio"
2215 plugins="yes"
2216 swcodec="yes"
2217 boottool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBBL"
2218 bootoutput="FWImage.ebn"
2219 # toolset is the tools within the tools directory that we build for
2220 # this particular target.
2221 toolset=$scramblebitmaptools
2222 # architecture, manufacturer and model for the target-tree build
2223 t_cpu="arm"
2224 t_manufacturer="philips"
2225 t_model="hdd1630"
2228 102|gogearhdd6330)
2229 target_id=65
2230 modelname="gogearhdd6330"
2231 target="-DPHILIPS_HDD6330"
2232 memory=64 # always
2233 arm7tdmicc
2234 tool="$rootdir/tools/scramble -mi4v3 -model=6330 -type=RBOS"
2235 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2236 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2237 output="rockbox.mi4"
2238 appextra="recorder:gui:radio"
2239 plugins=""
2240 swcodec="yes"
2241 boottool="$rootdir/tools/scramble -mi4v3 -model=6330 -type=RBBL"
2242 bootoutput="FWImage.ebn"
2243 # toolset is the tools within the tools directory that we build for
2244 # this particular target.
2245 toolset=$scramblebitmaptools
2246 # architecture, manufacturer and model for the target-tree build
2247 t_cpu="arm"
2248 t_manufacturer="philips"
2249 t_model="hdd6330"
2252 110|meizum6sl)
2253 target_id=49
2254 modelname="meizum6sl"
2255 target="-DMEIZU_M6SL"
2256 memory=16 # always
2257 arm940tbecc
2258 tool="cp"
2259 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2260 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2261 output="rockbox.meizu"
2262 appextra="recorder:gui:radio"
2263 plugins="no" #FIXME
2264 swcodec="yes"
2265 toolset=$genericbitmaptools
2266 boottool="cp"
2267 bootoutput="rockboot.ebn"
2268 # architecture, manufacturer and model for the target-tree build
2269 t_cpu="arm"
2270 t_manufacturer="s5l8700"
2271 t_model="meizu-m6sl"
2274 111|meizum6sp)
2275 target_id=46
2276 modelname="meizum6sp"
2277 target="-DMEIZU_M6SP"
2278 memory=16 # always
2279 arm940tbecc
2280 tool="cp"
2281 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2282 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2283 output="rockbox.meizu"
2284 appextra="recorder:gui:radio"
2285 plugins="no" #FIXME
2286 swcodec="yes"
2287 toolset=$genericbitmaptools
2288 boottool="cp"
2289 bootoutput="rockboot.ebn"
2290 # architecture, manufacturer and model for the target-tree build
2291 t_cpu="arm"
2292 t_manufacturer="s5l8700"
2293 t_model="meizu-m6sp"
2296 112|meizum3)
2297 target_id=47
2298 modelname="meizum3"
2299 target="-DMEIZU_M3"
2300 memory=16 # always
2301 arm940tbecc
2302 tool="cp"
2303 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2304 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2305 output="rockbox.meizu"
2306 appextra="recorder:gui:radio"
2307 plugins="no" #FIXME
2308 swcodec="yes"
2309 toolset=$genericbitmaptools
2310 boottool="cp"
2311 bootoutput="rockboot.ebn"
2312 # architecture, manufacturer and model for the target-tree build
2313 t_cpu="arm"
2314 t_manufacturer="s5l8700"
2315 t_model="meizu-m3"
2318 120|ondavx747)
2319 target_id=45
2320 modelname="ondavx747"
2321 target="-DONDA_VX747"
2322 memory=16
2323 mipselcc
2324 tool="$rootdir/tools/scramble -add=x747"
2325 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2326 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2327 output="rockbox.vx747"
2328 appextra="recorder:gui:radio"
2329 plugins="yes"
2330 swcodec="yes"
2331 toolset=$genericbitmaptools
2332 boottool="$rootdir/tools/scramble -ccpmp"
2333 bootoutput="ccpmp.bin"
2334 # architecture, manufacturer and model for the target-tree build
2335 t_cpu="mips"
2336 t_manufacturer="ingenic_jz47xx"
2337 t_model="onda_vx747"
2340 121|ondavx767)
2341 target_id=64
2342 modelname="ondavx767"
2343 target="-DONDA_VX767"
2344 memory=16 #FIXME
2345 mipselcc
2346 tool="cp"
2347 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2348 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2349 output="rockbox.vx767"
2350 appextra="recorder:gui:radio"
2351 plugins="" #FIXME
2352 swcodec="yes"
2353 toolset=$genericbitmaptools
2354 boottool="$rootdir/tools/scramble -ccpmp"
2355 bootoutput="ccpmp.bin"
2356 # architecture, manufacturer and model for the target-tree build
2357 t_cpu="mips"
2358 t_manufacturer="ingenic_jz47xx"
2359 t_model="onda_vx767"
2362 122|ondavx747p)
2363 target_id=54
2364 modelname="ondavx747p"
2365 target="-DONDA_VX747P"
2366 memory=16
2367 mipselcc
2368 tool="$rootdir/tools/scramble -add=747p"
2369 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2370 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2371 output="rockbox.vx747p"
2372 appextra="recorder:gui:radio"
2373 plugins="yes"
2374 swcodec="yes"
2375 toolset=$genericbitmaptools
2376 boottool="$rootdir/tools/scramble -ccpmp"
2377 bootoutput="ccpmp.bin"
2378 # architecture, manufacturer and model for the target-tree build
2379 t_cpu="mips"
2380 t_manufacturer="ingenic_jz47xx"
2381 t_model="onda_vx747"
2384 123|ondavx777)
2385 target_id=61
2386 modelname="ondavx777"
2387 target="-DONDA_VX777"
2388 memory=16
2389 mipselcc
2390 tool="$rootdir/tools/scramble -add=x777"
2391 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2392 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2393 output="rockbox.vx777"
2394 appextra="recorder:gui:radio"
2395 plugins="yes"
2396 swcodec="yes"
2397 toolset=$genericbitmaptools
2398 boottool="$rootdir/tools/scramble -ccpmp"
2399 bootoutput="ccpmp.bin"
2400 # architecture, manufacturer and model for the target-tree build
2401 t_cpu="mips"
2402 t_manufacturer="ingenic_jz47xx"
2403 t_model="onda_vx747"
2406 130|lyreproto1)
2407 target_id=56
2408 modelname="lyreproto1"
2409 target="-DLYRE_PROTO1"
2410 memory=64
2411 arm926ejscc
2412 tool="cp"
2413 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2414 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2415 output="rockbox.lyre"
2416 appextra="recorder:gui:radio"
2417 plugins=""
2418 swcodec="yes"
2419 toolset=$scramblebitmaptools
2420 boottool="cp"
2421 bootoutput="bootloader-proto1.lyre"
2422 # architecture, manufacturer and model for the target-tree build
2423 t_cpu="arm"
2424 t_manufacturer="at91sam"
2425 t_model="lyre_proto1"
2428 131|mini2440)
2429 target_id=99
2430 modelname="mini2440"
2431 target="-DMINI2440"
2432 memory=64
2433 arm9tdmicc
2434 tool="$rootdir/tools/scramble -add=m244"
2435 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2436 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2437 output="rockbox.mini2440"
2438 appextra="recorder:gui:radio"
2439 plugins=""
2440 swcodec="yes"
2441 toolset=$scramblebitmaptools
2442 boottool="cp"
2443 bootoutput="bootloader-mini2440.lyre"
2444 # architecture, manufacturer and model for the target-tree build
2445 t_cpu="arm"
2446 t_manufacturer="s3c2440"
2447 t_model="mini2440"
2450 140|samsungyh820)
2451 target_id=57
2452 modelname="samsungyh820"
2453 target="-DSAMSUNG_YH820"
2454 memory=32 # always
2455 arm7tdmicc
2456 tool="$rootdir/tools/scramble -mi4v2 -model=y820 -type=RBOS"
2457 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2458 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2459 output="rockbox.mi4"
2460 appextra="recorder:gui:radio"
2461 plugins="yes"
2462 swcodec="yes"
2463 boottool="$rootdir/tools/scramble -mi4v2 -model=y820 -type=RBBL"
2464 bootoutput="FW_YH820.mi4"
2465 # toolset is the tools within the tools directory that we build for
2466 # this particular target.
2467 toolset=$scramblebitmaptools
2468 # architecture, manufacturer and model for the target-tree build
2469 t_cpu="arm"
2470 t_manufacturer="samsung"
2471 t_model="yh820"
2474 141|samsungyh920)
2475 target_id=58
2476 modelname="samsungyh920"
2477 target="-DSAMSUNG_YH920"
2478 memory=32 # always
2479 arm7tdmicc
2480 tool="$rootdir/tools/scramble -mi4v2 -model=y920 -type=RBOS"
2481 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2482 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
2483 output="rockbox.mi4"
2484 appextra="recorder:gui:radio"
2485 plugins="yes"
2486 swcodec="yes"
2487 boottool="$rootdir/tools/scramble -mi4v2 -model=y920 -type=RBBL"
2488 bootoutput="PP5020.mi4"
2489 # toolset is the tools within the tools directory that we build for
2490 # this particular target.
2491 toolset=$scramblebitmaptools
2492 # architecture, manufacturer and model for the target-tree build
2493 t_cpu="arm"
2494 t_manufacturer="samsung"
2495 t_model="yh920"
2498 142|samsungyh925)
2499 target_id=59
2500 modelname="samsungyh925"
2501 target="-DSAMSUNG_YH925"
2502 memory=32 # always
2503 arm7tdmicc
2504 tool="$rootdir/tools/scramble -mi4v2 -model=y925 -type=RBOS"
2505 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2506 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2507 output="rockbox.mi4"
2508 appextra="recorder:gui:radio"
2509 plugins="yes"
2510 swcodec="yes"
2511 boottool="$rootdir/tools/scramble -mi4v2 -model=y925 -type=RBBL"
2512 bootoutput="FW_YH925.mi4"
2513 # toolset is the tools within the tools directory that we build for
2514 # this particular target.
2515 toolset=$scramblebitmaptools
2516 # architecture, manufacturer and model for the target-tree build
2517 t_cpu="arm"
2518 t_manufacturer="samsung"
2519 t_model="yh925"
2522 143|samsungyps3)
2523 target_id=60
2524 modelname="samsungyps3"
2525 target="-DSAMSUNG_YPS3"
2526 memory=16 # always
2527 arm940tbecc
2528 tool="cp"
2529 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2530 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2531 output="rockbox.yps3"
2532 appextra="recorder:gui:radio"
2533 plugins="no" #FIXME
2534 swcodec="yes"
2535 toolset=$genericbitmaptools
2536 boottool="cp"
2537 bootoutput="rockboot.ebn"
2538 # architecture, manufacturer and model for the target-tree build
2539 t_cpu="arm"
2540 t_manufacturer="s5l8700"
2541 t_model="yps3"
2544 160|vibe500)
2545 target_id=67
2546 modelname="vibe500"
2547 target="-DPBELL_VIBE500"
2548 memory=32 # always
2549 arm7tdmicc
2550 tool="$rootdir/tools/scramble -mi4v3 -model=v500 -type=RBOS"
2551 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2552 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
2553 output="rockbox.mi4"
2554 appextra="recorder:gui:radio"
2555 plugins="yes"
2556 swcodec="yes"
2557 boottool="$rootdir/tools/scramble -mi4v3 -model=v500 -type=RBBL"
2558 bootoutput="jukebox.mi4"
2559 # toolset is the tools within the tools directory that we build for
2560 # this particular target.
2561 toolset=$scramblebitmaptools
2562 # architecture, manufacturer and model for the target-tree build
2563 t_cpu="arm"
2564 t_manufacturer="pbell"
2565 t_model="vibe500"
2568 170|hd200)
2569 target_id=69
2570 modelname="mpiohd200"
2571 target="-DMPIO_HD200"
2572 memory=16 # always
2573 coldfirecc
2574 tool="$rootdir/tools/scramble -add=hd20"
2575 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2576 bmp2rb_native="$rootdir/tools/bmp2rb -f 7"
2577 output="rockbox.mpio"
2578 bootoutput="bootloader.mpio"
2579 appextra="recorder:gui:radio"
2580 plugins="yes"
2581 swcodec="yes"
2582 # toolset is the tools within the tools directory that we build for
2583 # this particular target.
2584 toolset="$genericbitmaptools"
2585 # architecture, manufacturer and model for the target-tree build
2586 t_cpu="coldfire"
2587 t_manufacturer="mpio"
2588 t_model="hd200"
2592 echo "Please select a supported target platform!"
2593 exit 7
2596 esac
2598 echo "Platform set to $modelname"
2601 #remove start
2602 ############################################################################
2603 # Amount of memory, for those that can differ. They have $memory unset at
2604 # this point.
2607 if [ -z "$memory" ]; then
2608 case $target_id in
2610 if [ "$ARG_RAM" ]; then
2611 size=$ARG_RAM
2612 else
2613 echo "Enter size of your RAM (in MB): (Defaults to 32)"
2614 size=`input`;
2616 case $size in
2617 60|64)
2618 memory="64"
2621 memory="32"
2623 esac
2626 if [ "$ARG_RAM" ]; then
2627 size=$ARG_RAM
2628 else
2629 echo "Enter size of your RAM (in MB): (Defaults to 2)"
2630 size=`input`;
2632 case $size in
2634 memory="8"
2637 memory="2"
2639 esac
2641 esac
2642 echo "Memory size selected: $memory MB"
2643 [ "$ARG_TYPE" ] || echo ""
2645 #remove end
2647 ##################################################################
2648 # Figure out build "type"
2651 # the ifp7x0 is the only platform that supports building a gdb stub like
2652 # this
2653 case $modelname in
2654 iriverifp7xx)
2655 gdbstub="(G)DB stub, "
2657 sansae200r|sansae200)
2658 gdbstub="(I)nstaller, "
2660 sansac200)
2661 gdbstub="(E)raser, "
2665 esac
2666 if [ "$ARG_TYPE" ]; then
2667 btype=$ARG_TYPE
2668 else
2669 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, (C)heckWPS, (D)atabase tool, $gdbstub(M)anual: (Defaults to N)"
2670 btype=`input`;
2673 case $btype in
2674 [Ii])
2675 appsdir='\$(ROOTDIR)/bootloader'
2676 apps="bootloader"
2677 extradefines="-DBOOTLOADER -DE200R_INSTALLER -ffunction-sections -fdata-sections"
2678 bootloader="1"
2679 echo "e200R-installer build selected"
2681 [Ee])
2682 appsdir='\$(ROOTDIR)/bootloader'
2683 apps="bootloader"
2684 echo "C2(4)0 or C2(5)0"
2685 variant=`input`
2686 case $variant in
2688 extradefines="-DBOOTLOADER -DC200_ERASE -DC240_ERASE -ffunction-sections -fdata-sections"
2689 echo "c240 eraser build selected"
2692 extradefines="-DBOOTLOADER -DC200_ERASE -DC250_ERASE -ffunction-sections -fdata-sections"
2693 echo "c240 eraser build selected"
2695 esac
2696 bootloader="1"
2697 echo "c200 eraser build selected"
2699 [Bb])
2700 if test $t_manufacturer = "archos"; then
2701 # Archos SH-based players do this somewhat differently for
2702 # some reason
2703 appsdir='\$(ROOTDIR)/flash/bootbox'
2704 apps="bootbox"
2705 else
2706 appsdir='\$(ROOTDIR)/bootloader'
2707 apps="bootloader"
2708 flash=""
2709 if test -n "$boottool"; then
2710 tool="$boottool"
2712 if test -n "$bootoutput"; then
2713 output=$bootoutput
2716 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
2717 bootloader="1"
2718 echo "Bootloader build selected"
2720 [Ss])
2721 if [ "$modelname" = "sansae200r" ]; then
2722 echo "Do not use the e200R target for simulator builds. Use e200 instead."
2723 exit 8
2725 debug="-DDEBUG"
2726 simulator="yes"
2727 extradefines="-DSIMULATOR"
2728 archosrom=""
2729 flash=""
2730 echo "Simulator build selected"
2732 [Aa]*)
2733 echo "Advanced build selected"
2734 whichadvanced $btype
2736 [Gg])
2737 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
2738 appsdir='\$(ROOTDIR)/gdb'
2739 apps="stub"
2740 case $modelname in
2741 iriverifp7xx)
2742 output="stub.wma"
2746 esac
2747 echo "GDB stub build selected"
2749 [Mm])
2750 toolset='';
2751 apps="manual"
2752 echo "Manual build selected"
2754 [Cc])
2755 uname=`uname`
2756 simcc "checkwps"
2757 toolset='';
2758 t_cpu='';
2759 GCCOPTS='';
2760 extradefines="-DDEBUG"
2761 appsdir='\$(ROOTDIR)/tools/checkwps';
2762 output='checkwps.'${modelname};
2763 archosrom='';
2764 echo "CheckWPS build selected"
2766 [Dd])
2767 uname=`uname`
2768 simcc "database"
2769 toolset='';
2770 t_cpu='';
2771 GCCOPTS='';
2772 appsdir='\$(ROOTDIR)/tools/database';
2773 archosrom='';
2775 case $uname in
2776 CYGWIN*|MINGW*)
2777 output="database_${modelname}.exe"
2780 output='database.'${modelname};
2782 esac
2784 echo "Database tool build selected"
2787 if [ "$modelname" = "sansae200r" ]; then
2788 echo "Do not use the e200R target for regular builds. Use e200 instead."
2789 exit 8
2791 debug=""
2792 btype="N" # set it explicitly since RET only gets here as well
2793 echo "Normal build selected"
2796 esac
2797 # to be able running "make manual" from non-manual configuration
2798 case $modelname in
2799 archosrecorderv2)
2800 manualdev="archosfmrecorder"
2802 iriverh1??)
2803 manualdev="iriverh100"
2805 ipodmini2g)
2806 manualdev="ipodmini1g"
2809 manualdev=$modelname
2811 esac
2813 if [ -z "$debug" ]; then
2814 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
2817 echo "Using source code root directory: $rootdir"
2819 # this was once possible to change at build-time, but no more:
2820 language="english"
2822 uname=`uname`
2824 if [ "yes" = "$simulator" ]; then
2825 # setup compiler and things for simulator
2826 simcc "sdl"
2828 if [ -d "simdisk" ]; then
2829 echo "Subdirectory 'simdisk' already present"
2830 else
2831 mkdir simdisk
2832 echo "Created a 'simdisk' subdirectory for simulating the hard disk"
2836 # Now, figure out version number of the (gcc) compiler we are about to use
2837 gccver=`$CC -dumpversion`;
2839 # figure out the binutil version too and display it, mostly for the build
2840 # system etc to be able to see it easier
2841 if [ $uname = "Darwin" ]; then
2842 ldver=`$LD -v 2>&1 | sed -e 's/[^0-9.-]//g'`
2843 else
2844 ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
2847 if [ -z "$gccver" ]; then
2848 echo "[WARNING] The compiler you must use ($CC) is not in your path!"
2849 echo "[WARNING] this may cause your build to fail since we cannot do the"
2850 echo "[WARNING] checks we want now."
2851 else
2853 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
2854 # DEPEND on it
2856 num1=`echo $gccver | cut -d . -f1`
2857 num2=`echo $gccver | cut -d . -f2`
2858 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
2860 # This makes:
2861 # 3.3.X => 303
2862 # 3.4.X => 304
2863 # 2.95.3 => 295
2865 echo "Using $CC $gccver ($gccnum)"
2867 if test "$gccnum" -ge "400"; then
2868 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
2869 # so we ignore that warnings for now
2870 # -Wno-pointer-sign
2871 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
2874 if test "$gccnum" -ge "402"; then
2875 # disable warning about "warning: initialized field overwritten" as gcc 4.2
2876 # and later would throw it for several valid cases
2877 GCCOPTS="$GCCOPTS -Wno-override-init"
2880 case $prefix in
2881 ""|"$CROSS_COMPILE")
2882 # simulator
2884 i586-mingw32msvc-)
2885 # cross-compile for win32
2888 # Verify that the cross-compiler is of a recommended version!
2889 if test "$gccver" != "$gccchoice"; then
2890 echo "WARNING: Your cross-compiler $CC $gccver is not of the recommended"
2891 echo "WARNING: version $gccchoice!"
2892 echo "WARNING: This may cause your build to fail since it may be a version"
2893 echo "WARNING: that isn't functional or known to not be the best choice."
2894 echo "WARNING: If you suffer from build problems, you know that this is"
2895 echo "WARNING: a likely source for them..."
2898 esac
2903 echo "Using $LD $ldver"
2905 # check the compiler for SH platforms
2906 if test "$CC" = "sh-elf-gcc"; then
2907 if test "$gccnum" -lt "400"; then
2908 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
2909 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2910 else
2911 # figure out patch status
2912 gccpatch=`$CC --version`;
2914 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
2915 echo "gcc $gccver is rockbox patched"
2916 # then convert -O to -Os to get smaller binaries!
2917 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2918 else
2919 echo "WARNING: You use an unpatched gcc compiler: $gccver"
2920 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2925 if test "$CC" = "m68k-elf-gcc"; then
2926 # convert -O to -Os to get smaller binaries!
2927 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2930 if [ "$ARG_CCACHE" = "1" ]; then
2931 echo "Enable ccache for building"
2932 ccache="ccache"
2933 elif [ "$ARG_CCACHE" != "0" ]; then
2934 ccache=`findtool ccache`
2935 if test -n "$ccache"; then
2936 echo "Found and uses ccache ($ccache)"
2940 # figure out the full path to the various commands if possible
2941 HOSTCC=`findtool gcc --lit`
2942 HOSTAR=`findtool ar --lit`
2943 CC=`findtool ${CC} --lit`
2944 LD=`findtool ${AR} --lit`
2945 AR=`findtool ${AR} --lit`
2946 AS=`findtool ${AS} --lit`
2947 OC=`findtool ${OC} --lit`
2948 WINDRES=`findtool ${WINDRES} --lit`
2949 DLLTOOL=`findtool ${DLLTOOL} --lit`
2950 DLLWRAP=`findtool ${DLLWRAP} --lit`
2951 RANLIB=`findtool ${RANLIB} --lit`
2953 if test "$ARG_ARM_THUMB" = "1"; then
2954 extradefines="$extradefines -DUSE_THUMB"
2955 CC="$toolsdir/thumb-cc.py $CC"
2958 if test -n "$ccache"; then
2959 CC="$ccache $CC"
2962 if test "X$endian" = "Xbig"; then
2963 defendian="ROCKBOX_BIG_ENDIAN"
2964 else
2965 defendian="ROCKBOX_LITTLE_ENDIAN"
2968 if [ "$ARG_RBDIR" ]; then
2969 rbdir=$ARG_RBDIR
2970 echo "Using alternate rockbox dir: ${rbdir}"
2973 sed > autoconf.h \
2974 -e "s,@ENDIAN@,${defendian},g" \
2975 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
2976 -e "s,^#undef DO_BOOTCHART,$use_bootchart,g" \
2977 -e "s,@config_rtc@,$config_rtc,g" \
2978 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
2979 -e "s,@RBDIR@,${rbdir},g" \
2980 -e "s,@have_backlight@,$have_backlight,g" \
2981 -e "s,@have_fmradio_in@,$have_fmradio_in,g" \
2982 -e "s,@have_ata_poweroff@,$have_ata_poweroff,g" \
2983 <<EOF
2984 /* This header was made by configure */
2985 #ifndef __BUILD_AUTOCONF_H
2986 #define __BUILD_AUTOCONF_H
2988 /* Define endianess for the target or simulator platform */
2989 #define @ENDIAN@ 1
2991 /* Define this if you build rockbox to support the logf logging and display */
2992 #undef ROCKBOX_HAS_LOGF
2994 /* Define this to record a chart with timings for the stages of boot */
2995 #undef DO_BOOTCHART
2997 /* optional define for a backlight modded Ondio */
2998 @have_backlight@
3000 /* optional define for FM radio mod for iAudio M5 */
3001 @have_fmradio_in@
3003 /* optional define for ATA poweroff on Player */
3004 @have_ata_poweroff@
3006 /* optional defines for RTC mod for h1x0 */
3007 @config_rtc@
3008 @have_rtc_alarm@
3010 /* root of Rockbox */
3011 #define ROCKBOX_DIR "/@RBDIR@"
3013 #endif /* __BUILD_AUTOCONF_H */
3016 if test -n "$t_cpu"; then
3017 TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
3018 if [ "$simulator" = "yes" ]; then # a few more includes for the sim target tree
3019 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl/"
3020 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/"
3022 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
3023 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
3024 GCCOPTS="$GCCOPTS"
3027 if test "$simulator" = "yes"; then
3028 # add simul make stuff on the #SIMUL# line
3029 simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
3030 simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
3031 else
3032 # delete the lines that match
3033 simmagic1='/@SIMUL1@/D'
3034 simmagic2='/@SIMUL2@/D'
3037 if test "$swcodec" = "yes"; then
3038 voicetoolset="rbspeexenc voicefont wavtrim"
3039 else
3040 voicetoolset="voicefont wavtrim"
3043 if test "$apps" = "apps"; then
3044 # only when we build "real" apps we build the .lng files
3045 buildlangs="langs"
3048 #### Fix the cmdline ###
3049 if [ "$ARG_CCACHE" = "1" ]; then
3050 cmdline="--ccache "
3051 elif [ "$ARG_CCACHE" = "0" ]; then
3052 cmdline="--no-ccache "
3054 if [ "$ARG_ARM_EABI" = "1" ]; then
3055 cmdline="$cmdline--eabi "
3058 cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts"
3059 ### end of cmdline
3061 sed > Makefile \
3062 -e "s,@ROOTDIR@,${rootdir},g" \
3063 -e "s,@DEBUG@,${debug},g" \
3064 -e "s,@MEMORY@,${memory},g" \
3065 -e "s,@TARGET_ID@,${target_id},g" \
3066 -e "s,@TARGET@,${target},g" \
3067 -e "s,@CPU@,${t_cpu},g" \
3068 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
3069 -e "s,@MODELNAME@,${modelname},g" \
3070 -e "s,@LANGUAGE@,${language},g" \
3071 -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
3072 -e "s,@PWD@,${pwd},g" \
3073 -e "s,@HOSTCC@,${HOSTCC},g" \
3074 -e "s,@HOSTAR@,${HOSTAR},g" \
3075 -e "s,@CC@,${CC},g" \
3076 -e "s,@LD@,${LD},g" \
3077 -e "s,@AR@,${AR},g" \
3078 -e "s,@AS@,${AS},g" \
3079 -e "s,@OC@,${OC},g" \
3080 -e "s,@WINDRES@,${WINDRES},g" \
3081 -e "s,@DLLTOOL@,${DLLTOOL},g" \
3082 -e "s,@DLLWRAP@,${DLLWRAP},g" \
3083 -e "s,@RANLIB@,${RANLIB},g" \
3084 -e "s,@TOOL@,${tool},g" \
3085 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
3086 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
3087 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
3088 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
3089 -e "s,@OUTPUT@,${output},g" \
3090 -e "s,@APPEXTRA@,${appextra},g" \
3091 -e "s,@ARCHOSROM@,${archosrom},g" \
3092 -e "s,@FLASHFILE@,${flash},g" \
3093 -e "s,@PLUGINS@,${plugins},g" \
3094 -e "s,@CODECS@,${swcodec},g" \
3095 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
3096 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
3097 -e "s,@GCCOPTS@,${GCCOPTS},g" \
3098 -e "s,@TARGET_INC@,${TARGET_INC},g" \
3099 -e "s!@LDOPTS@!${LDOPTS}!g" \
3100 -e "s,@LOADADDRESS@,${loadaddress},g" \
3101 -e "s,@EXTRADEF@,${extradefines},g" \
3102 -e "s,@APPSDIR@,${appsdir},g" \
3103 -e "s,@FIRMDIR@,${firmdir},g" \
3104 -e "s,@TOOLSDIR@,${toolsdir},g" \
3105 -e "s,@APPS@,${apps},g" \
3106 -e "s,@SIMVER@,${simver},g" \
3107 -e "s,@GCCVER@,${gccver},g" \
3108 -e "s,@GCCNUM@,${gccnum},g" \
3109 -e "s,@UNAME@,${uname},g" \
3110 -e "s,@ENDIAN@,${defendian},g" \
3111 -e "s,@TOOLSET@,${toolset},g" \
3112 -e "${simmagic1}" \
3113 -e "${simmagic2}" \
3114 -e "s,@MANUALDEV@,${manualdev},g" \
3115 -e "s,@ENCODER@,${ENC_CMD},g" \
3116 -e "s,@ENC_OPTS@,${ENC_OPTS},g" \
3117 -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
3118 -e "s,@TTS_OPTS@,${TTS_OPTS},g" \
3119 -e "s,@VOICETOOLSET@,${voicetoolset},g" \
3120 -e "s,@LANGS@,${buildlangs},g" \
3121 -e "s,@USE_ELF@,${USE_ELF},g" \
3122 -e "s,@RBDIR@,${rbdir},g" \
3123 -e "s,@PREFIX@,$PREFIX,g" \
3124 -e "s,@CMDLINE@,$cmdline,g" \
3125 -e "s,@SDLCONFIG@,$sdl,g" \
3126 <<EOF
3127 ## Automatically generated. http://www.rockbox.org/
3129 export ROOTDIR=@ROOTDIR@
3130 export FIRMDIR=@FIRMDIR@
3131 export APPSDIR=@APPSDIR@
3132 export TOOLSDIR=@TOOLSDIR@
3133 export DOCSDIR=\$(ROOTDIR)/docs
3134 export MANUALDIR=\${ROOTDIR}/manual
3135 export DEBUG=@DEBUG@
3136 export MODELNAME=@MODELNAME@
3137 export ARCHOSROM=@ARCHOSROM@
3138 export FLASHFILE=@FLASHFILE@
3139 export TARGET_ID=@TARGET_ID@
3140 export TARGET=@TARGET@
3141 export CPU=@CPU@
3142 export MANUFACTURER=@MANUFACTURER@
3143 export OBJDIR=@PWD@
3144 export BUILDDIR=@PWD@
3145 export LANGUAGE=@LANGUAGE@
3146 export VOICELANGUAGE=@VOICELANGUAGE@
3147 export MEMORYSIZE=@MEMORY@
3148 export BUILDDATE:=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
3149 export MKFIRMWARE=@TOOL@
3150 export BMP2RB_MONO=@BMP2RB_MONO@
3151 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
3152 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
3153 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
3154 export BINARY=@OUTPUT@
3155 export APPEXTRA=@APPEXTRA@
3156 export ENABLEDPLUGINS=@PLUGINS@
3157 export SOFTWARECODECS=@CODECS@
3158 export EXTRA_DEFINES=@EXTRADEF@
3159 export HOSTCC=@HOSTCC@
3160 export HOSTAR=@HOSTAR@
3161 export CC=@CC@
3162 export LD=@LD@
3163 export AR=@AR@
3164 export AS=@AS@
3165 export OC=@OC@
3166 export WINDRES=@WINDRES@
3167 export DLLTOOL=@DLLTOOL@
3168 export DLLWRAP=@DLLWRAP@
3169 export RANLIB=@RANLIB@
3170 export PREFIX=@PREFIX@
3171 export PROFILE_OPTS=@PROFILE_OPTS@
3172 export SIMVER=@SIMVER@
3173 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
3174 export GCCOPTS=@GCCOPTS@
3175 export TARGET_INC=@TARGET_INC@
3176 export LOADADDRESS=@LOADADDRESS@
3177 export SHARED_FLAG=@SHARED_FLAG@
3178 export LDOPTS=@LDOPTS@
3179 export GCCVER=@GCCVER@
3180 export GCCNUM=@GCCNUM@
3181 export UNAME=@UNAME@
3182 export MANUALDEV=@MANUALDEV@
3183 export TTS_OPTS=@TTS_OPTS@
3184 export TTS_ENGINE=@TTS_ENGINE@
3185 export ENC_OPTS=@ENC_OPTS@
3186 export ENCODER=@ENCODER@
3187 export USE_ELF=@USE_ELF@
3188 export RBDIR=@RBDIR@
3189 export SDLCONFIG=@SDLCONFIG@
3191 CONFIGURE_OPTIONS=@CMDLINE@
3193 include \$(TOOLSDIR)/root.make
3197 echo "Created Makefile"