boomshine: use theme colour to draw text so that text would be more readable with...
[kugel-rb.git] / tools / configure
blob50b89dc4fa006cc8ec42b68b5701efa7458dc55e
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"
16 scriptver=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'`
18 rbdir=".rockbox"
21 # Begin Function Definitions
23 input() {
24 read response
25 echo $response
28 prefixtools () {
29 prefix="$1"
30 CC=${prefix}gcc
31 WINDRES=${prefix}windres
32 DLLTOOL=${prefix}dlltool
33 DLLWRAP=${prefix}dllwrap
34 RANLIB=${prefix}ranlib
35 LD=${prefix}ld
36 AR=${prefix}ar
37 AS=${prefix}as
38 OC=${prefix}objcopy
41 findarmgcc() {
42 if [ "$ARG_ARM_EABI" = "1" ]; then
43 prefixtools arm-elf-eabi-
44 gccchoice="4.4.2"
45 else
46 prefixtools arm-elf-
47 gccchoice="4.0.3"
51 # scan the $PATH for the given command
52 findtool(){
53 file="$1"
55 IFS=":"
56 for path in $PATH
58 # echo "checks for $file in $path" >&2
59 if test -f "$path/$file"; then
60 echo "$path/$file"
61 return
63 done
64 # check whether caller wants literal return value if not found
65 if [ "$2" = "--lit" ]; then
66 echo "$file"
70 # scan the $PATH for sdl-config - if crosscompiling, require that it is
71 # a mingw32 sdl-config
72 findsdl(){
73 file="sdl-config"
75 IFS=":"
76 for path in $PATH
78 #echo "checks for $file in $path" >&2
79 if test -f "$path/$file"; then
80 if [ "yes" = "${crosscompile}" ]; then
81 if [ "0" != `$path/$file --libs |grep -c mwindows` ]; then
82 echo "$path/$file"
83 return
85 else
86 echo "$path/$file"
87 return
90 done
93 simcc () {
95 # default tool setup for native building
96 prefixtools ""
98 simver=sdl
99 GCCOPTS='-W -Wall -g -fno-builtin'
100 GCCOPTIMIZE=''
102 output="rockboxui" # use this as default output binary name
103 sdl=`findsdl`
104 sdl_cflags=""
105 sdl_libs=""
107 if [ $1 = "sdl" ]; then
108 if [ -z "$sdl" ]; then
109 echo "configure didn't find sdl-config, which indicates that you"
110 echo "don't have SDL (properly) installed. Please correct and"
111 echo "re-run configure!"
112 exit 1
113 else
114 # generic sdl-config checker
115 sdl_cflags=`$sdl --cflags`
116 sdl_libs=`$sdl --libs`
120 # default share option, override below if needed
121 SHARED_FLAG="-shared"
123 case $uname in
124 CYGWIN*)
125 echo "Cygwin host detected"
127 # sdl version
128 GCCOPTS="$GCCOPTS $sdl_cflags"
129 LDOPTS="-mconsole $sdl_libs"
131 output="rockboxui.exe" # use this as output binary name
134 MINGW*)
135 echo "MinGW host detected"
137 # sdl version
138 GCCOPTS="$GCCOPTS $sdl_cflags"
139 LDOPTS="-mconsole $sdl_libs"
141 output="rockboxui.exe" # use this as output binary name
144 Linux)
145 echo "Linux host detected"
146 GCCOPTS="$GCCOPTS $sdl_cflags"
147 LDOPTS="$sdl_libs"
150 FreeBSD)
151 echo "FreeBSD host detected"
152 # sdl version
153 GCCOPTS="$GCCOPTS $sdl_cflags"
154 LDOPTS="$sdl_libs"
157 Darwin)
158 echo "Darwin host detected"
159 # sdl version
160 GCCOPTS="$GCCOPTS $sdl_cflags"
161 LDOPTS="$sdl_libs"
162 SHARED_FLAG="-dynamiclib -Wl\,-single_module"
166 echo "[ERROR] Unsupported system: $uname, fix configure and retry"
167 exit 2
169 esac
171 GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
173 if test "X$crosscompile" != "Xyes"; then
174 if [ "`uname -m`" = "x86_64" ] || [ "`uname -m`" = "amd64" ]; then
175 # fPIC is needed to make shared objects link
176 # setting visibility to hidden is necessary to avoid strange crashes
177 # due to symbol clashing
178 GCCOPTS="$GCCOPTS -fPIC -fvisibility=hidden"
181 id=$$
182 cat >$tmpdir/conftest-$id.c <<EOF
183 #include <stdio.h>
184 int main(int argc, char **argv)
186 int var=0;
187 char *varp = (char *)&var;
188 *varp=1;
190 printf("%d\n", var);
191 return 0;
195 $CC -o $tmpdir/conftest-$id $tmpdir/conftest-$id.c 2>/dev/null
197 if test `$tmpdir/conftest-$id 2>/dev/null` -gt "1"; then
198 # big endian
199 endian="big"
200 else
201 # little endian
202 endian="little"
205 if [ $1 = "sdl" ]; then
206 echo "Simulator environment deemed $endian endian"
207 elif [ $1 = "checkwps" ]; then
208 echo "CheckWPS environment deemed $endian endian"
211 # use wildcard here to make it work even if it was named *.exe like
212 # on cygwin
213 rm -f $tmpdir/conftest-$id*
214 else
215 # We are crosscompiling
216 # add cross-compiler option(s)
217 prefixtools i586-mingw32msvc-
218 LDOPTS="-mconsole $sdl_libs"
219 output="rockboxui.exe" # use this as output binary name
220 endian="little" # windows is little endian
225 # functions for setting up cross-compiler names and options
226 # also set endianess and what the exact recommended gcc version is
227 # the gcc version should most likely match what versions we build with
228 # rockboxdev.sh
230 shcc () {
231 prefixtools sh-elf-
232 GCCOPTS="$CCOPTS -m1"
233 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
234 endian="big"
235 gccchoice="4.0.3"
238 calmrisccc () {
239 prefixtools calmrisc16-unknown-elf-
240 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
241 GCCOPTIMIZE="-fomit-frame-pointer"
242 endian="big"
245 coldfirecc () {
246 prefixtools m68k-elf-
247 GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
248 GCCOPTIMIZE="-fomit-frame-pointer"
249 endian="big"
250 gccchoice="3.4.6"
253 arm7tdmicc () {
254 findarmgcc
255 GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
256 if test "X$1" != "Xshort" -a "$ARG_ARM_EABI" != "1"; then
257 GCCOPTS="$GCCOPTS -mlong-calls"
259 GCCOPTIMIZE="-fomit-frame-pointer"
260 endian="little"
263 arm9tdmicc () {
264 findarmgcc
265 GCCOPTS="$CCOPTS -mcpu=arm9tdmi"
266 if test "$modelname" != "gigabeatf" -a "$t_manufacturer" != "as3525" -a "$ARG_ARM_EABI" != "1"; then
267 GCCOPTS="$GCCOPTS -mlong-calls"
269 GCCOPTIMIZE="-fomit-frame-pointer"
270 endian="little"
273 arm940tbecc () {
274 findarmgcc
275 GCCOPTS="$CCOPTS -mbig-endian -mcpu=arm940t"
276 if test "ARG_ARM_EABI" != "1"; then
277 GCCOPTS="$GCCOPTS -mlong-calls"
279 GCCOPTIMIZE="-fomit-frame-pointer"
280 endian="big"
283 arm940tcc () {
284 findarmgcc
285 GCCOPTS="$CCOPTS -mcpu=arm940t"
286 if test "ARG_ARM_EABI" != "1"; then
287 GCCOPTS="$GCCOPTS -mlong-calls"
289 GCCOPTIMIZE="-fomit-frame-pointer"
290 endian="little"
293 arm946cc () {
294 findarmgcc
295 GCCOPTS="$CCOPTS -mcpu=arm9e"
296 if test "ARG_ARM_EABI" != "1"; then
297 GCCOPTS="$GCCOPTS -mlong-calls"
299 GCCOPTIMIZE="-fomit-frame-pointer"
300 endian="little"
303 arm926ejscc () {
304 findarmgcc
305 GCCOPTS="$CCOPTS -mcpu=arm926ej-s"
306 if test "ARG_ARM_EABI" != "1"; then
307 GCCOPTS="$GCCOPTS -mlong-calls"
309 GCCOPTIMIZE="-fomit-frame-pointer"
310 endian="little"
313 arm1136jfscc () {
314 findarmgcc
315 GCCOPTS="$CCOPTS -mcpu=arm1136jf-s"
316 if test "$modelname" != "gigabeats" -a "ARG_ARM_EABI" != "1"; then
317 GCCOPTS="$GCCOPTS -mlong-calls"
319 GCCOPTIMIZE="-fomit-frame-pointer"
320 endian="little"
323 arm1176jzscc () {
324 findarmgcc
325 GCCOPTS="$CCOPTS -mcpu=arm1176jz-s"
326 if test "ARG_ARM_EABI" != "1"; then
327 GCCOPTS="$GCCOPTS -mlong-calls"
329 GCCOPTIMIZE="-fomit-frame-pointer"
330 endian="little"
333 mipselcc () {
334 prefixtools mipsel-elf-
335 GCCOPTS="$CCOPTS -march=mips32 -mtune=r4600 -mno-mips16 -mno-long-calls"
336 GCCOPTS="$GCCOPTS -ffunction-sections -msoft-float -G 0 -Wno-parentheses"
337 GCCOPTIMIZE="-fomit-frame-pointer"
338 endian="little"
339 gccchoice="4.1.2"
342 whichadvanced () {
343 atype=`echo "$1" | cut -c 2-`
344 ##################################################################
345 # Prompt for specific developer options
347 if [ "$atype" ]; then
348 interact=
349 else
350 interact=1
351 echo ""
352 echo "Enter your developer options (press enter when done)"
353 printf "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice, (W)in32 crosscompile"
354 if [ "$memory" = "2" ]; then
355 printf ", (8)MB MOD"
357 if [ "$modelname" = "player" ]; then
358 printf ", Use (A)TA poweroff"
360 if [ "$t_model" = "ondio" ]; then
361 printf ", (B)acklight MOD"
363 if [ "$modelname" = "m5" ]; then
364 printf ", (F)M radio MOD"
366 if [ "$modelname" = "h120" ]; then
367 printf ", (R)TC MOD"
369 echo ""
372 cont=1
373 while [ $cont = "1" ]; do
375 if [ "$interact" ]; then
376 option=`input`
377 else
378 option=`echo "$atype" | cut -c 1`
381 case $option in
382 [Dd])
383 if [ "yes" = "$profile" ]; then
384 echo "Debug is incompatible with profiling"
385 else
386 echo "DEBUG build enabled"
387 use_debug="yes"
390 [Ll])
391 echo "logf() support enabled"
392 logf="yes"
394 [Ss])
395 echo "Simulator build enabled"
396 simulator="yes"
398 [Pp])
399 if [ "yes" = "$use_debug" ]; then
400 echo "Profiling is incompatible with debug"
401 else
402 echo "Profiling support is enabled"
403 profile="yes"
406 [Vv])
407 echo "Voice build selected"
408 voice="yes"
411 if [ "$memory" = "2" ]; then
412 memory="8"
413 echo "Memory size selected: 8MB"
416 [Aa])
417 if [ "$modelname" = "player" ]; then
418 have_ata_poweroff="#define HAVE_ATA_POWEROFF"
419 echo "ATA poweroff enabled"
422 [Bb])
423 if [ "$t_model" = "ondio" ]; then
424 have_backlight="#define HAVE_BACKLIGHT"
425 echo "Backlight functions enabled"
428 [Ff])
429 if [ "$modelname" = "m5" ]; then
430 have_fmradio_in="#define HAVE_FMRADIO_IN"
431 echo "FM radio functions enabled"
434 [Rr])
435 if [ "$modelname" = "h120" ]; then
436 config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231"
437 have_rtc_alarm="#define HAVE_RTC_ALARM"
438 echo "RTC functions enabled (DS1339/DS3231)"
441 [Ww])
442 echo "Enabling Windows 32 cross-compiling"
443 crosscompile="yes"
446 if [ "$interact" ]; then
447 cont=0
448 else
449 echo "[ERROR] Option $option unsupported"
452 esac
453 if [ ! "$interact" ]; then
454 atype=`echo "$atype" | cut -c 2-`
455 [ "$atype" ] || cont=0
457 done
458 echo "done"
460 if [ "yes" = "$voice" ]; then
461 # Ask about languages to build
462 picklang
463 voicelanguage=`whichlang`
464 echo "Voice language set to $voicelanguage"
466 # Configure encoder and TTS engine for each language
467 for thislang in `echo $voicelanguage | sed 's/,/ /g'`; do
468 voiceconfig "$thislang"
469 done
471 if [ "yes" = "$use_debug" ]; then
472 debug="-DDEBUG"
473 GCCOPTS="$GCCOPTS -g -DDEBUG"
475 if [ "yes" = "$logf" ]; then
476 use_logf="#define ROCKBOX_HAS_LOGF 1"
478 if [ "yes" = "$simulator" ]; then
479 debug="-DDEBUG"
480 extradefines="$extradefines -DSIMULATOR"
481 archosrom=""
482 flash=""
484 if [ "yes" = "$profile" ]; then
485 extradefines="$extradefines -DRB_PROFILE"
486 PROFILE_OPTS="-finstrument-functions"
490 # Configure voice settings
491 voiceconfig () {
492 thislang=$1
493 if [ ! "$ARG_TTS" ]; then
494 echo "Building $thislang voice for $modelname. Select options"
495 echo ""
498 if [ -n "`findtool flite`" ]; then
499 FLITE="F(l)ite "
500 FLITE_OPTS=""
501 DEFAULT_TTS="flite"
502 DEFAULT_TTS_OPTS=$FLITE_OPTS
503 DEFAULT_NOISEFLOOR="500"
504 DEFAULT_CHOICE="L"
506 if [ -n "`findtool espeak`" ]; then
507 ESPEAK="(e)Speak "
508 ESPEAK_OPTS=""
509 DEFAULT_TTS="espeak"
510 DEFAULT_TTS_OPTS=$ESPEAK_OPTS
511 DEFAULT_NOISEFLOOR="500"
512 DEFAULT_CHOICE="e"
514 if [ -n "`findtool festival`" ]; then
515 FESTIVAL="(F)estival "
516 case "$thislang" in
517 "italiano")
518 FESTIVAL_OPTS="--language italian"
520 "espanol")
521 FESTIVAL_OPTS="--language spanish"
523 "finnish")
524 FESTIVAL_OPTS="--language finnish"
526 "czech")
527 FESTIVAL_OPTS="--language czech"
530 FESTIVAL_OPTS=""
532 esac
533 DEFAULT_TTS="festival"
534 DEFAULT_TTS_OPTS=$FESTIVAL_OPTS
535 DEFAULT_NOISEFLOOR="500"
536 DEFAULT_CHOICE="F"
538 if [ -n "`findtool swift`" ]; then
539 SWIFT="S(w)ift "
540 SWIFT_OPTS=""
541 DEFAULT_TTS="swift"
542 DEFAULT_TTS_OPTS=$SWIFT_OPTS
543 DEFAULT_NOISEFLOOR="500"
544 DEFAULT_CHOICE="w"
546 # Allow SAPI if Windows is in use
547 if [ -n "`findtool winver`" ]; then
548 SAPI="(S)API "
549 SAPI_OPTS=""
550 DEFAULT_TTS="sapi"
551 DEFAULT_TTS_OPTS=$SAPI_OPTS
552 DEFAULT_NOISEFLOOR="500"
553 DEFAULT_CHOICE="S"
556 if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ] && [ "$ESPEAK" = "$SAPI" ] && [ "$SAPI" = "$SWIFT" ]; then
557 echo "You need Festival, eSpeak or Flite in your path, or SAPI available to build voice files"
558 exit 3
561 if [ "$ARG_TTS" ]; then
562 option=$ARG_TTS
563 else
564 echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?"
565 option=`input`
567 advopts="$advopts --tts=$option"
568 case "$option" in
569 [Ll])
570 TTS_ENGINE="flite"
571 NOISEFLOOR="500" # TODO: check this value
572 TTS_OPTS=$FLITE_OPTS
574 [Ee])
575 TTS_ENGINE="espeak"
576 NOISEFLOOR="500"
577 TTS_OPTS=$ESPEAK_OPTS
579 [Ff])
580 TTS_ENGINE="festival"
581 NOISEFLOOR="500"
582 TTS_OPTS=$FESTIVAL_OPTS
584 [Ss])
585 TTS_ENGINE="sapi"
586 NOISEFLOOR="500"
587 TTS_OPTS=$SAPI_OPTS
589 [Ww])
590 TTS_ENGINE="swift"
591 NOISEFLOOR="500"
592 TTS_OPTS=$SWIFT_OPTS
595 TTS_ENGINE=$DEFAULT_TTS
596 TTS_OPTS=$DEFAULT_TTS_OPTS
597 NOISEFLOOR=$DEFAULT_NOISEFLOOR
598 esac
599 echo "Using $TTS_ENGINE for TTS"
601 # Select which voice to use for Festival
602 if [ "$TTS_ENGINE" = "festival" ]; then
603 voicelist=`echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1/'|sort`
604 for voice in $voicelist; do
605 TTS_FESTIVAL_VOICE="$voice" # Default choice
606 break
607 done
608 if [ "$ARG_VOICE" ]; then
609 CHOICE=$ARG_VOICE
610 else
612 for voice in $voicelist; do
613 printf "%3d. %s\n" "$i" "$voice"
614 i=`expr $i + 1`
615 done
616 printf "Please select which Festival voice to use (default is $TTS_FESTIVAL_VOICE): "
617 CHOICE=`input`
620 for voice in $voicelist; do
621 if [ "$i" = "$CHOICE" -o "$voice" = "$CHOICE" ]; then
622 TTS_FESTIVAL_VOICE="$voice"
624 i=`expr $i + 1`
625 done
626 advopts="$advopts --voice=$CHOICE"
627 echo "Festival voice set to $TTS_FESTIVAL_VOICE"
628 echo "(voice_$TTS_FESTIVAL_VOICE)" > festival-prolog.scm
631 # Allow the user to input manual commandline options
632 if [ "$ARG_TTSOPTS" ]; then
633 USER_TTS_OPTS=$ARG_TTSOPTS
634 else
635 printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): "
636 USER_TTS_OPTS=`input`
637 echo ""
639 advopts="$advopts --ttsopts='$USER_TTS_OPTS'"
640 if [ -n "$USER_TTS_OPTS" ]; then
641 TTS_OPTS="$USER_TTS_OPTS"
643 echo "$TTS_ENGINE options set to $TTS_OPTS"
645 if [ "$swcodec" = "yes" ]; then
646 ENCODER="rbspeexenc"
647 ENC_CMD="rbspeexenc"
648 ENC_OPTS="-q 4 -c 10"
649 else
650 if [ -n "`findtool lame`" ]; then
651 ENCODER="lame"
652 ENC_CMD="lame"
653 ENC_OPTS="--resample 12 -t -m m -h -V 9.999 -S -B 64 --vbr-new"
654 else
655 echo "You need LAME in the system path to build voice files for"
656 echo "HWCODEC targets."
657 exit 4
661 echo "Using $ENCODER for encoding voice clips"
663 # Allow the user to input manual commandline options
664 if [ "$ARG_ENCOPTS" ]; then
665 USER_ENC_OPTS=$ARG_ENCOPTS
666 else
667 printf "Enter $ENCODER options (enter for defaults \"$ENC_OPTS\"): "
668 USER_ENC_OPTS=`input`
670 advopts="$advopts --encopts='$USER_ENC_OPTS'"
671 if [ -n "$USER_ENC_OPTS" ]; then
672 ENC_OPTS=$USER_ENC_OPTS
674 echo "$ENCODER options set to $ENC_OPTS"
676 TEMPDIR="${pwd}"
677 if [ -n "`findtool cygpath`" ]; then
678 TEMPDIR=`cygpath . -a -w`
682 picklang() {
683 # figure out which languages that are around
684 for file in $rootdir/apps/lang/*.lang; do
685 clean=`basename $file .lang`
686 langs="$langs $clean"
687 done
689 if [ "$ARG_LANG" ]; then
690 pick=$ARG_LANG
691 else
692 echo "Select a number for the language to use (default is english)"
693 # FIXME The multiple-language feature is currently broken
694 # echo "You may enter a comma-separated list of languages to build"
696 num=1
697 for one in $langs; do
698 echo "$num. $one"
699 num=`expr $num + 1`
700 done
701 pick=`input`
703 advopts="$advopts --language=$pick"
706 whichlang() {
707 output=""
708 # Allow the user to pass a comma-separated list of langauges
709 for thispick in `echo $pick | sed 's/,/ /g'`; do
710 num=1
711 for one in $langs; do
712 # Accept both the language number and name
713 if [ "$num" = "$thispick" ] || [ "$thispick" = "$one" ]; then
714 if [ "$output" = "" ]; then
715 output=$one
716 else
717 output=$output,$one
720 num=`expr $num + 1`
721 done
722 done
723 if [ -z "$output" ]; then
724 # pick a default
725 output="english"
727 echo $output
730 help() {
731 echo "Rockbox configure script."
732 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
733 echo "Do *NOT* run this within the tools directory!"
734 echo ""
735 cat <<EOF
736 Usage: configure [OPTION]...
737 Options:
738 --target=TARGET Sets the target, TARGET can be either the target ID or
739 corresponding string. Run without this option to see all
740 available targets.
742 --ram=RAM Sets the RAM for certain targets. Even though any number
743 is accepted, not every number is correct. The default
744 value will be applied, if you entered a wrong number
745 (which depends on the target). Watch the output. Run
746 without this option if you are not sure which the right
747 number is.
749 --type=TYPE Sets the build type. Shortcuts are also valid.
750 Run without this option to see all available types.
751 Multiple values are allowed and managed in the input
752 order. So --type=b stands for Bootloader build, while
753 --type=ab stands for "Backlight MOD" build.
755 --language=LANG Set the language used for voice generation (used only if
756 TYPE is AV).
758 --tts=ENGINE Set the TTS engine used for voice generation (used only
759 if TYPE is AV).
761 --voice=VOICE Set voice to use with selected TTS (used only if TYPE is
762 AV).
764 --ttsopts=OPTS Set TTS engine manual options (used only if TYPE is AV).
766 --encopts=OPTS Set encoder manual options (used only if ATYPE is AV).
768 --rbdir=dir Use alternative rockbox directory (default: ${rbdir}).
769 This is useful for having multiple alternate builds on
770 your device that you can load with ROLO. However as the
771 bootloader looks for .rockbox you won't be able to boot
772 into this build.
774 --ccache Enable ccache use (done by default these days)
775 --no-ccache Disable ccache use
777 --eabi Make configure prefer toolchains that are able to compile
778 for the new ARM standard abi EABI
779 --no-eabi The opposite of --eabi (prefer old non-eabi toolchains)
780 --help Shows this message (must not be used with other options)
784 exit
787 ARG_CCACHE=
788 ARG_ENCOPTS=
789 ARG_LANG=
790 ARG_RAM=
791 ARG_RBDIR=
792 ARG_TARGET=
793 ARG_TTS=
794 ARG_TTSOPTS=
795 ARG_TYPE=
796 ARG_VOICE=
797 ARG_ARM_EABI=
798 err=
799 for arg in "$@"; do
800 case "$arg" in
801 --ccache) ARG_CCACHE=1;;
802 --no-ccache) ARG_CCACHE=0;;
803 --encopts=*) ARG_ENCOPTS=`echo "$arg" | cut -d = -f 2`;;
804 --language=*) ARG_LANG=`echo "$arg" | cut -d = -f 2`;;
805 --ram=*) ARG_RAM=`echo "$arg" | cut -d = -f 2`;;
806 --rbdir=*) ARG_RBDIR=`echo "$arg" | cut -d = -f 2`;;
807 --target=*) ARG_TARGET=`echo "$arg" | cut -d = -f 2`;;
808 --tts=*) ARG_TTS=`echo "$arg" | cut -d = -f 2`;;
809 --ttsopts=*) ARG_TTSOPTS=`echo "$arg" | cut -d = -f 2`;;
810 --type=*) ARG_TYPE=`echo "$arg" | cut -d = -f 2`;;
811 --voice=*) ARG_VOICE=`echo "$arg" | cut -d = -f 2`;;
812 --eabi) ARG_ARM_EABI=1;;
813 --no-eabi) ARG_ARM_EABI=0;;
814 --help) help;;
815 *) err=1; echo "[ERROR] Option '$arg' unsupported";;
816 esac
817 done
818 [ "$err" ] && exit 1
820 advopts=
822 if [ "$TMPDIR" != "" ]; then
823 tmpdir=$TMPDIR
824 else
825 tmpdir=/tmp
827 echo Using temporary directory $tmpdir
829 if test -r "configure"; then
830 # this is a check for a configure script in the current directory, it there
831 # is one, try to figure out if it is this one!
833 if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
834 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
835 echo "It will only cause you pain and grief. Instead do this:"
836 echo ""
837 echo " cd .."
838 echo " mkdir build-dir"
839 echo " cd build-dir"
840 echo " ../tools/configure"
841 echo ""
842 echo "Much happiness will arise from this. Enjoy"
843 exit 5
847 # get our current directory
848 pwd=`pwd`;
850 if { echo $pwd | grep " "; } then
851 echo "You're running this script in a path that contains space. The build"
852 echo "system is unfortunately not clever enough to deal with this. Please"
853 echo "run the script from a different path, rename the path or fix the build"
854 echo "system!"
855 exit 6
858 if [ -z "$rootdir" ]; then
859 ##################################################################
860 # Figure out where the source code root is!
862 rootdir=`dirname $0`/../
864 #####################################################################
865 # Convert the possibly relative directory name to an absolute version
867 now=`pwd`
868 cd $rootdir
869 rootdir=`pwd`
871 # cd back to the build dir
872 cd $now
875 apps="apps"
876 appsdir='\$(ROOTDIR)/apps'
877 firmdir='\$(ROOTDIR)/firmware'
878 toolsdir='\$(ROOTDIR)/tools'
881 ##################################################################
882 # Figure out target platform
885 if [ "$ARG_TARGET" ]; then
886 buildfor=$ARG_TARGET
887 else
888 echo "Enter target platform:"
889 cat <<EOF
890 ==Archos== ==iriver== ==Apple iPod==
891 0) Player/Studio 10) H120/H140 20) Color/Photo
892 1) Recorder 11) H320/H340 21) Nano
893 2) FM Recorder 12) iHP-100/110/115 22) Video
894 3) Recorder v2 13) iFP-790 23) 3G
895 4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
896 5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
897 6) AV300 26) Mini 2G
898 ==Toshiba== 27) 1G, 2G
899 ==Cowon/iAudio== 40) Gigabeat F 28) Nano 2G
900 30) X5/X5V/X5L 41) Gigabeat S
901 31) M5/M5L ==SanDisk==
902 32) 7 ==Olympus= 50) Sansa e200
903 33) D2 70) M:Robe 500 51) Sansa e200R
904 34) M3/M3L 71) M:Robe 100 52) Sansa c200
905 53) Sansa m200
906 ==Creative== ==Philips== 54) Sansa c100
907 90) Zen Vision:M 30GB 100) GoGear SA9200 55) Sansa Clip
908 91) Zen Vision:M 60GB 101) GoGear HDD1630/ 56) Sansa e200v2
909 92) Zen Vision HDD1830 57) Sansa m200v4
910 58) Sansa Fuze
911 ==Onda== ==Meizu== 59) Sansa c200v2
912 120) VX747 110) M6SL 60) Sansa Clipv2
913 121) VX767 111) M6SP 61) Sansa View
914 122) VX747+ 112) M3
915 123) VX777 ==Logik==
916 80) DAX 1GB MP3/DAB
917 ==Samsung== ==Tatung==
918 140) YH-820 150) Elio TPJ-1022 ==Lyre project==
919 141) YH-920 130) Lyre proto 1
920 142) YH-925 131) Mini2440
921 143) YP-S3
924 buildfor=`input`;
927 # Set of tools built for all target platforms:
928 toolset="rdf2binary convbdf codepages"
930 # Toolsets for some target families:
931 archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
932 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
933 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
934 ipodbitmaptools="$toolset scramble bmp2rb"
935 gigabeatbitmaptools="$toolset scramble descramble bmp2rb"
936 tccbitmaptools="$toolset scramble bmp2rb"
937 # generic is used by IFP, Meizu and Onda
938 genericbitmaptools="$toolset bmp2rb"
939 # scramble is used by all other targets
940 scramblebitmaptools="$genericbitmaptools scramble"
943 # ---- For each target ----
945 # *Variables*
946 # target_id: a unique number identifying this target, IS NOT the menu number.
947 # Just use the currently highest number+1 when you add a new
948 # target.
949 # modelname: short model name used all over to identify this target
950 # memory: number of megabytes of RAM this target has. If the amount can
951 # be selected by the size prompt, let memory be unset here
952 # target: -Ddefine passed to the build commands to make the correct
953 # config-*.h file get included etc
954 # tool: the tool that takes a plain binary and converts that into a
955 # working "firmware" file for your target
956 # output: the final output file name
957 # boottool: the tool that takes a plain binary and generates a bootloader
958 # file for your target (or blank to use $tool)
959 # bootoutput:the final output file name for the bootloader (or blank to use
960 # $output)
961 # appextra: passed to the APPEXTRA variable in the Makefiles.
962 # TODO: add proper explanation
963 # archosrom: used only for Archos targets that build a special flashable .ucl
964 # image.
965 # flash: name of output for flashing, for targets where there's a special
966 # file output for this.
967 # plugins: set to 'yes' to build the plugins. Early development builds can
968 # set this to no in the early stages to have an easier life for a
969 # while
970 # swcodec: set 'yes' on swcodec targets
971 # toolset: lists what particular tools in the tools/ directory that this
972 # target needs to have built prior to building Rockbox
974 # *Functions*
975 # *cc: sets up gcc and compiler options for your target builds. Note
976 # that if you select a simulator build, the compiler selection is
977 # overridden later in the script.
979 case $buildfor in
981 0|player)
982 target_id=1
983 modelname="player"
984 target="-DARCHOS_PLAYER"
985 shcc
986 tool="$rootdir/tools/scramble"
987 output="archos.mod"
988 appextra="player:gui"
989 archosrom="$pwd/rombox.ucl"
990 flash="$pwd/rockbox.ucl"
991 plugins="yes"
992 swcodec=""
994 # toolset is the tools within the tools directory that we build for
995 # this particular target.
996 toolset="$toolset scramble descramble sh2d player_unifont uclpack"
998 # Note: the convbdf is present in the toolset just because: 1) the
999 # firmware/Makefile assumes it is present always, and 2) we will need it when we
1000 # build the player simulator
1002 t_cpu="sh"
1003 t_manufacturer="archos"
1004 t_model="player"
1007 1|recorder)
1008 target_id=2
1009 modelname="recorder"
1010 target="-DARCHOS_RECORDER"
1011 shcc
1012 tool="$rootdir/tools/scramble"
1013 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1014 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1015 output="ajbrec.ajz"
1016 appextra="recorder:gui"
1017 #archosrom="$pwd/rombox.ucl"
1018 flash="$pwd/rockbox.ucl"
1019 plugins="yes"
1020 swcodec=""
1021 # toolset is the tools within the tools directory that we build for
1022 # this particular target.
1023 toolset=$archosbitmaptools
1024 t_cpu="sh"
1025 t_manufacturer="archos"
1026 t_model="recorder"
1029 2|fmrecorder)
1030 target_id=3
1031 modelname="fmrecorder"
1032 target="-DARCHOS_FMRECORDER"
1033 shcc
1034 tool="$rootdir/tools/scramble -fm"
1035 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1036 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1037 output="ajbrec.ajz"
1038 appextra="recorder:gui"
1039 #archosrom="$pwd/rombox.ucl"
1040 flash="$pwd/rockbox.ucl"
1041 plugins="yes"
1042 swcodec=""
1043 # toolset is the tools within the tools directory that we build for
1044 # this particular target.
1045 toolset=$archosbitmaptools
1046 t_cpu="sh"
1047 t_manufacturer="archos"
1048 t_model="fm_v2"
1051 3|recorderv2)
1052 target_id=4
1053 modelname="recorderv2"
1054 target="-DARCHOS_RECORDERV2"
1055 shcc
1056 tool="$rootdir/tools/scramble -v2"
1057 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1058 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1059 output="ajbrec.ajz"
1060 appextra="recorder:gui"
1061 #archosrom="$pwd/rombox.ucl"
1062 flash="$pwd/rockbox.ucl"
1063 plugins="yes"
1064 swcodec=""
1065 # toolset is the tools within the tools directory that we build for
1066 # this particular target.
1067 toolset=$archosbitmaptools
1068 t_cpu="sh"
1069 t_manufacturer="archos"
1070 t_model="fm_v2"
1073 4|ondiosp)
1074 target_id=7
1075 modelname="ondiosp"
1076 target="-DARCHOS_ONDIOSP"
1077 shcc
1078 tool="$rootdir/tools/scramble -osp"
1079 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1080 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1081 output="ajbrec.ajz"
1082 appextra="recorder:gui"
1083 archosrom="$pwd/rombox.ucl"
1084 flash="$pwd/rockbox.ucl"
1085 plugins="yes"
1086 swcodec=""
1087 # toolset is the tools within the tools directory that we build for
1088 # this particular target.
1089 toolset=$archosbitmaptools
1090 t_cpu="sh"
1091 t_manufacturer="archos"
1092 t_model="ondio"
1095 5|ondiofm)
1096 target_id=8
1097 modelname="ondiofm"
1098 target="-DARCHOS_ONDIOFM"
1099 shcc
1100 tool="$rootdir/tools/scramble -ofm"
1101 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1102 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1103 output="ajbrec.ajz"
1104 appextra="recorder:gui"
1105 #archosrom="$pwd/rombox.ucl"
1106 flash="$pwd/rockbox.ucl"
1107 plugins="yes"
1108 swcodec=""
1109 toolset=$archosbitmaptools
1110 t_cpu="sh"
1111 t_manufacturer="archos"
1112 t_model="ondio"
1115 6|av300)
1116 target_id=38
1117 modelname="av300"
1118 target="-DARCHOS_AV300"
1119 memory=16 # always
1120 arm7tdmicc
1121 tool="$rootdir/tools/scramble -mm=C"
1122 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1123 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1124 output="cjbm.ajz"
1125 appextra="recorder:gui"
1126 plugins="yes"
1127 swcodec=""
1128 # toolset is the tools within the tools directory that we build for
1129 # this particular target.
1130 toolset="$toolset scramble descramble bmp2rb"
1131 # architecture, manufacturer and model for the target-tree build
1132 t_cpu="arm"
1133 t_manufacturer="archos"
1134 t_model="av300"
1137 10|h120)
1138 target_id=9
1139 modelname="h120"
1140 target="-DIRIVER_H120"
1141 memory=32 # always
1142 coldfirecc
1143 tool="$rootdir/tools/scramble -add=h120"
1144 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1145 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1146 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1147 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1148 output="rockbox.iriver"
1149 bootoutput="bootloader.iriver"
1150 appextra="recorder:gui"
1151 flash="$pwd/rombox.iriver"
1152 plugins="yes"
1153 swcodec="yes"
1154 # toolset is the tools within the tools directory that we build for
1155 # this particular target.
1156 toolset=$iriverbitmaptools
1157 t_cpu="coldfire"
1158 t_manufacturer="iriver"
1159 t_model="h100"
1162 11|h300)
1163 target_id=10
1164 modelname="h300"
1165 target="-DIRIVER_H300"
1166 memory=32 # always
1167 coldfirecc
1168 tool="$rootdir/tools/scramble -add=h300"
1169 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1170 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1171 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1172 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1173 output="rockbox.iriver"
1174 appextra="recorder:gui"
1175 plugins="yes"
1176 swcodec="yes"
1177 # toolset is the tools within the tools directory that we build for
1178 # this particular target.
1179 toolset=$iriverbitmaptools
1180 t_cpu="coldfire"
1181 t_manufacturer="iriver"
1182 t_model="h300"
1185 12|h100)
1186 target_id=11
1187 modelname="h100"
1188 target="-DIRIVER_H100"
1189 memory=16 # always
1190 coldfirecc
1191 tool="$rootdir/tools/scramble -add=h100"
1192 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1193 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1194 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1195 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1196 output="rockbox.iriver"
1197 bootoutput="bootloader.iriver"
1198 appextra="recorder:gui"
1199 flash="$pwd/rombox.iriver"
1200 plugins="yes"
1201 swcodec="yes"
1202 # toolset is the tools within the tools directory that we build for
1203 # this particular target.
1204 toolset=$iriverbitmaptools
1205 t_cpu="coldfire"
1206 t_manufacturer="iriver"
1207 t_model="h100"
1210 13|ifp7xx)
1211 target_id=19
1212 modelname="ifp7xx"
1213 target="-DIRIVER_IFP7XX"
1214 memory=1
1215 arm7tdmicc short
1216 tool="cp"
1217 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1218 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1219 output="rockbox.wma"
1220 appextra="recorder:gui"
1221 plugins="yes"
1222 swcodec="yes"
1223 # toolset is the tools within the tools directory that we build for
1224 # this particular target.
1225 toolset=$genericbitmaptools
1226 t_cpu="arm"
1227 t_manufacturer="pnx0101"
1228 t_model="iriver-ifp7xx"
1231 14|h10)
1232 target_id=22
1233 modelname="h10"
1234 target="-DIRIVER_H10"
1235 memory=32 # always
1236 arm7tdmicc
1237 tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
1238 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1239 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1240 output="rockbox.mi4"
1241 appextra="recorder:gui"
1242 plugins="yes"
1243 swcodec="yes"
1244 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
1245 bootoutput="H10_20GC.mi4"
1246 # toolset is the tools within the tools directory that we build for
1247 # this particular target.
1248 toolset=$scramblebitmaptools
1249 # architecture, manufacturer and model for the target-tree build
1250 t_cpu="arm"
1251 t_manufacturer="iriver"
1252 t_model="h10"
1255 15|h10_5gb)
1256 target_id=24
1257 modelname="h10_5gb"
1258 target="-DIRIVER_H10_5GB"
1259 memory=32 # always
1260 arm7tdmicc
1261 tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
1262 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1263 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1264 output="rockbox.mi4"
1265 appextra="recorder:gui"
1266 plugins="yes"
1267 swcodec="yes"
1268 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
1269 bootoutput="H10.mi4"
1270 # toolset is the tools within the tools directory that we build for
1271 # this particular target.
1272 toolset=$scramblebitmaptools
1273 # architecture, manufacturer and model for the target-tree build
1274 t_cpu="arm"
1275 t_manufacturer="iriver"
1276 t_model="h10"
1279 20|ipodcolor)
1280 target_id=13
1281 modelname="ipodcolor"
1282 target="-DIPOD_COLOR"
1283 memory=32 # always
1284 arm7tdmicc
1285 tool="$rootdir/tools/scramble -add=ipco"
1286 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1287 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1288 output="rockbox.ipod"
1289 appextra="recorder:gui"
1290 plugins="yes"
1291 swcodec="yes"
1292 bootoutput="bootloader-$modelname.ipod"
1293 # toolset is the tools within the tools directory that we build for
1294 # this particular target.
1295 toolset=$ipodbitmaptools
1296 # architecture, manufacturer and model for the target-tree build
1297 t_cpu="arm"
1298 t_manufacturer="ipod"
1299 t_model="color"
1302 21|ipodnano)
1303 target_id=14
1304 modelname="ipodnano"
1305 target="-DIPOD_NANO"
1306 memory=32 # always
1307 arm7tdmicc
1308 tool="$rootdir/tools/scramble -add=nano"
1309 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1310 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1311 output="rockbox.ipod"
1312 appextra="recorder:gui"
1313 plugins="yes"
1314 swcodec="yes"
1315 bootoutput="bootloader-$modelname.ipod"
1316 # toolset is the tools within the tools directory that we build for
1317 # this particular target.
1318 toolset=$ipodbitmaptools
1319 # architecture, manufacturer and model for the target-tree build
1320 t_cpu="arm"
1321 t_manufacturer="ipod"
1322 t_model="nano"
1325 22|ipodvideo)
1326 target_id=15
1327 modelname="ipodvideo"
1328 target="-DIPOD_VIDEO"
1329 arm7tdmicc
1330 tool="$rootdir/tools/scramble -add=ipvd"
1331 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1332 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1333 output="rockbox.ipod"
1334 appextra="recorder:gui"
1335 plugins="yes"
1336 swcodec="yes"
1337 bootoutput="bootloader-$modelname.ipod"
1338 # toolset is the tools within the tools directory that we build for
1339 # this particular target.
1340 toolset=$ipodbitmaptools
1341 # architecture, manufacturer and model for the target-tree build
1342 t_cpu="arm"
1343 t_manufacturer="ipod"
1344 t_model="video"
1347 23|ipod3g)
1348 target_id=16
1349 modelname="ipod3g"
1350 target="-DIPOD_3G"
1351 memory=32 # always
1352 arm7tdmicc
1353 tool="$rootdir/tools/scramble -add=ip3g"
1354 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1355 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1356 output="rockbox.ipod"
1357 appextra="recorder:gui"
1358 plugins="yes"
1359 swcodec="yes"
1360 bootoutput="bootloader-$modelname.ipod"
1361 # toolset is the tools within the tools directory that we build for
1362 # this particular target.
1363 toolset=$ipodbitmaptools
1364 # architecture, manufacturer and model for the target-tree build
1365 t_cpu="arm"
1366 t_manufacturer="ipod"
1367 t_model="3g"
1370 24|ipod4g)
1371 target_id=17
1372 modelname="ipod4g"
1373 target="-DIPOD_4G"
1374 memory=32 # always
1375 arm7tdmicc
1376 tool="$rootdir/tools/scramble -add=ip4g"
1377 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1378 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1379 output="rockbox.ipod"
1380 appextra="recorder:gui"
1381 plugins="yes"
1382 swcodec="yes"
1383 bootoutput="bootloader-$modelname.ipod"
1384 # toolset is the tools within the tools directory that we build for
1385 # this particular target.
1386 toolset=$ipodbitmaptools
1387 # architecture, manufacturer and model for the target-tree build
1388 t_cpu="arm"
1389 t_manufacturer="ipod"
1390 t_model="4g"
1393 25|ipodmini)
1394 target_id=18
1395 modelname="ipodmini"
1396 target="-DIPOD_MINI"
1397 memory=32 # always
1398 arm7tdmicc
1399 tool="$rootdir/tools/scramble -add=mini"
1400 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1401 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1402 output="rockbox.ipod"
1403 appextra="recorder:gui"
1404 plugins="yes"
1405 swcodec="yes"
1406 bootoutput="bootloader-$modelname.ipod"
1407 # toolset is the tools within the tools directory that we build for
1408 # this particular target.
1409 toolset=$ipodbitmaptools
1410 # architecture, manufacturer and model for the target-tree build
1411 t_cpu="arm"
1412 t_manufacturer="ipod"
1413 t_model="mini"
1416 26|ipodmini2g)
1417 target_id=21
1418 modelname="ipodmini2g"
1419 target="-DIPOD_MINI2G"
1420 memory=32 # always
1421 arm7tdmicc
1422 tool="$rootdir/tools/scramble -add=mn2g"
1423 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1424 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1425 output="rockbox.ipod"
1426 appextra="recorder:gui"
1427 plugins="yes"
1428 swcodec="yes"
1429 bootoutput="bootloader-$modelname.ipod"
1430 # toolset is the tools within the tools directory that we build for
1431 # this particular target.
1432 toolset=$ipodbitmaptools
1433 # architecture, manufacturer and model for the target-tree build
1434 t_cpu="arm"
1435 t_manufacturer="ipod"
1436 t_model="mini2g"
1439 27|ipod1g2g)
1440 target_id=29
1441 modelname="ipod1g2g"
1442 target="-DIPOD_1G2G"
1443 memory=32 # always
1444 arm7tdmicc
1445 tool="$rootdir/tools/scramble -add=1g2g"
1446 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1447 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1448 output="rockbox.ipod"
1449 appextra="recorder:gui"
1450 plugins="yes"
1451 swcodec="yes"
1452 bootoutput="bootloader-$modelname.ipod"
1453 # toolset is the tools within the tools directory that we build for
1454 # this particular target.
1455 toolset=$ipodbitmaptools
1456 # architecture, manufacturer and model for the target-tree build
1457 t_cpu="arm"
1458 t_manufacturer="ipod"
1459 t_model="1g2g"
1462 28|ipodnano2g)
1463 target_id=62
1464 modelname="ipodnano2g"
1465 target="-DIPOD_NANO2G"
1466 memory=32 # always
1467 arm940tcc
1468 tool="$rootdir/tools/scramble -add=nn2g"
1469 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1470 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1471 output="rockbox.ipod"
1472 appextra="recorder:gui"
1473 plugins="yes"
1474 swcodec="yes"
1475 bootoutput="bootloader-$modelname.ipod"
1476 # toolset is the tools within the tools directory that we build for
1477 # this particular target.
1478 toolset=$ipodbitmaptools
1479 # architecture, manufacturer and model for the target-tree build
1480 t_cpu="arm"
1481 t_manufacturer="s5l8700"
1482 t_model="ipodnano2g"
1485 30|x5)
1486 target_id=12
1487 modelname="x5"
1488 target="-DIAUDIO_X5"
1489 memory=16 # always
1490 coldfirecc
1491 tool="$rootdir/tools/scramble -add=iax5"
1492 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1493 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1494 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1495 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1496 output="rockbox.iaudio"
1497 appextra="recorder:gui"
1498 plugins="yes"
1499 swcodec="yes"
1500 # toolset is the tools within the tools directory that we build for
1501 # this particular target.
1502 toolset="$iaudiobitmaptools"
1503 # architecture, manufacturer and model for the target-tree build
1504 t_cpu="coldfire"
1505 t_manufacturer="iaudio"
1506 t_model="x5"
1509 31|m5)
1510 target_id=28
1511 modelname="m5"
1512 target="-DIAUDIO_M5"
1513 memory=16 # always
1514 coldfirecc
1515 tool="$rootdir/tools/scramble -add=iam5"
1516 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1517 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1518 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1519 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1520 output="rockbox.iaudio"
1521 appextra="recorder:gui"
1522 plugins="yes"
1523 swcodec="yes"
1524 # toolset is the tools within the tools directory that we build for
1525 # this particular target.
1526 toolset="$iaudiobitmaptools"
1527 # architecture, manufacturer and model for the target-tree build
1528 t_cpu="coldfire"
1529 t_manufacturer="iaudio"
1530 t_model="m5"
1533 32|iaudio7)
1534 target_id=32
1535 modelname="iaudio7"
1536 target="-DIAUDIO_7"
1537 memory=16 # always
1538 arm946cc
1539 tool="$rootdir/tools/scramble -add=i7"
1540 boottool="$rootdir/tools/scramble -tcc=crc"
1541 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1542 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1543 output="rockbox.iaudio"
1544 appextra="recorder:gui"
1545 plugins="yes"
1546 swcodec="yes"
1547 bootoutput="I7_FW.BIN"
1548 # toolset is the tools within the tools directory that we build for
1549 # this particular target.
1550 toolset="$tccbitmaptools"
1551 # architecture, manufacturer and model for the target-tree build
1552 t_cpu="arm"
1553 t_manufacturer="tcc77x"
1554 t_model="iaudio7"
1557 33|cowond2)
1558 target_id=34
1559 modelname="cowond2"
1560 target="-DCOWON_D2"
1561 memory=32
1562 arm926ejscc
1563 tool="$rootdir/tools/scramble -add=d2"
1564 boottool="cp "
1565 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1566 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1567 output="rockbox.d2"
1568 bootoutput="bootloader-cowond2.bin"
1569 appextra="recorder:gui"
1570 plugins="yes"
1571 swcodec="yes"
1572 toolset="$tccbitmaptools"
1573 # architecture, manufacturer and model for the target-tree build
1574 t_cpu="arm"
1575 t_manufacturer="tcc780x"
1576 t_model="cowond2"
1579 34|m3)
1580 target_id=37
1581 modelname="m3"
1582 target="-DIAUDIO_M3"
1583 memory=16 # always
1584 coldfirecc
1585 tool="$rootdir/tools/scramble -add=iam3"
1586 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1587 bmp2rb_native="$rootdir/tools/bmp2rb -f 7"
1588 output="rockbox.iaudio"
1589 appextra="recorder:gui"
1590 plugins="yes"
1591 swcodec="yes"
1592 # toolset is the tools within the tools directory that we build for
1593 # this particular target.
1594 toolset="$iaudiobitmaptools"
1595 # architecture, manufacturer and model for the target-tree build
1596 t_cpu="coldfire"
1597 t_manufacturer="iaudio"
1598 t_model="m3"
1601 40|gigabeatf)
1602 target_id=20
1603 modelname="gigabeatf"
1604 target="-DGIGABEAT_F"
1605 memory=32 # always
1606 arm9tdmicc
1607 tool="$rootdir/tools/scramble -add=giga"
1608 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1609 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1610 output="rockbox.gigabeat"
1611 appextra="recorder:gui"
1612 plugins="yes"
1613 swcodec="yes"
1614 toolset=$gigabeatbitmaptools
1615 boottool="$rootdir/tools/scramble -gigabeat"
1616 bootoutput="FWIMG01.DAT"
1617 # architecture, manufacturer and model for the target-tree build
1618 t_cpu="arm"
1619 t_manufacturer="s3c2440"
1620 t_model="gigabeat-fx"
1623 41|gigabeats)
1624 target_id=26
1625 modelname="gigabeats"
1626 target="-DGIGABEAT_S"
1627 memory=64
1628 arm1136jfscc
1629 tool="$rootdir/tools/scramble -add=gigs"
1630 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1631 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1632 output="rockbox.gigabeat"
1633 appextra="recorder:gui"
1634 plugins="yes"
1635 swcodec="yes"
1636 toolset="$gigabeatbitmaptools"
1637 boottool="$rootdir/tools/scramble -gigabeats"
1638 bootoutput="nk.bin"
1639 # architecture, manufacturer and model for the target-tree build
1640 t_cpu="arm"
1641 t_manufacturer="imx31"
1642 t_model="gigabeat-s"
1645 70|mrobe500)
1646 target_id=36
1647 modelname="mrobe500"
1648 target="-DMROBE_500"
1649 memory=64 # always
1650 arm926ejscc
1651 tool="$rootdir/tools/scramble -add=m500"
1652 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1653 bmp2rb_native="$rootdir/tools/bmp2rb -f 8"
1654 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1655 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1656 output="rockbox.mrobe500"
1657 appextra="recorder:gui"
1658 plugins="yes"
1659 swcodec="yes"
1660 toolset=$gigabeatbitmaptools
1661 boottool="cp "
1662 bootoutput="rockbox.mrboot"
1663 # architecture, manufacturer and model for the target-tree build
1664 t_cpu="arm"
1665 t_manufacturer="tms320dm320"
1666 t_model="mrobe-500"
1669 71|mrobe100)
1670 target_id=33
1671 modelname="mrobe100"
1672 target="-DMROBE_100"
1673 memory=32 # always
1674 arm7tdmicc
1675 tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS"
1676 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1677 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1678 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1679 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1680 output="rockbox.mi4"
1681 appextra="recorder:gui"
1682 plugins="yes"
1683 swcodec="yes"
1684 boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL"
1685 bootoutput="pp5020.mi4"
1686 # toolset is the tools within the tools directory that we build for
1687 # this particular target.
1688 toolset=$scramblebitmaptools
1689 # architecture, manufacturer and model for the target-tree build
1690 t_cpu="arm"
1691 t_manufacturer="olympus"
1692 t_model="mrobe-100"
1695 80|logikdax)
1696 target_id=31
1697 modelname="logikdax"
1698 target="-DLOGIK_DAX"
1699 memory=2 # always
1700 arm946cc
1701 tool="$rootdir/tools/scramble -add=ldax"
1702 boottool="$rootdir/tools/scramble -tcc=crc"
1703 bootoutput="player.rom"
1704 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1705 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1706 output="rockbox.logik"
1707 appextra="recorder:gui"
1708 plugins=""
1709 swcodec="yes"
1710 # toolset is the tools within the tools directory that we build for
1711 # this particular target.
1712 toolset=$tccbitmaptools
1713 # architecture, manufacturer and model for the target-tree build
1714 t_cpu="arm"
1715 t_manufacturer="tcc77x"
1716 t_model="logikdax"
1719 90|creativezvm30gb)
1720 target_id=35
1721 modelname="creativezvm30gb"
1722 target="-DCREATIVE_ZVM"
1723 memory=64
1724 arm926ejscc
1725 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1726 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1727 tool="$rootdir/tools/scramble -creative=zvm"
1728 USE_ELF="yes"
1729 output="rockbox.zvm"
1730 appextra="recorder:gui"
1731 plugins="yes"
1732 swcodec="yes"
1733 toolset=$ipodbitmaptools
1734 boottool="$rootdir/tools/scramble -creative=zvm -no-ciff"
1735 bootoutput="rockbox.zvmboot"
1736 # architecture, manufacturer and model for the target-tree build
1737 t_cpu="arm"
1738 t_manufacturer="tms320dm320"
1739 t_model="creative-zvm"
1742 91|creativezvm60gb)
1743 target_id=40
1744 modelname="creativezvm60gb"
1745 target="-DCREATIVE_ZVM60GB"
1746 memory=64
1747 arm926ejscc
1748 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1749 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1750 tool="$rootdir/tools/scramble -creative=zvm60 -no-ciff"
1751 USE_ELF="yes"
1752 output="rockbox.zvm60"
1753 appextra="recorder:gui"
1754 plugins="yes"
1755 swcodec="yes"
1756 toolset=$ipodbitmaptools
1757 boottool="$rootdir/tools/scramble -creative=zvm60"
1758 bootoutput="rockbox.zvm60boot"
1759 # architecture, manufacturer and model for the target-tree build
1760 t_cpu="arm"
1761 t_manufacturer="tms320dm320"
1762 t_model="creative-zvm"
1765 92|creativezenvision)
1766 target_id=39
1767 modelname="creativezenvision"
1768 target="-DCREATIVE_ZV"
1769 memory=64
1770 arm926ejscc
1771 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1772 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1773 tool="$rootdir/tools/scramble -creative=zenvision -no-ciff"
1774 USE_ELF="yes"
1775 output="rockbox.zv"
1776 appextra="recorder:gui"
1777 plugins=""
1778 swcodec="yes"
1779 toolset=$ipodbitmaptools
1780 boottool="$rootdir/tools/scramble -creative=zenvision"
1781 bootoutput="rockbox.zvboot"
1782 # architecture, manufacturer and model for the target-tree build
1783 t_cpu="arm"
1784 t_manufacturer="tms320dm320"
1785 t_model="creative-zvm"
1788 50|e200)
1789 target_id=23
1790 modelname="e200"
1791 target="-DSANSA_E200"
1792 memory=32 # supposedly
1793 arm7tdmicc
1794 tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1795 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1796 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1797 output="rockbox.mi4"
1798 appextra="recorder:gui"
1799 plugins="yes"
1800 swcodec="yes"
1801 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1802 bootoutput="PP5022.mi4"
1803 # toolset is the tools within the tools directory that we build for
1804 # this particular target.
1805 toolset=$scramblebitmaptools
1806 # architecture, manufacturer and model for the target-tree build
1807 t_cpu="arm"
1808 t_manufacturer="sandisk"
1809 t_model="sansa-e200"
1812 51|e200r)
1813 # the e200R model is pretty much identical to the e200, it only has a
1814 # different option to the scramble tool when building a bootloader and
1815 # makes the bootloader output file name in all lower case.
1816 target_id=27
1817 modelname="e200r"
1818 target="-DSANSA_E200"
1819 memory=32 # supposedly
1820 arm7tdmicc
1821 tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1822 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1823 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1824 output="rockbox.mi4"
1825 appextra="recorder:gui"
1826 plugins="yes"
1827 swcodec="yes"
1828 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1829 bootoutput="pp5022.mi4"
1830 # toolset is the tools within the tools directory that we build for
1831 # this particular target.
1832 toolset=$scramblebitmaptools
1833 # architecture, manufacturer and model for the target-tree build
1834 t_cpu="arm"
1835 t_manufacturer="sandisk"
1836 t_model="sansa-e200"
1839 52|c200)
1840 target_id=30
1841 modelname="c200"
1842 target="-DSANSA_C200"
1843 memory=32 # supposedly
1844 arm7tdmicc
1845 tool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBOS"
1846 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1847 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1848 output="rockbox.mi4"
1849 appextra="recorder:gui"
1850 plugins="yes"
1851 swcodec="yes"
1852 boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
1853 bootoutput="firmware.mi4"
1854 # toolset is the tools within the tools directory that we build for
1855 # this particular target.
1856 toolset=$scramblebitmaptools
1857 # architecture, manufacturer and model for the target-tree build
1858 t_cpu="arm"
1859 t_manufacturer="sandisk"
1860 t_model="sansa-c200"
1863 53|m200)
1864 target_id=48
1865 modelname="m200"
1866 target="-DSANSA_M200"
1867 memory=1 # always
1868 arm946cc
1869 tool="$rootdir/tools/scramble -add=m200"
1870 boottool="$rootdir/tools/scramble -tcc=crc"
1871 bootoutput="player.rom"
1872 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1873 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1874 output="rockbox.m200"
1875 appextra="recorder:gui"
1876 plugins=""
1877 swcodec="yes"
1878 # toolset is the tools within the tools directory that we build for
1879 # this particular target.
1880 toolset=$tccbitmaptools
1881 # architecture, manufacturer and model for the target-tree build
1882 t_cpu="arm"
1883 t_manufacturer="tcc77x"
1884 t_model="m200"
1887 54|c100)
1888 target_id=42
1889 modelname="c100"
1890 target="-DSANSA_C100"
1891 memory=2
1892 arm946cc
1893 tool="$rootdir/tools/scramble -add=c100"
1894 boottool="$rootdir/tools/scramble -tcc=crc"
1895 bootoutput="player.rom"
1896 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1897 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1898 output="rockbox.c100"
1899 appextra="recorder:gui"
1900 plugins=""
1901 swcodec="yes"
1902 # toolset is the tools within the tools directory that we build for
1903 # this particular target.
1904 toolset=$tccbitmaptools
1905 # architecture, manufacturer and model for the target-tree build
1906 t_cpu="arm"
1907 t_manufacturer="tcc77x"
1908 t_model="c100"
1911 55|Clip|clip)
1912 target_id=50
1913 modelname="clip"
1914 target="-DSANSA_CLIP"
1915 memory=2
1916 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1917 bmp2rb_native="$bmp2rb_mono"
1918 tool="$rootdir/tools/scramble -add=clip"
1919 output="rockbox.sansa"
1920 bootoutput="bootloader-clip.sansa"
1921 appextra="recorder:gui"
1922 plugins="yes"
1923 swcodec="yes"
1924 toolset=$scramblebitmaptools
1925 t_cpu="arm"
1926 t_manufacturer="as3525"
1927 t_model="sansa-clip"
1928 arm9tdmicc
1932 56|e200v2)
1933 target_id=51
1934 modelname="e200v2"
1935 target="-DSANSA_E200V2"
1936 memory=8
1937 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1938 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1939 tool="$rootdir/tools/scramble -add=e2v2"
1940 output="rockbox.sansa"
1941 bootoutput="bootloader-e200v2.sansa"
1942 appextra="recorder:gui"
1943 plugins="yes"
1944 swcodec="yes"
1945 toolset=$scramblebitmaptools
1946 t_cpu="arm"
1947 t_manufacturer="as3525"
1948 t_model="sansa-e200v2"
1949 arm9tdmicc
1953 57|m200v4)
1954 target_id=52
1955 modelname="m200v4"
1956 target="-DSANSA_M200V4"
1957 memory=2
1958 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1959 bmp2rb_native="$bmp2rb_mono"
1960 tool="$rootdir/tools/scramble -add=m2v4"
1961 output="rockbox.sansa"
1962 bootoutput="bootloader-m200v4.sansa"
1963 appextra="recorder:gui"
1964 plugins="yes"
1965 swcodec="yes"
1966 toolset=$scramblebitmaptools
1967 t_cpu="arm"
1968 t_manufacturer="as3525"
1969 t_model="sansa-m200v4"
1970 arm9tdmicc
1974 58|fuze)
1975 target_id=53
1976 modelname="fuze"
1977 target="-DSANSA_FUZE"
1978 memory=8
1979 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1980 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1981 tool="$rootdir/tools/scramble -add=fuze"
1982 output="rockbox.sansa"
1983 bootoutput="bootloader-fuze.sansa"
1984 appextra="recorder:gui"
1985 plugins="yes"
1986 swcodec="yes"
1987 toolset=$scramblebitmaptools
1988 t_cpu="arm"
1989 t_manufacturer="as3525"
1990 t_model="sansa-fuze"
1991 arm9tdmicc
1995 59|c200v2)
1996 target_id=55
1997 modelname="c200v2"
1998 target="-DSANSA_C200V2"
1999 memory=2 # as per OF diagnosis mode
2000 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2001 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2002 tool="$rootdir/tools/scramble -add=c2v2"
2003 output="rockbox.sansa"
2004 bootoutput="bootloader-c200v2.sansa"
2005 appextra="recorder:gui"
2006 plugins="yes"
2007 swcodec="yes"
2008 # toolset is the tools within the tools directory that we build for
2009 # this particular target.
2010 toolset=$scramblebitmaptools
2011 # architecture, manufacturer and model for the target-tree build
2012 t_cpu="arm"
2013 t_manufacturer="as3525"
2014 t_model="sansa-c200v2"
2015 arm9tdmicc
2018 60|Clipv2|clipv2)
2019 echo "Sansa Clipv2 is not yet supported !"
2020 exit 1
2021 target_id=60
2022 modelname="clipv2"
2023 target="-DSANSA_CLIPV2"
2024 memory=8
2025 arm926ejscc
2026 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2027 bmp2rb_native="$bmp2rb_mono"
2028 tool="$rootdir/tools/scramble -add=clv2"
2029 output="rockbox.sansa"
2030 bootoutput="bootloader-clipv2.sansa"
2031 appextra="recorder:gui"
2032 plugins="yes"
2033 swcodec="yes"
2034 toolset=$scramblebitmaptools
2035 t_cpu="arm"
2036 t_manufacturer="as3525"
2037 t_model="sansa-clipv2"
2040 61|view)
2041 echo "Sansa View is not yet supported!"
2042 exit 1
2043 target_id=63
2044 modelname="view"
2045 target="-DSANSA_VIEW"
2046 memory=32
2047 arm1176jzscc
2048 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2049 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2050 output="rockbox.mi4"
2051 appextra="gui"
2052 plugins=""
2053 swcodec="yes"
2054 boottool="$rootdir/tools/scramble -mi4v3 -model=view -type=RBBL"
2055 bootoutput="firmware.mi4"
2056 # toolset is the tools within the tools directory that we build for
2057 # this particular target.
2058 toolset=$scramblebitmaptools
2059 t_cpu="arm"
2060 t_manufacturer="sandisk"
2061 t_model="sansa-view"
2064 150|tpj1022)
2065 target_id=25
2066 modelname="tpj1022"
2067 target="-DELIO_TPJ1022"
2068 memory=32 # always
2069 arm7tdmicc
2070 tool="$rootdir/tools/scramble -add tpj2"
2071 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2072 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
2073 output="rockbox.elio"
2074 appextra="recorder:gui"
2075 plugins="yes"
2076 swcodec="yes"
2077 boottool="$rootdir/tools/scramble -mi4v2"
2078 bootoutput="pp5020.mi4"
2079 # toolset is the tools within the tools directory that we build for
2080 # this particular target.
2081 toolset=$scramblebitmaptools
2082 # architecture, manufacturer and model for the target-tree build
2083 t_cpu="arm"
2084 t_manufacturer="tatung"
2085 t_model="tpj1022"
2088 100|sa9200)
2089 target_id=41
2090 modelname="sa9200"
2091 target="-DPHILIPS_SA9200"
2092 memory=32 # supposedly
2093 arm7tdmicc
2094 tool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBOS"
2095 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2096 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2097 output="rockbox.mi4"
2098 appextra="recorder:gui"
2099 plugins=""
2100 swcodec="yes"
2101 boottool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBBL"
2102 bootoutput="FWImage.ebn"
2103 # toolset is the tools within the tools directory that we build for
2104 # this particular target.
2105 toolset=$scramblebitmaptools
2106 # architecture, manufacturer and model for the target-tree build
2107 t_cpu="arm"
2108 t_manufacturer="philips"
2109 t_model="sa9200"
2112 101|hdd1630)
2113 target_id=43
2114 modelname="hdd1630"
2115 target="-DPHILIPS_HDD1630"
2116 memory=32 # supposedly
2117 arm7tdmicc
2118 tool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBOS"
2119 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2120 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2121 output="rockbox.mi4"
2122 appextra="recorder:gui"
2123 plugins="yes"
2124 swcodec="yes"
2125 boottool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBBL"
2126 bootoutput="FWImage.ebn"
2127 # toolset is the tools within the tools directory that we build for
2128 # this particular target.
2129 toolset=$scramblebitmaptools
2130 # architecture, manufacturer and model for the target-tree build
2131 t_cpu="arm"
2132 t_manufacturer="philips"
2133 t_model="hdd1630"
2136 110|meizum6sl)
2137 target_id=49
2138 modelname="meizum6sl"
2139 target="-DMEIZU_M6SL"
2140 memory=16 # always
2141 arm940tbecc
2142 tool="cp"
2143 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2144 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2145 output="rockbox.meizu"
2146 appextra="recorder:gui"
2147 plugins="no" #FIXME
2148 swcodec="yes"
2149 toolset=$genericbitmaptools
2150 boottool="cp"
2151 bootoutput="rockboot.ebn"
2152 # architecture, manufacturer and model for the target-tree build
2153 t_cpu="arm"
2154 t_manufacturer="s5l8700"
2155 t_model="meizu-m6sl"
2158 111|meizum6sp)
2159 target_id=46
2160 modelname="meizum6sp"
2161 target="-DMEIZU_M6SP"
2162 memory=16 # always
2163 arm940tbecc
2164 tool="cp"
2165 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2166 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2167 output="rockbox.meizu"
2168 appextra="recorder:gui"
2169 plugins="no" #FIXME
2170 swcodec="yes"
2171 toolset=$genericbitmaptools
2172 boottool="cp"
2173 bootoutput="rockboot.ebn"
2174 # architecture, manufacturer and model for the target-tree build
2175 t_cpu="arm"
2176 t_manufacturer="s5l8700"
2177 t_model="meizu-m6sp"
2180 112|meizum3)
2181 target_id=47
2182 modelname="meizum3"
2183 target="-DMEIZU_M3"
2184 memory=16 # always
2185 arm940tbecc
2186 tool="cp"
2187 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2188 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2189 output="rockbox.meizu"
2190 appextra="recorder:gui"
2191 plugins="no" #FIXME
2192 swcodec="yes"
2193 toolset=$genericbitmaptools
2194 boottool="cp"
2195 bootoutput="rockboot.ebn"
2196 # architecture, manufacturer and model for the target-tree build
2197 t_cpu="arm"
2198 t_manufacturer="s5l8700"
2199 t_model="meizu-m3"
2202 120|ondavx747)
2203 target_id=45
2204 modelname="ondavx747"
2205 target="-DONDA_VX747"
2206 memory=16
2207 mipselcc
2208 tool="$rootdir/tools/scramble -add=x747"
2209 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2210 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2211 output="rockbox.vx747"
2212 appextra="recorder:gui"
2213 plugins="yes"
2214 swcodec="yes"
2215 toolset=$genericbitmaptools
2216 boottool="$rootdir/tools/scramble -ccpmp"
2217 bootoutput="ccpmp.bin"
2218 # architecture, manufacturer and model for the target-tree build
2219 t_cpu="mips"
2220 t_manufacturer="ingenic_jz47xx"
2221 t_model="onda_vx747"
2224 121|ondavx767)
2225 target_id=64
2226 modelname="ondavx767"
2227 target="-DONDA_VX767"
2228 memory=16 #FIXME
2229 mipselcc
2230 tool="cp"
2231 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2232 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2233 output="rockbox.vx767"
2234 appextra="recorder:gui"
2235 plugins="" #FIXME
2236 swcodec="yes"
2237 toolset=$genericbitmaptools
2238 boottool="$rootdir/tools/scramble -ccpmp"
2239 bootoutput="ccpmp.bin"
2240 # architecture, manufacturer and model for the target-tree build
2241 t_cpu="mips"
2242 t_manufacturer="ingenic_jz47xx"
2243 t_model="onda_vx767"
2246 122|ondavx747p)
2247 target_id=54
2248 modelname="ondavx747p"
2249 target="-DONDA_VX747P"
2250 memory=16
2251 mipselcc
2252 tool="$rootdir/tools/scramble -add=747p"
2253 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2254 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2255 output="rockbox.vx747p"
2256 appextra="recorder:gui"
2257 plugins="yes"
2258 swcodec="yes"
2259 toolset=$genericbitmaptools
2260 boottool="$rootdir/tools/scramble -ccpmp"
2261 bootoutput="ccpmp.bin"
2262 # architecture, manufacturer and model for the target-tree build
2263 t_cpu="mips"
2264 t_manufacturer="ingenic_jz47xx"
2265 t_model="onda_vx747"
2268 123|ondavx777)
2269 target_id=61
2270 modelname="ondavx777"
2271 target="-DONDA_VX777"
2272 memory=16
2273 mipselcc
2274 tool="$rootdir/tools/scramble -add=x777"
2275 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2276 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2277 output="rockbox.vx777"
2278 appextra="recorder:gui"
2279 plugins="yes"
2280 swcodec="yes"
2281 toolset=$genericbitmaptools
2282 boottool="$rootdir/tools/scramble -ccpmp"
2283 bootoutput="ccpmp.bin"
2284 # architecture, manufacturer and model for the target-tree build
2285 t_cpu="mips"
2286 t_manufacturer="ingenic_jz47xx"
2287 t_model="onda_vx747"
2290 130|lyre_proto1)
2291 target_id=56
2292 modelname="lyre_proto1"
2293 target="-DLYRE_PROTO1"
2294 memory=64
2295 arm926ejscc
2296 tool="cp"
2297 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2298 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2299 output="rockbox.lyre"
2300 appextra="recorder:gui"
2301 plugins=""
2302 swcodec="yes"
2303 toolset=$scramblebitmaptools
2304 boottool="cp"
2305 bootoutput="bootloader-proto1.lyre"
2306 # architecture, manufacturer and model for the target-tree build
2307 t_cpu="arm"
2308 t_manufacturer="at91sam"
2309 t_model="lyre_proto1"
2312 131|mini2440)
2313 target_id=99
2314 modelname="mini2440"
2315 target="-DMINI2440"
2316 memory=64
2317 arm9tdmicc
2318 tool="$rootdir/tools/scramble -add=m244"
2319 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2320 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2321 output="rockbox.mini2440"
2322 appextra="recorder:gui"
2323 plugins=""
2324 swcodec="yes"
2325 toolset=$scramblebitmaptools
2326 boottool="cp"
2327 bootoutput="bootloader-mini2440.lyre"
2328 # architecture, manufacturer and model for the target-tree build
2329 t_cpu="arm"
2330 t_manufacturer="s3c2440"
2331 t_model="mini2440"
2334 140|yh820)
2335 target_id=57
2336 modelname="yh820"
2337 target="-DSAMSUNG_YH820"
2338 memory=32 # always
2339 arm7tdmicc
2340 tool="$rootdir/tools/scramble -mi4v2 -model=y820 -type=RBOS"
2341 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2342 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2343 output="rockbox.mi4"
2344 appextra="recorder:gui"
2345 plugins="yes"
2346 swcodec="yes"
2347 boottool="$rootdir/tools/scramble -mi4v2 -model=y820 -type=RBBL"
2348 bootoutput="FW_YH820.mi4"
2349 # toolset is the tools within the tools directory that we build for
2350 # this particular target.
2351 toolset=$scramblebitmaptools
2352 # architecture, manufacturer and model for the target-tree build
2353 t_cpu="arm"
2354 t_manufacturer="samsung"
2355 t_model="yh820"
2358 141|yh920)
2359 target_id=58
2360 modelname="yh920"
2361 target="-DSAMSUNG_YH920"
2362 memory=32 # always
2363 arm7tdmicc
2364 tool="$rootdir/tools/scramble -mi4v2 -model=y920 -type=RBOS"
2365 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2366 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
2367 output="rockbox.mi4"
2368 appextra="recorder:gui"
2369 plugins="yes"
2370 swcodec="yes"
2371 boottool="$rootdir/tools/scramble -mi4v2 -model=y920 -type=RBBL"
2372 bootoutput="PP5020.mi4"
2373 # toolset is the tools within the tools directory that we build for
2374 # this particular target.
2375 toolset=$scramblebitmaptools
2376 # architecture, manufacturer and model for the target-tree build
2377 t_cpu="arm"
2378 t_manufacturer="samsung"
2379 t_model="yh920"
2382 142|yh925)
2383 target_id=59
2384 modelname="yh925"
2385 target="-DSAMSUNG_YH925"
2386 memory=32 # always
2387 arm7tdmicc
2388 tool="$rootdir/tools/scramble -mi4v2 -model=y925 -type=RBOS"
2389 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2390 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2391 output="rockbox.mi4"
2392 appextra="recorder:gui"
2393 plugins="yes"
2394 swcodec="yes"
2395 boottool="$rootdir/tools/scramble -mi4v2 -model=y925 -type=RBBL"
2396 bootoutput="FW_YH925.mi4"
2397 # toolset is the tools within the tools directory that we build for
2398 # this particular target.
2399 toolset=$scramblebitmaptools
2400 # architecture, manufacturer and model for the target-tree build
2401 t_cpu="arm"
2402 t_manufacturer="samsung"
2403 t_model="yh925"
2406 143|yps3)
2407 target_id=60
2408 modelname="yps3"
2409 target="-DSAMSUNG_YPS3"
2410 memory=16 # always
2411 arm940tbecc
2412 tool="cp"
2413 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2414 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2415 output="rockbox.yps3"
2416 appextra="recorder:gui"
2417 plugins="no" #FIXME
2418 swcodec="yes"
2419 toolset=$genericbitmaptools
2420 boottool="cp"
2421 bootoutput="rockboot.ebn"
2422 # architecture, manufacturer and model for the target-tree build
2423 t_cpu="arm"
2424 t_manufacturer="s5l8700"
2425 t_model="yps3"
2430 echo "Please select a supported target platform!"
2431 exit 7
2434 esac
2436 echo "Platform set to $modelname"
2439 #remove start
2440 ############################################################################
2441 # Amount of memory, for those that can differ. They have $memory unset at
2442 # this point.
2445 if [ -z "$memory" ]; then
2446 case $target_id in
2448 if [ "$ARG_RAM" ]; then
2449 size=$ARG_RAM
2450 else
2451 echo "Enter size of your RAM (in MB): (Defaults to 32)"
2452 size=`input`;
2454 case $size in
2455 60|64)
2456 memory="64"
2459 memory="32"
2461 esac
2464 if [ "$ARG_RAM" ]; then
2465 size=$ARG_RAM
2466 else
2467 echo "Enter size of your RAM (in MB): (Defaults to 2)"
2468 size=`input`;
2470 case $size in
2472 memory="8"
2475 memory="2"
2477 esac
2479 esac
2480 echo "Memory size selected: $memory MB"
2481 [ "$ARG_TYPE" ] || echo ""
2483 #remove end
2485 ##################################################################
2486 # Figure out build "type"
2489 # the ifp7x0 is the only platform that supports building a gdb stub like
2490 # this
2491 case $modelname in
2492 ifp7xx)
2493 gdbstub="(G)DB stub, "
2495 e200r|e200)
2496 gdbstub="(I)nstaller, "
2498 c200)
2499 gdbstub="(E)raser, "
2503 esac
2504 if [ "$ARG_TYPE" ]; then
2505 btype=$ARG_TYPE
2506 else
2507 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, (C)heckWPS, (D)atabase tool, $gdbstub(M)anual: (Defaults to N)"
2508 btype=`input`;
2511 case $btype in
2512 [Ii])
2513 appsdir='\$(ROOTDIR)/bootloader'
2514 apps="bootloader"
2515 extradefines="-DBOOTLOADER -DE200R_INSTALLER -ffunction-sections -fdata-sections"
2516 bootloader="1"
2517 echo "e200R-installer build selected"
2519 [Ee])
2520 appsdir='\$(ROOTDIR)/bootloader'
2521 apps="bootloader"
2522 echo "C2(4)0 or C2(5)0"
2523 variant=`input`
2524 case $variant in
2526 extradefines="-DBOOTLOADER -DC200_ERASE -DC240_ERASE -ffunction-sections -fdata-sections"
2527 echo "c240 eraser build selected"
2530 extradefines="-DBOOTLOADER -DC200_ERASE -DC250_ERASE -ffunction-sections -fdata-sections"
2531 echo "c240 eraser build selected"
2533 esac
2534 bootloader="1"
2535 echo "c200 eraser build selected"
2537 [Bb])
2538 if test $t_manufacturer = "archos"; then
2539 # Archos SH-based players do this somewhat differently for
2540 # some reason
2541 appsdir='\$(ROOTDIR)/flash/bootbox'
2542 apps="bootbox"
2543 else
2544 appsdir='\$(ROOTDIR)/bootloader'
2545 apps="bootloader"
2546 flash=""
2547 if test -n "$boottool"; then
2548 tool="$boottool"
2550 if test -n "$bootoutput"; then
2551 output=$bootoutput
2554 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
2555 bootloader="1"
2556 echo "Bootloader build selected"
2558 [Ss])
2559 debug="-DDEBUG"
2560 simulator="yes"
2561 extradefines="-DSIMULATOR"
2562 archosrom=""
2563 flash=""
2564 echo "Simulator build selected"
2566 [Aa]*)
2567 echo "Advanced build selected"
2568 whichadvanced $btype
2570 [Gg])
2571 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
2572 appsdir='\$(ROOTDIR)/gdb'
2573 apps="stub"
2574 case $modelname in
2575 ifp7xx)
2576 output="stub.wma"
2580 esac
2581 echo "GDB stub build selected"
2583 [Mm])
2584 toolset='';
2585 apps="manual"
2586 echo "Manual build selected"
2588 [Cc])
2589 uname=`uname`
2590 simcc "checkwps"
2591 toolset='';
2592 t_cpu='';
2593 GCCOPTS='';
2594 appsdir='\$(ROOTDIR)/tools/checkwps';
2595 output='checkwps.'${modelname};
2596 archosrom='';
2597 echo "CheckWPS build selected"
2599 [Dd])
2600 uname=`uname`
2601 simcc "database"
2602 toolset='';
2603 t_cpu='';
2604 GCCOPTS='';
2605 appsdir='\$(ROOTDIR)/tools/database';
2606 output='database.'${modelname};
2607 archosrom='';
2608 echo "Database tool build selected"
2611 if [ "$modelname" = "e200r" ]; then
2612 echo "Do not use the e200R target for regular builds. Use e200 instead."
2613 exit 8
2615 debug=""
2616 btype="N" # set it explicitly since RET only gets here as well
2617 echo "Normal build selected"
2620 esac
2621 # to be able running "make manual" from non-manual configuration
2622 case $modelname in
2623 fmrecorder)
2624 manualdev="recorderv2fm"
2626 recorderv2)
2627 manualdev="recorderv2fm"
2629 h1??)
2630 manualdev="h100"
2632 ipodmini2g)
2633 manualdev="ipodmini"
2636 manualdev=$modelname
2638 esac
2640 if [ -z "$debug" ]; then
2641 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
2644 echo "Using source code root directory: $rootdir"
2646 # this was once possible to change at build-time, but no more:
2647 language="english"
2649 uname=`uname`
2651 if [ "yes" = "$simulator" ]; then
2652 # setup compiler and things for simulator
2653 simcc "sdl"
2655 if [ -d "simdisk" ]; then
2656 echo "Subdirectory 'simdisk' already present"
2657 else
2658 mkdir simdisk
2659 echo "Created a 'simdisk' subdirectory for simulating the hard disk"
2663 # Now, figure out version number of the (gcc) compiler we are about to use
2664 gccver=`$CC -dumpversion`;
2666 # figure out the binutil version too and display it, mostly for the build
2667 # system etc to be able to see it easier
2668 if [ $uname = "Darwin" ]; then
2669 ldver=`$LD -v 2>&1 | sed -e 's/[^0-9.-]//g'`
2670 else
2671 ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
2674 if [ -z "$gccver" ]; then
2675 echo "[WARNING] The compiler you must use ($CC) is not in your path!"
2676 echo "[WARNING] this may cause your build to fail since we cannot do the"
2677 echo "[WARNING] checks we want now."
2678 else
2680 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
2681 # DEPEND on it
2683 num1=`echo $gccver | cut -d . -f1`
2684 num2=`echo $gccver | cut -d . -f2`
2685 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
2687 # This makes:
2688 # 3.3.X => 303
2689 # 3.4.X => 304
2690 # 2.95.3 => 295
2692 echo "Using $CC $gccver ($gccnum)"
2694 if test "$gccnum" -ge "400"; then
2695 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
2696 # so we ignore that warnings for now
2697 # -Wno-pointer-sign
2698 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
2701 if test "$gccnum" -ge "401"; then
2702 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
2703 # will break strict-aliasing rules"
2705 GCCOPTS="$GCCOPTS -fno-strict-aliasing"
2708 if test "$gccnum" -ge "402"; then
2709 # disable warning about "warning: initialized field overwritten" as gcc 4.2
2710 # and later would throw it for several valid cases
2711 GCCOPTS="$GCCOPTS -Wno-override-init"
2714 case $prefix in
2716 # simulator
2718 i586-mingw32msvc-)
2719 # cross-compile for win32
2722 # Verify that the cross-compiler is of a recommended version!
2723 if test "$gccver" != "$gccchoice"; then
2724 echo "WARNING: Your cross-compiler $CC $gccver is not of the recommended"
2725 echo "WARNING: version $gccchoice!"
2726 echo "WARNING: This may cause your build to fail since it may be a version"
2727 echo "WARNING: that isn't functional or known to not be the best choice."
2728 echo "WARNING: If you suffer from build problems, you know that this is"
2729 echo "WARNING: a likely source for them..."
2732 esac
2737 echo "Using $LD $ldver"
2739 # check the compiler for SH platforms
2740 if test "$CC" = "sh-elf-gcc"; then
2741 if test "$gccnum" -lt "400"; then
2742 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
2743 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2744 else
2745 # figure out patch status
2746 gccpatch=`$CC --version`;
2748 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
2749 echo "gcc $gccver is rockbox patched"
2750 # then convert -O to -Os to get smaller binaries!
2751 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2752 else
2753 echo "WARNING: You use an unpatched gcc compiler: $gccver"
2754 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2759 if test "$CC" = "m68k-elf-gcc"; then
2760 # convert -O to -Os to get smaller binaries!
2761 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2764 if [ "$ARG_CCACHE" = "1" ]; then
2765 echo "Enable ccache for building"
2766 ccache="ccache"
2767 elif [ "$ARG_CCACHE" != "0" ]; then
2768 ccache=`findtool ccache`
2769 if test -n "$ccache"; then
2770 echo "Found and uses ccache ($ccache)"
2774 # figure out the full path to the various commands if possible
2775 HOSTCC=`findtool gcc --lit`
2776 HOSTAR=`findtool ar --lit`
2777 CC=`findtool ${CC} --lit`
2778 LD=`findtool ${AR} --lit`
2779 AR=`findtool ${AR} --lit`
2780 AS=`findtool ${AS} --lit`
2781 OC=`findtool ${OC} --lit`
2782 WINDRES=`findtool ${WINDRES} --lit`
2783 DLLTOOL=`findtool ${DLLTOOL} --lit`
2784 DLLWRAP=`findtool ${DLLWRAP} --lit`
2785 RANLIB=`findtool ${RANLIB} --lit`
2787 if test -n "$ccache"; then
2788 CC="$ccache $CC"
2791 if test "X$endian" = "Xbig"; then
2792 defendian="ROCKBOX_BIG_ENDIAN"
2793 else
2794 defendian="ROCKBOX_LITTLE_ENDIAN"
2797 if [ "$ARG_RBDIR" ]; then
2798 rbdir=$ARG_RBDIR
2799 echo "Using alternate rockbox dir: ${rbdir}"
2802 sed > autoconf.h \
2803 -e "s,@ENDIAN@,${defendian},g" \
2804 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
2805 -e "s,@config_rtc@,$config_rtc,g" \
2806 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
2807 -e "s,@RBDIR@,${rbdir},g" \
2808 -e "s,@have_backlight@,$have_backlight,g" \
2809 -e "s,@have_fmradio_in@,$have_fmradio_in,g" \
2810 -e "s,@have_ata_poweroff@,$have_ata_poweroff,g" \
2811 <<EOF
2812 /* This header was made by configure */
2813 #ifndef __BUILD_AUTOCONF_H
2814 #define __BUILD_AUTOCONF_H
2816 /* Define endianess for the target or simulator platform */
2817 #define @ENDIAN@ 1
2819 /* Define this if you build rockbox to support the logf logging and display */
2820 #undef ROCKBOX_HAS_LOGF
2822 /* optional define for a backlight modded Ondio */
2823 @have_backlight@
2825 /* optional define for FM radio mod for iAudio M5 */
2826 @have_fmradio_in@
2828 /* optional define for ATA poweroff on Player */
2829 @have_ata_poweroff@
2831 /* optional defines for RTC mod for h1x0 */
2832 @config_rtc@
2833 @have_rtc_alarm@
2835 /* root of Rockbox */
2836 #define ROCKBOX_DIR "/@RBDIR@"
2838 #endif /* __BUILD_AUTOCONF_H */
2841 if test -n "$t_cpu"; then
2842 TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
2843 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
2844 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
2845 GCCOPTS="$GCCOPTS"
2848 if test "$simulator" = "yes"; then
2849 # add simul make stuff on the #SIMUL# line
2850 simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
2851 simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
2852 else
2853 # delete the lines that match
2854 simmagic1='/@SIMUL1@/D'
2855 simmagic2='/@SIMUL2@/D'
2858 if test "$swcodec" = "yes"; then
2859 voicetoolset="rbspeexenc voicefont wavtrim"
2860 else
2861 voicetoolset="voicefont wavtrim"
2864 if test "$apps" = "apps"; then
2865 # only when we build "real" apps we build the .lng files
2866 buildlangs="langs"
2869 #### Fix the cmdline ###
2870 if test -n "$ccache"; then
2871 cmdline="--ccache "
2874 cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts"
2875 ### end of cmdline
2877 sed > Makefile \
2878 -e "s,@ROOTDIR@,${rootdir},g" \
2879 -e "s,@DEBUG@,${debug},g" \
2880 -e "s,@MEMORY@,${memory},g" \
2881 -e "s,@TARGET_ID@,${target_id},g" \
2882 -e "s,@TARGET@,${target},g" \
2883 -e "s,@CPU@,${t_cpu},g" \
2884 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
2885 -e "s,@MODELNAME@,${modelname},g" \
2886 -e "s,@LANGUAGE@,${language},g" \
2887 -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
2888 -e "s,@PWD@,${pwd},g" \
2889 -e "s,@HOSTCC@,${HOSTCC},g" \
2890 -e "s,@HOSTAR@,${HOSTAR},g" \
2891 -e "s,@CC@,${CC},g" \
2892 -e "s,@LD@,${LD},g" \
2893 -e "s,@AR@,${AR},g" \
2894 -e "s,@AS@,${AS},g" \
2895 -e "s,@OC@,${OC},g" \
2896 -e "s,@WINDRES@,${WINDRES},g" \
2897 -e "s,@DLLTOOL@,${DLLTOOL},g" \
2898 -e "s,@DLLWRAP@,${DLLWRAP},g" \
2899 -e "s,@RANLIB@,${RANLIB},g" \
2900 -e "s,@TOOL@,${tool},g" \
2901 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
2902 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
2903 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
2904 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
2905 -e "s,@OUTPUT@,${output},g" \
2906 -e "s,@APPEXTRA@,${appextra},g" \
2907 -e "s,@ARCHOSROM@,${archosrom},g" \
2908 -e "s,@FLASHFILE@,${flash},g" \
2909 -e "s,@PLUGINS@,${plugins},g" \
2910 -e "s,@CODECS@,${swcodec},g" \
2911 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
2912 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
2913 -e "s,@GCCOPTS@,${GCCOPTS},g" \
2914 -e "s,@TARGET_INC@,${TARGET_INC},g" \
2915 -e "s!@LDOPTS@!${LDOPTS}!g" \
2916 -e "s,@LOADADDRESS@,${loadaddress},g" \
2917 -e "s,@EXTRADEF@,${extradefines},g" \
2918 -e "s,@APPSDIR@,${appsdir},g" \
2919 -e "s,@FIRMDIR@,${firmdir},g" \
2920 -e "s,@TOOLSDIR@,${toolsdir},g" \
2921 -e "s,@APPS@,${apps},g" \
2922 -e "s,@SIMVER@,${simver},g" \
2923 -e "s,@GCCVER@,${gccver},g" \
2924 -e "s,@GCCNUM@,${gccnum},g" \
2925 -e "s,@UNAME@,${uname},g" \
2926 -e "s,@ENDIAN@,${defendian},g" \
2927 -e "s,@TOOLSET@,${toolset},g" \
2928 -e "${simmagic1}" \
2929 -e "${simmagic2}" \
2930 -e "s,@MANUALDEV@,${manualdev},g" \
2931 -e "s,@ENCODER@,${ENC_CMD},g" \
2932 -e "s,@ENC_OPTS@,${ENC_OPTS},g" \
2933 -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
2934 -e "s,@TTS_OPTS@,${TTS_OPTS},g" \
2935 -e "s,@VOICETOOLSET@,${voicetoolset},g" \
2936 -e "s,@LANGS@,${buildlangs},g" \
2937 -e "s,@USE_ELF@,${USE_ELF},g" \
2938 -e "s,@RBDIR@,${rbdir},g" \
2939 -e "s,@PREFIX@,$PREFIX,g" \
2940 -e "s,@CMDLINE@,$cmdline,g" \
2941 <<EOF
2942 ## Automatically generated. http://www.rockbox.org/
2944 export ROOTDIR=@ROOTDIR@
2945 export FIRMDIR=@FIRMDIR@
2946 export APPSDIR=@APPSDIR@
2947 export TOOLSDIR=@TOOLSDIR@
2948 export DOCSDIR=\$(ROOTDIR)/docs
2949 export MANUALDIR=\${ROOTDIR}/manual
2950 export DEBUG=@DEBUG@
2951 export MODELNAME=@MODELNAME@
2952 export ARCHOSROM=@ARCHOSROM@
2953 export FLASHFILE=@FLASHFILE@
2954 export TARGET_ID=@TARGET_ID@
2955 export TARGET=@TARGET@
2956 export CPU=@CPU@
2957 export MANUFACTURER=@MANUFACTURER@
2958 export OBJDIR=@PWD@
2959 export BUILDDIR=@PWD@
2960 export LANGUAGE=@LANGUAGE@
2961 export VOICELANGUAGE=@VOICELANGUAGE@
2962 export MEMORYSIZE=@MEMORY@
2963 export VERSION:=\$(shell \$(ROOTDIR)/tools/version.sh \$(ROOTDIR))
2964 export BUILDDATE:=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
2965 export MKFIRMWARE=@TOOL@
2966 export BMP2RB_MONO=@BMP2RB_MONO@
2967 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
2968 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
2969 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
2970 export BINARY=@OUTPUT@
2971 export APPEXTRA=@APPEXTRA@
2972 export ENABLEDPLUGINS=@PLUGINS@
2973 export SOFTWARECODECS=@CODECS@
2974 export EXTRA_DEFINES=@EXTRADEF@
2975 export HOSTCC=@HOSTCC@
2976 export HOSTAR=@HOSTAR@
2977 export CC=@CC@
2978 export LD=@LD@
2979 export AR=@AR@
2980 export AS=@AS@
2981 export OC=@OC@
2982 export WINDRES=@WINDRES@
2983 export DLLTOOL=@DLLTOOL@
2984 export DLLWRAP=@DLLWRAP@
2985 export RANLIB=@RANLIB@
2986 export PREFIX=@PREFIX@
2987 export PROFILE_OPTS=@PROFILE_OPTS@
2988 export SIMVER=@SIMVER@
2989 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
2990 export GCCOPTS=@GCCOPTS@
2991 export TARGET_INC=@TARGET_INC@
2992 export LOADADDRESS=@LOADADDRESS@
2993 export SHARED_FLAG=@SHARED_FLAG@
2994 export LDOPTS=@LDOPTS@
2995 export GCCVER=@GCCVER@
2996 export GCCNUM=@GCCNUM@
2997 export UNAME=@UNAME@
2998 export MANUALDEV=@MANUALDEV@
2999 export TTS_OPTS=@TTS_OPTS@
3000 export TTS_ENGINE=@TTS_ENGINE@
3001 export ENC_OPTS=@ENC_OPTS@
3002 export ENCODER=@ENCODER@
3003 export USE_ELF=@USE_ELF@
3004 export RBDIR=@RBDIR@
3006 CONFIGURE_OPTIONS=@CMDLINE@
3008 include \$(TOOLSDIR)/root.make
3012 echo "Created Makefile"