Avoid more useless string copys and make some random cleanups
[kugel-rb.git] / tools / configure
blob790be27cc55b4b920b66dbe6f44876072982d924
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'
88 GCCOPTIMIZE=''
90 output="rockboxui" # use this as default output binary name
91 sdl=`findtool sdl-config`
92 sdl_cflags=""
93 sdl_libs=""
95 if [ $1 = "sdl" ]; then
96 if [ -z "$sdl" ]; then
97 echo "configure didn't find sdl-config, which indicates that you"
98 echo "don't have SDL (properly) installed. Please correct and"
99 echo "re-run configure!"
100 exit 1
101 else
102 # generic sdl-config checker
103 sdl_cflags=`sdl-config --cflags`
104 sdl_libs=`sdl-config --libs`
108 # default share option, override below if needed
109 SHARED_FLAG="-shared"
111 case $uname in
112 CYGWIN*)
113 echo "Cygwin host detected"
115 # sdl version
116 GCCOPTS="$GCCOPTS $sdl_cflags"
117 LDOPTS="-mconsole $sdl_libs"
119 output="rockboxui.exe" # use this as output binary name
122 MINGW*)
123 echo "MinGW host detected"
125 # sdl version
126 GCCOPTS="$GCCOPTS $sdl_cflags"
127 LDOPTS="-mconsole $sdl_libs"
129 output="rockboxui.exe" # use this as output binary name
132 Linux)
133 echo "Linux host detected"
134 GCCOPTS="$GCCOPTS $sdl_cflags"
135 LDOPTS="$sdl_libs"
136 # cannot crosscompile without SDL installed
137 if [ -n "$sdl" ]; then
138 if [ "0" != `sdl-config --libs |grep -c mwindows` ]; then
139 # Enable crosscompiling if sdl-config is from Windows SDL
140 # overrides GCCOPTS and LDOPTS
141 crosswincc $1
146 FreeBSD)
147 echo "FreeBSD host detected"
148 # sdl version
149 GCCOPTS="$GCCOPTS $sdl_cflags"
150 LDOPTS="$sdl_libs"
153 Darwin)
154 echo "Darwin host detected"
155 # sdl version
156 GCCOPTS="$GCCOPTS $sdl_cflags"
157 LDOPTS="$sdl_libs"
158 SHARED_FLAG="-dynamiclib -Wl\,-single_module"
162 echo "[ERROR] Unsupported system: $uname, fix configure and retry"
163 exit 2
165 esac
167 GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
169 if test "X$crosscompile" != "Xyes"; then
170 if [ "`uname -m`" = "x86_64" ] || [ "`uname -m`" = "amd64" ]; then
171 # fPIC is needed to make shared objects link
172 # setting visibility to hidden is necessary to avoid strange crashes
173 # due to symbol clashing
174 GCCOPTS="$GCCOPTS -fPIC -fvisibility=hidden"
177 id=$$
178 cat >$tmpdir/conftest-$id.c <<EOF
179 #include <stdio.h>
180 int main(int argc, char **argv)
182 int var=0;
183 char *varp = (char *)&var;
184 *varp=1;
186 printf("%d\n", var);
187 return 0;
191 $CC -o $tmpdir/conftest-$id $tmpdir/conftest-$id.c 2>/dev/null
193 if test `$tmpdir/conftest-$id 2>/dev/null` -gt "1"; then
194 # big endian
195 endian="big"
196 else
197 # little endian
198 endian="little"
201 if [ $1 = "sdl" ]; then
202 echo "Simulator environment deemed $endian endian"
203 elif [ $1 = "checkwps" ]; then
204 echo "CheckWPS environment deemed $endian endian"
207 # use wildcard here to make it work even if it was named *.exe like
208 # on cygwin
209 rm -f $tmpdir/conftest-$id*
214 # functions for setting up cross-compiler names and options
215 # also set endianess and what the exact recommended gcc version is
216 # the gcc version should most likely match what versions we build with
217 # rockboxdev.sh
219 shcc () {
220 prefixtools sh-elf-
221 GCCOPTS="$CCOPTS -m1"
222 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
223 endian="big"
224 gccchoice="4.0.3"
227 calmrisccc () {
228 prefixtools calmrisc16-unknown-elf-
229 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
230 GCCOPTIMIZE="-fomit-frame-pointer"
231 endian="big"
234 coldfirecc () {
235 prefixtools m68k-elf-
236 GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
237 GCCOPTIMIZE="-fomit-frame-pointer"
238 endian="big"
239 gccchoice="3.4.6"
242 arm7tdmicc () {
243 prefixtools arm-elf-
244 GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
245 if test "X$1" != "Xshort"; then
246 GCCOPTS="$GCCOPTS -mlong-calls"
248 GCCOPTIMIZE="-fomit-frame-pointer"
249 endian="little"
250 gccchoice="4.0.3"
253 arm9tdmicc () {
254 prefixtools arm-elf-
255 GCCOPTS="$CCOPTS -mcpu=arm9tdmi"
256 if test "$modelname" != "gigabeatf" -a "$t_manufacturer" != "as3525"; then
257 GCCOPTS="$GCCOPTS -mlong-calls"
259 GCCOPTIMIZE="-fomit-frame-pointer"
260 endian="little"
261 gccchoice="4.0.3"
264 arm940tbecc () {
265 prefixtools arm-elf-
266 GCCOPTS="$CCOPTS -mbig-endian -mcpu=arm940t -mlong-calls"
267 GCCOPTIMIZE="-fomit-frame-pointer"
268 endian="big"
269 gccchoice="4.0.3"
272 arm940tcc () {
273 prefixtools arm-elf-
274 GCCOPTS="$CCOPTS -mcpu=arm940t -mlong-calls"
275 GCCOPTIMIZE="-fomit-frame-pointer"
276 endian="little"
277 gccchoice="4.0.3"
280 arm946cc () {
281 prefixtools arm-elf-
282 GCCOPTS="$CCOPTS -mcpu=arm9e -mlong-calls"
283 GCCOPTIMIZE="-fomit-frame-pointer"
284 endian="little"
285 gccchoice="4.0.3"
288 arm926ejscc () {
289 prefixtools arm-elf-
290 GCCOPTS="$CCOPTS -mcpu=arm926ej-s -mlong-calls"
291 GCCOPTIMIZE="-fomit-frame-pointer"
292 endian="little"
293 gccchoice="4.0.3"
296 arm1136jfscc () {
297 prefixtools arm-elf-
298 GCCOPTS="$CCOPTS -mcpu=arm1136jf-s"
299 if test "$modelname" != "gigabeats"; then
300 GCCOPTS="$GCCOPTS -mlong-calls"
302 GCCOPTIMIZE="-fomit-frame-pointer"
303 endian="little"
304 gccchoice="4.0.3"
307 arm1176jzscc () {
308 prefixtools arm-elf-
309 GCCOPTS="$CCOPTS -mcpu=arm1176jz-s -mlong-calls"
310 GCCOPTIMIZE="-fomit-frame-pointer"
311 endian="little"
312 gccchoice="4.0.3"
315 mipselcc () {
316 prefixtools mipsel-elf-
317 GCCOPTS="$CCOPTS -march=mips32 -mtune=r4600 -mno-mips16 -mno-long-calls"
318 GCCOPTS="$GCCOPTS -ffunction-sections -msoft-float -G 0 -Wno-parentheses"
319 GCCOPTIMIZE="-fomit-frame-pointer"
320 endian="little"
321 gccchoice="4.1.2"
324 whichadvanced () {
325 atype=`echo "$1" | cut -c 2-`
326 ##################################################################
327 # Prompt for specific developer options
329 if [ "$atype" ]; then
330 interact=
331 else
332 interact=1
333 echo ""
334 echo "Enter your developer options (press enter when done)"
335 printf "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice"
336 if [ "$memory" = "2" ]; then
337 printf ", (8)MB MOD"
339 if [ "$modelname" = "player" ]; then
340 printf ", Use (A)TA poweroff"
342 if [ "$t_model" = "ondio" ]; then
343 printf ", (B)acklight MOD"
345 if [ "$modelname" = "m5" ]; then
346 printf ", (F)M radio MOD"
348 if [ "$modelname" = "h120" ]; then
349 printf ", (R)TC MOD"
351 echo ""
354 cont=1
355 while [ $cont = "1" ]; do
357 if [ "$interact" ]; then
358 option=`input`
359 else
360 option=`echo "$atype" | cut -c 1`
363 case $option in
364 [Dd])
365 if [ "yes" = "$profile" ]; then
366 echo "Debug is incompatible with profiling"
367 else
368 echo "DEBUG build enabled"
369 use_debug="yes"
372 [Ll])
373 echo "logf() support enabled"
374 logf="yes"
376 [Ss])
377 echo "Simulator build enabled"
378 simulator="yes"
380 [Pp])
381 if [ "yes" = "$use_debug" ]; then
382 echo "Profiling is incompatible with debug"
383 else
384 echo "Profiling support is enabled"
385 profile="yes"
388 [Vv])
389 echo "Voice build selected"
390 voice="yes"
393 if [ "$memory" = "2" ]; then
394 memory="8"
395 echo "Memory size selected: 8MB"
398 [Aa])
399 if [ "$modelname" = "player" ]; then
400 have_ata_poweroff="#define HAVE_ATA_POWEROFF"
401 echo "ATA poweroff enabled"
404 [Bb])
405 if [ "$t_model" = "ondio" ]; then
406 have_backlight="#define HAVE_BACKLIGHT"
407 echo "Backlight functions enabled"
410 [Ff])
411 if [ "$modelname" = "m5" ]; then
412 have_fmradio_in="#define HAVE_FMRADIO_IN"
413 echo "FM radio functions enabled"
416 [Rr])
417 if [ "$modelname" = "h120" ]; then
418 config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231"
419 have_rtc_alarm="#define HAVE_RTC_ALARM"
420 echo "RTC functions enabled (DS1339/DS3231)"
424 if [ "$interact" ]; then
425 cont=0
426 else
427 echo "[ERROR] Option $option unsupported"
430 esac
431 if [ ! "$interact" ]; then
432 atype=`echo "$atype" | cut -c 2-`
433 [ "$atype" ] || cont=0
435 done
436 echo "done"
438 if [ "yes" = "$voice" ]; then
439 # Ask about languages to build
440 picklang
441 voicelanguage=`whichlang`
442 echo "Voice language set to $voicelanguage"
444 # Configure encoder and TTS engine for each language
445 for thislang in `echo $voicelanguage | sed 's/,/ /g'`; do
446 voiceconfig "$thislang"
447 done
449 if [ "yes" = "$use_debug" ]; then
450 debug="-DDEBUG"
451 GCCOPTS="$GCCOPTS -g -DDEBUG"
453 if [ "yes" = "$logf" ]; then
454 use_logf="#define ROCKBOX_HAS_LOGF 1"
456 if [ "yes" = "$simulator" ]; then
457 debug="-DDEBUG"
458 extradefines="$extradefines -DSIMULATOR"
459 archosrom=""
460 flash=""
462 if [ "yes" = "$profile" ]; then
463 extradefines="$extradefines -DRB_PROFILE"
464 PROFILE_OPTS="-finstrument-functions"
468 # Configure voice settings
469 voiceconfig () {
470 thislang=$1
471 if [ ! "$ARG_TTS" ]; then
472 echo "Building $thislang voice for $modelname. Select options"
473 echo ""
476 if [ -n "`findtool flite`" ]; then
477 FLITE="F(l)ite "
478 FLITE_OPTS=""
479 DEFAULT_TTS="flite"
480 DEFAULT_TTS_OPTS=$FLITE_OPTS
481 DEFAULT_NOISEFLOOR="500"
482 DEFAULT_CHOICE="L"
484 if [ -n "`findtool espeak`" ]; then
485 ESPEAK="(e)Speak "
486 ESPEAK_OPTS=""
487 DEFAULT_TTS="espeak"
488 DEFAULT_TTS_OPTS=$ESPEAK_OPTS
489 DEFAULT_NOISEFLOOR="500"
490 DEFAULT_CHOICE="e"
492 if [ -n "`findtool festival`" ]; then
493 FESTIVAL="(F)estival "
494 case "$thislang" in
495 "italiano")
496 FESTIVAL_OPTS="--language italian"
498 "espanol")
499 FESTIVAL_OPTS="--language spanish"
501 "finnish")
502 FESTIVAL_OPTS="--language finnish"
504 "czech")
505 FESTIVAL_OPTS="--language czech"
508 FESTIVAL_OPTS=""
510 esac
511 DEFAULT_TTS="festival"
512 DEFAULT_TTS_OPTS=$FESTIVAL_OPTS
513 DEFAULT_NOISEFLOOR="500"
514 DEFAULT_CHOICE="F"
516 if [ -n "`findtool swift`" ]; then
517 SWIFT="S(w)ift "
518 SWIFT_OPTS=""
519 DEFAULT_TTS="swift"
520 DEFAULT_TTS_OPTS=$SWIFT_OPTS
521 DEFAULT_NOISEFLOOR="500"
522 DEFAULT_CHOICE="w"
524 # Allow SAPI if Windows is in use
525 if [ -n "`findtool winver`" ]; then
526 SAPI="(S)API "
527 SAPI_OPTS=""
528 DEFAULT_TTS="sapi"
529 DEFAULT_TTS_OPTS=$SAPI_OPTS
530 DEFAULT_NOISEFLOOR="500"
531 DEFAULT_CHOICE="S"
534 if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ] && [ "$ESPEAK" = "$SAPI" ] && [ "$SAPI" = "$SWIFT" ]; then
535 echo "You need Festival, eSpeak or Flite in your path, or SAPI available to build voice files"
536 exit 3
539 if [ "$ARG_TTS" ]; then
540 option=$ARG_TTS
541 else
542 echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?"
543 option=`input`
545 advopts="$advopts --tts=$option"
546 case "$option" in
547 [Ll])
548 TTS_ENGINE="flite"
549 NOISEFLOOR="500" # TODO: check this value
550 TTS_OPTS=$FLITE_OPTS
552 [Ee])
553 TTS_ENGINE="espeak"
554 NOISEFLOOR="500"
555 TTS_OPTS=$ESPEAK_OPTS
557 [Ff])
558 TTS_ENGINE="festival"
559 NOISEFLOOR="500"
560 TTS_OPTS=$FESTIVAL_OPTS
562 [Ss])
563 TTS_ENGINE="sapi"
564 NOISEFLOOR="500"
565 TTS_OPTS=$SAPI_OPTS
567 [Ww])
568 TTS_ENGINE="swift"
569 NOISEFLOOR="500"
570 TTS_OPTS=$SWIFT_OPTS
573 TTS_ENGINE=$DEFAULT_TTS
574 TTS_OPTS=$DEFAULT_TTS_OPTS
575 NOISEFLOOR=$DEFAULT_NOISEFLOOR
576 esac
577 echo "Using $TTS_ENGINE for TTS"
579 # Select which voice to use for Festival
580 if [ "$TTS_ENGINE" = "festival" ]; then
581 voicelist=`echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1/'|sort`
582 for voice in $voicelist; do
583 TTS_FESTIVAL_VOICE="$voice" # Default choice
584 break
585 done
586 if [ "$ARG_VOICE" ]; then
587 CHOICE=$ARG_VOICE
588 else
590 for voice in $voicelist; do
591 printf "%3d. %s\n" "$i" "$voice"
592 i=`expr $i + 1`
593 done
594 printf "Please select which Festival voice to use (default is $TTS_FESTIVAL_VOICE): "
595 CHOICE=`input`
598 for voice in $voicelist; do
599 if [ "$i" = "$CHOICE" -o "$voice" = "$CHOICE" ]; then
600 TTS_FESTIVAL_VOICE="$voice"
602 i=`expr $i + 1`
603 done
604 advopts="$advopts --voice=$CHOICE"
605 echo "Festival voice set to $TTS_FESTIVAL_VOICE"
606 echo "(voice_$TTS_FESTIVAL_VOICE)" > festival-prolog.scm
609 # Allow the user to input manual commandline options
610 if [ "$ARG_TTSOPTS" ]; then
611 USER_TTS_OPTS=$ARG_TTSOPTS
612 else
613 printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): "
614 USER_TTS_OPTS=`input`
615 echo ""
617 advopts="$advopts --ttsopts='$USER_TTS_OPTS'"
618 if [ -n "$USER_TTS_OPTS" ]; then
619 TTS_OPTS="$USER_TTS_OPTS"
621 echo "$TTS_ENGINE options set to $TTS_OPTS"
623 if [ "$swcodec" = "yes" ]; then
624 ENCODER="rbspeexenc"
625 ENC_CMD="rbspeexenc"
626 ENC_OPTS="-q 4 -c 10"
627 else
628 if [ -n "`findtool lame`" ]; then
629 ENCODER="lame"
630 ENC_CMD="lame"
631 ENC_OPTS="--resample 12 -t -m m -h -V 9.999 -S -B 64 --vbr-new"
632 else
633 echo "You need LAME in the system path to build voice files for"
634 echo "HWCODEC targets."
635 exit 4
639 echo "Using $ENCODER for encoding voice clips"
641 # Allow the user to input manual commandline options
642 if [ "$ARG_ENCOPTS" ]; then
643 USER_ENC_OPTS=$ARG_ENCOPTS
644 else
645 printf "Enter $ENCODER options (enter for defaults \"$ENC_OPTS\"): "
646 USER_ENC_OPTS=`input`
648 advopts="$advopts --encopts='$USER_ENC_OPTS'"
649 if [ -n "$USER_ENC_OPTS" ]; then
650 ENC_OPTS=$USER_ENC_OPTS
652 echo "$ENCODER options set to $ENC_OPTS"
654 TEMPDIR="${pwd}"
655 if [ -n "`findtool cygpath`" ]; then
656 TEMPDIR=`cygpath . -a -w`
660 picklang() {
661 # figure out which languages that are around
662 for file in $rootdir/apps/lang/*.lang; do
663 clean=`basename $file .lang`
664 langs="$langs $clean"
665 done
667 if [ "$ARG_LANG" ]; then
668 pick=$ARG_LANG
669 else
670 echo "Select a number for the language to use (default is english)"
671 # FIXME The multiple-language feature is currently broken
672 # echo "You may enter a comma-separated list of languages to build"
674 num=1
675 for one in $langs; do
676 echo "$num. $one"
677 num=`expr $num + 1`
678 done
679 pick=`input`
681 advopts="$advopts --language=$pick"
684 whichlang() {
685 output=""
686 # Allow the user to pass a comma-separated list of langauges
687 for thispick in `echo $pick | sed 's/,/ /g'`; do
688 num=1
689 for one in $langs; do
690 # Accept both the language number and name
691 if [ "$num" = "$thispick" ] || [ "$thispick" = "$one" ]; then
692 if [ "$output" = "" ]; then
693 output=$one
694 else
695 output=$output,$one
698 num=`expr $num + 1`
699 done
700 done
701 if [ -z "$output" ]; then
702 # pick a default
703 output="english"
705 echo $output
708 help() {
709 echo "Rockbox configure script."
710 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
711 echo "Do *NOT* run this within the tools directory!"
712 echo ""
713 cat <<EOF
714 Usage: configure [OPTION]...
715 Options:
716 --target=TARGET Sets the target, TARGET can be either the target ID or
717 corresponding string. Run without this option to see all
718 available targets.
720 --ram=RAM Sets the RAM for certain targets. Even though any number
721 is accepted, not every number is correct. The default
722 value will be applied, if you entered a wrong number
723 (which depends on the target). Watch the output. Run
724 without this option if you are not sure which the right
725 number is.
727 --type=TYPE Sets the build type. Shortcuts are also valid.
728 Run without this option to see all available types.
729 Multiple values are allowed and managed in the input
730 order. So --type=b stands for Bootloader build, while
731 --type=ab stands for "Backlight MOD" build.
733 --language=LANG Set the language used for voice generation (used only if
734 TYPE is AV).
736 --tts=ENGINE Set the TTS engine used for voice generation (used only
737 if TYPE is AV).
739 --voice=VOICE Set voice to use with selected TTS (used only if TYPE is
740 AV).
742 --ttsopts=OPTS Set TTS engine manual options (used only if TYPE is AV).
744 --encopts=OPTS Set encoder manual options (used only if ATYPE is AV).
746 --rbdir=dir Use alternative rockbox directory (default: ${rbdir}).
747 This is useful for having multiple alternate builds on
748 your device that you can load with ROLO. However as the
749 bootloader looks for .rockbox you won't be able to boot
750 into this build.
752 --ccache Enable ccache use (done by default these days)
753 --no-ccache Disable ccache use
754 --help Shows this message (must not be used with other options)
758 exit
761 ARG_CCACHE=
762 ARG_ENCOPTS=
763 ARG_LANG=
764 ARG_RAM=
765 ARG_RBDIR=
766 ARG_TARGET=
767 ARG_TTS=
768 ARG_TTSOPTS=
769 ARG_TYPE=
770 ARG_VOICE=
771 err=
772 for arg in "$@"; do
773 case "$arg" in
774 --ccache) ARG_CCACHE=1;;
775 --encopts=*) ARG_ENCOPTS=`echo "$arg" | cut -d = -f 2`;;
776 --language=*) ARG_LANG=`echo "$arg" | cut -d = -f 2`;;
777 --no-ccache) ARG_CCACHE=0;;
778 --ram=*) ARG_RAM=`echo "$arg" | cut -d = -f 2`;;
779 --rbdir=*) ARG_RBDIR=`echo "$arg" | cut -d = -f 2`;;
780 --target=*) ARG_TARGET=`echo "$arg" | cut -d = -f 2`;;
781 --tts=*) ARG_TTS=`echo "$arg" | cut -d = -f 2`;;
782 --ttsopts=*) ARG_TTSOPTS=`echo "$arg" | cut -d = -f 2`;;
783 --type=*) ARG_TYPE=`echo "$arg" | cut -d = -f 2`;;
784 --voice=*) ARG_VOICE=`echo "$arg" | cut -d = -f 2`;;
785 --help) help;;
786 *) err=1; echo "[ERROR] Option '$arg' unsupported";;
787 esac
788 done
789 [ "$err" ] && exit 1
791 advopts=
793 if [ "$TMPDIR" != "" ]; then
794 tmpdir=$TMPDIR
795 else
796 tmpdir=/tmp
798 echo Using temporary directory $tmpdir
800 if test -r "configure"; then
801 # this is a check for a configure script in the current directory, it there
802 # is one, try to figure out if it is this one!
804 if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
805 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
806 echo "It will only cause you pain and grief. Instead do this:"
807 echo ""
808 echo " cd .."
809 echo " mkdir build-dir"
810 echo " cd build-dir"
811 echo " ../tools/configure"
812 echo ""
813 echo "Much happiness will arise from this. Enjoy"
814 exit 5
818 # get our current directory
819 pwd=`pwd`;
821 if { echo $pwd | grep " "; } then
822 echo "You're running this script in a path that contains space. The build"
823 echo "system is unfortunately not clever enough to deal with this. Please"
824 echo "run the script from a different path, rename the path or fix the build"
825 echo "system!"
826 exit 6
829 if [ -z "$rootdir" ]; then
830 ##################################################################
831 # Figure out where the source code root is!
833 rootdir=`dirname $0`/../
835 #####################################################################
836 # Convert the possibly relative directory name to an absolute version
838 now=`pwd`
839 cd $rootdir
840 rootdir=`pwd`
842 # cd back to the build dir
843 cd $now
846 apps="apps"
847 appsdir='\$(ROOTDIR)/apps'
848 firmdir='\$(ROOTDIR)/firmware'
849 toolsdir='\$(ROOTDIR)/tools'
852 ##################################################################
853 # Figure out target platform
856 if [ "$ARG_TARGET" ]; then
857 buildfor=$ARG_TARGET
858 else
859 echo "Enter target platform:"
860 cat <<EOF
861 ==Archos== ==iriver== ==Apple iPod==
862 0) Player/Studio 10) H120/H140 20) Color/Photo
863 1) Recorder 11) H320/H340 21) Nano
864 2) FM Recorder 12) iHP-100/110/115 22) Video
865 3) Recorder v2 13) iFP-790 23) 3G
866 4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
867 5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
868 6) AV300 26) Mini 2G
869 ==Toshiba== 27) 1G, 2G
870 ==Cowon/iAudio== 40) Gigabeat F 28) Nano 2G
871 30) X5/X5V/X5L 41) Gigabeat S
872 31) M5/M5L ==SanDisk==
873 32) 7 ==Olympus= 50) Sansa e200
874 33) D2 70) M:Robe 500 51) Sansa e200R
875 34) M3/M3L 71) M:Robe 100 52) Sansa c200
876 53) Sansa m200
877 ==Creative== ==Philips== 54) Sansa c100
878 90) Zen Vision:M 30GB 100) GoGear SA9200 55) Sansa Clip
879 91) Zen Vision:M 60GB 101) GoGear HDD1630/ 56) Sansa e200v2
880 92) Zen Vision HDD1830 57) Sansa m200v4
881 58) Sansa Fuze
882 ==Onda== ==Meizu== 59) Sansa c200v2
883 120) VX747 110) M6SL 60) Sansa Clipv2
884 121) VX767 111) M6SP 61) Sansa View
885 122) VX747+ 112) M3
886 123) VX777 ==Logik==
887 80) DAX 1GB MP3/DAB
888 ==Samsung== ==Tatung==
889 140) YH-820 150) Elio TPJ-1022 ==Lyre project==
890 141) YH-920 130) Lyre proto 1
891 142) YH-925
892 143) YP-S3
895 buildfor=`input`;
898 # Set of tools built for all target platforms:
899 toolset="rdf2binary convbdf codepages"
901 # Toolsets for some target families:
902 archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
903 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
904 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
905 ipodbitmaptools="$toolset scramble bmp2rb"
906 gigabeatbitmaptools="$toolset scramble descramble bmp2rb"
907 tccbitmaptools="$toolset scramble mktccboot bmp2rb"
908 # generic is used by IFP, Meizu and Onda
909 genericbitmaptools="$toolset bmp2rb"
910 # scramble is used by all other targets
911 scramblebitmaptools="$genericbitmaptools scramble"
914 # ---- For each target ----
916 # *Variables*
917 # target_id: a unique number identifying this target, IS NOT the menu number.
918 # Just use the currently highest number+1 when you add a new
919 # target.
920 # modelname: short model name used all over to identify this target
921 # memory: number of megabytes of RAM this target has. If the amount can
922 # be selected by the size prompt, let memory be unset here
923 # target: -Ddefine passed to the build commands to make the correct
924 # config-*.h file get included etc
925 # tool: the tool that takes a plain binary and converts that into a
926 # working "firmware" file for your target
927 # output: the final output file name
928 # boottool: the tool that takes a plain binary and generates a bootloader
929 # file for your target (or blank to use $tool)
930 # bootoutput:the final output file name for the bootloader (or blank to use
931 # $output)
932 # appextra: passed to the APPEXTRA variable in the Makefiles.
933 # TODO: add proper explanation
934 # archosrom: used only for Archos targets that build a special flashable .ucl
935 # image.
936 # flash: name of output for flashing, for targets where there's a special
937 # file output for this.
938 # plugins: set to 'yes' to build the plugins. Early development builds can
939 # set this to no in the early stages to have an easier life for a
940 # while
941 # swcodec: set 'yes' on swcodec targets
942 # toolset: lists what particular tools in the tools/ directory that this
943 # target needs to have built prior to building Rockbox
945 # *Functions*
946 # *cc: sets up gcc and compiler options for your target builds. Note
947 # that if you select a simulator build, the compiler selection is
948 # overridden later in the script.
950 case $buildfor in
952 0|player)
953 target_id=1
954 modelname="player"
955 target="-DARCHOS_PLAYER"
956 shcc
957 tool="$rootdir/tools/scramble"
958 output="archos.mod"
959 appextra="player:gui"
960 archosrom="$pwd/rombox.ucl"
961 flash="$pwd/rockbox.ucl"
962 plugins="yes"
963 swcodec=""
965 # toolset is the tools within the tools directory that we build for
966 # this particular target.
967 toolset="$toolset scramble descramble sh2d player_unifont uclpack"
969 # Note: the convbdf is present in the toolset just because: 1) the
970 # firmware/Makefile assumes it is present always, and 2) we will need it when we
971 # build the player simulator
973 t_cpu="sh"
974 t_manufacturer="archos"
975 t_model="player"
978 1|recorder)
979 target_id=2
980 modelname="recorder"
981 target="-DARCHOS_RECORDER"
982 shcc
983 tool="$rootdir/tools/scramble"
984 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
985 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
986 output="ajbrec.ajz"
987 appextra="recorder:gui"
988 #archosrom="$pwd/rombox.ucl"
989 flash="$pwd/rockbox.ucl"
990 plugins="yes"
991 swcodec=""
992 # toolset is the tools within the tools directory that we build for
993 # this particular target.
994 toolset=$archosbitmaptools
995 t_cpu="sh"
996 t_manufacturer="archos"
997 t_model="recorder"
1000 2|fmrecorder)
1001 target_id=3
1002 modelname="fmrecorder"
1003 target="-DARCHOS_FMRECORDER"
1004 shcc
1005 tool="$rootdir/tools/scramble -fm"
1006 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1007 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1008 output="ajbrec.ajz"
1009 appextra="recorder:gui"
1010 #archosrom="$pwd/rombox.ucl"
1011 flash="$pwd/rockbox.ucl"
1012 plugins="yes"
1013 swcodec=""
1014 # toolset is the tools within the tools directory that we build for
1015 # this particular target.
1016 toolset=$archosbitmaptools
1017 t_cpu="sh"
1018 t_manufacturer="archos"
1019 t_model="fm_v2"
1022 3|recorderv2)
1023 target_id=4
1024 modelname="recorderv2"
1025 target="-DARCHOS_RECORDERV2"
1026 shcc
1027 tool="$rootdir/tools/scramble -v2"
1028 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1029 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1030 output="ajbrec.ajz"
1031 appextra="recorder:gui"
1032 #archosrom="$pwd/rombox.ucl"
1033 flash="$pwd/rockbox.ucl"
1034 plugins="yes"
1035 swcodec=""
1036 # toolset is the tools within the tools directory that we build for
1037 # this particular target.
1038 toolset=$archosbitmaptools
1039 t_cpu="sh"
1040 t_manufacturer="archos"
1041 t_model="fm_v2"
1044 4|ondiosp)
1045 target_id=7
1046 modelname="ondiosp"
1047 target="-DARCHOS_ONDIOSP"
1048 shcc
1049 tool="$rootdir/tools/scramble -osp"
1050 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1051 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1052 output="ajbrec.ajz"
1053 appextra="recorder:gui"
1054 archosrom="$pwd/rombox.ucl"
1055 flash="$pwd/rockbox.ucl"
1056 plugins="yes"
1057 swcodec=""
1058 # toolset is the tools within the tools directory that we build for
1059 # this particular target.
1060 toolset=$archosbitmaptools
1061 t_cpu="sh"
1062 t_manufacturer="archos"
1063 t_model="ondio"
1066 5|ondiofm)
1067 target_id=8
1068 modelname="ondiofm"
1069 target="-DARCHOS_ONDIOFM"
1070 shcc
1071 tool="$rootdir/tools/scramble -ofm"
1072 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1073 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1074 output="ajbrec.ajz"
1075 appextra="recorder:gui"
1076 #archosrom="$pwd/rombox.ucl"
1077 flash="$pwd/rockbox.ucl"
1078 plugins="yes"
1079 swcodec=""
1080 toolset=$archosbitmaptools
1081 t_cpu="sh"
1082 t_manufacturer="archos"
1083 t_model="ondio"
1086 6|av300)
1087 target_id=38
1088 modelname="av300"
1089 target="-DARCHOS_AV300"
1090 memory=16 # always
1091 arm7tdmicc
1092 tool="$rootdir/tools/scramble -mm=C"
1093 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1094 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1095 output="cjbm.ajz"
1096 appextra="recorder:gui"
1097 plugins="yes"
1098 swcodec=""
1099 # toolset is the tools within the tools directory that we build for
1100 # this particular target.
1101 toolset="$toolset scramble descramble bmp2rb"
1102 # architecture, manufacturer and model for the target-tree build
1103 t_cpu="arm"
1104 t_manufacturer="archos"
1105 t_model="av300"
1108 10|h120)
1109 target_id=9
1110 modelname="h120"
1111 target="-DIRIVER_H120"
1112 memory=32 # always
1113 coldfirecc
1114 tool="$rootdir/tools/scramble -add=h120"
1115 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1116 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1117 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1118 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1119 output="rockbox.iriver"
1120 appextra="recorder:gui"
1121 flash="$pwd/rombox.iriver"
1122 plugins="yes"
1123 swcodec="yes"
1124 # toolset is the tools within the tools directory that we build for
1125 # this particular target.
1126 toolset=$iriverbitmaptools
1127 t_cpu="coldfire"
1128 t_manufacturer="iriver"
1129 t_model="h100"
1132 11|h300)
1133 target_id=10
1134 modelname="h300"
1135 target="-DIRIVER_H300"
1136 memory=32 # always
1137 coldfirecc
1138 tool="$rootdir/tools/scramble -add=h300"
1139 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1140 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1141 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1142 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1143 output="rockbox.iriver"
1144 appextra="recorder:gui"
1145 plugins="yes"
1146 swcodec="yes"
1147 # toolset is the tools within the tools directory that we build for
1148 # this particular target.
1149 toolset=$iriverbitmaptools
1150 t_cpu="coldfire"
1151 t_manufacturer="iriver"
1152 t_model="h300"
1155 12|h100)
1156 target_id=11
1157 modelname="h100"
1158 target="-DIRIVER_H100"
1159 memory=16 # always
1160 coldfirecc
1161 tool="$rootdir/tools/scramble -add=h100"
1162 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1163 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1164 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1165 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1166 output="rockbox.iriver"
1167 appextra="recorder:gui"
1168 flash="$pwd/rombox.iriver"
1169 plugins="yes"
1170 swcodec="yes"
1171 # toolset is the tools within the tools directory that we build for
1172 # this particular target.
1173 toolset=$iriverbitmaptools
1174 t_cpu="coldfire"
1175 t_manufacturer="iriver"
1176 t_model="h100"
1179 13|ifp7xx)
1180 target_id=19
1181 modelname="ifp7xx"
1182 target="-DIRIVER_IFP7XX"
1183 memory=1
1184 arm7tdmicc short
1185 tool="cp"
1186 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1187 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1188 output="rockbox.wma"
1189 appextra="recorder:gui"
1190 plugins="yes"
1191 swcodec="yes"
1192 # toolset is the tools within the tools directory that we build for
1193 # this particular target.
1194 toolset=$genericbitmaptools
1195 t_cpu="arm"
1196 t_manufacturer="pnx0101"
1197 t_model="iriver-ifp7xx"
1200 14|h10)
1201 target_id=22
1202 modelname="h10"
1203 target="-DIRIVER_H10"
1204 memory=32 # always
1205 arm7tdmicc
1206 tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
1207 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1208 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1209 output="rockbox.mi4"
1210 appextra="recorder:gui"
1211 plugins="yes"
1212 swcodec="yes"
1213 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
1214 bootoutput="H10_20GC.mi4"
1215 # toolset is the tools within the tools directory that we build for
1216 # this particular target.
1217 toolset=$scramblebitmaptools
1218 # architecture, manufacturer and model for the target-tree build
1219 t_cpu="arm"
1220 t_manufacturer="iriver"
1221 t_model="h10"
1224 15|h10_5gb)
1225 target_id=24
1226 modelname="h10_5gb"
1227 target="-DIRIVER_H10_5GB"
1228 memory=32 # always
1229 arm7tdmicc
1230 tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
1231 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1232 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1233 output="rockbox.mi4"
1234 appextra="recorder:gui"
1235 plugins="yes"
1236 swcodec="yes"
1237 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
1238 bootoutput="H10.mi4"
1239 # toolset is the tools within the tools directory that we build for
1240 # this particular target.
1241 toolset=$scramblebitmaptools
1242 # architecture, manufacturer and model for the target-tree build
1243 t_cpu="arm"
1244 t_manufacturer="iriver"
1245 t_model="h10"
1248 20|ipodcolor)
1249 target_id=13
1250 modelname="ipodcolor"
1251 target="-DIPOD_COLOR"
1252 memory=32 # always
1253 arm7tdmicc
1254 tool="$rootdir/tools/scramble -add=ipco"
1255 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1256 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1257 output="rockbox.ipod"
1258 appextra="recorder:gui"
1259 plugins="yes"
1260 swcodec="yes"
1261 bootoutput="bootloader-$modelname.ipod"
1262 # toolset is the tools within the tools directory that we build for
1263 # this particular target.
1264 toolset=$ipodbitmaptools
1265 # architecture, manufacturer and model for the target-tree build
1266 t_cpu="arm"
1267 t_manufacturer="ipod"
1268 t_model="color"
1271 21|ipodnano)
1272 target_id=14
1273 modelname="ipodnano"
1274 target="-DIPOD_NANO"
1275 memory=32 # always
1276 arm7tdmicc
1277 tool="$rootdir/tools/scramble -add=nano"
1278 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1279 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1280 output="rockbox.ipod"
1281 appextra="recorder:gui"
1282 plugins="yes"
1283 swcodec="yes"
1284 bootoutput="bootloader-$modelname.ipod"
1285 # toolset is the tools within the tools directory that we build for
1286 # this particular target.
1287 toolset=$ipodbitmaptools
1288 # architecture, manufacturer and model for the target-tree build
1289 t_cpu="arm"
1290 t_manufacturer="ipod"
1291 t_model="nano"
1294 22|ipodvideo)
1295 target_id=15
1296 modelname="ipodvideo"
1297 target="-DIPOD_VIDEO"
1298 arm7tdmicc
1299 tool="$rootdir/tools/scramble -add=ipvd"
1300 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1301 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1302 output="rockbox.ipod"
1303 appextra="recorder:gui"
1304 plugins="yes"
1305 swcodec="yes"
1306 bootoutput="bootloader-$modelname.ipod"
1307 # toolset is the tools within the tools directory that we build for
1308 # this particular target.
1309 toolset=$ipodbitmaptools
1310 # architecture, manufacturer and model for the target-tree build
1311 t_cpu="arm"
1312 t_manufacturer="ipod"
1313 t_model="video"
1316 23|ipod3g)
1317 target_id=16
1318 modelname="ipod3g"
1319 target="-DIPOD_3G"
1320 memory=32 # always
1321 arm7tdmicc
1322 tool="$rootdir/tools/scramble -add=ip3g"
1323 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1324 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1325 output="rockbox.ipod"
1326 appextra="recorder:gui"
1327 plugins="yes"
1328 swcodec="yes"
1329 bootoutput="bootloader-$modelname.ipod"
1330 # toolset is the tools within the tools directory that we build for
1331 # this particular target.
1332 toolset=$ipodbitmaptools
1333 # architecture, manufacturer and model for the target-tree build
1334 t_cpu="arm"
1335 t_manufacturer="ipod"
1336 t_model="3g"
1339 24|ipod4g)
1340 target_id=17
1341 modelname="ipod4g"
1342 target="-DIPOD_4G"
1343 memory=32 # always
1344 arm7tdmicc
1345 tool="$rootdir/tools/scramble -add=ip4g"
1346 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1347 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1348 output="rockbox.ipod"
1349 appextra="recorder:gui"
1350 plugins="yes"
1351 swcodec="yes"
1352 bootoutput="bootloader-$modelname.ipod"
1353 # toolset is the tools within the tools directory that we build for
1354 # this particular target.
1355 toolset=$ipodbitmaptools
1356 # architecture, manufacturer and model for the target-tree build
1357 t_cpu="arm"
1358 t_manufacturer="ipod"
1359 t_model="4g"
1362 25|ipodmini)
1363 target_id=18
1364 modelname="ipodmini"
1365 target="-DIPOD_MINI"
1366 memory=32 # always
1367 arm7tdmicc
1368 tool="$rootdir/tools/scramble -add=mini"
1369 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1370 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1371 output="rockbox.ipod"
1372 appextra="recorder:gui"
1373 plugins="yes"
1374 swcodec="yes"
1375 bootoutput="bootloader-$modelname.ipod"
1376 # toolset is the tools within the tools directory that we build for
1377 # this particular target.
1378 toolset=$ipodbitmaptools
1379 # architecture, manufacturer and model for the target-tree build
1380 t_cpu="arm"
1381 t_manufacturer="ipod"
1382 t_model="mini"
1385 26|ipodmini2g)
1386 target_id=21
1387 modelname="ipodmini2g"
1388 target="-DIPOD_MINI2G"
1389 memory=32 # always
1390 arm7tdmicc
1391 tool="$rootdir/tools/scramble -add=mn2g"
1392 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1393 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1394 output="rockbox.ipod"
1395 appextra="recorder:gui"
1396 plugins="yes"
1397 swcodec="yes"
1398 bootoutput="bootloader-$modelname.ipod"
1399 # toolset is the tools within the tools directory that we build for
1400 # this particular target.
1401 toolset=$ipodbitmaptools
1402 # architecture, manufacturer and model for the target-tree build
1403 t_cpu="arm"
1404 t_manufacturer="ipod"
1405 t_model="mini2g"
1408 27|ipod1g2g)
1409 target_id=29
1410 modelname="ipod1g2g"
1411 target="-DIPOD_1G2G"
1412 memory=32 # always
1413 arm7tdmicc
1414 tool="$rootdir/tools/scramble -add=1g2g"
1415 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1416 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1417 output="rockbox.ipod"
1418 appextra="recorder:gui"
1419 plugins="yes"
1420 swcodec="yes"
1421 bootoutput="bootloader-$modelname.ipod"
1422 # toolset is the tools within the tools directory that we build for
1423 # this particular target.
1424 toolset=$ipodbitmaptools
1425 # architecture, manufacturer and model for the target-tree build
1426 t_cpu="arm"
1427 t_manufacturer="ipod"
1428 t_model="1g2g"
1431 28|ipodnano2g)
1432 target_id=62
1433 modelname="ipodnano2g"
1434 target="-DIPOD_NANO2G"
1435 memory=32 # always
1436 arm940tcc
1437 tool="$rootdir/tools/scramble -add=nn2g"
1438 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1439 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1440 output="rockbox.ipod"
1441 appextra="recorder:gui"
1442 plugins="yes"
1443 swcodec="yes"
1444 bootoutput="bootloader-$modelname.ipod"
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 8"
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, (D)atabase tool, $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"
2545 [Dd])
2546 uname=`uname`
2547 simcc "database"
2548 toolset='';
2549 t_cpu='';
2550 GCCOPTS='';
2551 appsdir='\$(ROOTDIR)/tools/database';
2552 output='database.'${modelname};
2553 archosrom='';
2554 echo "Database tool build selected"
2557 if [ "$modelname" = "e200r" ]; then
2558 echo "Do not use the e200R target for regular builds. Use e200 instead."
2559 exit 8
2561 debug=""
2562 btype="N" # set it explicitly since RET only gets here as well
2563 echo "Normal build selected"
2566 esac
2567 # to be able running "make manual" from non-manual configuration
2568 case $modelname in
2569 fmrecorder)
2570 manualdev="recorderv2fm"
2572 recorderv2)
2573 manualdev="recorderv2fm"
2575 h1??)
2576 manualdev="h100"
2578 ipodmini2g)
2579 manualdev="ipodmini"
2582 manualdev=$modelname
2584 esac
2586 if [ -z "$debug" ]; then
2587 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
2590 echo "Using source code root directory: $rootdir"
2592 # this was once possible to change at build-time, but no more:
2593 language="english"
2595 uname=`uname`
2597 if [ "yes" = "$simulator" ]; then
2598 # setup compiler and things for simulator
2599 simcc "sdl"
2601 if [ -d "simdisk" ]; then
2602 echo "Subdirectory 'simdisk' already present"
2603 else
2604 mkdir simdisk
2605 echo "Created a 'simdisk' subdirectory for simulating the hard disk"
2609 # Now, figure out version number of the (gcc) compiler we are about to use
2610 gccver=`$CC -dumpversion`;
2612 # figure out the binutil version too and display it, mostly for the build
2613 # system etc to be able to see it easier
2614 if [ $uname = "Darwin" ]; then
2615 ldver=`$LD -v 2>&1 | sed -e 's/[^0-9.-]//g'`
2616 else
2617 ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
2620 if [ -z "$gccver" ]; then
2621 echo "[WARNING] The compiler you must use ($CC) is not in your path!"
2622 echo "[WARNING] this may cause your build to fail since we cannot do the"
2623 echo "[WARNING] checks we want now."
2624 else
2626 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
2627 # DEPEND on it
2629 num1=`echo $gccver | cut -d . -f1`
2630 num2=`echo $gccver | cut -d . -f2`
2631 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
2633 # This makes:
2634 # 3.3.X => 303
2635 # 3.4.X => 304
2636 # 2.95.3 => 295
2638 echo "Using $CC $gccver ($gccnum)"
2640 if test "$gccnum" -ge "400"; then
2641 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
2642 # so we ignore that warnings for now
2643 # -Wno-pointer-sign
2644 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
2647 if test "$gccnum" -ge "401"; then
2648 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
2649 # will break strict-aliasing rules"
2651 GCCOPTS="$GCCOPTS -fno-strict-aliasing"
2654 if test "$gccnum" -ge "402"; then
2655 # disable warning about "warning: initialized field overwritten" as gcc 4.2
2656 # and later would throw it for several valid cases
2657 GCCOPTS="$GCCOPTS -Wno-override-init"
2660 case $prefix in
2662 # simulator
2664 i586-mingw32msvc-)
2665 # cross-compile for win32
2668 # Verify that the cross-compiler is of a recommended version!
2669 if test "$gccver" != "$gccchoice"; then
2670 echo "WARNING: Your cross-compiler $CC $gccver is not of the recommended"
2671 echo "WARNING: version $gccchoice!"
2672 echo "WARNING: This may cause your build to fail since it may be a version"
2673 echo "WARNING: that isn't functional or known to not be the best choice."
2674 echo "WARNING: If you suffer from build problems, you know that this is"
2675 echo "WARNING: a likely source for them..."
2678 esac
2683 echo "Using $LD $ldver"
2685 # check the compiler for SH platforms
2686 if test "$CC" = "sh-elf-gcc"; then
2687 if test "$gccnum" -lt "400"; then
2688 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
2689 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2690 else
2691 # figure out patch status
2692 gccpatch=`$CC --version`;
2694 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
2695 echo "gcc $gccver is rockbox patched"
2696 # then convert -O to -Os to get smaller binaries!
2697 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2698 else
2699 echo "WARNING: You use an unpatched gcc compiler: $gccver"
2700 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2705 if test "$CC" = "m68k-elf-gcc"; then
2706 # convert -O to -Os to get smaller binaries!
2707 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2710 if [ "$ARG_CCACHE" = "1" ]; then
2711 echo "Enable ccache for building"
2712 ccache="ccache"
2713 elif [ "$ARG_CCACHE" != "0" ]; then
2714 ccache=`findtool ccache`
2715 if test -n "$ccache"; then
2716 echo "Found and uses ccache ($ccache)"
2720 # figure out the full path to the various commands if possible
2721 HOSTCC=`findtool gcc --lit`
2722 HOSTAR=`findtool ar --lit`
2723 CC=`findtool ${CC} --lit`
2724 LD=`findtool ${AR} --lit`
2725 AR=`findtool ${AR} --lit`
2726 AS=`findtool ${AS} --lit`
2727 OC=`findtool ${OC} --lit`
2728 WINDRES=`findtool ${WINDRES} --lit`
2729 DLLTOOL=`findtool ${DLLTOOL} --lit`
2730 DLLWRAP=`findtool ${DLLWRAP} --lit`
2731 RANLIB=`findtool ${RANLIB} --lit`
2733 if test -n "$ccache"; then
2734 CC="$ccache $CC"
2737 if test "X$endian" = "Xbig"; then
2738 defendian="ROCKBOX_BIG_ENDIAN"
2739 else
2740 defendian="ROCKBOX_LITTLE_ENDIAN"
2743 if [ "$ARG_RBDIR" ]; then
2744 rbdir=$ARG_RBDIR
2745 echo "Using alternate rockbox dir: ${rbdir}"
2748 sed > autoconf.h \
2749 -e "s,@ENDIAN@,${defendian},g" \
2750 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
2751 -e "s,@config_rtc@,$config_rtc,g" \
2752 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
2753 -e "s,@RBDIR@,${rbdir},g" \
2754 -e "s,@have_backlight@,$have_backlight,g" \
2755 -e "s,@have_fmradio_in@,$have_fmradio_in,g" \
2756 -e "s,@have_ata_poweroff@,$have_ata_poweroff,g" \
2757 <<EOF
2758 /* This header was made by configure */
2759 #ifndef __BUILD_AUTOCONF_H
2760 #define __BUILD_AUTOCONF_H
2762 /* Define endianess for the target or simulator platform */
2763 #define @ENDIAN@ 1
2765 /* Define this if you build rockbox to support the logf logging and display */
2766 #undef ROCKBOX_HAS_LOGF
2768 /* optional define for a backlight modded Ondio */
2769 @have_backlight@
2771 /* optional define for FM radio mod for iAudio M5 */
2772 @have_fmradio_in@
2774 /* optional define for ATA poweroff on Player */
2775 @have_ata_poweroff@
2777 /* optional defines for RTC mod for h1x0 */
2778 @config_rtc@
2779 @have_rtc_alarm@
2781 /* root of Rockbox */
2782 #define ROCKBOX_DIR "/@RBDIR@"
2784 #endif /* __BUILD_AUTOCONF_H */
2787 if test -n "$t_cpu"; then
2788 TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
2789 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
2790 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
2791 GCCOPTS="$GCCOPTS"
2794 if test "$simulator" = "yes"; then
2795 # add simul make stuff on the #SIMUL# line
2796 simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
2797 simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
2798 else
2799 # delete the lines that match
2800 simmagic1='/@SIMUL1@/D'
2801 simmagic2='/@SIMUL2@/D'
2804 if test "$swcodec" = "yes"; then
2805 voicetoolset="rbspeexenc voicefont wavtrim"
2806 else
2807 voicetoolset="voicefont wavtrim"
2810 if test "$apps" = "apps"; then
2811 # only when we build "real" apps we build the .lng files
2812 buildlangs="langs"
2815 #### Fix the cmdline ###
2816 if test -n "$ccache"; then
2817 cmdline="--ccache "
2820 cmdline="$cmdline--target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts"
2821 ### end of cmdline
2823 sed > Makefile \
2824 -e "s,@ROOTDIR@,${rootdir},g" \
2825 -e "s,@DEBUG@,${debug},g" \
2826 -e "s,@MEMORY@,${memory},g" \
2827 -e "s,@TARGET_ID@,${target_id},g" \
2828 -e "s,@TARGET@,${target},g" \
2829 -e "s,@CPU@,${t_cpu},g" \
2830 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
2831 -e "s,@MODELNAME@,${modelname},g" \
2832 -e "s,@LANGUAGE@,${language},g" \
2833 -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
2834 -e "s,@PWD@,${pwd},g" \
2835 -e "s,@HOSTCC@,${HOSTCC},g" \
2836 -e "s,@HOSTAR@,${HOSTAR},g" \
2837 -e "s,@CC@,${CC},g" \
2838 -e "s,@LD@,${LD},g" \
2839 -e "s,@AR@,${AR},g" \
2840 -e "s,@AS@,${AS},g" \
2841 -e "s,@OC@,${OC},g" \
2842 -e "s,@WINDRES@,${WINDRES},g" \
2843 -e "s,@DLLTOOL@,${DLLTOOL},g" \
2844 -e "s,@DLLWRAP@,${DLLWRAP},g" \
2845 -e "s,@RANLIB@,${RANLIB},g" \
2846 -e "s,@TOOL@,${tool},g" \
2847 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
2848 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
2849 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
2850 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
2851 -e "s,@OUTPUT@,${output},g" \
2852 -e "s,@APPEXTRA@,${appextra},g" \
2853 -e "s,@ARCHOSROM@,${archosrom},g" \
2854 -e "s,@FLASHFILE@,${flash},g" \
2855 -e "s,@PLUGINS@,${plugins},g" \
2856 -e "s,@CODECS@,${swcodec},g" \
2857 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
2858 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
2859 -e "s,@GCCOPTS@,${GCCOPTS},g" \
2860 -e "s,@TARGET_INC@,${TARGET_INC},g" \
2861 -e "s!@LDOPTS@!${LDOPTS}!g" \
2862 -e "s,@LOADADDRESS@,${loadaddress},g" \
2863 -e "s,@EXTRADEF@,${extradefines},g" \
2864 -e "s,@APPSDIR@,${appsdir},g" \
2865 -e "s,@FIRMDIR@,${firmdir},g" \
2866 -e "s,@TOOLSDIR@,${toolsdir},g" \
2867 -e "s,@APPS@,${apps},g" \
2868 -e "s,@SIMVER@,${simver},g" \
2869 -e "s,@GCCVER@,${gccver},g" \
2870 -e "s,@GCCNUM@,${gccnum},g" \
2871 -e "s,@UNAME@,${uname},g" \
2872 -e "s,@ENDIAN@,${defendian},g" \
2873 -e "s,@TOOLSET@,${toolset},g" \
2874 -e "${simmagic1}" \
2875 -e "${simmagic2}" \
2876 -e "s,@MANUALDEV@,${manualdev},g" \
2877 -e "s,@ENCODER@,${ENC_CMD},g" \
2878 -e "s,@ENC_OPTS@,${ENC_OPTS},g" \
2879 -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
2880 -e "s,@TTS_OPTS@,${TTS_OPTS},g" \
2881 -e "s,@VOICETOOLSET@,${voicetoolset},g" \
2882 -e "s,@LANGS@,${buildlangs},g" \
2883 -e "s,@USE_ELF@,${USE_ELF},g" \
2884 -e "s,@RBDIR@,${rbdir},g" \
2885 -e "s,@PREFIX@,$PREFIX,g" \
2886 -e "s,@CMDLINE@,$cmdline,g" \
2887 <<EOF
2888 ## Automatically generated. http://www.rockbox.org/
2890 export ROOTDIR=@ROOTDIR@
2891 export FIRMDIR=@FIRMDIR@
2892 export APPSDIR=@APPSDIR@
2893 export TOOLSDIR=@TOOLSDIR@
2894 export DOCSDIR=\$(ROOTDIR)/docs
2895 export MANUALDIR=\${ROOTDIR}/manual
2896 export DEBUG=@DEBUG@
2897 export MODELNAME=@MODELNAME@
2898 export ARCHOSROM=@ARCHOSROM@
2899 export FLASHFILE=@FLASHFILE@
2900 export TARGET_ID=@TARGET_ID@
2901 export TARGET=@TARGET@
2902 export CPU=@CPU@
2903 export MANUFACTURER=@MANUFACTURER@
2904 export OBJDIR=@PWD@
2905 export BUILDDIR=@PWD@
2906 export LANGUAGE=@LANGUAGE@
2907 export VOICELANGUAGE=@VOICELANGUAGE@
2908 export MEMORYSIZE=@MEMORY@
2909 export VERSION:=\$(shell \$(ROOTDIR)/tools/version.sh \$(ROOTDIR))
2910 export BUILDDATE:=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
2911 export MKFIRMWARE=@TOOL@
2912 export BMP2RB_MONO=@BMP2RB_MONO@
2913 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
2914 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
2915 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
2916 export BINARY=@OUTPUT@
2917 export APPEXTRA=@APPEXTRA@
2918 export ENABLEDPLUGINS=@PLUGINS@
2919 export SOFTWARECODECS=@CODECS@
2920 export EXTRA_DEFINES=@EXTRADEF@
2921 export HOSTCC=@HOSTCC@
2922 export HOSTAR=@HOSTAR@
2923 export CC=@CC@
2924 export LD=@LD@
2925 export AR=@AR@
2926 export AS=@AS@
2927 export OC=@OC@
2928 export WINDRES=@WINDRES@
2929 export DLLTOOL=@DLLTOOL@
2930 export DLLWRAP=@DLLWRAP@
2931 export RANLIB=@RANLIB@
2932 export PREFIX=@PREFIX@
2933 export PROFILE_OPTS=@PROFILE_OPTS@
2934 export SIMVER=@SIMVER@
2935 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
2936 export GCCOPTS=@GCCOPTS@
2937 export TARGET_INC=@TARGET_INC@
2938 export LOADADDRESS=@LOADADDRESS@
2939 export SHARED_FLAG=@SHARED_FLAG@
2940 export LDOPTS=@LDOPTS@
2941 export GCCVER=@GCCVER@
2942 export GCCNUM=@GCCNUM@
2943 export UNAME=@UNAME@
2944 export MANUALDEV=@MANUALDEV@
2945 export TTS_OPTS=@TTS_OPTS@
2946 export TTS_ENGINE=@TTS_ENGINE@
2947 export ENC_OPTS=@ENC_OPTS@
2948 export ENCODER=@ENCODER@
2949 export USE_ELF=@USE_ELF@
2950 export RBDIR=@RBDIR@
2952 CONFIGURE_OPTIONS=@CMDLINE@
2954 include \$(TOOLSDIR)/root.make
2958 echo "Created Makefile"