Merge branch 'master' into gsoc-app-target
[kugel-rb.git] / tools / configure
blob803c95de6fef36973256e01447b794b252469f02
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== == Application ==
963 170) HD200 200) SDL 320x240
967 buildfor=`input`;
970 # Set of tools built for all target platforms:
971 toolset="rdf2binary convbdf codepages"
973 # Toolsets for some target families:
974 archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
975 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
976 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
977 ipodbitmaptools="$toolset scramble bmp2rb"
978 gigabeatbitmaptools="$toolset scramble descramble bmp2rb"
979 tccbitmaptools="$toolset scramble bmp2rb"
980 # generic is used by IFP, Meizu and Onda
981 genericbitmaptools="$toolset bmp2rb"
982 # scramble is used by all other targets
983 scramblebitmaptools="$genericbitmaptools scramble"
986 # ---- For each target ----
988 # *Variables*
989 # target_id: a unique number identifying this target, IS NOT the menu number.
990 # Just use the currently highest number+1 when you add a new
991 # target.
992 # modelname: short model name used all over to identify this target
993 # memory: number of megabytes of RAM this target has. If the amount can
994 # be selected by the size prompt, let memory be unset here
995 # target: -Ddefine passed to the build commands to make the correct
996 # config-*.h file get included etc
997 # tool: the tool that takes a plain binary and converts that into a
998 # working "firmware" file for your target
999 # output: the final output file name
1000 # boottool: the tool that takes a plain binary and generates a bootloader
1001 # file for your target (or blank to use $tool)
1002 # bootoutput:the final output file name for the bootloader (or blank to use
1003 # $output)
1004 # appextra: passed to the APPEXTRA variable in the Makefiles.
1005 # TODO: add proper explanation
1006 # archosrom: used only for Archos targets that build a special flashable .ucl
1007 # image.
1008 # flash: name of output for flashing, for targets where there's a special
1009 # file output for this.
1010 # plugins: set to 'yes' to build the plugins. Early development builds can
1011 # set this to no in the early stages to have an easier life for a
1012 # while
1013 # swcodec: set 'yes' on swcodec targets
1014 # toolset: lists what particular tools in the tools/ directory that this
1015 # target needs to have built prior to building Rockbox
1017 # *Functions*
1018 # *cc: sets up gcc and compiler options for your target builds. Note
1019 # that if you select a simulator build, the compiler selection is
1020 # overridden later in the script.
1022 case $buildfor in
1024 0|archosplayer)
1025 target_id=1
1026 modelname="archosplayer"
1027 target="-DARCHOS_PLAYER"
1028 shcc
1029 tool="$rootdir/tools/scramble"
1030 output="archos.mod"
1031 appextra="player:gui"
1032 archosrom="$pwd/rombox.ucl"
1033 flash="$pwd/rockbox.ucl"
1034 plugins="yes"
1035 swcodec=""
1037 # toolset is the tools within the tools directory that we build for
1038 # this particular target.
1039 toolset="$toolset scramble descramble sh2d player_unifont uclpack"
1041 # Note: the convbdf is present in the toolset just because: 1) the
1042 # firmware/Makefile assumes it is present always, and 2) we will need it when we
1043 # build the player simulator
1045 t_cpu="sh"
1046 t_manufacturer="archos"
1047 t_model="player"
1050 1|archosrecorder)
1051 target_id=2
1052 modelname="archosrecorder"
1053 target="-DARCHOS_RECORDER"
1054 shcc
1055 tool="$rootdir/tools/scramble"
1056 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1057 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1058 output="ajbrec.ajz"
1059 appextra="recorder:gui:radio"
1060 #archosrom="$pwd/rombox.ucl"
1061 flash="$pwd/rockbox.ucl"
1062 plugins="yes"
1063 swcodec=""
1064 # toolset is the tools within the tools directory that we build for
1065 # this particular target.
1066 toolset=$archosbitmaptools
1067 t_cpu="sh"
1068 t_manufacturer="archos"
1069 t_model="recorder"
1072 2|archosfmrecorder)
1073 target_id=3
1074 modelname="archosfmrecorder"
1075 target="-DARCHOS_FMRECORDER"
1076 shcc
1077 tool="$rootdir/tools/scramble -fm"
1078 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1079 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1080 output="ajbrec.ajz"
1081 appextra="recorder:gui:radio"
1082 #archosrom="$pwd/rombox.ucl"
1083 flash="$pwd/rockbox.ucl"
1084 plugins="yes"
1085 swcodec=""
1086 # toolset is the tools within the tools directory that we build for
1087 # this particular target.
1088 toolset=$archosbitmaptools
1089 t_cpu="sh"
1090 t_manufacturer="archos"
1091 t_model="fm_v2"
1094 3|archosrecorderv2)
1095 target_id=4
1096 modelname="archosrecorderv2"
1097 target="-DARCHOS_RECORDERV2"
1098 shcc
1099 tool="$rootdir/tools/scramble -v2"
1100 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1101 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1102 output="ajbrec.ajz"
1103 appextra="recorder:gui:radio"
1104 #archosrom="$pwd/rombox.ucl"
1105 flash="$pwd/rockbox.ucl"
1106 plugins="yes"
1107 swcodec=""
1108 # toolset is the tools within the tools directory that we build for
1109 # this particular target.
1110 toolset=$archosbitmaptools
1111 t_cpu="sh"
1112 t_manufacturer="archos"
1113 t_model="fm_v2"
1116 4|archosondiosp)
1117 target_id=7
1118 modelname="archosondiosp"
1119 target="-DARCHOS_ONDIOSP"
1120 shcc
1121 tool="$rootdir/tools/scramble -osp"
1122 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1123 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1124 output="ajbrec.ajz"
1125 appextra="recorder:gui:radio"
1126 #archosrom="$pwd/rombox.ucl"
1127 flash="$pwd/rockbox.ucl"
1128 plugins="yes"
1129 swcodec=""
1130 # toolset is the tools within the tools directory that we build for
1131 # this particular target.
1132 toolset=$archosbitmaptools
1133 t_cpu="sh"
1134 t_manufacturer="archos"
1135 t_model="ondio"
1138 5|archosondiofm)
1139 target_id=8
1140 modelname="archosondiofm"
1141 target="-DARCHOS_ONDIOFM"
1142 shcc
1143 tool="$rootdir/tools/scramble -ofm"
1144 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1145 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1146 output="ajbrec.ajz"
1147 appextra="recorder:gui:radio"
1148 #archosrom="$pwd/rombox.ucl"
1149 flash="$pwd/rockbox.ucl"
1150 plugins="yes"
1151 swcodec=""
1152 toolset=$archosbitmaptools
1153 t_cpu="sh"
1154 t_manufacturer="archos"
1155 t_model="ondio"
1158 6|archosav300)
1159 target_id=38
1160 modelname="archosav300"
1161 target="-DARCHOS_AV300"
1162 memory=16 # always
1163 arm7tdmicc
1164 tool="$rootdir/tools/scramble -mm=C"
1165 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1166 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1167 output="cjbm.ajz"
1168 appextra="recorder:gui:radio"
1169 plugins="yes"
1170 swcodec=""
1171 # toolset is the tools within the tools directory that we build for
1172 # this particular target.
1173 toolset="$toolset scramble descramble bmp2rb"
1174 # architecture, manufacturer and model for the target-tree build
1175 t_cpu="arm"
1176 t_manufacturer="archos"
1177 t_model="av300"
1180 10|iriverh120)
1181 target_id=9
1182 modelname="iriverh120"
1183 target="-DIRIVER_H120"
1184 memory=32 # always
1185 coldfirecc
1186 tool="$rootdir/tools/scramble -add=h120"
1187 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1188 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1189 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1190 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1191 output="rockbox.iriver"
1192 bootoutput="bootloader.iriver"
1193 appextra="recorder:gui:radio"
1194 flash="$pwd/rombox.iriver"
1195 plugins="yes"
1196 swcodec="yes"
1197 # toolset is the tools within the tools directory that we build for
1198 # this particular target.
1199 toolset=$iriverbitmaptools
1200 t_cpu="coldfire"
1201 t_manufacturer="iriver"
1202 t_model="h100"
1205 11|iriverh300)
1206 target_id=10
1207 modelname="iriverh300"
1208 target="-DIRIVER_H300"
1209 memory=32 # always
1210 coldfirecc
1211 tool="$rootdir/tools/scramble -add=h300"
1212 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1213 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1214 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1215 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1216 output="rockbox.iriver"
1217 appextra="recorder:gui:radio"
1218 plugins="yes"
1219 swcodec="yes"
1220 # toolset is the tools within the tools directory that we build for
1221 # this particular target.
1222 toolset=$iriverbitmaptools
1223 t_cpu="coldfire"
1224 t_manufacturer="iriver"
1225 t_model="h300"
1228 12|iriverh100)
1229 target_id=11
1230 modelname="iriverh100"
1231 target="-DIRIVER_H100"
1232 memory=16 # always
1233 coldfirecc
1234 tool="$rootdir/tools/scramble -add=h100"
1235 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1236 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1237 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1238 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1239 output="rockbox.iriver"
1240 bootoutput="bootloader.iriver"
1241 appextra="recorder:gui:radio"
1242 flash="$pwd/rombox.iriver"
1243 plugins="yes"
1244 swcodec="yes"
1245 # toolset is the tools within the tools directory that we build for
1246 # this particular target.
1247 toolset=$iriverbitmaptools
1248 t_cpu="coldfire"
1249 t_manufacturer="iriver"
1250 t_model="h100"
1253 13|iriverifp7xx)
1254 target_id=19
1255 modelname="iriverifp7xx"
1256 target="-DIRIVER_IFP7XX"
1257 memory=1
1258 arm7tdmicc short
1259 tool="cp"
1260 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1261 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1262 output="rockbox.wma"
1263 appextra="recorder:gui:radio"
1264 plugins="yes"
1265 swcodec="yes"
1266 # toolset is the tools within the tools directory that we build for
1267 # this particular target.
1268 toolset=$genericbitmaptools
1269 t_cpu="arm"
1270 t_manufacturer="pnx0101"
1271 t_model="iriver-ifp7xx"
1274 14|iriverh10)
1275 target_id=22
1276 modelname="iriverh10"
1277 target="-DIRIVER_H10"
1278 memory=32 # always
1279 arm7tdmicc
1280 tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
1281 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1282 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1283 output="rockbox.mi4"
1284 appextra="recorder:gui:radio"
1285 plugins="yes"
1286 swcodec="yes"
1287 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
1288 bootoutput="H10_20GC.mi4"
1289 # toolset is the tools within the tools directory that we build for
1290 # this particular target.
1291 toolset=$scramblebitmaptools
1292 # architecture, manufacturer and model for the target-tree build
1293 t_cpu="arm"
1294 t_manufacturer="iriver"
1295 t_model="h10"
1298 15|iriverh10_5gb)
1299 target_id=24
1300 modelname="iriverh10_5gb"
1301 target="-DIRIVER_H10_5GB"
1302 memory=32 # always
1303 arm7tdmicc
1304 tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
1305 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1306 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1307 output="rockbox.mi4"
1308 appextra="recorder:gui:radio"
1309 plugins="yes"
1310 swcodec="yes"
1311 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
1312 bootoutput="H10.mi4"
1313 # toolset is the tools within the tools directory that we build for
1314 # this particular target.
1315 toolset=$scramblebitmaptools
1316 # architecture, manufacturer and model for the target-tree build
1317 t_cpu="arm"
1318 t_manufacturer="iriver"
1319 t_model="h10"
1322 20|ipodcolor)
1323 target_id=13
1324 modelname="ipodcolor"
1325 target="-DIPOD_COLOR"
1326 memory=32 # always
1327 arm7tdmicc
1328 tool="$rootdir/tools/scramble -add=ipco"
1329 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1330 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1331 output="rockbox.ipod"
1332 appextra="recorder:gui:radio"
1333 plugins="yes"
1334 swcodec="yes"
1335 bootoutput="bootloader-$modelname.ipod"
1336 # toolset is the tools within the tools directory that we build for
1337 # this particular target.
1338 toolset=$ipodbitmaptools
1339 # architecture, manufacturer and model for the target-tree build
1340 t_cpu="arm"
1341 t_manufacturer="ipod"
1342 t_model="color"
1345 21|ipodnano1g)
1346 target_id=14
1347 modelname="ipodnano1g"
1348 target="-DIPOD_NANO"
1349 memory=32 # always
1350 arm7tdmicc
1351 tool="$rootdir/tools/scramble -add=nano"
1352 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1353 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1354 output="rockbox.ipod"
1355 appextra="recorder:gui:radio"
1356 plugins="yes"
1357 swcodec="yes"
1358 bootoutput="bootloader-$modelname.ipod"
1359 # toolset is the tools within the tools directory that we build for
1360 # this particular target.
1361 toolset=$ipodbitmaptools
1362 # architecture, manufacturer and model for the target-tree build
1363 t_cpu="arm"
1364 t_manufacturer="ipod"
1365 t_model="nano"
1368 22|ipodvideo)
1369 target_id=15
1370 modelname="ipodvideo"
1371 target="-DIPOD_VIDEO"
1372 arm7tdmicc
1373 tool="$rootdir/tools/scramble -add=ipvd"
1374 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1375 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1376 output="rockbox.ipod"
1377 appextra="recorder:gui:radio"
1378 plugins="yes"
1379 swcodec="yes"
1380 bootoutput="bootloader-$modelname.ipod"
1381 # toolset is the tools within the tools directory that we build for
1382 # this particular target.
1383 toolset=$ipodbitmaptools
1384 # architecture, manufacturer and model for the target-tree build
1385 t_cpu="arm"
1386 t_manufacturer="ipod"
1387 t_model="video"
1390 23|ipod3g)
1391 target_id=16
1392 modelname="ipod3g"
1393 target="-DIPOD_3G"
1394 memory=32 # always
1395 arm7tdmicc
1396 tool="$rootdir/tools/scramble -add=ip3g"
1397 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1398 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1399 output="rockbox.ipod"
1400 appextra="recorder:gui:radio"
1401 plugins="yes"
1402 swcodec="yes"
1403 bootoutput="bootloader-$modelname.ipod"
1404 # toolset is the tools within the tools directory that we build for
1405 # this particular target.
1406 toolset=$ipodbitmaptools
1407 # architecture, manufacturer and model for the target-tree build
1408 t_cpu="arm"
1409 t_manufacturer="ipod"
1410 t_model="3g"
1413 24|ipod4g)
1414 target_id=17
1415 modelname="ipod4g"
1416 target="-DIPOD_4G"
1417 memory=32 # always
1418 arm7tdmicc
1419 tool="$rootdir/tools/scramble -add=ip4g"
1420 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1421 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1422 output="rockbox.ipod"
1423 appextra="recorder:gui:radio"
1424 plugins="yes"
1425 swcodec="yes"
1426 bootoutput="bootloader-$modelname.ipod"
1427 # toolset is the tools within the tools directory that we build for
1428 # this particular target.
1429 toolset=$ipodbitmaptools
1430 # architecture, manufacturer and model for the target-tree build
1431 t_cpu="arm"
1432 t_manufacturer="ipod"
1433 t_model="4g"
1436 25|ipodmini1g)
1437 target_id=18
1438 modelname="ipodmini1g"
1439 target="-DIPOD_MINI"
1440 memory=32 # always
1441 arm7tdmicc
1442 tool="$rootdir/tools/scramble -add=mini"
1443 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1444 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1445 output="rockbox.ipod"
1446 appextra="recorder:gui:radio"
1447 plugins="yes"
1448 swcodec="yes"
1449 bootoutput="bootloader-$modelname.ipod"
1450 # toolset is the tools within the tools directory that we build for
1451 # this particular target.
1452 toolset=$ipodbitmaptools
1453 # architecture, manufacturer and model for the target-tree build
1454 t_cpu="arm"
1455 t_manufacturer="ipod"
1456 t_model="mini"
1459 26|ipodmini2g)
1460 target_id=21
1461 modelname="ipodmini2g"
1462 target="-DIPOD_MINI2G"
1463 memory=32 # always
1464 arm7tdmicc
1465 tool="$rootdir/tools/scramble -add=mn2g"
1466 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1467 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1468 output="rockbox.ipod"
1469 appextra="recorder:gui:radio"
1470 plugins="yes"
1471 swcodec="yes"
1472 bootoutput="bootloader-$modelname.ipod"
1473 # toolset is the tools within the tools directory that we build for
1474 # this particular target.
1475 toolset=$ipodbitmaptools
1476 # architecture, manufacturer and model for the target-tree build
1477 t_cpu="arm"
1478 t_manufacturer="ipod"
1479 t_model="mini2g"
1482 27|ipod1g2g)
1483 target_id=29
1484 modelname="ipod1g2g"
1485 target="-DIPOD_1G2G"
1486 memory=32 # always
1487 arm7tdmicc
1488 tool="$rootdir/tools/scramble -add=1g2g"
1489 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1490 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1491 output="rockbox.ipod"
1492 appextra="recorder:gui:radio"
1493 plugins="yes"
1494 swcodec="yes"
1495 bootoutput="bootloader-$modelname.ipod"
1496 # toolset is the tools within the tools directory that we build for
1497 # this particular target.
1498 toolset=$ipodbitmaptools
1499 # architecture, manufacturer and model for the target-tree build
1500 t_cpu="arm"
1501 t_manufacturer="ipod"
1502 t_model="1g2g"
1505 28|ipodnano2g)
1506 target_id=62
1507 modelname="ipodnano2g"
1508 target="-DIPOD_NANO2G"
1509 memory=32 # always
1510 arm940tcc
1511 tool="$rootdir/tools/scramble -add=nn2g"
1512 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1513 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1514 output="rockbox.ipod"
1515 appextra="recorder:gui:radio"
1516 plugins="yes"
1517 swcodec="yes"
1518 bootoutput="bootloader-$modelname.ipod"
1519 # toolset is the tools within the tools directory that we build for
1520 # this particular target.
1521 toolset=$ipodbitmaptools
1522 # architecture, manufacturer and model for the target-tree build
1523 t_cpu="arm"
1524 t_manufacturer="s5l8700"
1525 t_model="ipodnano2g"
1528 30|iaudiox5)
1529 target_id=12
1530 modelname="iaudiox5"
1531 target="-DIAUDIO_X5"
1532 memory=16 # always
1533 coldfirecc
1534 tool="$rootdir/tools/scramble -add=iax5"
1535 boottool="$rootdir/tools/scramble -iaudiox5"
1536 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1537 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1538 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1539 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1540 output="rockbox.iaudio"
1541 bootoutput="x5_fw.bin"
1542 appextra="recorder:gui:radio"
1543 plugins="yes"
1544 swcodec="yes"
1545 # toolset is the tools within the tools directory that we build for
1546 # this particular target.
1547 toolset="$iaudiobitmaptools"
1548 # architecture, manufacturer and model for the target-tree build
1549 t_cpu="coldfire"
1550 t_manufacturer="iaudio"
1551 t_model="x5"
1554 31|iaudiom5)
1555 target_id=28
1556 modelname="iaudiom5"
1557 target="-DIAUDIO_M5"
1558 memory=16 # always
1559 coldfirecc
1560 tool="$rootdir/tools/scramble -add=iam5"
1561 boottool="$rootdir/tools/scramble -iaudiom5"
1562 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1563 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1564 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1565 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1566 output="rockbox.iaudio"
1567 bootoutput="m5_fw.bin"
1568 appextra="recorder:gui:radio"
1569 plugins="yes"
1570 swcodec="yes"
1571 # toolset is the tools within the tools directory that we build for
1572 # this particular target.
1573 toolset="$iaudiobitmaptools"
1574 # architecture, manufacturer and model for the target-tree build
1575 t_cpu="coldfire"
1576 t_manufacturer="iaudio"
1577 t_model="m5"
1580 32|iaudio7)
1581 target_id=32
1582 modelname="iaudio7"
1583 target="-DIAUDIO_7"
1584 memory=16 # always
1585 arm946cc
1586 tool="$rootdir/tools/scramble -add=i7"
1587 boottool="$rootdir/tools/scramble -tcc=crc"
1588 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1589 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1590 output="rockbox.iaudio"
1591 appextra="recorder:gui:radio"
1592 plugins="yes"
1593 swcodec="yes"
1594 bootoutput="I7_FW.BIN"
1595 # toolset is the tools within the tools directory that we build for
1596 # this particular target.
1597 toolset="$tccbitmaptools"
1598 # architecture, manufacturer and model for the target-tree build
1599 t_cpu="arm"
1600 t_manufacturer="tcc77x"
1601 t_model="iaudio7"
1604 33|cowond2)
1605 target_id=34
1606 modelname="cowond2"
1607 target="-DCOWON_D2"
1608 memory=32
1609 arm926ejscc
1610 tool="$rootdir/tools/scramble -add=d2"
1611 boottool="cp "
1612 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1613 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1614 output="rockbox.d2"
1615 bootoutput="bootloader-cowond2.bin"
1616 appextra="recorder:gui:radio"
1617 plugins="yes"
1618 swcodec="yes"
1619 toolset="$tccbitmaptools"
1620 # architecture, manufacturer and model for the target-tree build
1621 t_cpu="arm"
1622 t_manufacturer="tcc780x"
1623 t_model="cowond2"
1626 34|iaudiom3)
1627 target_id=37
1628 modelname="iaudiom3"
1629 target="-DIAUDIO_M3"
1630 memory=16 # always
1631 coldfirecc
1632 tool="$rootdir/tools/scramble -add=iam3"
1633 boottool="$rootdir/tools/scramble -iaudiom3"
1634 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1635 bmp2rb_native="$rootdir/tools/bmp2rb -f 7"
1636 output="rockbox.iaudio"
1637 bootoutput="cowon_m3.bin"
1638 appextra="recorder:gui:radio"
1639 plugins="yes"
1640 swcodec="yes"
1641 # toolset is the tools within the tools directory that we build for
1642 # this particular target.
1643 toolset="$iaudiobitmaptools"
1644 # architecture, manufacturer and model for the target-tree build
1645 t_cpu="coldfire"
1646 t_manufacturer="iaudio"
1647 t_model="m3"
1650 40|gigabeatfx)
1651 target_id=20
1652 modelname="gigabeatfx"
1653 target="-DGIGABEAT_F"
1654 memory=32 # always
1655 arm9tdmicc
1656 tool="$rootdir/tools/scramble -add=giga"
1657 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1658 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1659 output="rockbox.gigabeat"
1660 appextra="recorder:gui:radio"
1661 plugins="yes"
1662 swcodec="yes"
1663 toolset=$gigabeatbitmaptools
1664 boottool="$rootdir/tools/scramble -gigabeat"
1665 bootoutput="FWIMG01.DAT"
1666 # architecture, manufacturer and model for the target-tree build
1667 t_cpu="arm"
1668 t_manufacturer="s3c2440"
1669 t_model="gigabeat-fx"
1672 41|gigabeats)
1673 target_id=26
1674 modelname="gigabeats"
1675 target="-DGIGABEAT_S"
1676 memory=64
1677 arm1136jfscc
1678 tool="$rootdir/tools/scramble -add=gigs"
1679 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1680 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1681 output="rockbox.gigabeat"
1682 appextra="recorder:gui:radio"
1683 plugins="yes"
1684 swcodec="yes"
1685 toolset="$gigabeatbitmaptools"
1686 boottool="$rootdir/tools/scramble -gigabeats"
1687 bootoutput="nk.bin"
1688 # architecture, manufacturer and model for the target-tree build
1689 t_cpu="arm"
1690 t_manufacturer="imx31"
1691 t_model="gigabeat-s"
1694 70|mrobe500)
1695 target_id=36
1696 modelname="mrobe500"
1697 target="-DMROBE_500"
1698 memory=64 # always
1699 arm926ejscc
1700 tool="$rootdir/tools/scramble -add=m500"
1701 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1702 bmp2rb_native="$rootdir/tools/bmp2rb -f 8"
1703 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1704 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1705 output="rockbox.mrobe500"
1706 appextra="recorder:gui:radio"
1707 plugins="yes"
1708 swcodec="yes"
1709 toolset=$gigabeatbitmaptools
1710 boottool="cp "
1711 bootoutput="rockbox.mrboot"
1712 # architecture, manufacturer and model for the target-tree build
1713 t_cpu="arm"
1714 t_manufacturer="tms320dm320"
1715 t_model="mrobe-500"
1718 71|mrobe100)
1719 target_id=33
1720 modelname="mrobe100"
1721 target="-DMROBE_100"
1722 memory=32 # always
1723 arm7tdmicc
1724 tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS"
1725 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1726 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1727 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1728 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1729 output="rockbox.mi4"
1730 appextra="recorder:gui:radio"
1731 plugins="yes"
1732 swcodec="yes"
1733 boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL"
1734 bootoutput="pp5020.mi4"
1735 # toolset is the tools within the tools directory that we build for
1736 # this particular target.
1737 toolset=$scramblebitmaptools
1738 # architecture, manufacturer and model for the target-tree build
1739 t_cpu="arm"
1740 t_manufacturer="olympus"
1741 t_model="mrobe-100"
1744 80|logikdax)
1745 target_id=31
1746 modelname="logikdax"
1747 target="-DLOGIK_DAX"
1748 memory=2 # always
1749 arm946cc
1750 tool="$rootdir/tools/scramble -add=ldax"
1751 boottool="$rootdir/tools/scramble -tcc=crc"
1752 bootoutput="player.rom"
1753 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1754 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1755 output="rockbox.logik"
1756 appextra="recorder:gui:radio"
1757 plugins=""
1758 swcodec="yes"
1759 # toolset is the tools within the tools directory that we build for
1760 # this particular target.
1761 toolset=$tccbitmaptools
1762 # architecture, manufacturer and model for the target-tree build
1763 t_cpu="arm"
1764 t_manufacturer="tcc77x"
1765 t_model="logikdax"
1768 90|zenvisionm30gb)
1769 target_id=35
1770 modelname="zenvisionm30gb"
1771 target="-DCREATIVE_ZVM"
1772 memory=64
1773 arm926ejscc
1774 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1775 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1776 tool="$rootdir/tools/scramble -creative=zvm"
1777 USE_ELF="yes"
1778 output="rockbox.zvm"
1779 appextra="recorder:gui:radio"
1780 plugins="yes"
1781 swcodec="yes"
1782 toolset=$ipodbitmaptools
1783 boottool="$rootdir/tools/scramble -creative=zvm -no-ciff"
1784 bootoutput="rockbox.zvmboot"
1785 # architecture, manufacturer and model for the target-tree build
1786 t_cpu="arm"
1787 t_manufacturer="tms320dm320"
1788 t_model="creative-zvm"
1791 91|zenvisionm60gb)
1792 target_id=40
1793 modelname="zenvisionm60gb"
1794 target="-DCREATIVE_ZVM60GB"
1795 memory=64
1796 arm926ejscc
1797 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1798 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1799 tool="$rootdir/tools/scramble -creative=zvm60 -no-ciff"
1800 USE_ELF="yes"
1801 output="rockbox.zvm60"
1802 appextra="recorder:gui:radio"
1803 plugins="yes"
1804 swcodec="yes"
1805 toolset=$ipodbitmaptools
1806 boottool="$rootdir/tools/scramble -creative=zvm60"
1807 bootoutput="rockbox.zvm60boot"
1808 # architecture, manufacturer and model for the target-tree build
1809 t_cpu="arm"
1810 t_manufacturer="tms320dm320"
1811 t_model="creative-zvm"
1814 92|zenvision)
1815 target_id=39
1816 modelname="zenvision"
1817 target="-DCREATIVE_ZV"
1818 memory=64
1819 arm926ejscc
1820 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1821 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1822 tool="$rootdir/tools/scramble -creative=zenvision -no-ciff"
1823 USE_ELF="yes"
1824 output="rockbox.zv"
1825 appextra="recorder:gui:radio"
1826 plugins=""
1827 swcodec="yes"
1828 toolset=$ipodbitmaptools
1829 boottool="$rootdir/tools/scramble -creative=zenvision"
1830 bootoutput="rockbox.zvboot"
1831 # architecture, manufacturer and model for the target-tree build
1832 t_cpu="arm"
1833 t_manufacturer="tms320dm320"
1834 t_model="creative-zvm"
1837 50|sansae200)
1838 target_id=23
1839 modelname="sansae200"
1840 target="-DSANSA_E200"
1841 memory=32 # supposedly
1842 arm7tdmicc
1843 tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1844 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1845 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1846 output="rockbox.mi4"
1847 appextra="recorder:gui:radio"
1848 plugins="yes"
1849 swcodec="yes"
1850 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1851 bootoutput="PP5022.mi4"
1852 # toolset is the tools within the tools directory that we build for
1853 # this particular target.
1854 toolset=$scramblebitmaptools
1855 # architecture, manufacturer and model for the target-tree build
1856 t_cpu="arm"
1857 t_manufacturer="sandisk"
1858 t_model="sansa-e200"
1861 51|sansae200r)
1862 # the e200R model is pretty much identical to the e200, it only has a
1863 # different option to the scramble tool when building a bootloader and
1864 # makes the bootloader output file name in all lower case.
1865 target_id=27
1866 modelname="sansae200r"
1867 target="-DSANSA_E200"
1868 memory=32 # supposedly
1869 arm7tdmicc
1870 tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1871 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1872 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1873 output="rockbox.mi4"
1874 appextra="recorder:gui:radio"
1875 plugins="yes"
1876 swcodec="yes"
1877 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1878 bootoutput="pp5022.mi4"
1879 # toolset is the tools within the tools directory that we build for
1880 # this particular target.
1881 toolset=$scramblebitmaptools
1882 # architecture, manufacturer and model for the target-tree build
1883 t_cpu="arm"
1884 t_manufacturer="sandisk"
1885 t_model="sansa-e200"
1888 52|sansac200)
1889 target_id=30
1890 modelname="sansac200"
1891 target="-DSANSA_C200"
1892 memory=32 # supposedly
1893 arm7tdmicc
1894 tool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBOS"
1895 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1896 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1897 output="rockbox.mi4"
1898 appextra="recorder:gui:radio"
1899 plugins="yes"
1900 swcodec="yes"
1901 boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
1902 bootoutput="firmware.mi4"
1903 # toolset is the tools within the tools directory that we build for
1904 # this particular target.
1905 toolset=$scramblebitmaptools
1906 # architecture, manufacturer and model for the target-tree build
1907 t_cpu="arm"
1908 t_manufacturer="sandisk"
1909 t_model="sansa-c200"
1912 53|sansam200)
1913 target_id=48
1914 modelname="sansam200"
1915 target="-DSANSA_M200"
1916 memory=1 # always
1917 arm946cc
1918 tool="$rootdir/tools/scramble -add=m200"
1919 boottool="$rootdir/tools/scramble -tcc=crc"
1920 bootoutput="player.rom"
1921 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1922 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1923 output="rockbox.m200"
1924 appextra="recorder:gui:radio"
1925 plugins=""
1926 swcodec="yes"
1927 # toolset is the tools within the tools directory that we build for
1928 # this particular target.
1929 toolset=$tccbitmaptools
1930 # architecture, manufacturer and model for the target-tree build
1931 t_cpu="arm"
1932 t_manufacturer="tcc77x"
1933 t_model="m200"
1936 54|sansac100)
1937 target_id=42
1938 modelname="sansac100"
1939 target="-DSANSA_C100"
1940 memory=2
1941 arm946cc
1942 tool="$rootdir/tools/scramble -add=c100"
1943 boottool="$rootdir/tools/scramble -tcc=crc"
1944 bootoutput="player.rom"
1945 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1946 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1947 output="rockbox.c100"
1948 appextra="recorder:gui:radio"
1949 plugins=""
1950 swcodec="yes"
1951 # toolset is the tools within the tools directory that we build for
1952 # this particular target.
1953 toolset=$tccbitmaptools
1954 # architecture, manufacturer and model for the target-tree build
1955 t_cpu="arm"
1956 t_manufacturer="tcc77x"
1957 t_model="c100"
1960 55|sansaclip)
1961 target_id=50
1962 modelname="sansaclip"
1963 target="-DSANSA_CLIP"
1964 memory=2
1965 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1966 bmp2rb_native="$bmp2rb_mono"
1967 tool="$rootdir/tools/scramble -add=clip"
1968 output="rockbox.sansa"
1969 bootoutput="bootloader-clip.sansa"
1970 appextra="recorder:gui:radio"
1971 plugins="yes"
1972 swcodec="yes"
1973 toolset=$scramblebitmaptools
1974 t_cpu="arm"
1975 t_manufacturer="as3525"
1976 t_model="sansa-clip"
1977 if [ "$ARG_ARM_THUMB" != 0 ]; then ARG_ARM_THUMB=1; fi
1978 arm9tdmicc
1979 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
1983 56|sansae200v2)
1984 target_id=51
1985 modelname="sansae200v2"
1986 target="-DSANSA_E200V2"
1987 memory=8
1988 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1989 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1990 tool="$rootdir/tools/scramble -add=e2v2"
1991 output="rockbox.sansa"
1992 bootoutput="bootloader-e200v2.sansa"
1993 appextra="recorder:gui:radio"
1994 plugins="yes"
1995 swcodec="yes"
1996 toolset=$scramblebitmaptools
1997 t_cpu="arm"
1998 t_manufacturer="as3525"
1999 t_model="sansa-e200v2"
2000 arm9tdmicc
2004 57|sansam200v4)
2005 target_id=52
2006 modelname="sansam200v4"
2007 target="-DSANSA_M200V4"
2008 memory=2
2009 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2010 bmp2rb_native="$bmp2rb_mono"
2011 tool="$rootdir/tools/scramble -add=m2v4"
2012 output="rockbox.sansa"
2013 bootoutput="bootloader-m200v4.sansa"
2014 appextra="recorder:gui:radio"
2015 plugins="yes"
2016 swcodec="yes"
2017 toolset=$scramblebitmaptools
2018 t_cpu="arm"
2019 t_manufacturer="as3525"
2020 t_model="sansa-m200v4"
2021 if [ "$ARG_ARM_THUMB" != 0 ]; then ARG_ARM_THUMB=1; fi
2022 arm9tdmicc
2023 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2027 58|sansafuze)
2028 target_id=53
2029 modelname="sansafuze"
2030 target="-DSANSA_FUZE"
2031 memory=8
2032 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2033 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2034 tool="$rootdir/tools/scramble -add=fuze"
2035 output="rockbox.sansa"
2036 bootoutput="bootloader-fuze.sansa"
2037 appextra="recorder:gui:radio"
2038 plugins="yes"
2039 swcodec="yes"
2040 toolset=$scramblebitmaptools
2041 t_cpu="arm"
2042 t_manufacturer="as3525"
2043 t_model="sansa-fuze"
2044 arm9tdmicc
2048 59|sansac200v2)
2049 target_id=55
2050 modelname="sansac200v2"
2051 target="-DSANSA_C200V2"
2052 memory=2 # as per OF diagnosis mode
2053 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2054 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2055 tool="$rootdir/tools/scramble -add=c2v2"
2056 output="rockbox.sansa"
2057 bootoutput="bootloader-c200v2.sansa"
2058 appextra="recorder:gui:radio"
2059 plugins="yes"
2060 swcodec="yes"
2061 # toolset is the tools within the tools directory that we build for
2062 # this particular target.
2063 toolset=$scramblebitmaptools
2064 # architecture, manufacturer and model for the target-tree build
2065 t_cpu="arm"
2066 t_manufacturer="as3525"
2067 t_model="sansa-c200v2"
2068 if [ "$ARG_ARM_THUMB" != 0 ]; then ARG_ARM_THUMB=1; fi
2069 arm9tdmicc
2070 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2073 60|sansaclipv2)
2074 target_id=60
2075 modelname="sansaclipv2"
2076 target="-DSANSA_CLIPV2"
2077 memory=8
2078 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2079 bmp2rb_native="$bmp2rb_mono"
2080 tool="$rootdir/tools/scramble -add=clv2"
2081 output="rockbox.sansa"
2082 bootoutput="bootloader-clipv2.sansa"
2083 appextra="recorder:gui:radio"
2084 plugins="yes"
2085 swcodec="yes"
2086 toolset=$scramblebitmaptools
2087 t_cpu="arm"
2088 t_manufacturer="as3525"
2089 t_model="sansa-clipv2"
2090 arm926ejscc
2093 61|sansaview)
2094 echo "Sansa View is not yet supported!"
2095 exit 1
2096 target_id=63
2097 modelname="sansaview"
2098 target="-DSANSA_VIEW"
2099 memory=32
2100 arm1176jzscc
2101 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2102 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2103 output="rockbox.mi4"
2104 appextra="gui"
2105 plugins=""
2106 swcodec="yes"
2107 boottool="$rootdir/tools/scramble -mi4v3 -model=view -type=RBBL"
2108 bootoutput="firmware.mi4"
2109 # toolset is the tools within the tools directory that we build for
2110 # this particular target.
2111 toolset=$scramblebitmaptools
2112 t_cpu="arm"
2113 t_manufacturer="sandisk"
2114 t_model="sansa-view"
2117 62|sansaclipplus)
2118 target_id=66
2119 modelname="sansaclipplus"
2120 target="-DSANSA_CLIPPLUS"
2121 memory=8
2122 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2123 bmp2rb_native="$bmp2rb_mono"
2124 tool="$rootdir/tools/scramble -add=cli+"
2125 output="rockbox.sansa"
2126 bootoutput="bootloader-clipplus.sansa"
2127 appextra="recorder:gui:radio"
2128 plugins="yes"
2129 swcodec="yes"
2130 toolset=$scramblebitmaptools
2131 t_cpu="arm"
2132 t_manufacturer="as3525"
2133 t_model="sansa-clipplus"
2134 arm926ejscc
2137 63|sansafuzev2)
2138 target_id=68
2139 modelname="sansafuzev2"
2140 target="-DSANSA_FUZEV2"
2141 memory=8 # not sure
2142 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2143 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
2144 tool="$rootdir/tools/scramble -add=fuz2"
2145 output="rockbox.sansa"
2146 bootoutput="bootloader-fuzev2.sansa"
2147 appextra="recorder:gui:radio"
2148 plugins="yes"
2149 swcodec="yes"
2150 toolset=$scramblebitmaptools
2151 t_cpu="arm"
2152 t_manufacturer="as3525"
2153 t_model="sansa-fuzev2"
2154 arm926ejscc
2157 150|tatungtpj1022)
2158 target_id=25
2159 modelname="tatungtpj1022"
2160 target="-DTATUNG_TPJ1022"
2161 memory=32 # always
2162 arm7tdmicc
2163 tool="$rootdir/tools/scramble -add tpj2"
2164 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2165 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
2166 output="rockbox.elio"
2167 appextra="recorder:gui:radio"
2168 plugins="yes"
2169 swcodec="yes"
2170 boottool="$rootdir/tools/scramble -mi4v2"
2171 bootoutput="pp5020.mi4"
2172 # toolset is the tools within the tools directory that we build for
2173 # this particular target.
2174 toolset=$scramblebitmaptools
2175 # architecture, manufacturer and model for the target-tree build
2176 t_cpu="arm"
2177 t_manufacturer="tatung"
2178 t_model="tpj1022"
2181 100|gogearsa9200)
2182 target_id=41
2183 modelname="gogearsa9200"
2184 target="-DPHILIPS_SA9200"
2185 memory=32 # supposedly
2186 arm7tdmicc
2187 tool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBOS"
2188 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2189 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2190 output="rockbox.mi4"
2191 appextra="recorder:gui:radio"
2192 plugins=""
2193 swcodec="yes"
2194 boottool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBBL"
2195 bootoutput="FWImage.ebn"
2196 # toolset is the tools within the tools directory that we build for
2197 # this particular target.
2198 toolset=$scramblebitmaptools
2199 # architecture, manufacturer and model for the target-tree build
2200 t_cpu="arm"
2201 t_manufacturer="philips"
2202 t_model="sa9200"
2205 101|gogearhdd1630)
2206 target_id=43
2207 modelname="gogearhdd1630"
2208 target="-DPHILIPS_HDD1630"
2209 memory=32 # supposedly
2210 arm7tdmicc
2211 tool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBOS"
2212 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2213 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2214 output="rockbox.mi4"
2215 appextra="recorder:gui:radio"
2216 plugins="yes"
2217 swcodec="yes"
2218 boottool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBBL"
2219 bootoutput="FWImage.ebn"
2220 # toolset is the tools within the tools directory that we build for
2221 # this particular target.
2222 toolset=$scramblebitmaptools
2223 # architecture, manufacturer and model for the target-tree build
2224 t_cpu="arm"
2225 t_manufacturer="philips"
2226 t_model="hdd1630"
2229 102|gogearhdd6330)
2230 target_id=65
2231 modelname="gogearhdd6330"
2232 target="-DPHILIPS_HDD6330"
2233 memory=64 # always
2234 arm7tdmicc
2235 tool="$rootdir/tools/scramble -mi4v3 -model=6330 -type=RBOS"
2236 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2237 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2238 output="rockbox.mi4"
2239 appextra="recorder:gui:radio"
2240 plugins=""
2241 swcodec="yes"
2242 boottool="$rootdir/tools/scramble -mi4v3 -model=6330 -type=RBBL"
2243 bootoutput="FWImage.ebn"
2244 # toolset is the tools within the tools directory that we build for
2245 # this particular target.
2246 toolset=$scramblebitmaptools
2247 # architecture, manufacturer and model for the target-tree build
2248 t_cpu="arm"
2249 t_manufacturer="philips"
2250 t_model="hdd6330"
2253 110|meizum6sl)
2254 target_id=49
2255 modelname="meizum6sl"
2256 target="-DMEIZU_M6SL"
2257 memory=16 # always
2258 arm940tbecc
2259 tool="cp"
2260 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2261 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2262 output="rockbox.meizu"
2263 appextra="recorder:gui:radio"
2264 plugins="no" #FIXME
2265 swcodec="yes"
2266 toolset=$genericbitmaptools
2267 boottool="cp"
2268 bootoutput="rockboot.ebn"
2269 # architecture, manufacturer and model for the target-tree build
2270 t_cpu="arm"
2271 t_manufacturer="s5l8700"
2272 t_model="meizu-m6sl"
2275 111|meizum6sp)
2276 target_id=46
2277 modelname="meizum6sp"
2278 target="-DMEIZU_M6SP"
2279 memory=16 # always
2280 arm940tbecc
2281 tool="cp"
2282 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2283 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2284 output="rockbox.meizu"
2285 appextra="recorder:gui:radio"
2286 plugins="no" #FIXME
2287 swcodec="yes"
2288 toolset=$genericbitmaptools
2289 boottool="cp"
2290 bootoutput="rockboot.ebn"
2291 # architecture, manufacturer and model for the target-tree build
2292 t_cpu="arm"
2293 t_manufacturer="s5l8700"
2294 t_model="meizu-m6sp"
2297 112|meizum3)
2298 target_id=47
2299 modelname="meizum3"
2300 target="-DMEIZU_M3"
2301 memory=16 # always
2302 arm940tbecc
2303 tool="cp"
2304 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2305 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2306 output="rockbox.meizu"
2307 appextra="recorder:gui:radio"
2308 plugins="no" #FIXME
2309 swcodec="yes"
2310 toolset=$genericbitmaptools
2311 boottool="cp"
2312 bootoutput="rockboot.ebn"
2313 # architecture, manufacturer and model for the target-tree build
2314 t_cpu="arm"
2315 t_manufacturer="s5l8700"
2316 t_model="meizu-m3"
2319 120|ondavx747)
2320 target_id=45
2321 modelname="ondavx747"
2322 target="-DONDA_VX747"
2323 memory=16
2324 mipselcc
2325 tool="$rootdir/tools/scramble -add=x747"
2326 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2327 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2328 output="rockbox.vx747"
2329 appextra="recorder:gui:radio"
2330 plugins="yes"
2331 swcodec="yes"
2332 toolset=$genericbitmaptools
2333 boottool="$rootdir/tools/scramble -ccpmp"
2334 bootoutput="ccpmp.bin"
2335 # architecture, manufacturer and model for the target-tree build
2336 t_cpu="mips"
2337 t_manufacturer="ingenic_jz47xx"
2338 t_model="onda_vx747"
2341 121|ondavx767)
2342 target_id=64
2343 modelname="ondavx767"
2344 target="-DONDA_VX767"
2345 memory=16 #FIXME
2346 mipselcc
2347 tool="cp"
2348 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2349 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2350 output="rockbox.vx767"
2351 appextra="recorder:gui:radio"
2352 plugins="" #FIXME
2353 swcodec="yes"
2354 toolset=$genericbitmaptools
2355 boottool="$rootdir/tools/scramble -ccpmp"
2356 bootoutput="ccpmp.bin"
2357 # architecture, manufacturer and model for the target-tree build
2358 t_cpu="mips"
2359 t_manufacturer="ingenic_jz47xx"
2360 t_model="onda_vx767"
2363 122|ondavx747p)
2364 target_id=54
2365 modelname="ondavx747p"
2366 target="-DONDA_VX747P"
2367 memory=16
2368 mipselcc
2369 tool="$rootdir/tools/scramble -add=747p"
2370 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2371 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2372 output="rockbox.vx747p"
2373 appextra="recorder:gui:radio"
2374 plugins="yes"
2375 swcodec="yes"
2376 toolset=$genericbitmaptools
2377 boottool="$rootdir/tools/scramble -ccpmp"
2378 bootoutput="ccpmp.bin"
2379 # architecture, manufacturer and model for the target-tree build
2380 t_cpu="mips"
2381 t_manufacturer="ingenic_jz47xx"
2382 t_model="onda_vx747"
2385 123|ondavx777)
2386 target_id=61
2387 modelname="ondavx777"
2388 target="-DONDA_VX777"
2389 memory=16
2390 mipselcc
2391 tool="$rootdir/tools/scramble -add=x777"
2392 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2393 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2394 output="rockbox.vx777"
2395 appextra="recorder:gui:radio"
2396 plugins="yes"
2397 swcodec="yes"
2398 toolset=$genericbitmaptools
2399 boottool="$rootdir/tools/scramble -ccpmp"
2400 bootoutput="ccpmp.bin"
2401 # architecture, manufacturer and model for the target-tree build
2402 t_cpu="mips"
2403 t_manufacturer="ingenic_jz47xx"
2404 t_model="onda_vx747"
2407 130|lyreproto1)
2408 target_id=56
2409 modelname="lyreproto1"
2410 target="-DLYRE_PROTO1"
2411 memory=64
2412 arm926ejscc
2413 tool="cp"
2414 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2415 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2416 output="rockbox.lyre"
2417 appextra="recorder:gui:radio"
2418 plugins=""
2419 swcodec="yes"
2420 toolset=$scramblebitmaptools
2421 boottool="cp"
2422 bootoutput="bootloader-proto1.lyre"
2423 # architecture, manufacturer and model for the target-tree build
2424 t_cpu="arm"
2425 t_manufacturer="at91sam"
2426 t_model="lyre_proto1"
2429 131|mini2440)
2430 target_id=99
2431 modelname="mini2440"
2432 target="-DMINI2440"
2433 memory=64
2434 arm9tdmicc
2435 tool="$rootdir/tools/scramble -add=m244"
2436 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2437 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2438 output="rockbox.mini2440"
2439 appextra="recorder:gui:radio"
2440 plugins=""
2441 swcodec="yes"
2442 toolset=$scramblebitmaptools
2443 boottool="cp"
2444 bootoutput="bootloader-mini2440.lyre"
2445 # architecture, manufacturer and model for the target-tree build
2446 t_cpu="arm"
2447 t_manufacturer="s3c2440"
2448 t_model="mini2440"
2451 140|samsungyh820)
2452 target_id=57
2453 modelname="samsungyh820"
2454 target="-DSAMSUNG_YH820"
2455 memory=32 # always
2456 arm7tdmicc
2457 tool="$rootdir/tools/scramble -mi4v2 -model=y820 -type=RBOS"
2458 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2459 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2460 output="rockbox.mi4"
2461 appextra="recorder:gui:radio"
2462 plugins="yes"
2463 swcodec="yes"
2464 boottool="$rootdir/tools/scramble -mi4v2 -model=y820 -type=RBBL"
2465 bootoutput="FW_YH820.mi4"
2466 # toolset is the tools within the tools directory that we build for
2467 # this particular target.
2468 toolset=$scramblebitmaptools
2469 # architecture, manufacturer and model for the target-tree build
2470 t_cpu="arm"
2471 t_manufacturer="samsung"
2472 t_model="yh820"
2475 141|samsungyh920)
2476 target_id=58
2477 modelname="samsungyh920"
2478 target="-DSAMSUNG_YH920"
2479 memory=32 # always
2480 arm7tdmicc
2481 tool="$rootdir/tools/scramble -mi4v2 -model=y920 -type=RBOS"
2482 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2483 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
2484 output="rockbox.mi4"
2485 appextra="recorder:gui:radio"
2486 plugins="yes"
2487 swcodec="yes"
2488 boottool="$rootdir/tools/scramble -mi4v2 -model=y920 -type=RBBL"
2489 bootoutput="PP5020.mi4"
2490 # toolset is the tools within the tools directory that we build for
2491 # this particular target.
2492 toolset=$scramblebitmaptools
2493 # architecture, manufacturer and model for the target-tree build
2494 t_cpu="arm"
2495 t_manufacturer="samsung"
2496 t_model="yh920"
2499 142|samsungyh925)
2500 target_id=59
2501 modelname="samsungyh925"
2502 target="-DSAMSUNG_YH925"
2503 memory=32 # always
2504 arm7tdmicc
2505 tool="$rootdir/tools/scramble -mi4v2 -model=y925 -type=RBOS"
2506 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2507 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2508 output="rockbox.mi4"
2509 appextra="recorder:gui:radio"
2510 plugins="yes"
2511 swcodec="yes"
2512 boottool="$rootdir/tools/scramble -mi4v2 -model=y925 -type=RBBL"
2513 bootoutput="FW_YH925.mi4"
2514 # toolset is the tools within the tools directory that we build for
2515 # this particular target.
2516 toolset=$scramblebitmaptools
2517 # architecture, manufacturer and model for the target-tree build
2518 t_cpu="arm"
2519 t_manufacturer="samsung"
2520 t_model="yh925"
2523 143|samsungyps3)
2524 target_id=60
2525 modelname="samsungyps3"
2526 target="-DSAMSUNG_YPS3"
2527 memory=16 # always
2528 arm940tbecc
2529 tool="cp"
2530 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2531 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2532 output="rockbox.yps3"
2533 appextra="recorder:gui:radio"
2534 plugins="no" #FIXME
2535 swcodec="yes"
2536 toolset=$genericbitmaptools
2537 boottool="cp"
2538 bootoutput="rockboot.ebn"
2539 # architecture, manufacturer and model for the target-tree build
2540 t_cpu="arm"
2541 t_manufacturer="s5l8700"
2542 t_model="yps3"
2545 160|vibe500)
2546 target_id=67
2547 modelname="vibe500"
2548 target="-DPBELL_VIBE500"
2549 memory=32 # always
2550 arm7tdmicc
2551 tool="$rootdir/tools/scramble -mi4v3 -model=v500 -type=RBOS"
2552 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2553 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
2554 output="rockbox.mi4"
2555 appextra="recorder:gui:radio"
2556 plugins="yes"
2557 swcodec="yes"
2558 boottool="$rootdir/tools/scramble -mi4v3 -model=v500 -type=RBBL"
2559 bootoutput="jukebox.mi4"
2560 # toolset is the tools within the tools directory that we build for
2561 # this particular target.
2562 toolset=$scramblebitmaptools
2563 # architecture, manufacturer and model for the target-tree build
2564 t_cpu="arm"
2565 t_manufacturer="pbell"
2566 t_model="vibe500"
2569 170|hd200)
2570 target_id=69
2571 modelname="mpiohd200"
2572 target="-DMPIO_HD200"
2573 memory=16 # always
2574 coldfirecc
2575 tool="$rootdir/tools/scramble -add=hd20"
2576 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2577 bmp2rb_native="$rootdir/tools/bmp2rb -f 7"
2578 output="rockbox.mpio"
2579 bootoutput="bootloader.mpio"
2580 appextra="recorder:gui:radio"
2581 plugins="yes"
2582 swcodec="yes"
2583 # toolset is the tools within the tools directory that we build for
2584 # this particular target.
2585 toolset="$genericbitmaptools"
2586 # architecture, manufacturer and model for the target-tree build
2587 t_cpu="coldfire"
2588 t_manufacturer="mpio"
2589 t_model="hd200"
2592 200|app*)
2593 target_id=100
2594 modelname="application"
2595 target="-DAPPLICATION"
2596 memory=32
2597 uname=`uname`
2598 simcc "sdl"
2599 tool="cp "
2600 boottool="cp "
2601 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2602 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2603 output="rockbox"
2604 bootoutput="bootloader-cowond2.bin"
2605 appextra="recorder:gui:radio"
2606 plugins=""
2607 swcodec="yes"
2608 # architecture, manufacturer and model for the target-tree build
2609 t_cpu="hosted"
2610 t_manufacturer="sdl"
2611 t_model="app"
2615 echo "Please select a supported target platform!"
2616 exit 7
2619 esac
2621 echo "Platform set to $modelname"
2624 #remove start
2625 ############################################################################
2626 # Amount of memory, for those that can differ. They have $memory unset at
2627 # this point.
2630 if [ -z "$memory" ]; then
2631 case $target_id in
2633 if [ "$ARG_RAM" ]; then
2634 size=$ARG_RAM
2635 else
2636 echo "Enter size of your RAM (in MB): (Defaults to 32)"
2637 size=`input`;
2639 case $size in
2640 60|64)
2641 memory="64"
2644 memory="32"
2646 esac
2649 if [ "$ARG_RAM" ]; then
2650 size=$ARG_RAM
2651 else
2652 echo "Enter size of your RAM (in MB): (Defaults to 2)"
2653 size=`input`;
2655 case $size in
2657 memory="8"
2660 memory="2"
2662 esac
2664 esac
2665 echo "Memory size selected: $memory MB"
2666 [ "$ARG_TYPE" ] || echo ""
2668 #remove end
2670 ##################################################################
2671 # Figure out build "type"
2674 # the ifp7x0 is the only platform that supports building a gdb stub like
2675 # this
2676 case $modelname in
2677 iriverifp7xx)
2678 gdbstub="(G)DB stub, "
2680 sansae200r|sansae200)
2681 gdbstub="(I)nstaller, "
2683 sansac200)
2684 gdbstub="(E)raser, "
2688 esac
2689 if [ "$ARG_TYPE" ]; then
2690 btype=$ARG_TYPE
2691 else
2692 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, (C)heckWPS, (D)atabase tool, $gdbstub(M)anual: (Defaults to N)"
2693 btype=`input`;
2696 case $btype in
2697 [Ii])
2698 appsdir='\$(ROOTDIR)/bootloader'
2699 apps="bootloader"
2700 extradefines="-DBOOTLOADER -DE200R_INSTALLER -ffunction-sections -fdata-sections"
2701 bootloader="1"
2702 echo "e200R-installer build selected"
2704 [Ee])
2705 appsdir='\$(ROOTDIR)/bootloader'
2706 apps="bootloader"
2707 echo "C2(4)0 or C2(5)0"
2708 variant=`input`
2709 case $variant in
2711 extradefines="-DBOOTLOADER -DC200_ERASE -DC240_ERASE -ffunction-sections -fdata-sections"
2712 echo "c240 eraser build selected"
2715 extradefines="-DBOOTLOADER -DC200_ERASE -DC250_ERASE -ffunction-sections -fdata-sections"
2716 echo "c240 eraser build selected"
2718 esac
2719 bootloader="1"
2720 echo "c200 eraser build selected"
2722 [Bb])
2723 if test $t_manufacturer = "archos"; then
2724 # Archos SH-based players do this somewhat differently for
2725 # some reason
2726 appsdir='\$(ROOTDIR)/flash/bootbox'
2727 apps="bootbox"
2728 else
2729 appsdir='\$(ROOTDIR)/bootloader'
2730 apps="bootloader"
2731 flash=""
2732 if test -n "$boottool"; then
2733 tool="$boottool"
2735 if test -n "$bootoutput"; then
2736 output=$bootoutput
2739 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
2740 bootloader="1"
2741 echo "Bootloader build selected"
2743 [Ss])
2744 if [ "$modelname" = "sansae200r" ]; then
2745 echo "Do not use the e200R target for simulator builds. Use e200 instead."
2746 exit 8
2748 debug="-DDEBUG"
2749 simulator="yes"
2750 extradefines="-DSIMULATOR"
2751 archosrom=""
2752 flash=""
2753 echo "Simulator build selected"
2755 [Aa]*)
2756 echo "Advanced build selected"
2757 whichadvanced $btype
2759 [Gg])
2760 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
2761 appsdir='\$(ROOTDIR)/gdb'
2762 apps="stub"
2763 case $modelname in
2764 iriverifp7xx)
2765 output="stub.wma"
2769 esac
2770 echo "GDB stub build selected"
2772 [Mm])
2773 toolset='';
2774 apps="manual"
2775 echo "Manual build selected"
2777 [Cc])
2778 uname=`uname`
2779 simcc "checkwps"
2780 toolset='';
2781 t_cpu='';
2782 GCCOPTS='';
2783 extradefines="-DDEBUG"
2784 appsdir='\$(ROOTDIR)/tools/checkwps';
2785 output='checkwps.'${modelname};
2786 archosrom='';
2787 echo "CheckWPS build selected"
2789 [Dd])
2790 uname=`uname`
2791 simcc "database"
2792 toolset='';
2793 t_cpu='';
2794 GCCOPTS='';
2795 appsdir='\$(ROOTDIR)/tools/database';
2796 archosrom='';
2798 case $uname in
2799 CYGWIN*|MINGW*)
2800 output="database_${modelname}.exe"
2803 output='database.'${modelname};
2805 esac
2807 echo "Database tool build selected"
2810 if [ "$modelname" = "sansae200r" ]; then
2811 echo "Do not use the e200R target for regular builds. Use e200 instead."
2812 exit 8
2814 debug=""
2815 btype="N" # set it explicitly since RET only gets here as well
2816 echo "Normal build selected"
2819 esac
2820 # to be able running "make manual" from non-manual configuration
2821 case $modelname in
2822 archosrecorderv2)
2823 manualdev="archosfmrecorder"
2825 iriverh1??)
2826 manualdev="iriverh100"
2828 ipodmini2g)
2829 manualdev="ipodmini1g"
2832 manualdev=$modelname
2834 esac
2836 if [ -z "$debug" ]; then
2837 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
2840 echo "Using source code root directory: $rootdir"
2842 # this was once possible to change at build-time, but no more:
2843 language="english"
2845 uname=`uname`
2847 if [ "yes" = "$simulator" ]; then
2848 # setup compiler and things for simulator
2849 simcc "sdl"
2851 if [ -d "simdisk" ]; then
2852 echo "Subdirectory 'simdisk' already present"
2853 else
2854 mkdir simdisk
2855 echo "Created a 'simdisk' subdirectory for simulating the hard disk"
2859 # Now, figure out version number of the (gcc) compiler we are about to use
2860 gccver=`$CC -dumpversion`;
2862 # figure out the binutil version too and display it, mostly for the build
2863 # system etc to be able to see it easier
2864 if [ $uname = "Darwin" ]; then
2865 ldver=`$LD -v 2>&1 | sed -e 's/[^0-9.-]//g'`
2866 else
2867 ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
2870 if [ -z "$gccver" ]; then
2871 echo "[WARNING] The compiler you must use ($CC) is not in your path!"
2872 echo "[WARNING] this may cause your build to fail since we cannot do the"
2873 echo "[WARNING] checks we want now."
2874 else
2876 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
2877 # DEPEND on it
2879 num1=`echo $gccver | cut -d . -f1`
2880 num2=`echo $gccver | cut -d . -f2`
2881 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
2883 # This makes:
2884 # 3.3.X => 303
2885 # 3.4.X => 304
2886 # 2.95.3 => 295
2888 echo "Using $CC $gccver ($gccnum)"
2890 if test "$gccnum" -ge "400"; then
2891 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
2892 # so we ignore that warnings for now
2893 # -Wno-pointer-sign
2894 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
2897 if test "$gccnum" -ge "402"; then
2898 # disable warning about "warning: initialized field overwritten" as gcc 4.2
2899 # and later would throw it for several valid cases
2900 GCCOPTS="$GCCOPTS -Wno-override-init"
2903 case $prefix in
2904 ""|"$CROSS_COMPILE")
2905 # simulator
2907 i586-mingw32msvc-)
2908 # cross-compile for win32
2911 # Verify that the cross-compiler is of a recommended version!
2912 if test "$gccver" != "$gccchoice"; then
2913 echo "WARNING: Your cross-compiler $CC $gccver is not of the recommended"
2914 echo "WARNING: version $gccchoice!"
2915 echo "WARNING: This may cause your build to fail since it may be a version"
2916 echo "WARNING: that isn't functional or known to not be the best choice."
2917 echo "WARNING: If you suffer from build problems, you know that this is"
2918 echo "WARNING: a likely source for them..."
2921 esac
2926 echo "Using $LD $ldver"
2928 # check the compiler for SH platforms
2929 if test "$CC" = "sh-elf-gcc"; then
2930 if test "$gccnum" -lt "400"; then
2931 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
2932 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2933 else
2934 # figure out patch status
2935 gccpatch=`$CC --version`;
2937 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
2938 echo "gcc $gccver is rockbox patched"
2939 # then convert -O to -Os to get smaller binaries!
2940 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2941 else
2942 echo "WARNING: You use an unpatched gcc compiler: $gccver"
2943 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2948 if test "$CC" = "m68k-elf-gcc"; then
2949 # convert -O to -Os to get smaller binaries!
2950 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2953 if [ "$ARG_CCACHE" = "1" ]; then
2954 echo "Enable ccache for building"
2955 ccache="ccache"
2956 elif [ "$ARG_CCACHE" != "0" ]; then
2957 ccache=`findtool ccache`
2958 if test -n "$ccache"; then
2959 echo "Found and uses ccache ($ccache)"
2963 # figure out the full path to the various commands if possible
2964 HOSTCC=`findtool gcc --lit`
2965 HOSTAR=`findtool ar --lit`
2966 CC=`findtool ${CC} --lit`
2967 LD=`findtool ${AR} --lit`
2968 AR=`findtool ${AR} --lit`
2969 AS=`findtool ${AS} --lit`
2970 OC=`findtool ${OC} --lit`
2971 WINDRES=`findtool ${WINDRES} --lit`
2972 DLLTOOL=`findtool ${DLLTOOL} --lit`
2973 DLLWRAP=`findtool ${DLLWRAP} --lit`
2974 RANLIB=`findtool ${RANLIB} --lit`
2976 if test -n "$ccache"; then
2977 CC="$ccache $CC"
2980 if test "$ARG_ARM_THUMB" = "1"; then
2981 extradefines="$extradefines -DUSE_THUMB"
2982 CC="$toolsdir/thumb-cc.py $CC"
2985 if test "X$endian" = "Xbig"; then
2986 defendian="ROCKBOX_BIG_ENDIAN"
2987 else
2988 defendian="ROCKBOX_LITTLE_ENDIAN"
2991 if [ "$ARG_RBDIR" ]; then
2992 rbdir=$ARG_RBDIR
2993 echo "Using alternate rockbox dir: ${rbdir}"
2996 sed > autoconf.h \
2997 -e "s,@ENDIAN@,${defendian},g" \
2998 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
2999 -e "s,^#undef DO_BOOTCHART,$use_bootchart,g" \
3000 -e "s,@config_rtc@,$config_rtc,g" \
3001 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
3002 -e "s,@RBDIR@,${rbdir},g" \
3003 -e "s,@have_backlight@,$have_backlight,g" \
3004 -e "s,@have_fmradio_in@,$have_fmradio_in,g" \
3005 -e "s,@have_ata_poweroff@,$have_ata_poweroff,g" \
3006 <<EOF
3007 /* This header was made by configure */
3008 #ifndef __BUILD_AUTOCONF_H
3009 #define __BUILD_AUTOCONF_H
3011 /* Define endianess for the target or simulator platform */
3012 #define @ENDIAN@ 1
3014 /* Define this if you build rockbox to support the logf logging and display */
3015 #undef ROCKBOX_HAS_LOGF
3017 /* Define this to record a chart with timings for the stages of boot */
3018 #undef DO_BOOTCHART
3020 /* optional define for a backlight modded Ondio */
3021 @have_backlight@
3023 /* optional define for FM radio mod for iAudio M5 */
3024 @have_fmradio_in@
3026 /* optional define for ATA poweroff on Player */
3027 @have_ata_poweroff@
3029 /* optional defines for RTC mod for h1x0 */
3030 @config_rtc@
3031 @have_rtc_alarm@
3033 /* root of Rockbox */
3034 #define ROCKBOX_DIR "/@RBDIR@"
3036 #endif /* __BUILD_AUTOCONF_H */
3039 if test -n "$t_cpu"; then
3040 TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
3041 if [ "$simulator" = "yes" ]; then # a few more includes for the sim target tree
3042 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl/"
3043 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/"
3045 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
3046 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
3047 GCCOPTS="$GCCOPTS"
3050 if test "$simulator" = "yes"; then
3051 # add simul make stuff on the #SIMUL# line
3052 simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
3053 simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
3054 else
3055 # delete the lines that match
3056 simmagic1='/@SIMUL1@/D'
3057 simmagic2='/@SIMUL2@/D'
3060 if test "$swcodec" = "yes"; then
3061 voicetoolset="rbspeexenc voicefont wavtrim"
3062 else
3063 voicetoolset="voicefont wavtrim"
3066 if test "$apps" = "apps"; then
3067 # only when we build "real" apps we build the .lng files
3068 buildlangs="langs"
3071 #### Fix the cmdline ###
3072 if [ "$ARG_CCACHE" = "1" ]; then
3073 cmdline="--ccache "
3074 elif [ "$ARG_CCACHE" = "0" ]; then
3075 cmdline="--no-ccache "
3077 if [ "$ARG_ARM_EABI" = "1" ]; then
3078 cmdline="$cmdline--eabi "
3081 cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts"
3082 ### end of cmdline
3084 sed > Makefile \
3085 -e "s,@ROOTDIR@,${rootdir},g" \
3086 -e "s,@DEBUG@,${debug},g" \
3087 -e "s,@MEMORY@,${memory},g" \
3088 -e "s,@TARGET_ID@,${target_id},g" \
3089 -e "s,@TARGET@,${target},g" \
3090 -e "s,@CPU@,${t_cpu},g" \
3091 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
3092 -e "s,@MODELNAME@,${modelname},g" \
3093 -e "s,@LANGUAGE@,${language},g" \
3094 -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
3095 -e "s,@PWD@,${pwd},g" \
3096 -e "s,@HOSTCC@,${HOSTCC},g" \
3097 -e "s,@HOSTAR@,${HOSTAR},g" \
3098 -e "s,@CC@,${CC},g" \
3099 -e "s,@LD@,${LD},g" \
3100 -e "s,@AR@,${AR},g" \
3101 -e "s,@AS@,${AS},g" \
3102 -e "s,@OC@,${OC},g" \
3103 -e "s,@WINDRES@,${WINDRES},g" \
3104 -e "s,@DLLTOOL@,${DLLTOOL},g" \
3105 -e "s,@DLLWRAP@,${DLLWRAP},g" \
3106 -e "s,@RANLIB@,${RANLIB},g" \
3107 -e "s,@TOOL@,${tool},g" \
3108 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
3109 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
3110 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
3111 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
3112 -e "s,@OUTPUT@,${output},g" \
3113 -e "s,@APPEXTRA@,${appextra},g" \
3114 -e "s,@ARCHOSROM@,${archosrom},g" \
3115 -e "s,@FLASHFILE@,${flash},g" \
3116 -e "s,@PLUGINS@,${plugins},g" \
3117 -e "s,@CODECS@,${swcodec},g" \
3118 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
3119 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
3120 -e "s,@GCCOPTS@,${GCCOPTS},g" \
3121 -e "s,@TARGET_INC@,${TARGET_INC},g" \
3122 -e "s!@LDOPTS@!${LDOPTS}!g" \
3123 -e "s,@LOADADDRESS@,${loadaddress},g" \
3124 -e "s,@EXTRADEF@,${extradefines},g" \
3125 -e "s,@APPSDIR@,${appsdir},g" \
3126 -e "s,@FIRMDIR@,${firmdir},g" \
3127 -e "s,@TOOLSDIR@,${toolsdir},g" \
3128 -e "s,@APPS@,${apps},g" \
3129 -e "s,@SIMVER@,${simver},g" \
3130 -e "s,@GCCVER@,${gccver},g" \
3131 -e "s,@GCCNUM@,${gccnum},g" \
3132 -e "s,@UNAME@,${uname},g" \
3133 -e "s,@ENDIAN@,${defendian},g" \
3134 -e "s,@TOOLSET@,${toolset},g" \
3135 -e "${simmagic1}" \
3136 -e "${simmagic2}" \
3137 -e "s,@MANUALDEV@,${manualdev},g" \
3138 -e "s,@ENCODER@,${ENC_CMD},g" \
3139 -e "s,@ENC_OPTS@,${ENC_OPTS},g" \
3140 -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
3141 -e "s,@TTS_OPTS@,${TTS_OPTS},g" \
3142 -e "s,@VOICETOOLSET@,${voicetoolset},g" \
3143 -e "s,@LANGS@,${buildlangs},g" \
3144 -e "s,@USE_ELF@,${USE_ELF},g" \
3145 -e "s,@RBDIR@,${rbdir},g" \
3146 -e "s,@PREFIX@,$PREFIX,g" \
3147 -e "s,@CMDLINE@,$cmdline,g" \
3148 -e "s,@SDLCONFIG@,$sdl,g" \
3149 <<EOF
3150 ## Automatically generated. http://www.rockbox.org/
3152 export ROOTDIR=@ROOTDIR@
3153 export FIRMDIR=@FIRMDIR@
3154 export APPSDIR=@APPSDIR@
3155 export TOOLSDIR=@TOOLSDIR@
3156 export DOCSDIR=\$(ROOTDIR)/docs
3157 export MANUALDIR=\${ROOTDIR}/manual
3158 export DEBUG=@DEBUG@
3159 export MODELNAME=@MODELNAME@
3160 export ARCHOSROM=@ARCHOSROM@
3161 export FLASHFILE=@FLASHFILE@
3162 export TARGET_ID=@TARGET_ID@
3163 export TARGET=@TARGET@
3164 export CPU=@CPU@
3165 export MANUFACTURER=@MANUFACTURER@
3166 export OBJDIR=@PWD@
3167 export BUILDDIR=@PWD@
3168 export LANGUAGE=@LANGUAGE@
3169 export VOICELANGUAGE=@VOICELANGUAGE@
3170 export MEMORYSIZE=@MEMORY@
3171 export BUILDDATE:=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
3172 export MKFIRMWARE=@TOOL@
3173 export BMP2RB_MONO=@BMP2RB_MONO@
3174 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
3175 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
3176 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
3177 export BINARY=@OUTPUT@
3178 export APPEXTRA=@APPEXTRA@
3179 export ENABLEDPLUGINS=@PLUGINS@
3180 export SOFTWARECODECS=@CODECS@
3181 export EXTRA_DEFINES=@EXTRADEF@
3182 export HOSTCC=@HOSTCC@
3183 export HOSTAR=@HOSTAR@
3184 export CC=@CC@
3185 export LD=@LD@
3186 export AR=@AR@
3187 export AS=@AS@
3188 export OC=@OC@
3189 export WINDRES=@WINDRES@
3190 export DLLTOOL=@DLLTOOL@
3191 export DLLWRAP=@DLLWRAP@
3192 export RANLIB=@RANLIB@
3193 export PREFIX=@PREFIX@
3194 export PROFILE_OPTS=@PROFILE_OPTS@
3195 export SIMVER=@SIMVER@
3196 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
3197 export GCCOPTS=@GCCOPTS@
3198 export TARGET_INC=@TARGET_INC@
3199 export LOADADDRESS=@LOADADDRESS@
3200 export SHARED_FLAG=@SHARED_FLAG@
3201 export LDOPTS=@LDOPTS@
3202 export GCCVER=@GCCVER@
3203 export GCCNUM=@GCCNUM@
3204 export UNAME=@UNAME@
3205 export MANUALDEV=@MANUALDEV@
3206 export TTS_OPTS=@TTS_OPTS@
3207 export TTS_ENGINE=@TTS_ENGINE@
3208 export ENC_OPTS=@ENC_OPTS@
3209 export ENCODER=@ENCODER@
3210 export USE_ELF=@USE_ELF@
3211 export RBDIR=@RBDIR@
3212 export SDLCONFIG=@SDLCONFIG@
3214 CONFIGURE_OPTIONS=@CMDLINE@
3216 include \$(TOOLSDIR)/root.make
3220 echo "Created Makefile"