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