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