Add myself to docs/COMMITTERS
[kugel-rb.git] / tools / configure
blobac21e0e023d2cbd494c1fce58f83723a8a0e76dd
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 crosswincc () {
42 # naive approach to selecting a mingw cross-compiler on linux/*nix
43 echo "Enabling win32 crosscompiling"
45 sdl=`findtool sdl-config`
46 sdl_cflags=""
47 sdl_libs=""
48 prefixtools i586-mingw32msvc-
49 if [ $1 = "sdl" -a -n "$sdl" ]; then
50 sdl_cflags="`sdl-config --cflags`"
51 sdl_libs="`sdl-config --libs`"
53 # add cross-compiler option(s)
54 GCCOPTS="$GCCOPTS $sdl_cflags"
55 LDOPTS="-mconsole $sdl_libs"
57 output="rockboxui.exe" # use this as output binary name
58 crosscompile="yes"
59 endian="little" # windows is little endian
62 # scan the $PATH for the given command
63 findtool(){
64 file="$1"
66 IFS=":"
67 for path in $PATH
69 # echo "checks for $file in $path" >&2
70 if test -f "$path/$file"; then
71 echo "$path/$file"
72 return
74 done
75 # check whether caller wants literal return value if not found
76 if [ "$2" = "--lit" ]; then
77 echo "$file"
81 simcc () {
83 # default tool setup for native building
84 prefixtools ""
86 simver=sdl
87 GCCOPTS='-W -Wall -g -fno-builtin'
89 output="rockboxui" # use this as default output binary name
90 sdl=`findtool sdl-config`
91 sdl_cflags=""
92 sdl_libs=""
94 if [ $1 = "sdl" ]; then
95 if [ -z "$sdl" ]; then
96 echo "configure didn't find sdl-config, which indicates that you"
97 echo "don't have SDL (properly) installed. Please correct and"
98 echo "re-run configure!"
99 exit 1
100 else
101 # generic sdl-config checker
102 sdl_cflags=`sdl-config --cflags`
103 sdl_libs=`sdl-config --libs`
107 # default share option, override below if needed
108 SHARED_FLAG="-shared"
110 case $uname in
111 CYGWIN*)
112 echo "Cygwin host detected"
114 # sdl version
115 GCCOPTS="$GCCOPTS $sdl_cflags"
116 LDOPTS="-mconsole $sdl_libs"
118 output="rockboxui.exe" # use this as output binary name
121 MINGW*)
122 echo "MinGW host detected"
124 # sdl version
125 GCCOPTS="$GCCOPTS $sdl_cflags"
126 LDOPTS="-mconsole $sdl_libs"
128 output="rockboxui.exe" # use this as output binary name
131 Linux)
132 echo "Linux host detected"
133 GCCOPTS="$GCCOPTS $sdl_cflags"
134 LDOPTS="$sdl_libs"
135 # cannot crosscompile without SDL installed
136 if [ -n "$sdl" ]; then
137 if [ "0" != `sdl-config --libs |grep -c mwindows` ]; then
138 # Enable crosscompiling if sdl-config is from Windows SDL
139 # overrides GCCOPTS and LDOPTS
140 crosswincc $1
145 FreeBSD)
146 echo "FreeBSD host detected"
147 # sdl version
148 GCCOPTS="$GCCOPTS $sdl_cflags"
149 LDOPTS="$sdl_libs"
152 Darwin)
153 echo "Darwin host detected"
154 # sdl version
155 GCCOPTS="$GCCOPTS $sdl_cflags"
156 LDOPTS="$sdl_libs"
157 SHARED_FLAG="-dynamiclib -Wl\,-single_module"
161 echo "[ERROR] Unsupported system: $uname, fix configure and retry"
162 exit 2
164 esac
166 GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
168 if test "X$crosscompile" != "Xyes"; then
169 if [ "`uname -m`" = "x86_64" ] || [ "`uname -m`" = "amd64" ]; then
170 # fPIC is needed to make shared objects link
171 # setting visibility to hidden is necessary to avoid strange crashes
172 # due to symbol clashing
173 GCCOPTS="$GCCOPTS -fPIC -fvisibility=hidden"
176 id=$$
177 cat >$tmpdir/conftest-$id.c <<EOF
178 #include <stdio.h>
179 int main(int argc, char **argv)
181 int var=0;
182 char *varp = (char *)&var;
183 *varp=1;
185 printf("%d\n", var);
186 return 0;
190 $CC -o $tmpdir/conftest-$id $tmpdir/conftest-$id.c 2>/dev/null
192 if test `$tmpdir/conftest-$id 2>/dev/null` -gt "1"; then
193 # big endian
194 endian="big"
195 else
196 # little endian
197 endian="little"
200 if [ $1 = "sdl" ]; then
201 echo "Simulator environment deemed $endian endian"
202 elif [ $1 = "checkwps" ]; then
203 echo "CheckWPS environment deemed $endian endian"
206 # use wildcard here to make it work even if it was named *.exe like
207 # on cygwin
208 rm -f $tmpdir/conftest-$id*
213 # functions for setting up cross-compiler names and options
214 # also set endianess and what the exact recommended gcc version is
215 # the gcc version should most likely match what versions we build with
216 # rockboxdev.sh
218 shcc () {
219 prefixtools sh-elf-
220 GCCOPTS="$CCOPTS -m1"
221 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
222 endian="big"
223 gccchoice="4.0.3"
226 calmrisccc () {
227 prefixtools calmrisc16-unknown-elf-
228 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
229 GCCOPTIMIZE="-fomit-frame-pointer"
230 endian="big"
233 coldfirecc () {
234 prefixtools m68k-elf-
235 GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
236 GCCOPTIMIZE="-fomit-frame-pointer"
237 endian="big"
238 gccchoice="3.4.6"
241 arm7tdmicc () {
242 prefixtools arm-elf-
243 GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
244 if test "X$1" != "Xshort"; then
245 GCCOPTS="$GCCOPTS -mlong-calls"
247 GCCOPTIMIZE="-fomit-frame-pointer"
248 endian="little"
249 gccchoice="4.0.3"
252 arm9tdmicc () {
253 prefixtools arm-elf-
254 GCCOPTS="$CCOPTS -mcpu=arm9tdmi"
255 if test "$modelname" != "gigabeatf" -a "$t_manufacturer" != "as3525"; then
256 GCCOPTS="$GCCOPTS -mlong-calls"
258 GCCOPTIMIZE="-fomit-frame-pointer"
259 endian="little"
260 gccchoice="4.0.3"
263 arm940tbecc () {
264 prefixtools arm-elf-
265 GCCOPTS="$CCOPTS -mbig-endian -mcpu=arm940t -mlong-calls"
266 GCCOPTIMIZE="-fomit-frame-pointer"
267 endian="big"
268 gccchoice="4.0.3"
271 arm940tcc () {
272 prefixtools arm-elf-
273 GCCOPTS="$CCOPTS -mcpu=arm940t -mlong-calls"
274 GCCOPTIMIZE="-fomit-frame-pointer"
275 endian="little"
276 gccchoice="4.0.3"
279 arm946cc () {
280 prefixtools arm-elf-
281 GCCOPTS="$CCOPTS -mcpu=arm9e -mlong-calls"
282 GCCOPTIMIZE="-fomit-frame-pointer"
283 endian="little"
284 gccchoice="4.0.3"
287 arm926ejscc () {
288 prefixtools arm-elf-
289 GCCOPTS="$CCOPTS -mcpu=arm926ej-s -mlong-calls"
290 GCCOPTIMIZE="-fomit-frame-pointer"
291 endian="little"
292 gccchoice="4.0.3"
295 arm1136jfscc () {
296 prefixtools arm-elf-
297 GCCOPTS="$CCOPTS -mcpu=arm1136jf-s"
298 if test "$modelname" != "gigabeats"; then
299 GCCOPTS="$GCCOPTS -mlong-calls"
301 GCCOPTIMIZE="-fomit-frame-pointer"
302 endian="little"
303 gccchoice="4.0.3"
306 arm1176jzscc () {
307 prefixtools arm-elf-
308 GCCOPTS="$CCOPTS -mcpu=arm1176jz-s -mlong-calls"
309 GCCOPTIMIZE="-fomit-frame-pointer"
310 endian="little"
311 gccchoice="4.0.3"
314 mipselcc () {
315 prefixtools mipsel-elf-
316 GCCOPTS="$CCOPTS -march=mips32 -mtune=r4600 -mno-mips16 -mno-long-calls"
317 GCCOPTS="$GCCOPTS -ffunction-sections -msoft-float -G 0 -Wno-parentheses"
318 GCCOPTIMIZE="-fomit-frame-pointer"
319 endian="little"
320 gccchoice="4.1.2"
323 whichadvanced () {
324 atype=`echo "$1" | cut -c 2-`
325 ##################################################################
326 # Prompt for specific developer options
328 if [ "$atype" ]; then
329 interact=
330 else
331 interact=1
332 echo ""
333 echo "Enter your developer options (press enter when done)"
334 printf "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice"
335 if [ "$memory" = "2" ]; then
336 printf ", (8)MB MOD"
338 if [ "$modelname" = "player" ]; then
339 printf ", Use (A)TA poweroff"
341 if [ "$t_model" = "ondio" ]; then
342 printf ", (B)acklight MOD"
344 if [ "$modelname" = "m5" ]; then
345 printf ", (F)M radio MOD"
347 if [ "$modelname" = "h120" ]; then
348 printf ", (R)TC MOD"
350 echo ""
353 cont=1
354 while [ $cont = "1" ]; do
356 if [ "$interact" ]; then
357 option=`input`
358 else
359 option=`echo "$atype" | cut -c 1`
362 case $option in
363 [Dd])
364 if [ "yes" = "$profile" ]; then
365 echo "Debug is incompatible with profiling"
366 else
367 echo "DEBUG build enabled"
368 use_debug="yes"
371 [Ll])
372 echo "logf() support enabled"
373 logf="yes"
375 [Ss])
376 echo "Simulator build enabled"
377 simulator="yes"
379 [Pp])
380 if [ "yes" = "$use_debug" ]; then
381 echo "Profiling is incompatible with debug"
382 else
383 echo "Profiling support is enabled"
384 profile="yes"
387 [Vv])
388 echo "Voice build selected"
389 voice="yes"
392 if [ "$memory" = "2" ]; then
393 memory="8"
394 echo "Memory size selected: 8MB"
397 [Aa])
398 if [ "$modelname" = "player" ]; then
399 have_ata_poweroff="#define HAVE_ATA_POWEROFF"
400 echo "ATA poweroff enabled"
403 [Bb])
404 if [ "$t_model" = "ondio" ]; then
405 have_backlight="#define HAVE_BACKLIGHT"
406 echo "Backlight functions enabled"
409 [Ff])
410 if [ "$modelname" = "m5" ]; then
411 have_fmradio_in="#define HAVE_FMRADIO_IN"
412 echo "FM radio functions enabled"
415 [Rr])
416 if [ "$modelname" = "h120" ]; then
417 config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231"
418 have_rtc_alarm="#define HAVE_RTC_ALARM"
419 echo "RTC functions enabled (DS1339/DS3231)"
423 if [ "$interact" ]; then
424 cont=0
425 else
426 echo "[ERROR] Option $option unsupported"
429 esac
430 if [ ! "$interact" ]; then
431 atype=`echo "$atype" | cut -c 2-`
432 [ "$atype" ] || cont=0
434 done
435 echo "done"
437 if [ "yes" = "$voice" ]; then
438 # Ask about languages to build
439 picklang
440 voicelanguage=`whichlang`
441 echo "Voice language set to $voicelanguage"
443 # Configure encoder and TTS engine for each language
444 for thislang in `echo $voicelanguage | sed 's/,/ /g'`; do
445 voiceconfig "$thislang"
446 done
448 if [ "yes" = "$use_debug" ]; then
449 debug="-DDEBUG"
450 GCCOPTS="$GCCOPTS -g -DDEBUG"
452 if [ "yes" = "$logf" ]; then
453 use_logf="#define ROCKBOX_HAS_LOGF 1"
455 if [ "yes" = "$simulator" ]; then
456 debug="-DDEBUG"
457 extradefines="$extradefines -DSIMULATOR"
458 archosrom=""
459 flash=""
461 if [ "yes" = "$profile" ]; then
462 extradefines="$extradefines -DRB_PROFILE"
463 PROFILE_OPTS="-finstrument-functions"
467 # Configure voice settings
468 voiceconfig () {
469 thislang=$1
470 if [ ! "$ARG_TTS" ]; then
471 echo "Building $thislang voice for $modelname. Select options"
472 echo ""
475 if [ -n "`findtool flite`" ]; then
476 FLITE="F(l)ite "
477 FLITE_OPTS=""
478 DEFAULT_TTS="flite"
479 DEFAULT_TTS_OPTS=$FLITE_OPTS
480 DEFAULT_NOISEFLOOR="500"
481 DEFAULT_CHOICE="L"
483 if [ -n "`findtool espeak`" ]; then
484 ESPEAK="(e)Speak "
485 ESPEAK_OPTS=""
486 DEFAULT_TTS="espeak"
487 DEFAULT_TTS_OPTS=$ESPEAK_OPTS
488 DEFAULT_NOISEFLOOR="500"
489 DEFAULT_CHOICE="e"
491 if [ -n "`findtool festival`" ]; then
492 FESTIVAL="(F)estival "
493 case "$thislang" in
494 "italiano")
495 FESTIVAL_OPTS="--language italian"
497 "espanol")
498 FESTIVAL_OPTS="--language spanish"
500 "finnish")
501 FESTIVAL_OPTS="--language finnish"
503 "czech")
504 FESTIVAL_OPTS="--language czech"
507 FESTIVAL_OPTS=""
509 esac
510 DEFAULT_TTS="festival"
511 DEFAULT_TTS_OPTS=$FESTIVAL_OPTS
512 DEFAULT_NOISEFLOOR="500"
513 DEFAULT_CHOICE="F"
515 if [ -n "`findtool swift`" ]; then
516 SWIFT="S(w)ift "
517 SWIFT_OPTS=""
518 DEFAULT_TTS="swift"
519 DEFAULT_TTS_OPTS=$SWIFT_OPTS
520 DEFAULT_NOISEFLOOR="500"
521 DEFAULT_CHOICE="w"
523 # Allow SAPI if Windows is in use
524 if [ -n "`findtool winver`" ]; then
525 SAPI="(S)API "
526 SAPI_OPTS=""
527 DEFAULT_TTS="sapi"
528 DEFAULT_TTS_OPTS=$SAPI_OPTS
529 DEFAULT_NOISEFLOOR="500"
530 DEFAULT_CHOICE="S"
533 if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ] && [ "$ESPEAK" = "$SAPI" ] && [ "$SAPI" = "$SWIFT" ]; then
534 echo "You need Festival, eSpeak or Flite in your path, or SAPI available to build voice files"
535 exit 3
538 if [ "$ARG_TTS" ]; then
539 option=$ARG_TTS
540 else
541 echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?"
542 option=`input`
544 advopts="$advopts --tts=$option"
545 case "$option" in
546 [Ll])
547 TTS_ENGINE="flite"
548 NOISEFLOOR="500" # TODO: check this value
549 TTS_OPTS=$FLITE_OPTS
551 [Ee])
552 TTS_ENGINE="espeak"
553 NOISEFLOOR="500"
554 TTS_OPTS=$ESPEAK_OPTS
556 [Ff])
557 TTS_ENGINE="festival"
558 NOISEFLOOR="500"
559 TTS_OPTS=$FESTIVAL_OPTS
561 [Ss])
562 TTS_ENGINE="sapi"
563 NOISEFLOOR="500"
564 TTS_OPTS=$SAPI_OPTS
566 [Ww])
567 TTS_ENGINE="swift"
568 NOISEFLOOR="500"
569 TTS_OPTS=$SWIFT_OPTS
572 TTS_ENGINE=$DEFAULT_TTS
573 TTS_OPTS=$DEFAULT_TTS_OPTS
574 NOISEFLOOR=$DEFAULT_NOISEFLOOR
575 esac
576 echo "Using $TTS_ENGINE for TTS"
578 # Select which voice to use for Festival
579 if [ "$TTS_ENGINE" = "festival" ]; then
580 voicelist=`echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1/'|sort`
581 for voice in $voicelist; do
582 TTS_FESTIVAL_VOICE="$voice" # Default choice
583 break
584 done
585 if [ "$ARG_VOICE" ]; then
586 CHOICE=$ARG_VOICE
587 else
589 for voice in $voicelist; do
590 printf "%3d. %s\n" "$i" "$voice"
591 i=`expr $i + 1`
592 done
593 printf "Please select which Festival voice to use (default is $TTS_FESTIVAL_VOICE): "
594 CHOICE=`input`
597 for voice in $voicelist; do
598 if [ "$i" = "$CHOICE" -o "$voice" = "$CHOICE" ]; then
599 TTS_FESTIVAL_VOICE="$voice"
601 i=`expr $i + 1`
602 done
603 advopts="$advopts --voice=$CHOICE"
604 echo "Festival voice set to $TTS_FESTIVAL_VOICE"
605 echo "(voice_$TTS_FESTIVAL_VOICE)" > festival-prolog.scm
608 # Allow the user to input manual commandline options
609 if [ "$ARG_TTSOPTS" ]; then
610 USER_TTS_OPTS=$ARG_TTSOPTS
611 else
612 printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): "
613 USER_TTS_OPTS=`input`
614 echo ""
616 advopts="$advopts --ttsopts='$USER_TTS_OPTS'"
617 if [ -n "$USER_TTS_OPTS" ]; then
618 TTS_OPTS="$USER_TTS_OPTS"
620 echo "$TTS_ENGINE options set to $TTS_OPTS"
622 if [ "$swcodec" = "yes" ]; then
623 ENCODER="rbspeexenc"
624 ENC_CMD="rbspeexenc"
625 ENC_OPTS="-q 4 -c 10"
626 else
627 if [ -n "`findtool lame`" ]; then
628 ENCODER="lame"
629 ENC_CMD="lame"
630 ENC_OPTS="--resample 12 -t -m m -h -V 9.999 -S -B 64 --vbr-new"
631 else
632 echo "You need LAME in the system path to build voice files for"
633 echo "HWCODEC targets."
634 exit 4
638 echo "Using $ENCODER for encoding voice clips"
640 # Allow the user to input manual commandline options
641 if [ "$ARG_ENCOPTS" ]; then
642 USER_ENC_OPTS=$ARG_ENCOPTS
643 else
644 printf "Enter $ENCODER options (enter for defaults \"$ENC_OPTS\"): "
645 USER_ENC_OPTS=`input`
647 advopts="$advopts --encopts='$USER_ENC_OPTS'"
648 if [ -n "$USER_ENC_OPTS" ]; then
649 ENC_OPTS=$USER_ENC_OPTS
651 echo "$ENCODER options set to $ENC_OPTS"
653 TEMPDIR="${pwd}"
654 if [ -n "`findtool cygpath`" ]; then
655 TEMPDIR=`cygpath . -a -w`
659 picklang() {
660 # figure out which languages that are around
661 for file in $rootdir/apps/lang/*.lang; do
662 clean=`basename $file .lang`
663 langs="$langs $clean"
664 done
666 if [ "$ARG_LANG" ]; then
667 pick=$ARG_LANG
668 else
669 echo "Select a number for the language to use (default is english)"
670 # FIXME The multiple-language feature is currently broken
671 # echo "You may enter a comma-separated list of languages to build"
673 num=1
674 for one in $langs; do
675 echo "$num. $one"
676 num=`expr $num + 1`
677 done
678 pick=`input`
680 advopts="$advopts --language=$pick"
683 whichlang() {
684 output=""
685 # Allow the user to pass a comma-separated list of langauges
686 for thispick in `echo $pick | sed 's/,/ /g'`; do
687 num=1
688 for one in $langs; do
689 # Accept both the language number and name
690 if [ "$num" = "$thispick" ] || [ "$thispick" = "$one" ]; then
691 if [ "$output" = "" ]; then
692 output=$one
693 else
694 output=$output,$one
697 num=`expr $num + 1`
698 done
699 done
700 if [ -z "$output" ]; then
701 # pick a default
702 output="english"
704 echo $output
707 help() {
708 echo "Rockbox configure script."
709 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
710 echo "Do *NOT* run this within the tools directory!"
711 echo ""
712 cat <<EOF
713 Usage: configure [OPTION]...
714 Options:
715 --target=TARGET Sets the target, TARGET can be either the target ID or
716 corresponding string. Run without this option to see all
717 available targets.
719 --ram=RAM Sets the RAM for certain targets. Even though any number
720 is accepted, not every number is correct. The default
721 value will be applied, if you entered a wrong number
722 (which depends on the target). Watch the output. Run
723 without this option if you are not sure which the right
724 number is.
726 --type=TYPE Sets the build type. Shortcuts are also valid.
727 Run without this option to see all available types.
728 Multiple values are allowed and managed in the input
729 order. So --type=b stands for Bootloader build, while
730 --type=ab stands for "Backlight MOD" build.
732 --language=LANG Set the language used for voice generation (used only if
733 TYPE is AV).
735 --tts=ENGINE Set the TTS engine used for voice generation (used only
736 if TYPE is AV).
738 --voice=VOICE Set voice to use with selected TTS (used only if TYPE is
739 AV).
741 --ttsopts=OPTS Set TTS engine manual options (used only if TYPE is AV).
743 --encopts=OPTS Set encoder manual options (used only if ATYPE is AV).
745 --rbdir=dir Use alternative rockbox directory (default: ${rbdir}).
746 This is useful for having multiple alternate builds on
747 your device that you can load with ROLO. However as the
748 bootloader looks for .rockbox you won't be able to boot
749 into this build.
751 --ccache Enable ccache use (done by default these days)
752 --no-ccache Disable ccache use
753 --help Shows this message (must not be used with other options)
757 exit
760 ARG_CCACHE=
761 ARG_ENCOPTS=
762 ARG_LANG=
763 ARG_RAM=
764 ARG_RBDIR=
765 ARG_TARGET=
766 ARG_TTS=
767 ARG_TTSOPTS=
768 ARG_TYPE=
769 ARG_VOICE=
770 err=
771 for arg in "$@"; do
772 case "$arg" in
773 --ccache) ARG_CCACHE=1;;
774 --encopts=*) ARG_ENCOPTS=`echo "$arg" | cut -d = -f 2`;;
775 --language=*) ARG_LANG=`echo "$arg" | cut -d = -f 2`;;
776 --no-ccache) ARG_CCACHE=0;;
777 --ram=*) ARG_RAM=`echo "$arg" | cut -d = -f 2`;;
778 --rbdir=*) ARG_RBDIR=`echo "$arg" | cut -d = -f 2`;;
779 --target=*) ARG_TARGET=`echo "$arg" | cut -d = -f 2`;;
780 --tts=*) ARG_TTS=`echo "$arg" | cut -d = -f 2`;;
781 --ttsopts=*) ARG_TTSOPTS=`echo "$arg" | cut -d = -f 2`;;
782 --type=*) ARG_TYPE=`echo "$arg" | cut -d = -f 2`;;
783 --voice=*) ARG_VOICE=`echo "$arg" | cut -d = -f 2`;;
784 --help) help;;
785 *) err=1; echo "[ERROR] Option '$arg' unsupported";;
786 esac
787 done
788 [ "$err" ] && exit 1
790 advopts=
792 if [ "$TMPDIR" != "" ]; then
793 tmpdir=$TMPDIR
794 else
795 tmpdir=/tmp
797 echo Using temporary directory $tmpdir
799 if test -r "configure"; then
800 # this is a check for a configure script in the current directory, it there
801 # is one, try to figure out if it is this one!
803 if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
804 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
805 echo "It will only cause you pain and grief. Instead do this:"
806 echo ""
807 echo " cd .."
808 echo " mkdir build-dir"
809 echo " cd build-dir"
810 echo " ../tools/configure"
811 echo ""
812 echo "Much happiness will arise from this. Enjoy"
813 exit 5
817 # get our current directory
818 pwd=`pwd`;
820 if { echo $pwd | grep " "; } then
821 echo "You're running this script in a path that contains space. The build"
822 echo "system is unfortunately not clever enough to deal with this. Please"
823 echo "run the script from a different path, rename the path or fix the build"
824 echo "system!"
825 exit 6
828 if [ -z "$rootdir" ]; then
829 ##################################################################
830 # Figure out where the source code root is!
832 rootdir=`dirname $0`/../
834 #####################################################################
835 # Convert the possibly relative directory name to an absolute version
837 now=`pwd`
838 cd $rootdir
839 rootdir=`pwd`
841 # cd back to the build dir
842 cd $now
845 apps="apps"
846 appsdir='\$(ROOTDIR)/apps'
847 firmdir='\$(ROOTDIR)/firmware'
848 toolsdir='\$(ROOTDIR)/tools'
851 ##################################################################
852 # Figure out target platform
855 if [ "$ARG_TARGET" ]; then
856 buildfor=$ARG_TARGET
857 else
858 echo "Enter target platform:"
859 cat <<EOF
860 ==Archos== ==iriver== ==Apple iPod==
861 0) Player/Studio 10) H120/H140 20) Color/Photo
862 1) Recorder 11) H320/H340 21) Nano
863 2) FM Recorder 12) iHP-100/110/115 22) Video
864 3) Recorder v2 13) iFP-790 23) 3G
865 4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
866 5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
867 6) AV300 26) Mini 2G
868 ==Toshiba== 27) 1G, 2G
869 ==Cowon/iAudio== 40) Gigabeat F 28) Nano 2G
870 30) X5/X5V/X5L 41) Gigabeat S
871 31) M5/M5L ==SanDisk==
872 32) 7 ==Olympus= 50) Sansa e200
873 33) D2 70) M:Robe 500 51) Sansa e200R
874 34) M3/M3L 71) M:Robe 100 52) Sansa c200
875 53) Sansa m200
876 ==Creative== ==Philips== 54) Sansa c100
877 90) Zen Vision:M 30GB 100) GoGear SA9200 55) Sansa Clip
878 91) Zen Vision:M 60GB 101) GoGear HDD1630/ 56) Sansa e200v2
879 92) Zen Vision HDD1830 57) Sansa m200v4
880 58) Sansa Fuze
881 ==Onda== ==Meizu== 59) Sansa c200v2
882 120) VX747 110) M6SL 60) Sansa Clipv2
883 121) VX767 111) M6SP 61) Sansa View
884 122) VX747+ 112) M3
885 123) VX777 ==Logik==
886 80) DAX 1GB MP3/DAB
887 ==Samsung== ==Tatung==
888 140) YH-820 150) Elio TPJ-1022 ==Lyre project==
889 141) YH-920 130) Lyre proto 1
890 142) YH-925
891 143) YP-S3
894 buildfor=`input`;
897 # Set of tools built for all target platforms:
898 toolset="rdf2binary convbdf codepages"
900 # Toolsets for some target families:
901 archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
902 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
903 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
904 ipodbitmaptools="$toolset scramble bmp2rb"
905 gigabeatbitmaptools="$toolset scramble descramble bmp2rb"
906 tccbitmaptools="$toolset scramble mktccboot bmp2rb"
907 # generic is used by IFP, Meizu and Onda
908 genericbitmaptools="$toolset bmp2rb"
909 # scramble is used by all other targets
910 scramblebitmaptools="$genericbitmaptools scramble"
913 # ---- For each target ----
915 # *Variables*
916 # target_id: a unique number identifying this target, IS NOT the menu number.
917 # Just use the currently highest number+1 when you add a new
918 # target.
919 # modelname: short model name used all over to identify this target
920 # memory: number of megabytes of RAM this target has. If the amount can
921 # be selected by the size prompt, let memory be unset here
922 # target: -Ddefine passed to the build commands to make the correct
923 # config-*.h file get included etc
924 # tool: the tool that takes a plain binary and converts that into a
925 # working "firmware" file for your target
926 # output: the final output file name
927 # boottool: the tool that takes a plain binary and generates a bootloader
928 # file for your target (or blank to use $tool)
929 # bootoutput:the final output file name for the bootloader (or blank to use
930 # $output)
931 # appextra: passed to the APPEXTRA variable in the Makefiles.
932 # TODO: add proper explanation
933 # archosrom: used only for Archos targets that build a special flashable .ucl
934 # image.
935 # flash: name of output for flashing, for targets where there's a special
936 # file output for this.
937 # plugins: set to 'yes' to build the plugins. Early development builds can
938 # set this to no in the early stages to have an easier life for a
939 # while
940 # swcodec: set 'yes' on swcodec targets
941 # toolset: lists what particular tools in the tools/ directory that this
942 # target needs to have built prior to building Rockbox
944 # *Functions*
945 # *cc: sets up gcc and compiler options for your target builds. Note
946 # that if you select a simulator build, the compiler selection is
947 # overridden later in the script.
949 case $buildfor in
951 0|player)
952 target_id=1
953 modelname="player"
954 target="-DARCHOS_PLAYER"
955 shcc
956 tool="$rootdir/tools/scramble"
957 output="archos.mod"
958 appextra="player:gui"
959 archosrom="$pwd/rombox.ucl"
960 flash="$pwd/rockbox.ucl"
961 plugins="yes"
962 swcodec=""
964 # toolset is the tools within the tools directory that we build for
965 # this particular target.
966 toolset="$toolset scramble descramble sh2d player_unifont uclpack"
968 # Note: the convbdf is present in the toolset just because: 1) the
969 # firmware/Makefile assumes it is present always, and 2) we will need it when we
970 # build the player simulator
972 t_cpu="sh"
973 t_manufacturer="archos"
974 t_model="player"
977 1|recorder)
978 target_id=2
979 modelname="recorder"
980 target="-DARCHOS_RECORDER"
981 shcc
982 tool="$rootdir/tools/scramble"
983 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
984 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
985 output="ajbrec.ajz"
986 appextra="recorder:gui"
987 #archosrom="$pwd/rombox.ucl"
988 flash="$pwd/rockbox.ucl"
989 plugins="yes"
990 swcodec=""
991 # toolset is the tools within the tools directory that we build for
992 # this particular target.
993 toolset=$archosbitmaptools
994 t_cpu="sh"
995 t_manufacturer="archos"
996 t_model="recorder"
999 2|fmrecorder)
1000 target_id=3
1001 modelname="fmrecorder"
1002 target="-DARCHOS_FMRECORDER"
1003 shcc
1004 tool="$rootdir/tools/scramble -fm"
1005 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1006 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1007 output="ajbrec.ajz"
1008 appextra="recorder:gui"
1009 #archosrom="$pwd/rombox.ucl"
1010 flash="$pwd/rockbox.ucl"
1011 plugins="yes"
1012 swcodec=""
1013 # toolset is the tools within the tools directory that we build for
1014 # this particular target.
1015 toolset=$archosbitmaptools
1016 t_cpu="sh"
1017 t_manufacturer="archos"
1018 t_model="fm_v2"
1021 3|recorderv2)
1022 target_id=4
1023 modelname="recorderv2"
1024 target="-DARCHOS_RECORDERV2"
1025 shcc
1026 tool="$rootdir/tools/scramble -v2"
1027 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1028 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1029 output="ajbrec.ajz"
1030 appextra="recorder:gui"
1031 #archosrom="$pwd/rombox.ucl"
1032 flash="$pwd/rockbox.ucl"
1033 plugins="yes"
1034 swcodec=""
1035 # toolset is the tools within the tools directory that we build for
1036 # this particular target.
1037 toolset=$archosbitmaptools
1038 t_cpu="sh"
1039 t_manufacturer="archos"
1040 t_model="fm_v2"
1043 4|ondiosp)
1044 target_id=7
1045 modelname="ondiosp"
1046 target="-DARCHOS_ONDIOSP"
1047 shcc
1048 tool="$rootdir/tools/scramble -osp"
1049 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1050 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1051 output="ajbrec.ajz"
1052 appextra="recorder:gui"
1053 archosrom="$pwd/rombox.ucl"
1054 flash="$pwd/rockbox.ucl"
1055 plugins="yes"
1056 swcodec=""
1057 # toolset is the tools within the tools directory that we build for
1058 # this particular target.
1059 toolset=$archosbitmaptools
1060 t_cpu="sh"
1061 t_manufacturer="archos"
1062 t_model="ondio"
1065 5|ondiofm)
1066 target_id=8
1067 modelname="ondiofm"
1068 target="-DARCHOS_ONDIOFM"
1069 shcc
1070 tool="$rootdir/tools/scramble -ofm"
1071 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1072 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1073 output="ajbrec.ajz"
1074 appextra="recorder:gui"
1075 #archosrom="$pwd/rombox.ucl"
1076 flash="$pwd/rockbox.ucl"
1077 plugins="yes"
1078 swcodec=""
1079 toolset=$archosbitmaptools
1080 t_cpu="sh"
1081 t_manufacturer="archos"
1082 t_model="ondio"
1085 6|av300)
1086 target_id=38
1087 modelname="av300"
1088 target="-DARCHOS_AV300"
1089 memory=16 # always
1090 arm7tdmicc
1091 tool="$rootdir/tools/scramble -mm=C"
1092 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1093 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1094 output="cjbm.ajz"
1095 appextra="recorder:gui"
1096 plugins="yes"
1097 swcodec=""
1098 # toolset is the tools within the tools directory that we build for
1099 # this particular target.
1100 toolset="$toolset scramble descramble bmp2rb"
1101 # architecture, manufacturer and model for the target-tree build
1102 t_cpu="arm"
1103 t_manufacturer="archos"
1104 t_model="av300"
1107 10|h120)
1108 target_id=9
1109 modelname="h120"
1110 target="-DIRIVER_H120"
1111 memory=32 # always
1112 coldfirecc
1113 tool="$rootdir/tools/scramble -add=h120"
1114 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1115 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1116 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1117 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1118 output="rockbox.iriver"
1119 appextra="recorder:gui"
1120 flash="$pwd/rombox.iriver"
1121 plugins="yes"
1122 swcodec="yes"
1123 # toolset is the tools within the tools directory that we build for
1124 # this particular target.
1125 toolset=$iriverbitmaptools
1126 t_cpu="coldfire"
1127 t_manufacturer="iriver"
1128 t_model="h100"
1131 11|h300)
1132 target_id=10
1133 modelname="h300"
1134 target="-DIRIVER_H300"
1135 memory=32 # always
1136 coldfirecc
1137 tool="$rootdir/tools/scramble -add=h300"
1138 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1139 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1140 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1141 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1142 output="rockbox.iriver"
1143 appextra="recorder:gui"
1144 plugins="yes"
1145 swcodec="yes"
1146 # toolset is the tools within the tools directory that we build for
1147 # this particular target.
1148 toolset=$iriverbitmaptools
1149 t_cpu="coldfire"
1150 t_manufacturer="iriver"
1151 t_model="h300"
1154 12|h100)
1155 target_id=11
1156 modelname="h100"
1157 target="-DIRIVER_H100"
1158 memory=16 # always
1159 coldfirecc
1160 tool="$rootdir/tools/scramble -add=h100"
1161 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1162 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1163 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1164 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1165 output="rockbox.iriver"
1166 appextra="recorder:gui"
1167 flash="$pwd/rombox.iriver"
1168 plugins="yes"
1169 swcodec="yes"
1170 # toolset is the tools within the tools directory that we build for
1171 # this particular target.
1172 toolset=$iriverbitmaptools
1173 t_cpu="coldfire"
1174 t_manufacturer="iriver"
1175 t_model="h100"
1178 13|ifp7xx)
1179 target_id=19
1180 modelname="ifp7xx"
1181 target="-DIRIVER_IFP7XX"
1182 memory=1
1183 arm7tdmicc short
1184 tool="cp"
1185 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1186 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1187 output="rockbox.wma"
1188 appextra="recorder:gui"
1189 plugins="yes"
1190 swcodec="yes"
1191 # toolset is the tools within the tools directory that we build for
1192 # this particular target.
1193 toolset=$genericbitmaptools
1194 t_cpu="arm"
1195 t_manufacturer="pnx0101"
1196 t_model="iriver-ifp7xx"
1199 14|h10)
1200 target_id=22
1201 modelname="h10"
1202 target="-DIRIVER_H10"
1203 memory=32 # always
1204 arm7tdmicc
1205 tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
1206 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1207 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1208 output="rockbox.mi4"
1209 appextra="recorder:gui"
1210 plugins="yes"
1211 swcodec="yes"
1212 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
1213 bootoutput="H10_20GC.mi4"
1214 # toolset is the tools within the tools directory that we build for
1215 # this particular target.
1216 toolset=$scramblebitmaptools
1217 # architecture, manufacturer and model for the target-tree build
1218 t_cpu="arm"
1219 t_manufacturer="iriver"
1220 t_model="h10"
1223 15|h10_5gb)
1224 target_id=24
1225 modelname="h10_5gb"
1226 target="-DIRIVER_H10_5GB"
1227 memory=32 # always
1228 arm7tdmicc
1229 tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
1230 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1231 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1232 output="rockbox.mi4"
1233 appextra="recorder:gui"
1234 plugins="yes"
1235 swcodec="yes"
1236 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
1237 bootoutput="H10.mi4"
1238 # toolset is the tools within the tools directory that we build for
1239 # this particular target.
1240 toolset=$scramblebitmaptools
1241 # architecture, manufacturer and model for the target-tree build
1242 t_cpu="arm"
1243 t_manufacturer="iriver"
1244 t_model="h10"
1247 20|ipodcolor)
1248 target_id=13
1249 modelname="ipodcolor"
1250 target="-DIPOD_COLOR"
1251 memory=32 # always
1252 arm7tdmicc
1253 tool="$rootdir/tools/scramble -add=ipco"
1254 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1255 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1256 output="rockbox.ipod"
1257 appextra="recorder:gui"
1258 plugins="yes"
1259 swcodec="yes"
1260 bootoutput="bootloader-$modelname.ipod"
1261 # toolset is the tools within the tools directory that we build for
1262 # this particular target.
1263 toolset=$ipodbitmaptools
1264 # architecture, manufacturer and model for the target-tree build
1265 t_cpu="arm"
1266 t_manufacturer="ipod"
1267 t_model="color"
1270 21|ipodnano)
1271 target_id=14
1272 modelname="ipodnano"
1273 target="-DIPOD_NANO"
1274 memory=32 # always
1275 arm7tdmicc
1276 tool="$rootdir/tools/scramble -add=nano"
1277 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1278 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1279 output="rockbox.ipod"
1280 appextra="recorder:gui"
1281 plugins="yes"
1282 swcodec="yes"
1283 bootoutput="bootloader-$modelname.ipod"
1284 # toolset is the tools within the tools directory that we build for
1285 # this particular target.
1286 toolset=$ipodbitmaptools
1287 # architecture, manufacturer and model for the target-tree build
1288 t_cpu="arm"
1289 t_manufacturer="ipod"
1290 t_model="nano"
1293 22|ipodvideo)
1294 target_id=15
1295 modelname="ipodvideo"
1296 target="-DIPOD_VIDEO"
1297 arm7tdmicc
1298 tool="$rootdir/tools/scramble -add=ipvd"
1299 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1300 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1301 output="rockbox.ipod"
1302 appextra="recorder:gui"
1303 plugins="yes"
1304 swcodec="yes"
1305 bootoutput="bootloader-$modelname.ipod"
1306 # toolset is the tools within the tools directory that we build for
1307 # this particular target.
1308 toolset=$ipodbitmaptools
1309 # architecture, manufacturer and model for the target-tree build
1310 t_cpu="arm"
1311 t_manufacturer="ipod"
1312 t_model="video"
1315 23|ipod3g)
1316 target_id=16
1317 modelname="ipod3g"
1318 target="-DIPOD_3G"
1319 memory=32 # always
1320 arm7tdmicc
1321 tool="$rootdir/tools/scramble -add=ip3g"
1322 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1323 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1324 output="rockbox.ipod"
1325 appextra="recorder:gui"
1326 plugins="yes"
1327 swcodec="yes"
1328 bootoutput="bootloader-$modelname.ipod"
1329 # toolset is the tools within the tools directory that we build for
1330 # this particular target.
1331 toolset=$ipodbitmaptools
1332 # architecture, manufacturer and model for the target-tree build
1333 t_cpu="arm"
1334 t_manufacturer="ipod"
1335 t_model="3g"
1338 24|ipod4g)
1339 target_id=17
1340 modelname="ipod4g"
1341 target="-DIPOD_4G"
1342 memory=32 # always
1343 arm7tdmicc
1344 tool="$rootdir/tools/scramble -add=ip4g"
1345 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1346 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1347 output="rockbox.ipod"
1348 appextra="recorder:gui"
1349 plugins="yes"
1350 swcodec="yes"
1351 bootoutput="bootloader-$modelname.ipod"
1352 # toolset is the tools within the tools directory that we build for
1353 # this particular target.
1354 toolset=$ipodbitmaptools
1355 # architecture, manufacturer and model for the target-tree build
1356 t_cpu="arm"
1357 t_manufacturer="ipod"
1358 t_model="4g"
1361 25|ipodmini)
1362 target_id=18
1363 modelname="ipodmini"
1364 target="-DIPOD_MINI"
1365 memory=32 # always
1366 arm7tdmicc
1367 tool="$rootdir/tools/scramble -add=mini"
1368 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1369 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1370 output="rockbox.ipod"
1371 appextra="recorder:gui"
1372 plugins="yes"
1373 swcodec="yes"
1374 bootoutput="bootloader-$modelname.ipod"
1375 # toolset is the tools within the tools directory that we build for
1376 # this particular target.
1377 toolset=$ipodbitmaptools
1378 # architecture, manufacturer and model for the target-tree build
1379 t_cpu="arm"
1380 t_manufacturer="ipod"
1381 t_model="mini"
1384 26|ipodmini2g)
1385 target_id=21
1386 modelname="ipodmini2g"
1387 target="-DIPOD_MINI2G"
1388 memory=32 # always
1389 arm7tdmicc
1390 tool="$rootdir/tools/scramble -add=mn2g"
1391 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1392 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1393 output="rockbox.ipod"
1394 appextra="recorder:gui"
1395 plugins="yes"
1396 swcodec="yes"
1397 bootoutput="bootloader-$modelname.ipod"
1398 # toolset is the tools within the tools directory that we build for
1399 # this particular target.
1400 toolset=$ipodbitmaptools
1401 # architecture, manufacturer and model for the target-tree build
1402 t_cpu="arm"
1403 t_manufacturer="ipod"
1404 t_model="mini2g"
1407 27|ipod1g2g)
1408 target_id=29
1409 modelname="ipod1g2g"
1410 target="-DIPOD_1G2G"
1411 memory=32 # always
1412 arm7tdmicc
1413 tool="$rootdir/tools/scramble -add=1g2g"
1414 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1415 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1416 output="rockbox.ipod"
1417 appextra="recorder:gui"
1418 plugins="yes"
1419 swcodec="yes"
1420 bootoutput="bootloader-$modelname.ipod"
1421 # toolset is the tools within the tools directory that we build for
1422 # this particular target.
1423 toolset=$ipodbitmaptools
1424 # architecture, manufacturer and model for the target-tree build
1425 t_cpu="arm"
1426 t_manufacturer="ipod"
1427 t_model="1g2g"
1430 28|ipodnano2g)
1431 target_id=62
1432 modelname="ipodnano2g"
1433 target="-DIPOD_NANO2G"
1434 memory=32 # always
1435 arm940tcc
1436 tool="$rootdir/tools/scramble -add=nn2g"
1437 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1438 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1439 output="rockbox.ipod"
1440 appextra="recorder:gui"
1441 plugins="yes"
1442 swcodec="yes"
1443 boottool="cp"
1444 bootoutput="bootloader-$modelname.bin"
1445 # toolset is the tools within the tools directory that we build for
1446 # this particular target.
1447 toolset=$ipodbitmaptools
1448 # architecture, manufacturer and model for the target-tree build
1449 t_cpu="arm"
1450 t_manufacturer="s5l8700"
1451 t_model="ipodnano2g"
1454 30|x5)
1455 target_id=12
1456 modelname="x5"
1457 target="-DIAUDIO_X5"
1458 memory=16 # always
1459 coldfirecc
1460 tool="$rootdir/tools/scramble -add=iax5"
1461 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1462 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1463 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1464 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1465 output="rockbox.iaudio"
1466 appextra="recorder:gui"
1467 plugins="yes"
1468 swcodec="yes"
1469 # toolset is the tools within the tools directory that we build for
1470 # this particular target.
1471 toolset="$iaudiobitmaptools"
1472 # architecture, manufacturer and model for the target-tree build
1473 t_cpu="coldfire"
1474 t_manufacturer="iaudio"
1475 t_model="x5"
1478 31|m5)
1479 target_id=28
1480 modelname="m5"
1481 target="-DIAUDIO_M5"
1482 memory=16 # always
1483 coldfirecc
1484 tool="$rootdir/tools/scramble -add=iam5"
1485 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1486 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1487 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1488 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1489 output="rockbox.iaudio"
1490 appextra="recorder:gui"
1491 plugins="yes"
1492 swcodec="yes"
1493 # toolset is the tools within the tools directory that we build for
1494 # this particular target.
1495 toolset="$iaudiobitmaptools"
1496 # architecture, manufacturer and model for the target-tree build
1497 t_cpu="coldfire"
1498 t_manufacturer="iaudio"
1499 t_model="m5"
1502 32|iaudio7)
1503 target_id=32
1504 modelname="iaudio7"
1505 target="-DIAUDIO_7"
1506 memory=16 # always
1507 arm946cc
1508 tool="$rootdir/tools/scramble -add=i7"
1509 boottool="$rootdir/tools/scramble -tcc=crc"
1510 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1511 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1512 output="rockbox.iaudio"
1513 appextra="recorder:gui"
1514 plugins="yes"
1515 swcodec="yes"
1516 bootoutput="I7_FW.BIN"
1517 # toolset is the tools within the tools directory that we build for
1518 # this particular target.
1519 toolset="$tccbitmaptools"
1520 # architecture, manufacturer and model for the target-tree build
1521 t_cpu="arm"
1522 t_manufacturer="tcc77x"
1523 t_model="iaudio7"
1526 33|cowond2)
1527 target_id=34
1528 modelname="cowond2"
1529 target="-DCOWON_D2"
1530 memory=32
1531 arm926ejscc
1532 tool="$rootdir/tools/scramble -add=d2"
1533 boottool="$rootdir/tools/scramble -tcc=crc"
1534 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1535 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1536 output="rockbox.d2"
1537 appextra="recorder:gui"
1538 plugins="yes"
1539 swcodec="yes"
1540 toolset="$tccbitmaptools"
1541 # architecture, manufacturer and model for the target-tree build
1542 t_cpu="arm"
1543 t_manufacturer="tcc780x"
1544 t_model="cowond2"
1547 34|m3)
1548 target_id=37
1549 modelname="m3"
1550 target="-DIAUDIO_M3"
1551 memory=16 # always
1552 coldfirecc
1553 tool="$rootdir/tools/scramble -add=iam3"
1554 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1555 bmp2rb_native="$rootdir/tools/bmp2rb -f 7"
1556 output="rockbox.iaudio"
1557 appextra="recorder:gui"
1558 plugins="yes"
1559 swcodec="yes"
1560 # toolset is the tools within the tools directory that we build for
1561 # this particular target.
1562 toolset="$iaudiobitmaptools"
1563 # architecture, manufacturer and model for the target-tree build
1564 t_cpu="coldfire"
1565 t_manufacturer="iaudio"
1566 t_model="m3"
1569 40|gigabeatf)
1570 target_id=20
1571 modelname="gigabeatf"
1572 target="-DGIGABEAT_F"
1573 memory=32 # always
1574 arm9tdmicc
1575 tool="$rootdir/tools/scramble -add=giga"
1576 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1577 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1578 output="rockbox.gigabeat"
1579 appextra="recorder:gui"
1580 plugins="yes"
1581 swcodec="yes"
1582 toolset=$gigabeatbitmaptools
1583 boottool="$rootdir/tools/scramble -gigabeat"
1584 bootoutput="FWIMG01.DAT"
1585 # architecture, manufacturer and model for the target-tree build
1586 t_cpu="arm"
1587 t_manufacturer="s3c2440"
1588 t_model="gigabeat-fx"
1591 41|gigabeats)
1592 target_id=26
1593 modelname="gigabeats"
1594 target="-DGIGABEAT_S"
1595 memory=64
1596 arm1136jfscc
1597 tool="$rootdir/tools/scramble -add=gigs"
1598 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1599 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1600 output="rockbox.gigabeat"
1601 appextra="recorder:gui"
1602 plugins="yes"
1603 swcodec="yes"
1604 toolset="$gigabeatbitmaptools mknkboot"
1605 boottool="$rootdir/tools/scramble -gigabeats"
1606 bootoutput="nk.bin"
1607 # architecture, manufacturer and model for the target-tree build
1608 t_cpu="arm"
1609 t_manufacturer="imx31"
1610 t_model="gigabeat-s"
1613 70|mrobe500)
1614 target_id=36
1615 modelname="mrobe500"
1616 target="-DMROBE_500"
1617 memory=64 # always
1618 arm926ejscc
1619 tool="$rootdir/tools/scramble -add=m500"
1620 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1621 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1622 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1623 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1624 output="rockbox.mrobe500"
1625 appextra="recorder:gui"
1626 plugins="yes"
1627 swcodec="yes"
1628 toolset=$gigabeatbitmaptools
1629 boottool="cp "
1630 bootoutput="rockbox.mrboot"
1631 # architecture, manufacturer and model for the target-tree build
1632 t_cpu="arm"
1633 t_manufacturer="tms320dm320"
1634 t_model="mrobe-500"
1637 71|mrobe100)
1638 target_id=33
1639 modelname="mrobe100"
1640 target="-DMROBE_100"
1641 memory=32 # always
1642 arm7tdmicc
1643 tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS"
1644 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1645 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1646 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1647 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1648 output="rockbox.mi4"
1649 appextra="recorder:gui"
1650 plugins="yes"
1651 swcodec="yes"
1652 boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL"
1653 bootoutput="pp5020.mi4"
1654 # toolset is the tools within the tools directory that we build for
1655 # this particular target.
1656 toolset=$scramblebitmaptools
1657 # architecture, manufacturer and model for the target-tree build
1658 t_cpu="arm"
1659 t_manufacturer="olympus"
1660 t_model="mrobe-100"
1663 80|logikdax)
1664 target_id=31
1665 modelname="logikdax"
1666 target="-DLOGIK_DAX"
1667 memory=2 # always
1668 arm946cc
1669 tool="$rootdir/tools/scramble -add=ldax"
1670 boottool="$rootdir/tools/scramble -tcc=crc"
1671 bootoutput="player.rom"
1672 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1673 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1674 output="rockbox.logik"
1675 appextra="recorder:gui"
1676 plugins=""
1677 swcodec="yes"
1678 # toolset is the tools within the tools directory that we build for
1679 # this particular target.
1680 toolset=$tccbitmaptools
1681 # architecture, manufacturer and model for the target-tree build
1682 t_cpu="arm"
1683 t_manufacturer="tcc77x"
1684 t_model="logikdax"
1687 90|creativezvm30gb)
1688 target_id=35
1689 modelname="creativezvm30gb"
1690 target="-DCREATIVE_ZVM"
1691 memory=64
1692 arm926ejscc
1693 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1694 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1695 tool="$rootdir/tools/scramble -creative=zvm"
1696 USE_ELF="yes"
1697 output="rockbox.zvm"
1698 appextra="recorder:gui"
1699 plugins="yes"
1700 swcodec="yes"
1701 toolset=$ipodbitmaptools
1702 boottool="$rootdir/tools/scramble -creative=zvm -no-ciff"
1703 bootoutput="rockbox.zvmboot"
1704 # architecture, manufacturer and model for the target-tree build
1705 t_cpu="arm"
1706 t_manufacturer="tms320dm320"
1707 t_model="creative-zvm"
1710 91|creativezvm60gb)
1711 target_id=40
1712 modelname="creativezvm60gb"
1713 target="-DCREATIVE_ZVM60GB"
1714 memory=64
1715 arm926ejscc
1716 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1717 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1718 tool="$rootdir/tools/scramble -creative=zvm60 -no-ciff"
1719 USE_ELF="yes"
1720 output="rockbox.zvm60"
1721 appextra="recorder:gui"
1722 plugins="yes"
1723 swcodec="yes"
1724 toolset=$ipodbitmaptools
1725 boottool="$rootdir/tools/scramble -creative=zvm60"
1726 bootoutput="rockbox.zvm60boot"
1727 # architecture, manufacturer and model for the target-tree build
1728 t_cpu="arm"
1729 t_manufacturer="tms320dm320"
1730 t_model="creative-zvm"
1733 92|creativezenvision)
1734 target_id=39
1735 modelname="creativezenvision"
1736 target="-DCREATIVE_ZV"
1737 memory=64
1738 arm926ejscc
1739 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1740 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1741 tool="$rootdir/tools/scramble -creative=zenvision -no-ciff"
1742 USE_ELF="yes"
1743 output="rockbox.zv"
1744 appextra="recorder:gui"
1745 plugins=""
1746 swcodec="yes"
1747 toolset=$ipodbitmaptools
1748 boottool="$rootdir/tools/scramble -creative=zenvision"
1749 bootoutput="rockbox.zvboot"
1750 # architecture, manufacturer and model for the target-tree build
1751 t_cpu="arm"
1752 t_manufacturer="tms320dm320"
1753 t_model="creative-zvm"
1756 50|e200)
1757 target_id=23
1758 modelname="e200"
1759 target="-DSANSA_E200"
1760 memory=32 # supposedly
1761 arm7tdmicc
1762 tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1763 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1764 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1765 output="rockbox.mi4"
1766 appextra="recorder:gui"
1767 plugins="yes"
1768 swcodec="yes"
1769 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1770 bootoutput="PP5022.mi4"
1771 # toolset is the tools within the tools directory that we build for
1772 # this particular target.
1773 toolset=$scramblebitmaptools
1774 # architecture, manufacturer and model for the target-tree build
1775 t_cpu="arm"
1776 t_manufacturer="sandisk"
1777 t_model="sansa-e200"
1780 51|e200r)
1781 # the e200R model is pretty much identical to the e200, it only has a
1782 # different option to the scramble tool when building a bootloader and
1783 # makes the bootloader output file name in all lower case.
1784 target_id=27
1785 modelname="e200r"
1786 target="-DSANSA_E200"
1787 memory=32 # supposedly
1788 arm7tdmicc
1789 tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1790 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1791 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1792 output="rockbox.mi4"
1793 appextra="recorder:gui"
1794 plugins="yes"
1795 swcodec="yes"
1796 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1797 bootoutput="pp5022.mi4"
1798 # toolset is the tools within the tools directory that we build for
1799 # this particular target.
1800 toolset=$scramblebitmaptools
1801 # architecture, manufacturer and model for the target-tree build
1802 t_cpu="arm"
1803 t_manufacturer="sandisk"
1804 t_model="sansa-e200"
1807 52|c200)
1808 target_id=30
1809 modelname="c200"
1810 target="-DSANSA_C200"
1811 memory=32 # supposedly
1812 arm7tdmicc
1813 tool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBOS"
1814 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1815 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1816 output="rockbox.mi4"
1817 appextra="recorder:gui"
1818 plugins="yes"
1819 swcodec="yes"
1820 boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
1821 bootoutput="firmware.mi4"
1822 # toolset is the tools within the tools directory that we build for
1823 # this particular target.
1824 toolset=$scramblebitmaptools
1825 # architecture, manufacturer and model for the target-tree build
1826 t_cpu="arm"
1827 t_manufacturer="sandisk"
1828 t_model="sansa-c200"
1831 53|m200)
1832 target_id=48
1833 modelname="m200"
1834 target="-DSANSA_M200"
1835 memory=1 # always
1836 arm946cc
1837 tool="$rootdir/tools/scramble -add=m200"
1838 boottool="$rootdir/tools/scramble -tcc=crc"
1839 bootoutput="player.rom"
1840 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1841 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1842 output="rockbox.m200"
1843 appextra="recorder:gui"
1844 plugins=""
1845 swcodec="yes"
1846 # toolset is the tools within the tools directory that we build for
1847 # this particular target.
1848 toolset=$tccbitmaptools
1849 # architecture, manufacturer and model for the target-tree build
1850 t_cpu="arm"
1851 t_manufacturer="tcc77x"
1852 t_model="m200"
1855 54|c100)
1856 target_id=42
1857 modelname="c100"
1858 target="-DSANSA_C100"
1859 memory=2
1860 arm946cc
1861 tool="$rootdir/tools/scramble -add=c100"
1862 boottool="$rootdir/tools/scramble -tcc=crc"
1863 bootoutput="player.rom"
1864 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1865 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1866 output="rockbox.c100"
1867 appextra="recorder:gui"
1868 plugins=""
1869 swcodec="yes"
1870 # toolset is the tools within the tools directory that we build for
1871 # this particular target.
1872 toolset=$tccbitmaptools
1873 # architecture, manufacturer and model for the target-tree build
1874 t_cpu="arm"
1875 t_manufacturer="tcc77x"
1876 t_model="c100"
1879 55|Clip|clip)
1880 target_id=50
1881 modelname="clip"
1882 target="-DSANSA_CLIP"
1883 memory=2
1884 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1885 bmp2rb_native="$bmp2rb_mono"
1886 tool="$rootdir/tools/scramble -add=clip"
1887 output="rockbox.sansa"
1888 bootoutput="bootloader-clip.sansa"
1889 appextra="recorder:gui"
1890 plugins="yes"
1891 swcodec="yes"
1892 toolset=$scramblebitmaptools
1893 t_cpu="arm"
1894 t_manufacturer="as3525"
1895 t_model="sansa-clip"
1896 arm9tdmicc
1900 56|e200v2)
1901 target_id=51
1902 modelname="e200v2"
1903 target="-DSANSA_E200V2"
1904 memory=8
1905 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1906 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1907 tool="$rootdir/tools/scramble -add=e2v2"
1908 output="rockbox.sansa"
1909 bootoutput="bootloader-e200v2.sansa"
1910 appextra="recorder:gui"
1911 plugins="yes"
1912 swcodec="yes"
1913 toolset=$scramblebitmaptools
1914 t_cpu="arm"
1915 t_manufacturer="as3525"
1916 t_model="sansa-e200v2"
1917 arm9tdmicc
1921 57|m200v4)
1922 target_id=52
1923 modelname="m200v4"
1924 target="-DSANSA_M200V4"
1925 memory=2
1926 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1927 bmp2rb_native="$bmp2rb_mono"
1928 tool="$rootdir/tools/scramble -add=m2v4"
1929 output="rockbox.sansa"
1930 bootoutput="bootloader-m200v4.sansa"
1931 appextra="recorder:gui"
1932 plugins="yes"
1933 swcodec="yes"
1934 toolset=$scramblebitmaptools
1935 t_cpu="arm"
1936 t_manufacturer="as3525"
1937 t_model="sansa-m200v4"
1938 arm9tdmicc
1942 58|fuze)
1943 target_id=53
1944 modelname="fuze"
1945 target="-DSANSA_FUZE"
1946 memory=8
1947 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1948 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1949 tool="$rootdir/tools/scramble -add=fuze"
1950 output="rockbox.sansa"
1951 bootoutput="bootloader-fuze.sansa"
1952 appextra="recorder:gui"
1953 plugins="yes"
1954 swcodec="yes"
1955 toolset=$scramblebitmaptools
1956 t_cpu="arm"
1957 t_manufacturer="as3525"
1958 t_model="sansa-fuze"
1959 arm9tdmicc
1963 59|c200v2)
1964 target_id=55
1965 modelname="c200v2"
1966 target="-DSANSA_C200V2"
1967 memory=2 # as per OF diagnosis mode
1968 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1969 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1970 tool="$rootdir/tools/scramble -add=c2v2"
1971 output="rockbox.sansa"
1972 bootoutput="bootloader-c200v2.sansa"
1973 appextra="recorder:gui"
1974 plugins="yes"
1975 swcodec="yes"
1976 # toolset is the tools within the tools directory that we build for
1977 # this particular target.
1978 toolset=$scramblebitmaptools
1979 # architecture, manufacturer and model for the target-tree build
1980 t_cpu="arm"
1981 t_manufacturer="as3525"
1982 t_model="sansa-c200v2"
1983 arm9tdmicc
1986 60|Clipv2|clipv2)
1987 echo "Sansa Clipv2 is not yet supported !"
1988 exit 1
1989 target_id=60
1990 modelname="clipv2"
1991 target="-DSANSA_CLIPV2"
1992 memory=8
1993 arm926ejscc
1994 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1995 bmp2rb_native="$bmp2rb_mono"
1996 tool="$rootdir/tools/scramble -add=clv2"
1997 output="rockbox.sansa"
1998 bootoutput="bootloader-clipv2.sansa"
1999 appextra="recorder:gui"
2000 plugins="yes"
2001 swcodec="yes"
2002 toolset=$scramblebitmaptools
2003 t_cpu="arm"
2004 t_manufacturer="as3525"
2005 t_model="sansa-clipv2"
2008 61|view)
2009 echo "Sansa View is not yet supported!"
2010 exit 1
2011 target_id=63
2012 modelname="view"
2013 target="-DSANSA_VIEW"
2014 memory=32
2015 arm1176jzscc
2016 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2017 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2018 output="rockbox.mi4"
2019 appextra="gui"
2020 plugins=""
2021 swcodec="yes"
2022 boottool="$rootdir/tools/scramble -mi4v3 -model=view -type=RBBL"
2023 bootoutput="firmware.mi4"
2024 # toolset is the tools within the tools directory that we build for
2025 # this particular target.
2026 toolset=$scramblebitmaptools
2027 t_cpu="arm"
2028 t_manufacturer="sandisk"
2029 t_model="sansa-view"
2032 150|tpj1022)
2033 target_id=25
2034 modelname="tpj1022"
2035 target="-DELIO_TPJ1022"
2036 memory=32 # always
2037 arm7tdmicc
2038 tool="$rootdir/tools/scramble -add tpj2"
2039 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2040 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
2041 output="rockbox.elio"
2042 appextra="recorder:gui"
2043 plugins="yes"
2044 swcodec="yes"
2045 boottool="$rootdir/tools/scramble -mi4v2"
2046 bootoutput="pp5020.mi4"
2047 # toolset is the tools within the tools directory that we build for
2048 # this particular target.
2049 toolset=$scramblebitmaptools
2050 # architecture, manufacturer and model for the target-tree build
2051 t_cpu="arm"
2052 t_manufacturer="tatung"
2053 t_model="tpj1022"
2056 100|sa9200)
2057 target_id=41
2058 modelname="sa9200"
2059 target="-DPHILIPS_SA9200"
2060 memory=32 # supposedly
2061 arm7tdmicc
2062 tool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBOS"
2063 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2064 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2065 output="rockbox.mi4"
2066 appextra="recorder:gui"
2067 plugins=""
2068 swcodec="yes"
2069 boottool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBBL"
2070 bootoutput="FWImage.ebn"
2071 # toolset is the tools within the tools directory that we build for
2072 # this particular target.
2073 toolset=$scramblebitmaptools
2074 # architecture, manufacturer and model for the target-tree build
2075 t_cpu="arm"
2076 t_manufacturer="philips"
2077 t_model="sa9200"
2080 101|hdd1630)
2081 target_id=43
2082 modelname="hdd1630"
2083 target="-DPHILIPS_HDD1630"
2084 memory=32 # supposedly
2085 arm7tdmicc
2086 tool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBOS"
2087 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2088 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2089 output="rockbox.mi4"
2090 appextra="recorder:gui"
2091 plugins="yes"
2092 swcodec="yes"
2093 boottool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBBL"
2094 bootoutput="FWImage.ebn"
2095 # toolset is the tools within the tools directory that we build for
2096 # this particular target.
2097 toolset=$scramblebitmaptools
2098 # architecture, manufacturer and model for the target-tree build
2099 t_cpu="arm"
2100 t_manufacturer="philips"
2101 t_model="hdd1630"
2104 110|meizum6sl)
2105 target_id=49
2106 modelname="meizum6sl"
2107 target="-DMEIZU_M6SL"
2108 memory=16 # always
2109 arm940tbecc
2110 tool="cp"
2111 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2112 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2113 output="rockbox.meizu"
2114 appextra="recorder:gui"
2115 plugins="no" #FIXME
2116 swcodec="yes"
2117 toolset=$genericbitmaptools
2118 boottool="cp"
2119 bootoutput="rockboot.ebn"
2120 # architecture, manufacturer and model for the target-tree build
2121 t_cpu="arm"
2122 t_manufacturer="s5l8700"
2123 t_model="meizu-m6sl"
2126 111|meizum6sp)
2127 target_id=46
2128 modelname="meizum6sp"
2129 target="-DMEIZU_M6SP"
2130 memory=16 # always
2131 arm940tbecc
2132 tool="cp"
2133 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2134 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2135 output="rockbox.meizu"
2136 appextra="recorder:gui"
2137 plugins="no" #FIXME
2138 swcodec="yes"
2139 toolset=$genericbitmaptools
2140 boottool="cp"
2141 bootoutput="rockboot.ebn"
2142 # architecture, manufacturer and model for the target-tree build
2143 t_cpu="arm"
2144 t_manufacturer="s5l8700"
2145 t_model="meizu-m6sp"
2148 112|meizum3)
2149 target_id=47
2150 modelname="meizum3"
2151 target="-DMEIZU_M3"
2152 memory=16 # always
2153 arm940tbecc
2154 tool="cp"
2155 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2156 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2157 output="rockbox.meizu"
2158 appextra="recorder:gui"
2159 plugins="no" #FIXME
2160 swcodec="yes"
2161 toolset=$genericbitmaptools
2162 boottool="cp"
2163 bootoutput="rockboot.ebn"
2164 # architecture, manufacturer and model for the target-tree build
2165 t_cpu="arm"
2166 t_manufacturer="s5l8700"
2167 t_model="meizu-m3"
2170 120|ondavx747)
2171 target_id=45
2172 modelname="ondavx747"
2173 target="-DONDA_VX747"
2174 memory=16
2175 mipselcc
2176 tool="$rootdir/tools/scramble -add=x747"
2177 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2178 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2179 output="rockbox.vx747"
2180 appextra="recorder:gui"
2181 plugins="yes"
2182 swcodec="yes"
2183 toolset=$genericbitmaptools
2184 boottool="$rootdir/tools/scramble -ccpmp"
2185 bootoutput="ccpmp.bin"
2186 # architecture, manufacturer and model for the target-tree build
2187 t_cpu="mips"
2188 t_manufacturer="ingenic_jz47xx"
2189 t_model="onda_vx747"
2192 121|ondavx767)
2193 target_id=64
2194 modelname="ondavx767"
2195 target="-DONDA_VX767"
2196 memory=16 #FIXME
2197 mipselcc
2198 tool="cp"
2199 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2200 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2201 output="rockbox.vx767"
2202 appextra="recorder:gui"
2203 plugins="" #FIXME
2204 swcodec="yes"
2205 toolset=$genericbitmaptools
2206 boottool="$rootdir/tools/scramble -ccpmp"
2207 bootoutput="ccpmp.bin"
2208 # architecture, manufacturer and model for the target-tree build
2209 t_cpu="mips"
2210 t_manufacturer="ingenic_jz47xx"
2211 t_model="onda_vx767"
2214 122|ondavx747p)
2215 target_id=54
2216 modelname="ondavx747p"
2217 target="-DONDA_VX747P"
2218 memory=16
2219 mipselcc
2220 tool="$rootdir/tools/scramble -add=747p"
2221 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2222 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2223 output="rockbox.vx747p"
2224 appextra="recorder:gui"
2225 plugins="yes"
2226 swcodec="yes"
2227 toolset=$genericbitmaptools
2228 boottool="$rootdir/tools/scramble -ccpmp"
2229 bootoutput="ccpmp.bin"
2230 # architecture, manufacturer and model for the target-tree build
2231 t_cpu="mips"
2232 t_manufacturer="ingenic_jz47xx"
2233 t_model="onda_vx747"
2236 123|ondavx777)
2237 target_id=61
2238 modelname="ondavx777"
2239 target="-DONDA_VX777"
2240 memory=16
2241 mipselcc
2242 tool="$rootdir/tools/scramble -add=x777"
2243 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2244 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2245 output="rockbox.vx777"
2246 appextra="recorder:gui"
2247 plugins="yes"
2248 swcodec="yes"
2249 toolset=$genericbitmaptools
2250 boottool="$rootdir/tools/scramble -ccpmp"
2251 bootoutput="ccpmp.bin"
2252 # architecture, manufacturer and model for the target-tree build
2253 t_cpu="mips"
2254 t_manufacturer="ingenic_jz47xx"
2255 t_model="onda_vx747"
2258 130|lyre_proto1)
2259 target_id=56
2260 modelname="lyre_proto1"
2261 target="-DLYRE_PROTO1"
2262 memory=64
2263 arm926ejscc
2264 tool="cp"
2265 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2266 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2267 output="rockbox.lyre"
2268 appextra="recorder:gui"
2269 plugins=""
2270 swcodec="yes"
2271 toolset=$scramblebitmaptools
2272 boottool="cp"
2273 bootoutput="bootloader-proto1.lyre"
2274 # architecture, manufacturer and model for the target-tree build
2275 t_cpu="arm"
2276 t_manufacturer="at91sam"
2277 t_model="lyre_proto1"
2280 140|yh820)
2281 target_id=57
2282 modelname="yh820"
2283 target="-DSAMSUNG_YH820"
2284 memory=32 # always
2285 arm7tdmicc
2286 tool="$rootdir/tools/scramble -mi4v2 -model=y820 -type=RBOS"
2287 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2288 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2289 output="rockbox.mi4"
2290 appextra="recorder:gui"
2291 plugins="yes"
2292 swcodec="yes"
2293 boottool="$rootdir/tools/scramble -mi4v2 -model=y820 -type=RBBL"
2294 bootoutput="FW_YH820.mi4"
2295 # toolset is the tools within the tools directory that we build for
2296 # this particular target.
2297 toolset=$scramblebitmaptools
2298 # architecture, manufacturer and model for the target-tree build
2299 t_cpu="arm"
2300 t_manufacturer="samsung"
2301 t_model="yh820"
2304 141|yh920)
2305 target_id=58
2306 modelname="yh920"
2307 target="-DSAMSUNG_YH920"
2308 memory=32 # always
2309 arm7tdmicc
2310 tool="$rootdir/tools/scramble -mi4v2 -model=y920 -type=RBOS"
2311 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2312 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
2313 output="rockbox.mi4"
2314 appextra="recorder:gui"
2315 plugins="yes"
2316 swcodec="yes"
2317 boottool="$rootdir/tools/scramble -mi4v2 -model=y920 -type=RBBL"
2318 bootoutput="PP5020.mi4"
2319 # toolset is the tools within the tools directory that we build for
2320 # this particular target.
2321 toolset=$scramblebitmaptools
2322 # architecture, manufacturer and model for the target-tree build
2323 t_cpu="arm"
2324 t_manufacturer="samsung"
2325 t_model="yh920"
2328 142|yh925)
2329 target_id=59
2330 modelname="yh925"
2331 target="-DSAMSUNG_YH925"
2332 memory=32 # always
2333 arm7tdmicc
2334 tool="$rootdir/tools/scramble -mi4v2 -model=y925 -type=RBOS"
2335 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2336 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2337 output="rockbox.mi4"
2338 appextra="recorder:gui"
2339 plugins="yes"
2340 swcodec="yes"
2341 boottool="$rootdir/tools/scramble -mi4v2 -model=y925 -type=RBBL"
2342 bootoutput="FW_YH925.mi4"
2343 # toolset is the tools within the tools directory that we build for
2344 # this particular target.
2345 toolset=$scramblebitmaptools
2346 # architecture, manufacturer and model for the target-tree build
2347 t_cpu="arm"
2348 t_manufacturer="samsung"
2349 t_model="yh925"
2352 143|yps3)
2353 target_id=60
2354 modelname="yps3"
2355 target="-DSAMSUNG_YPS3"
2356 memory=16 # always
2357 arm940tbecc
2358 tool="cp"
2359 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2360 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2361 output="rockbox.yps3"
2362 appextra="recorder:gui"
2363 plugins="no" #FIXME
2364 swcodec="yes"
2365 toolset=$genericbitmaptools
2366 boottool="cp"
2367 bootoutput="rockboot.ebn"
2368 # architecture, manufacturer and model for the target-tree build
2369 t_cpu="arm"
2370 t_manufacturer="s5l8700"
2371 t_model="yps3"
2376 echo "Please select a supported target platform!"
2377 exit 7
2380 esac
2382 echo "Platform set to $modelname"
2385 #remove start
2386 ############################################################################
2387 # Amount of memory, for those that can differ. They have $memory unset at
2388 # this point.
2391 if [ -z "$memory" ]; then
2392 case $target_id in
2394 if [ "$ARG_RAM" ]; then
2395 size=$ARG_RAM
2396 else
2397 echo "Enter size of your RAM (in MB): (Defaults to 32)"
2398 size=`input`;
2400 case $size in
2401 60|64)
2402 memory="64"
2405 memory="32"
2407 esac
2410 if [ "$ARG_RAM" ]; then
2411 size=$ARG_RAM
2412 else
2413 echo "Enter size of your RAM (in MB): (Defaults to 2)"
2414 size=`input`;
2416 case $size in
2418 memory="8"
2421 memory="2"
2423 esac
2425 esac
2426 echo "Memory size selected: $memory MB"
2427 [ "$ARG_TYPE" ] || echo ""
2429 #remove end
2431 ##################################################################
2432 # Figure out build "type"
2435 # the ifp7x0 is the only platform that supports building a gdb stub like
2436 # this
2437 case $modelname in
2438 ifp7xx)
2439 gdbstub="(G)DB stub, "
2441 e200r|e200)
2442 gdbstub="(I)nstaller, "
2444 c200)
2445 gdbstub="(E)raser, "
2449 esac
2450 if [ "$ARG_TYPE" ]; then
2451 btype=$ARG_TYPE
2452 else
2453 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, (C)heckWPS, $gdbstub(M)anual: (Defaults to N)"
2454 btype=`input`;
2457 case $btype in
2458 [Ii])
2459 appsdir='\$(ROOTDIR)/bootloader'
2460 apps="bootloader"
2461 extradefines="-DBOOTLOADER -DE200R_INSTALLER -ffunction-sections -fdata-sections"
2462 bootloader="1"
2463 echo "e200R-installer build selected"
2465 [Ee])
2466 appsdir='\$(ROOTDIR)/bootloader'
2467 apps="bootloader"
2468 echo "C2(4)0 or C2(5)0"
2469 variant=`input`
2470 case $variant in
2472 extradefines="-DBOOTLOADER -DC200_ERASE -DC240_ERASE -ffunction-sections -fdata-sections"
2473 echo "c240 eraser build selected"
2476 extradefines="-DBOOTLOADER -DC200_ERASE -DC250_ERASE -ffunction-sections -fdata-sections"
2477 echo "c240 eraser build selected"
2479 esac
2480 bootloader="1"
2481 echo "c200 eraser build selected"
2483 [Bb])
2484 if test $t_manufacturer = "archos"; then
2485 # Archos SH-based players do this somewhat differently for
2486 # some reason
2487 appsdir='\$(ROOTDIR)/flash/bootbox'
2488 apps="bootbox"
2489 else
2490 appsdir='\$(ROOTDIR)/bootloader'
2491 apps="bootloader"
2492 flash=""
2493 if test -n "$boottool"; then
2494 tool="$boottool"
2496 if test -n "$bootoutput"; then
2497 output=$bootoutput
2500 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
2501 bootloader="1"
2502 echo "Bootloader build selected"
2504 [Ss])
2505 debug="-DDEBUG"
2506 simulator="yes"
2507 extradefines="-DSIMULATOR"
2508 archosrom=""
2509 flash=""
2510 echo "Simulator build selected"
2512 [Aa]*)
2513 echo "Advanced build selected"
2514 whichadvanced $btype
2516 [Gg])
2517 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
2518 appsdir='\$(ROOTDIR)/gdb'
2519 apps="stub"
2520 case $modelname in
2521 ifp7xx)
2522 output="stub.wma"
2526 esac
2527 echo "GDB stub build selected"
2529 [Mm])
2530 toolset='';
2531 apps="manual"
2532 echo "Manual build selected"
2534 [Cc])
2535 uname=`uname`
2536 simcc "checkwps"
2537 toolset='';
2538 t_cpu='';
2539 GCCOPTS='';
2540 appsdir='\$(ROOTDIR)/tools/checkwps';
2541 output='checkwps.'${modelname};
2542 archosrom='';
2543 echo "CheckWPS build selected"
2546 if [ "$modelname" = "e200r" ]; then
2547 echo "Do not use the e200R target for regular builds. Use e200 instead."
2548 exit 8
2550 debug=""
2551 btype="N" # set it explicitly since RET only gets here as well
2552 echo "Normal build selected"
2555 esac
2556 # to be able running "make manual" from non-manual configuration
2557 case $modelname in
2558 fmrecorder)
2559 manualdev="recorderv2fm"
2561 recorderv2)
2562 manualdev="recorderv2fm"
2564 h1??)
2565 manualdev="h100"
2567 ipodmini2g)
2568 manualdev="ipodmini"
2571 manualdev=$modelname
2573 esac
2575 if [ -z "$debug" ]; then
2576 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
2579 echo "Using source code root directory: $rootdir"
2581 # this was once possible to change at build-time, but no more:
2582 language="english"
2584 uname=`uname`
2586 if [ "yes" = "$simulator" ]; then
2587 # setup compiler and things for simulator
2588 simcc "sdl"
2590 if [ -d "simdisk" ]; then
2591 echo "Subdirectory 'simdisk' already present"
2592 else
2593 mkdir simdisk
2594 echo "Created a 'simdisk' subdirectory for simulating the hard disk"
2598 # Now, figure out version number of the (gcc) compiler we are about to use
2599 gccver=`$CC -dumpversion`;
2601 # figure out the binutil version too and display it, mostly for the build
2602 # system etc to be able to see it easier
2603 if [ $uname = "Darwin" ]; then
2604 ldver=`$LD -v 2>&1 | sed -e 's/[^0-9.-]//g'`
2605 else
2606 ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
2609 if [ -z "$gccver" ]; then
2610 echo "[WARNING] The compiler you must use ($CC) is not in your path!"
2611 echo "[WARNING] this may cause your build to fail since we cannot do the"
2612 echo "[WARNING] checks we want now."
2613 else
2615 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
2616 # DEPEND on it
2618 num1=`echo $gccver | cut -d . -f1`
2619 num2=`echo $gccver | cut -d . -f2`
2620 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
2622 # This makes:
2623 # 3.3.X => 303
2624 # 3.4.X => 304
2625 # 2.95.3 => 295
2627 echo "Using $CC $gccver ($gccnum)"
2629 if test "$gccnum" -ge "400"; then
2630 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
2631 # so we ignore that warnings for now
2632 # -Wno-pointer-sign
2633 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
2636 if test "$gccnum" -ge "401"; then
2637 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
2638 # will break strict-aliasing rules"
2640 GCCOPTS="$GCCOPTS -fno-strict-aliasing"
2643 if test "$gccnum" -ge "402"; then
2644 # disable warning about "warning: initialized field overwritten" as gcc 4.2
2645 # and later would throw it for several valid cases
2646 GCCOPTS="$GCCOPTS -Wno-override-init"
2649 case $prefix in
2651 # simulator
2653 i586-mingw32msvc-)
2654 # cross-compile for win32
2657 # Verify that the cross-compiler is of a recommended version!
2658 if test "$gccver" != "$gccchoice"; then
2659 echo "WARNING: Your cross-compiler $CC $gccver is not of the recommended"
2660 echo "WARNING: version $gccchoice!"
2661 echo "WARNING: This may cause your build to fail since it may be a version"
2662 echo "WARNING: that isn't functional or known to not be the best choice."
2663 echo "WARNING: If you suffer from build problems, you know that this is"
2664 echo "WARNING: a likely source for them..."
2667 esac
2672 echo "Using $LD $ldver"
2674 # check the compiler for SH platforms
2675 if test "$CC" = "sh-elf-gcc"; then
2676 if test "$gccnum" -lt "400"; then
2677 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
2678 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2679 else
2680 # figure out patch status
2681 gccpatch=`$CC --version`;
2683 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
2684 echo "gcc $gccver is rockbox patched"
2685 # then convert -O to -Os to get smaller binaries!
2686 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2687 else
2688 echo "WARNING: You use an unpatched gcc compiler: $gccver"
2689 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2694 if test "$CC" = "m68k-elf-gcc"; then
2695 # convert -O to -Os to get smaller binaries!
2696 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2699 if [ "$ARG_CCACHE" = "1" ]; then
2700 echo "Enable ccache for building"
2701 ccache="ccache"
2702 elif [ "$ARG_CCACHE" != "0" ]; then
2703 ccache=`findtool ccache`
2704 if test -n "$ccache"; then
2705 echo "Found and uses ccache ($ccache)"
2709 # figure out the full path to the various commands if possible
2710 HOSTCC=`findtool gcc --lit`
2711 HOSTAR=`findtool ar --lit`
2712 CC=`findtool ${CC} --lit`
2713 LD=`findtool ${AR} --lit`
2714 AR=`findtool ${AR} --lit`
2715 AS=`findtool ${AS} --lit`
2716 OC=`findtool ${OC} --lit`
2717 WINDRES=`findtool ${WINDRES} --lit`
2718 DLLTOOL=`findtool ${DLLTOOL} --lit`
2719 DLLWRAP=`findtool ${DLLWRAP} --lit`
2720 RANLIB=`findtool ${RANLIB} --lit`
2722 if test -n "$ccache"; then
2723 CC="$ccache $CC"
2726 if test "X$endian" = "Xbig"; then
2727 defendian="ROCKBOX_BIG_ENDIAN"
2728 else
2729 defendian="ROCKBOX_LITTLE_ENDIAN"
2732 if [ "$ARG_RBDIR" ]; then
2733 rbdir=$ARG_RBDIR
2734 echo "Using alternate rockbox dir: ${rbdir}"
2737 sed > autoconf.h \
2738 -e "s,@ENDIAN@,${defendian},g" \
2739 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
2740 -e "s,@config_rtc@,$config_rtc,g" \
2741 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
2742 -e "s,@RBDIR@,${rbdir},g" \
2743 -e "s,@have_backlight@,$have_backlight,g" \
2744 -e "s,@have_fmradio_in@,$have_fmradio_in,g" \
2745 -e "s,@have_ata_poweroff@,$have_ata_poweroff,g" \
2746 <<EOF
2747 /* This header was made by configure */
2748 #ifndef __BUILD_AUTOCONF_H
2749 #define __BUILD_AUTOCONF_H
2751 /* Define endianess for the target or simulator platform */
2752 #define @ENDIAN@ 1
2754 /* Define this if you build rockbox to support the logf logging and display */
2755 #undef ROCKBOX_HAS_LOGF
2757 /* optional define for a backlight modded Ondio */
2758 @have_backlight@
2760 /* optional define for FM radio mod for iAudio M5 */
2761 @have_fmradio_in@
2763 /* optional define for ATA poweroff on Player */
2764 @have_ata_poweroff@
2766 /* optional defines for RTC mod for h1x0 */
2767 @config_rtc@
2768 @have_rtc_alarm@
2770 /* root of Rockbox */
2771 #define ROCKBOX_DIR "/@RBDIR@"
2773 #endif /* __BUILD_AUTOCONF_H */
2776 if test -n "$t_cpu"; then
2777 TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
2778 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
2779 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
2780 GCCOPTS="$GCCOPTS"
2783 if test "$simulator" = "yes"; then
2784 # add simul make stuff on the #SIMUL# line
2785 simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
2786 simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
2787 else
2788 # delete the lines that match
2789 simmagic1='/@SIMUL1@/D'
2790 simmagic2='/@SIMUL2@/D'
2793 if test "$swcodec" = "yes"; then
2794 voicetoolset="rbspeexenc voicefont wavtrim"
2795 else
2796 voicetoolset="voicefont wavtrim"
2799 if test "$apps" = "apps"; then
2800 # only when we build "real" apps we build the .lng files
2801 buildlangs="langs"
2804 #### Fix the cmdline ###
2805 if test -n "$ccache"; then
2806 cmdline="--ccache "
2809 cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts"
2810 ### end of cmdline
2812 sed > Makefile \
2813 -e "s,@ROOTDIR@,${rootdir},g" \
2814 -e "s,@DEBUG@,${debug},g" \
2815 -e "s,@MEMORY@,${memory},g" \
2816 -e "s,@TARGET_ID@,${target_id},g" \
2817 -e "s,@TARGET@,${target},g" \
2818 -e "s,@CPU@,${t_cpu},g" \
2819 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
2820 -e "s,@MODELNAME@,${modelname},g" \
2821 -e "s,@LANGUAGE@,${language},g" \
2822 -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
2823 -e "s,@PWD@,${pwd},g" \
2824 -e "s,@HOSTCC@,${HOSTCC},g" \
2825 -e "s,@HOSTAR@,${HOSTAR},g" \
2826 -e "s,@CC@,${CC},g" \
2827 -e "s,@LD@,${LD},g" \
2828 -e "s,@AR@,${AR},g" \
2829 -e "s,@AS@,${AS},g" \
2830 -e "s,@OC@,${OC},g" \
2831 -e "s,@WINDRES@,${WINDRES},g" \
2832 -e "s,@DLLTOOL@,${DLLTOOL},g" \
2833 -e "s,@DLLWRAP@,${DLLWRAP},g" \
2834 -e "s,@RANLIB@,${RANLIB},g" \
2835 -e "s,@TOOL@,${tool},g" \
2836 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
2837 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
2838 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
2839 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
2840 -e "s,@OUTPUT@,${output},g" \
2841 -e "s,@APPEXTRA@,${appextra},g" \
2842 -e "s,@ARCHOSROM@,${archosrom},g" \
2843 -e "s,@FLASHFILE@,${flash},g" \
2844 -e "s,@PLUGINS@,${plugins},g" \
2845 -e "s,@CODECS@,${swcodec},g" \
2846 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
2847 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
2848 -e "s,@GCCOPTS@,${GCCOPTS},g" \
2849 -e "s,@TARGET_INC@,${TARGET_INC},g" \
2850 -e "s!@LDOPTS@!${LDOPTS}!g" \
2851 -e "s,@LOADADDRESS@,${loadaddress},g" \
2852 -e "s,@EXTRADEF@,${extradefines},g" \
2853 -e "s,@APPSDIR@,${appsdir},g" \
2854 -e "s,@FIRMDIR@,${firmdir},g" \
2855 -e "s,@TOOLSDIR@,${toolsdir},g" \
2856 -e "s,@APPS@,${apps},g" \
2857 -e "s,@SIMVER@,${simver},g" \
2858 -e "s,@GCCVER@,${gccver},g" \
2859 -e "s,@GCCNUM@,${gccnum},g" \
2860 -e "s,@UNAME@,${uname},g" \
2861 -e "s,@ENDIAN@,${defendian},g" \
2862 -e "s,@TOOLSET@,${toolset},g" \
2863 -e "${simmagic1}" \
2864 -e "${simmagic2}" \
2865 -e "s,@MANUALDEV@,${manualdev},g" \
2866 -e "s,@ENCODER@,${ENC_CMD},g" \
2867 -e "s,@ENC_OPTS@,${ENC_OPTS},g" \
2868 -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
2869 -e "s,@TTS_OPTS@,${TTS_OPTS},g" \
2870 -e "s,@VOICETOOLSET@,${voicetoolset},g" \
2871 -e "s,@LANGS@,${buildlangs},g" \
2872 -e "s,@USE_ELF@,${USE_ELF},g" \
2873 -e "s,@RBDIR@,${rbdir},g" \
2874 -e "s,@PREFIX@,$PREFIX,g" \
2875 -e "s,@CMDLINE@,$cmdline,g" \
2876 <<EOF
2877 ## Automatically generated. http://www.rockbox.org/
2879 export ROOTDIR=@ROOTDIR@
2880 export FIRMDIR=@FIRMDIR@
2881 export APPSDIR=@APPSDIR@
2882 export TOOLSDIR=@TOOLSDIR@
2883 export DOCSDIR=\$(ROOTDIR)/docs
2884 export MANUALDIR=\${ROOTDIR}/manual
2885 export DEBUG=@DEBUG@
2886 export MODELNAME=@MODELNAME@
2887 export ARCHOSROM=@ARCHOSROM@
2888 export FLASHFILE=@FLASHFILE@
2889 export TARGET_ID=@TARGET_ID@
2890 export TARGET=@TARGET@
2891 export CPU=@CPU@
2892 export MANUFACTURER=@MANUFACTURER@
2893 export OBJDIR=@PWD@
2894 export BUILDDIR=@PWD@
2895 export LANGUAGE=@LANGUAGE@
2896 export VOICELANGUAGE=@VOICELANGUAGE@
2897 export MEMORYSIZE=@MEMORY@
2898 export VERSION:=\$(shell \$(ROOTDIR)/tools/version.sh \$(ROOTDIR))
2899 export BUILDDATE:=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
2900 export MKFIRMWARE=@TOOL@
2901 export BMP2RB_MONO=@BMP2RB_MONO@
2902 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
2903 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
2904 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
2905 export BINARY=@OUTPUT@
2906 export APPEXTRA=@APPEXTRA@
2907 export ENABLEDPLUGINS=@PLUGINS@
2908 export SOFTWARECODECS=@CODECS@
2909 export EXTRA_DEFINES=@EXTRADEF@
2910 export HOSTCC=@HOSTCC@
2911 export HOSTAR=@HOSTAR@
2912 export CC=@CC@
2913 export LD=@LD@
2914 export AR=@AR@
2915 export AS=@AS@
2916 export OC=@OC@
2917 export WINDRES=@WINDRES@
2918 export DLLTOOL=@DLLTOOL@
2919 export DLLWRAP=@DLLWRAP@
2920 export RANLIB=@RANLIB@
2921 export PREFIX=@PREFIX@
2922 export PROFILE_OPTS=@PROFILE_OPTS@
2923 export SIMVER=@SIMVER@
2924 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
2925 export GCCOPTS=@GCCOPTS@
2926 export TARGET_INC=@TARGET_INC@
2927 export LOADADDRESS=@LOADADDRESS@
2928 export SHARED_FLAG=@SHARED_FLAG@
2929 export LDOPTS=@LDOPTS@
2930 export GCCVER=@GCCVER@
2931 export GCCNUM=@GCCNUM@
2932 export UNAME=@UNAME@
2933 export MANUALDEV=@MANUALDEV@
2934 export TTS_OPTS=@TTS_OPTS@
2935 export TTS_ENGINE=@TTS_ENGINE@
2936 export ENC_OPTS=@ENC_OPTS@
2937 export ENCODER=@ENCODER@
2938 export USE_ELF=@USE_ELF@
2939 export RBDIR=@RBDIR@
2941 CONFIGURE_OPTIONS=@CMDLINE@
2943 include \$(TOOLSDIR)/root.make
2947 echo "Created Makefile"