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