Make natural sorting work properly with cyrillic chars: they should be placed after...
[kugel-rb/myfork.git] / tools / configure
blob04d8e8d93f843099c45b8224a2ec2ef38b470a20
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"
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 # parse the argument list, returns the value after the = in case of a
76 # option=value type option, returns 0 in case of --ccache or --no-ccache,
77 # returns 1 if the searched argument type wasn't fount in the argument list
78 # Usage [var = ]`parse_args <argumenttype>`, e.g. `parse_args --target`
80 # var definitons below are needed so that parse_args can see the arguments
81 arg1=$1 arg2=$2 arg3=$3 arg4=$4 arg5=$5 arg6=$6 arg7=$7 arg8=$8 arg9=$9
83 parse_args() {
84 ret="1"
85 for i in $arg1 $arg2 $arg3 $arg4 $arg5 $arg6 $arg7 $arg8 $arg9
87 if [ "$1" = "--ccache" ]; then
88 if [ "$i" = "--ccache" ]; then
89 ret="0"
91 elif [ "$1" = "--no-ccache" ]; then
92 if [ "$i" = "--no-ccache" ]; then
93 ret="0"
95 elif [ "$1" = `echo $i|cut -d'=' -f1` ]; then
96 ret=`echo $i|cut -d'=' -f2`
98 done
99 echo "$ret"
102 simcc () {
104 # default tool setup for native building
105 prefixtools ""
107 simver=sdl
108 GCCOPTS='-W -Wall -g -fno-builtin'
110 output="rockboxui" # use this as default output binary name
112 # generic sdl-config checker
113 sdl=`findtool sdl-config`
115 if [ -z "$sdl" ]; then
116 echo "configure didn't find sdl-config, which indicates that you"
117 echo "don't have SDL (properly) installed. Please correct and"
118 echo "re-run configure!"
119 exit 1
122 # default share option, override below if needed
123 SHARED_FLAG="-shared"
125 case $uname in
126 CYGWIN*)
127 echo "Cygwin host detected"
129 # sdl version
130 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
131 LDOPTS="`sdl-config --libs` -mconsole"
133 output="rockboxui.exe" # use this as output binary name
136 MINGW*)
137 echo "MinGW host detected"
139 # sdl version
140 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
141 LDOPTS="`sdl-config --libs` -mconsole"
143 output="rockboxui.exe" # use this as output binary name
146 Linux)
147 echo "Linux host detected"
148 if [ "0" != `sdl-config --libs |grep -c mwindows` ]; then
149 # Enable crosscompiling if sdl-config is from Windows SDL
150 crosswincc
151 else
152 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
153 LDOPTS="`sdl-config --libs`"
157 FreeBSD)
158 echo "FreeBSD host detected"
159 # sdl version
160 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
161 LDOPTS="`sdl-config --libs`"
164 Darwin)
165 echo "Darwin host detected"
166 # sdl version
167 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
168 LDOPTS="`sdl-config --libs`"
169 SHARED_FLAG="-dynamiclib -Wl\,-single_module"
173 echo "Unsupported system: $uname, fix configure and retry"
174 exit 2
176 esac
178 GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
180 if test "X$crosscompile" != "Xyes"; then
181 if [ "`uname -m`" = "x86_64" ] || [ "`uname -m`" = "amd64" ]; then
182 # fPIC is needed to make shared objects link
183 # setting visibility to hidden is necessary to avoid strange crashes
184 # due to symbol clashing
185 GCCOPTS="$GCCOPTS -fPIC -fvisibility=hidden"
188 id=$$
189 cat >/tmp/conftest-$id.c <<EOF
190 #include <stdio.h>
191 int main(int argc, char **argv)
193 int var=0;
194 char *varp = (char *)&var;
195 *varp=1;
197 printf("%d\n", var);
198 return 0;
202 $CC -o /tmp/conftest-$id /tmp/conftest-$id.c 2>/dev/null
204 if test `/tmp/conftest-$id 2>/dev/null` -gt "1"; then
205 # big endian
206 endian="big"
207 else
208 # little endian
209 endian="little"
211 echo "Simulator environment deemed $endian endian"
213 # use wildcard here to make it work even if it was named *.exe like
214 # on cygwin
215 rm -f /tmp/conftest-$id*
220 # functions for setting up cross-compiler names and options
221 # also set endianess and what the exact recommended gcc version is
222 # the gcc version should most likely match what versions we build with
223 # rockboxdev.sh
225 shcc () {
226 prefixtools sh-elf-
227 GCCOPTS="$CCOPTS -m1"
228 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
229 endian="big"
230 gccchoice="4.0.3"
233 calmrisccc () {
234 prefixtools calmrisc16-unknown-elf-
235 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
236 GCCOPTIMIZE="-fomit-frame-pointer"
237 endian="big"
240 coldfirecc () {
241 prefixtools m68k-elf-
242 GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
243 GCCOPTIMIZE="-fomit-frame-pointer"
244 endian="big"
245 gccchoice="3.4.6"
248 arm7tdmicc () {
249 prefixtools arm-elf-
250 GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
251 if test "X$1" != "Xshort"; then
252 GCCOPTS="$GCCOPTS -mlong-calls"
254 GCCOPTIMIZE="-fomit-frame-pointer"
255 endian="little"
256 gccchoice="4.0.3"
259 arm9tdmicc () {
260 prefixtools arm-elf-
261 GCCOPTS="$CCOPTS -mcpu=arm9tdmi"
262 if test "$modelname" != "gigabeatf"; then
263 GCCOPTS="$GCCOPTS -mlong-calls"
265 GCCOPTIMIZE="-fomit-frame-pointer"
266 endian="little"
267 gccchoice="4.0.3"
270 arm940tbecc () {
271 prefixtools arm-elf-
272 GCCOPTS="$CCOPTS -mbig-endian -mcpu=arm940t -mlong-calls"
273 GCCOPTIMIZE="-fomit-frame-pointer"
274 endian="big"
275 gccchoice="4.0.3"
278 arm946cc () {
279 prefixtools arm-elf-
280 GCCOPTS="$CCOPTS -mcpu=arm9e -mlong-calls"
281 GCCOPTIMIZE="-fomit-frame-pointer"
282 endian="little"
283 gccchoice="4.0.3"
286 arm926ejscc () {
287 prefixtools arm-elf-
288 GCCOPTS="$CCOPTS -mcpu=arm926ej-s -mlong-calls"
289 GCCOPTIMIZE="-fomit-frame-pointer"
290 endian="little"
291 gccchoice="4.0.3"
294 arm1136jfscc () {
295 prefixtools arm-elf-
296 GCCOPTS="$CCOPTS -mcpu=arm1136jf-s"
297 if test "$modelname" != "gigabeats"; then
298 GCCOPTS="$GCCOPTS -mlong-calls"
300 GCCOPTIMIZE="-fomit-frame-pointer"
301 endian="little"
302 gccchoice="4.0.3"
305 mipselcc () {
306 prefixtools mipsel-elf-
307 GCCOPTS="$CCOPTS -march=mips32 -mtune=r4600 -mno-mips16 -mno-abicalls -mlong-calls"
308 GCCOPTIMIZE="-fomit-frame-pointer"
309 GCCOPTS="$GCCOPTS -fno-pic -fno-builtin -fno-exceptions -ffunction-sections -msoft-float -G 0"
310 endian="little"
311 gccchoice="4.1.2"
314 whichadvanced () {
315 ##################################################################
316 # Prompt for specific developer options
318 echo ""
319 echo "Enter your developer options (press enter when done)"
320 printf "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice"
321 if [ "$memory" = "2" ]; then
322 printf ", (8)MB MOD"
324 if [ "$modelname" = "h120" ]; then
325 printf ", (R)TC MOD"
327 echo ""
329 cont=1
331 while [ $cont = "1" ]; do
333 option=`input`;
335 case $option in
336 [Dd])
337 if [ "yes" = "$profile" ]; then
338 echo "Debug is incompatible with profiling"
339 else
340 echo "define DEBUG"
341 use_debug="yes"
344 [Ll])
345 echo "logf() support enabled"
346 logf="yes"
348 [Ss])
349 echo "Simulator build enabled"
350 simulator="yes"
352 [Pp])
353 if [ "yes" = "$use_debug" ]; then
354 echo "Profiling is incompatible with debug"
355 else
356 echo "Profiling support is enabled"
357 profile="yes"
360 [Vv])
361 echo "Voice build selected"
362 voice="yes"
365 if [ "$memory" = "2" ]; then
366 memory="8"
367 echo "Memory size selected: 8MB"
368 else
369 cont=0
372 [Rr])
373 if [ "$modelname" = "h120" ]; then
374 config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231"
375 have_rtc_alarm="#define HAVE_RTC_ALARM"
376 echo "RTC functions enabled (DS1339/DS3231)"
377 else
378 cont=0
382 cont=0
384 esac
385 done
386 echo "done"
388 if [ "yes" = "$voice" ]; then
389 # Ask about languages to build
390 echo "Select a number for the language to use (default is english)"
391 # The multiple-language feature is currently broken
392 # echo "You may enter a comma-separated list of languages to build"
394 picklang
395 voicelanguage=`whichlang`
397 if [ -z "$voicelanguage" ]; then
398 # pick a default
399 voicelanguage="english"
401 echo "Voice language set to $voicelanguage"
403 # Configure encoder and TTS engine for each language
404 for thislang in `echo $voicelanguage | sed 's/,/ /g'`; do
405 voiceconfig "$thislang"
406 done
408 if [ "yes" = "$use_debug" ]; then
409 debug="-DDEBUG"
410 GCCOPTS="$GCCOPTS -g -DDEBUG"
412 if [ "yes" = "$logf" ]; then
413 use_logf="#define ROCKBOX_HAS_LOGF 1"
415 if [ "yes" = "$simulator" ]; then
416 debug="-DDEBUG"
417 extradefines="$extradefines -DSIMULATOR"
419 if [ "yes" = "$profile" ]; then
420 extradefines="$extradefines -DRB_PROFILE"
421 PROFILE_OPTS="-finstrument-functions"
425 # Configure voice settings
426 voiceconfig () {
427 thislang=$1
428 echo "Building $thislang voice for $modelname. Select options"
429 echo ""
431 if [ -n "`findtool flite`" ]; then
432 FLITE="F(l)ite "
433 FLITE_OPTS=""
434 DEFAULT_TTS="flite"
435 DEFAULT_TTS_OPTS=$FLITE_OPTS
436 DEFAULT_NOISEFLOOR="500"
437 DEFAULT_CHOICE="L"
439 if [ -n "`findtool espeak`" ]; then
440 ESPEAK="(e)Speak "
441 ESPEAK_OPTS=""
442 DEFAULT_TTS="espeak"
443 DEFAULT_TTS_OPTS=$ESPEAK_OPTS
444 DEFAULT_NOISEFLOOR="500"
445 DEFAULT_CHOICE="e"
447 if [ -n "`findtool festival`" ]; then
448 FESTIVAL="(F)estival "
449 case "$thislang" in
450 "italiano")
451 FESTIVAL_OPTS="--language italian"
453 "espanol")
454 FESTIVAL_OPTS="--language spanish"
456 "finnish")
457 FESTIVAL_OPTS="--language finnish"
459 "czech")
460 FESTIVAL_OPTS="--language czech"
463 FESTIVAL_OPTS=""
465 esac
466 DEFAULT_TTS="festival"
467 DEFAULT_TTS_OPTS=$FESTIVAL_OPTS
468 DEFAULT_NOISEFLOOR="500"
469 DEFAULT_CHOICE="F"
471 if [ -n "`findtool swift`" ]; then
472 SWIFT="S(w)ift "
473 SWIFT_OPTS=""
474 DEFAULT_TTS="swift"
475 DEFAULT_TTS_OPTS=$SWIFT_OPTS
476 DEFAULT_NOISEFLOOR="500"
477 DEFAULT_CHOICE="w"
479 # Allow SAPI if Windows is in use
480 if [ -n "`findtool winver`" ]; then
481 SAPI="(S)API "
482 SAPI_OPTS=""
483 DEFAULT_TTS="sapi"
484 DEFAULT_TTS_OPTS=$SAPI_OPTS
485 DEFAULT_NOISEFLOOR="500"
486 DEFAULT_CHOICE="S"
489 if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ] && [ "$ESPEAK" = "$SAPI" ] && [ "$SAPI" = "$SWIFT" ]; then
490 echo "You need Festival, eSpeak or Flite in your path, or SAPI available to build voice files"
491 exit 3
494 echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?"
495 option=`input`
496 case "$option" in
497 [Ll])
498 TTS_ENGINE="flite"
499 NOISEFLOOR="500" # TODO: check this value
500 TTS_OPTS=$FLITE_OPTS
502 [Ee])
503 TTS_ENGINE="espeak"
504 NOISEFLOOR="500"
505 TTS_OPTS=$ESPEAK_OPTS
507 [Ff])
508 TTS_ENGINE="festival"
509 NOISEFLOOR="500"
510 TTS_OPTS=$FESTIVAL_OPTS
512 [Ss])
513 TTS_ENGINE="sapi"
514 NOISEFLOOR="500"
515 TTS_OPTS=$SAPI_OPTS
517 [Ww])
518 TTS_ENGINE="swift"
519 NOISEFLOOR="500"
520 TTS_OPTS=$SWIFT_OPTS
523 TTS_ENGINE=$DEFAULT_TTS
524 TTS_OPTS=$DEFAULT_TTS_OPTS
525 NOISEFLOOR=$DEFAULT_NOISEFLOOR
526 esac
527 echo "Using $TTS_ENGINE for TTS"
529 # Allow the user to input manual commandline options
530 printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): "
531 USER_TTS_OPTS=`input`
532 if [ -n "$USER_TTS_OPTS" ]; then
533 TTS_OPTS="$USER_TTS_OPTS"
536 echo ""
538 if [ "$swcodec" = "yes" ]; then
539 ENCODER="rbspeexenc"
540 ENC_CMD="rbspeexenc"
541 ENC_OPTS="-q 4 -c 10"
542 else
543 if [ -n "`findtool lame`" ]; then
544 ENCODER="lame"
545 ENC_CMD="lame"
546 ENC_OPTS="--resample 12 -t -m m -h -V 9 -S -B 64 --vbr-new"
547 else
548 echo "You need LAME in the system path to build voice files for"
549 echo "HWCODEC targets."
550 exit 4
554 echo "Using $ENCODER for encoding voice clips"
556 # Allow the user to input manual commandline options
557 printf "Enter $ENCODER options (enter for defaults \"$ENC_OPTS\"): "
558 USER_ENC_OPTS=`input`
559 if [ -n "$USER_ENC_OPTS" ]; then
560 ENC_OPTS=$USER_ENC_OPTS
563 TEMPDIR="${pwd}"
564 if [ -n "`findtool cygpath`" ]; then
565 TEMPDIR=`cygpath . -a -w`
569 picklang() {
570 # figure out which languages that are around
571 for file in $rootdir/apps/lang/*.lang; do
572 clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
573 langs="$langs $clean"
574 done
576 num=1
577 for one in $langs; do
578 echo "$num. $one"
579 num=`expr $num + 1`
580 done
582 read pick
585 whichlang() {
586 output=""
587 # Allow the user to pass a comma-separated list of langauges
588 for thispick in `echo $pick | sed 's/,/ /g'`; do
589 num=1
590 for one in $langs; do
591 # Accept both the language number and name
592 if [ "$num" = "$thispick" ] || [ "$thispick" = "$one" ]; then
593 if [ "$output" = "" ]; then
594 output=$one
595 else
596 output=$output,$one
599 num=`expr $num + 1`
600 done
601 done
602 echo $output
605 opt=$1
607 if test "$opt" = "--help"; then
608 echo "Rockbox configure script."
609 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
610 echo "Do *NOT* run this within the tools directory!"
611 echo ""
612 cat <<EOF
613 Usage: configure [OPTION]...
614 Options:
615 --target=TARGET Sets the target, TARGET can be either the target ID or
616 corresponding string. Run without this option to see all
617 available targets.
619 --ram=RAM Sets the RAM for certain targets. Even though any number
620 is accepted, not every number is correct. The default
621 value will be applied, if you entered a wrong number
622 (which depends on the target). Watch the output. Run
623 without this option if you are not sure which the right
624 number is.
626 --type=TYPE Sets the build type. The shortcut is also valid.
627 Run without this option to see available types.
629 --rbdir=dir Use alternative rockbox directory (default: ${rbdir}).
630 This is useful for having multiple alternate builds on
631 your device that you can load with ROLO. However as the
632 bootloader looks for .rockbox you won't be able to boot
633 into this build.
635 --ccache Enable ccache use (done by default these days)
636 --no-ccache Disable ccache use
637 --help Shows this message (must not be used with other options)
641 exit
644 if test -r "configure"; then
645 # this is a check for a configure script in the current directory, it there
646 # is one, try to figure out if it is this one!
648 if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
649 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
650 echo "It will only cause you pain and grief. Instead do this:"
651 echo ""
652 echo " cd .."
653 echo " mkdir build-dir"
654 echo " cd build-dir"
655 echo " ../tools/configure"
656 echo ""
657 echo "Much happiness will arise from this. Enjoy"
658 exit 5
662 # get our current directory
663 pwd=`pwd`;
665 if { echo $pwd | grep " "; } then
666 echo "You're running this script in a path that contains space. The build"
667 echo "system is unfortunately not clever enough to deal with this. Please"
668 echo "run the script from a different path, rename the path or fix the build"
669 echo "system!"
670 exit 6
673 if [ -z "$rootdir" ]; then
674 ##################################################################
675 # Figure out where the source code root is!
677 rootdir=`dirname $0`/../
679 #####################################################################
680 # Convert the possibly relative directory name to an absolute version
682 now=`pwd`
683 cd $rootdir
684 rootdir=`pwd`
686 # cd back to the build dir
687 cd $now
690 apps="apps"
691 appsdir='\$(ROOTDIR)/apps'
692 firmdir='\$(ROOTDIR)/firmware'
693 toolsdir='\$(ROOTDIR)/tools'
696 ##################################################################
697 # Figure out target platform
700 if [ "1" != `parse_args --target` ]; then
701 buildfor=`parse_args --target`;
702 else
703 echo "Enter target platform:"
704 cat <<EOF
705 ==Archos== ==iriver== ==Apple iPod==
706 0) Player/Studio 10) H120/H140 20) Color/Photo
707 1) Recorder 11) H320/H340 21) Nano
708 2) FM Recorder 12) iHP-100/110/115 22) Video
709 3) Recorder v2 13) iFP-790 23) 3G
710 4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
711 5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
712 6) AV300 26) Mini 2G
713 ==Toshiba== 27) 1G, 2G
714 40) Gigabeat F
715 ==Cowon/iAudio== 41) Gigabeat S ==SanDisk==
716 30) X5/X5V/X5L 50) Sansa e200
717 31) M5/M5L ==Tatung== 51) Sansa e200R
718 32) 7 60) Elio TPJ-1022 52) Sansa c200
719 33) D2 53) Sansa m200
720 34) M3/M3L ==Olympus== 54) Sansa c100
721 70) M:Robe 500 55) Sansa Clip
722 ==Creative== 71) M:Robe 100 56) Sansa e200v2
723 90) Zen Vision:M 30GB 57) Sansa m200v4
724 91) Zen Vision:M 60GB ==Philips== 58) Sansa Fuze
725 92) Zen Vision 100) GoGear SA9200 59) Sansa c200v2
726 101) GoGear HDD1630/
727 HDD1830 ==Logik==
728 ==Onda== 80) DAX 1GB MP3/DAB
729 120) VX747 ==Meizu==
730 121) VX767 110) M6SL
731 122) VX747+ 111) M6SP
732 112) M3
736 buildfor=`input`;
739 # Set of tools built for all target platforms:
740 toolset="rdf2binary convbdf codepages"
742 # Toolsets for some target families:
743 archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
744 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
745 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
746 ipodbitmaptools="$toolset scramble bmp2rb"
747 gigabeatbitmaptools="$toolset scramble descramble bmp2rb"
748 tccbitmaptools="$toolset scramble mktccboot bmp2rb"
749 # generic is used by IFP, Meizu and Onda
750 genericbitmaptools="$toolset bmp2rb"
751 # scramble is used by all other targets
752 scramblebitmaptools="$genericbitmaptools scramble"
755 # ---- For each target ----
757 # *Variables*
758 # target_id: a unique number identifying this target, IS NOT the menu number.
759 # Just use the currently highest number+1 when you add a new
760 # target.
761 # modelname: short model name used all over to identify this target
762 # memory: number of megabytes of RAM this target has. If the amount can
763 # be selected by the size prompt, let memory be unset here
764 # target: -Ddefine passed to the build commands to make the correct
765 # config-*.h file get included etc
766 # tool: the tool that takes a plain binary and converts that into a
767 # working "firmware" file for your target
768 # output: the final output file name
769 # boottool: the tool that takes a plain binary and generates a bootloader
770 # file for your target (or blank to use $tool)
771 # bootoutput:the final output file name for the bootloader (or blank to use
772 # $output)
773 # appextra: passed to the APPEXTRA variable in the Makefiles.
774 # TODO: add proper explanation
775 # archosrom: used only for Archos targets that build a special flashable .ucl
776 # image.
777 # flash: name of output for flashing, for targets where there's a special
778 # file output for this.
779 # plugins: set to 'yes' to build the plugins. Early development builds can
780 # set this to no in the early stages to have an easier life for a
781 # while
782 # swcodec: set 'yes' on swcodec targets
783 # toolset: lists what particular tools in the tools/ directory that this
784 # target needs to have built prior to building Rockbox
786 # *Functions*
787 # *cc: sets up gcc and compiler options for your target builds. Note
788 # that if you select a simulator build, the compiler selection is
789 # overridden later in the script.
791 case $buildfor in
793 0|player)
794 target_id=1
795 modelname="player"
796 target="-DARCHOS_PLAYER"
797 shcc
798 tool="$rootdir/tools/scramble"
799 output="archos.mod"
800 appextra="player:gui"
801 archosrom="$pwd/rombox.ucl"
802 flash="$pwd/rockbox.ucl"
803 plugins="yes"
804 swcodec=""
806 # toolset is the tools within the tools directory that we build for
807 # this particular target.
808 toolset="$toolset scramble descramble sh2d player_unifont uclpack"
810 # Note: the convbdf is present in the toolset just because: 1) the
811 # firmware/Makefile assumes it is present always, and 2) we will need it when we
812 # build the player simulator
814 t_cpu="sh"
815 t_manufacturer="archos"
816 t_model="player"
819 1|recorder)
820 target_id=2
821 modelname="recorder"
822 target="-DARCHOS_RECORDER"
823 shcc
824 tool="$rootdir/tools/scramble"
825 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
826 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
827 output="ajbrec.ajz"
828 appextra="recorder:gui"
829 #archosrom="$pwd/rombox.ucl"
830 flash="$pwd/rockbox.ucl"
831 plugins="yes"
832 swcodec=""
833 # toolset is the tools within the tools directory that we build for
834 # this particular target.
835 toolset=$archosbitmaptools
836 t_cpu="sh"
837 t_manufacturer="archos"
838 t_model="recorder"
841 2|fmrecorder)
842 target_id=3
843 modelname="fmrecorder"
844 target="-DARCHOS_FMRECORDER"
845 shcc
846 tool="$rootdir/tools/scramble -fm"
847 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
848 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
849 output="ajbrec.ajz"
850 appextra="recorder:gui"
851 #archosrom="$pwd/rombox.ucl"
852 flash="$pwd/rockbox.ucl"
853 plugins="yes"
854 swcodec=""
855 # toolset is the tools within the tools directory that we build for
856 # this particular target.
857 toolset=$archosbitmaptools
858 t_cpu="sh"
859 t_manufacturer="archos"
860 t_model="fm_v2"
863 3|recorderv2)
864 target_id=4
865 modelname="recorderv2"
866 target="-DARCHOS_RECORDERV2"
867 shcc
868 tool="$rootdir/tools/scramble -v2"
869 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
870 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
871 output="ajbrec.ajz"
872 appextra="recorder:gui"
873 #archosrom="$pwd/rombox.ucl"
874 flash="$pwd/rockbox.ucl"
875 plugins="yes"
876 swcodec=""
877 # toolset is the tools within the tools directory that we build for
878 # this particular target.
879 toolset=$archosbitmaptools
880 t_cpu="sh"
881 t_manufacturer="archos"
882 t_model="fm_v2"
885 4|ondiosp)
886 target_id=7
887 modelname="ondiosp"
888 target="-DARCHOS_ONDIOSP"
889 shcc
890 tool="$rootdir/tools/scramble -osp"
891 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
892 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
893 output="ajbrec.ajz"
894 appextra="recorder:gui"
895 archosrom="$pwd/rombox.ucl"
896 flash="$pwd/rockbox.ucl"
897 plugins="yes"
898 swcodec=""
899 # toolset is the tools within the tools directory that we build for
900 # this particular target.
901 toolset=$archosbitmaptools
902 t_cpu="sh"
903 t_manufacturer="archos"
904 t_model="ondio"
907 5|ondiofm)
908 target_id=8
909 modelname="ondiofm"
910 target="-DARCHOS_ONDIOFM"
911 shcc
912 tool="$rootdir/tools/scramble -ofm"
913 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
914 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
915 output="ajbrec.ajz"
916 appextra="recorder:gui"
917 #archosrom="$pwd/rombox.ucl"
918 flash="$pwd/rockbox.ucl"
919 plugins="yes"
920 swcodec=""
921 toolset=$archosbitmaptools
922 t_cpu="sh"
923 t_manufacturer="archos"
924 t_model="ondio"
927 6|av300)
928 target_id=38
929 modelname="av300"
930 target="-DARCHOS_AV300"
931 memory=16 # always
932 arm7tdmicc
933 tool="$rootdir/tools/scramble -mm=C"
934 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
935 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
936 output="cjbm.ajz"
937 appextra="recorder:gui"
938 plugins="yes"
939 swcodec=""
940 # toolset is the tools within the tools directory that we build for
941 # this particular target.
942 toolset="$toolset scramble descramble bmp2rb"
943 # architecture, manufacturer and model for the target-tree build
944 t_cpu="arm"
945 t_manufacturer="archos"
946 t_model="av300"
949 10|h120)
950 target_id=9
951 modelname="h120"
952 target="-DIRIVER_H120"
953 memory=32 # always
954 coldfirecc
955 tool="$rootdir/tools/scramble -add=h120"
956 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
957 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
958 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
959 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
960 output="rockbox.iriver"
961 appextra="recorder:gui"
962 flash="$pwd/rombox.iriver"
963 plugins="yes"
964 swcodec="yes"
965 # toolset is the tools within the tools directory that we build for
966 # this particular target.
967 toolset=$iriverbitmaptools
968 t_cpu="coldfire"
969 t_manufacturer="iriver"
970 t_model="h100"
973 11|h300)
974 target_id=10
975 modelname="h300"
976 target="-DIRIVER_H300"
977 memory=32 # always
978 coldfirecc
979 tool="$rootdir/tools/scramble -add=h300"
980 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
981 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
982 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
983 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
984 output="rockbox.iriver"
985 appextra="recorder:gui"
986 plugins="yes"
987 swcodec="yes"
988 # toolset is the tools within the tools directory that we build for
989 # this particular target.
990 toolset=$iriverbitmaptools
991 t_cpu="coldfire"
992 t_manufacturer="iriver"
993 t_model="h300"
996 12|h100)
997 target_id=11
998 modelname="h100"
999 target="-DIRIVER_H100"
1000 memory=16 # always
1001 coldfirecc
1002 tool="$rootdir/tools/scramble -add=h100"
1003 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1004 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1005 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1006 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1007 output="rockbox.iriver"
1008 appextra="recorder:gui"
1009 flash="$pwd/rombox.iriver"
1010 plugins="yes"
1011 swcodec="yes"
1012 # toolset is the tools within the tools directory that we build for
1013 # this particular target.
1014 toolset=$iriverbitmaptools
1015 t_cpu="coldfire"
1016 t_manufacturer="iriver"
1017 t_model="h100"
1020 13|ifp7xx)
1021 target_id=19
1022 modelname="ifp7xx"
1023 target="-DIRIVER_IFP7XX"
1024 memory=1
1025 arm7tdmicc short
1026 tool="cp"
1027 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1028 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1029 output="rockbox.wma"
1030 appextra="recorder:gui"
1031 plugins="yes"
1032 swcodec="yes"
1033 # toolset is the tools within the tools directory that we build for
1034 # this particular target.
1035 toolset=$genericbitmaptools
1036 t_cpu="arm"
1037 t_manufacturer="pnx0101"
1038 t_model="iriver-ifp7xx"
1041 14|h10)
1042 target_id=22
1043 modelname="h10"
1044 target="-DIRIVER_H10"
1045 memory=32 # always
1046 arm7tdmicc
1047 tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
1048 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1049 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1050 output="rockbox.mi4"
1051 appextra="recorder:gui"
1052 plugins="yes"
1053 swcodec="yes"
1054 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
1055 bootoutput="H10_20GC.mi4"
1056 # toolset is the tools within the tools directory that we build for
1057 # this particular target.
1058 toolset=$scramblebitmaptools
1059 # architecture, manufacturer and model for the target-tree build
1060 t_cpu="arm"
1061 t_manufacturer="iriver"
1062 t_model="h10"
1065 15|h10_5gb)
1066 target_id=24
1067 modelname="h10_5gb"
1068 target="-DIRIVER_H10_5GB"
1069 memory=32 # always
1070 arm7tdmicc
1071 tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
1072 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1073 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1074 output="rockbox.mi4"
1075 appextra="recorder:gui"
1076 plugins="yes"
1077 swcodec="yes"
1078 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
1079 bootoutput="H10.mi4"
1080 # toolset is the tools within the tools directory that we build for
1081 # this particular target.
1082 toolset=$scramblebitmaptools
1083 # architecture, manufacturer and model for the target-tree build
1084 t_cpu="arm"
1085 t_manufacturer="iriver"
1086 t_model="h10"
1089 20|ipodcolor)
1090 target_id=13
1091 modelname="ipodcolor"
1092 target="-DIPOD_COLOR"
1093 memory=32 # always
1094 arm7tdmicc
1095 tool="$rootdir/tools/scramble -add=ipco"
1096 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1097 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1098 output="rockbox.ipod"
1099 appextra="recorder:gui"
1100 plugins="yes"
1101 swcodec="yes"
1102 bootoutput="bootloader-$modelname.ipod"
1103 # toolset is the tools within the tools directory that we build for
1104 # this particular target.
1105 toolset=$ipodbitmaptools
1106 # architecture, manufacturer and model for the target-tree build
1107 t_cpu="arm"
1108 t_manufacturer="ipod"
1109 t_model="color"
1112 21|ipodnano)
1113 target_id=14
1114 modelname="ipodnano"
1115 target="-DIPOD_NANO"
1116 memory=32 # always
1117 arm7tdmicc
1118 tool="$rootdir/tools/scramble -add=nano"
1119 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1120 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1121 output="rockbox.ipod"
1122 appextra="recorder:gui"
1123 plugins="yes"
1124 swcodec="yes"
1125 bootoutput="bootloader-$modelname.ipod"
1126 # toolset is the tools within the tools directory that we build for
1127 # this particular target.
1128 toolset=$ipodbitmaptools
1129 # architecture, manufacturer and model for the target-tree build
1130 t_cpu="arm"
1131 t_manufacturer="ipod"
1132 t_model="nano"
1135 22|ipodvideo)
1136 target_id=15
1137 modelname="ipodvideo"
1138 target="-DIPOD_VIDEO"
1139 arm7tdmicc
1140 tool="$rootdir/tools/scramble -add=ipvd"
1141 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1142 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1143 output="rockbox.ipod"
1144 appextra="recorder:gui"
1145 plugins="yes"
1146 swcodec="yes"
1147 bootoutput="bootloader-$modelname.ipod"
1148 # toolset is the tools within the tools directory that we build for
1149 # this particular target.
1150 toolset=$ipodbitmaptools
1151 # architecture, manufacturer and model for the target-tree build
1152 t_cpu="arm"
1153 t_manufacturer="ipod"
1154 t_model="video"
1157 23|ipod3g)
1158 target_id=16
1159 modelname="ipod3g"
1160 target="-DIPOD_3G"
1161 memory=32 # always
1162 arm7tdmicc
1163 tool="$rootdir/tools/scramble -add=ip3g"
1164 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1165 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1166 output="rockbox.ipod"
1167 appextra="recorder:gui"
1168 plugins="yes"
1169 swcodec="yes"
1170 bootoutput="bootloader-$modelname.ipod"
1171 # toolset is the tools within the tools directory that we build for
1172 # this particular target.
1173 toolset=$ipodbitmaptools
1174 # architecture, manufacturer and model for the target-tree build
1175 t_cpu="arm"
1176 t_manufacturer="ipod"
1177 t_model="3g"
1180 24|ipod4g)
1181 target_id=17
1182 modelname="ipod4g"
1183 target="-DIPOD_4G"
1184 memory=32 # always
1185 arm7tdmicc
1186 tool="$rootdir/tools/scramble -add=ip4g"
1187 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1188 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1189 output="rockbox.ipod"
1190 appextra="recorder:gui"
1191 plugins="yes"
1192 swcodec="yes"
1193 bootoutput="bootloader-$modelname.ipod"
1194 # toolset is the tools within the tools directory that we build for
1195 # this particular target.
1196 toolset=$ipodbitmaptools
1197 # architecture, manufacturer and model for the target-tree build
1198 t_cpu="arm"
1199 t_manufacturer="ipod"
1200 t_model="4g"
1203 25|ipodmini)
1204 target_id=18
1205 modelname="ipodmini"
1206 target="-DIPOD_MINI"
1207 memory=32 # always
1208 arm7tdmicc
1209 tool="$rootdir/tools/scramble -add=mini"
1210 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1211 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1212 output="rockbox.ipod"
1213 appextra="recorder:gui"
1214 plugins="yes"
1215 swcodec="yes"
1216 bootoutput="bootloader-$modelname.ipod"
1217 # toolset is the tools within the tools directory that we build for
1218 # this particular target.
1219 toolset=$ipodbitmaptools
1220 # architecture, manufacturer and model for the target-tree build
1221 t_cpu="arm"
1222 t_manufacturer="ipod"
1223 t_model="mini"
1226 26|ipodmini2g)
1227 target_id=21
1228 modelname="ipodmini2g"
1229 target="-DIPOD_MINI2G"
1230 memory=32 # always
1231 arm7tdmicc
1232 tool="$rootdir/tools/scramble -add=mn2g"
1233 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1234 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1235 output="rockbox.ipod"
1236 appextra="recorder:gui"
1237 plugins="yes"
1238 swcodec="yes"
1239 bootoutput="bootloader-$modelname.ipod"
1240 # toolset is the tools within the tools directory that we build for
1241 # this particular target.
1242 toolset=$ipodbitmaptools
1243 # architecture, manufacturer and model for the target-tree build
1244 t_cpu="arm"
1245 t_manufacturer="ipod"
1246 t_model="mini2g"
1249 27|ipod1g2g)
1250 target_id=29
1251 modelname="ipod1g2g"
1252 target="-DIPOD_1G2G"
1253 memory=32 # always
1254 arm7tdmicc
1255 tool="$rootdir/tools/scramble -add=1g2g"
1256 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1257 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1258 output="rockbox.ipod"
1259 appextra="recorder:gui"
1260 plugins="yes"
1261 swcodec="yes"
1262 bootoutput="bootloader-$modelname.ipod"
1263 # toolset is the tools within the tools directory that we build for
1264 # this particular target.
1265 toolset=$ipodbitmaptools
1266 # architecture, manufacturer and model for the target-tree build
1267 t_cpu="arm"
1268 t_manufacturer="ipod"
1269 t_model="1g2g"
1272 30|x5)
1273 target_id=12
1274 modelname="x5"
1275 target="-DIAUDIO_X5"
1276 memory=16 # always
1277 coldfirecc
1278 tool="$rootdir/tools/scramble -add=iax5"
1279 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1280 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1281 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1282 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1283 output="rockbox.iaudio"
1284 appextra="recorder:gui"
1285 plugins="yes"
1286 swcodec="yes"
1287 # toolset is the tools within the tools directory that we build for
1288 # this particular target.
1289 toolset="$iaudiobitmaptools"
1290 # architecture, manufacturer and model for the target-tree build
1291 t_cpu="coldfire"
1292 t_manufacturer="iaudio"
1293 t_model="x5"
1296 31|m5)
1297 target_id=28
1298 modelname="m5"
1299 target="-DIAUDIO_M5"
1300 memory=16 # always
1301 coldfirecc
1302 tool="$rootdir/tools/scramble -add=iam5"
1303 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1304 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1305 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1306 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1307 output="rockbox.iaudio"
1308 appextra="recorder:gui"
1309 plugins="yes"
1310 swcodec="yes"
1311 # toolset is the tools within the tools directory that we build for
1312 # this particular target.
1313 toolset="$iaudiobitmaptools"
1314 # architecture, manufacturer and model for the target-tree build
1315 t_cpu="coldfire"
1316 t_manufacturer="iaudio"
1317 t_model="m5"
1320 32|iaudio7)
1321 target_id=32
1322 modelname="iaudio7"
1323 target="-DIAUDIO_7"
1324 memory=16 # always
1325 arm946cc
1326 tool="$rootdir/tools/scramble -add=i7"
1327 boottool="$rootdir/tools/scramble -tcc=crc"
1328 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1329 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1330 output="rockbox.iaudio"
1331 appextra="recorder:gui"
1332 plugins="yes"
1333 swcodec="yes"
1334 bootoutput="I7_FW.BIN"
1335 # toolset is the tools within the tools directory that we build for
1336 # this particular target.
1337 toolset="$tccbitmaptools"
1338 # architecture, manufacturer and model for the target-tree build
1339 t_cpu="arm"
1340 t_manufacturer="tcc77x"
1341 t_model="iaudio7"
1344 33|cowond2)
1345 target_id=34
1346 modelname="cowond2"
1347 target="-DCOWON_D2"
1348 memory=32
1349 arm926ejscc
1350 tool="$rootdir/tools/scramble -add=d2"
1351 boottool="$rootdir/tools/scramble -tcc=crc"
1352 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1353 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1354 output="rockbox.d2"
1355 appextra="recorder:gui"
1356 plugins="yes"
1357 swcodec="yes"
1358 toolset="$tccbitmaptools"
1359 # architecture, manufacturer and model for the target-tree build
1360 t_cpu="arm"
1361 t_manufacturer="tcc780x"
1362 t_model="cowond2"
1365 34|m3)
1366 target_id=37
1367 modelname="m3"
1368 target="-DIAUDIO_M3"
1369 memory=16 # always
1370 coldfirecc
1371 tool="$rootdir/tools/scramble -add=iam3"
1372 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1373 bmp2rb_native="$rootdir/tools/bmp2rb -f 7"
1374 output="rockbox.iaudio"
1375 appextra="recorder:gui"
1376 plugins="yes"
1377 swcodec="yes"
1378 # toolset is the tools within the tools directory that we build for
1379 # this particular target.
1380 toolset="$iaudiobitmaptools"
1381 # architecture, manufacturer and model for the target-tree build
1382 t_cpu="coldfire"
1383 t_manufacturer="iaudio"
1384 t_model="m3"
1387 40|gigabeatf)
1388 target_id=20
1389 modelname="gigabeatf"
1390 target="-DGIGABEAT_F"
1391 memory=32 # always
1392 arm9tdmicc
1393 tool="$rootdir/tools/scramble -add=giga"
1394 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1395 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1396 output="rockbox.gigabeat"
1397 appextra="recorder:gui"
1398 plugins="yes"
1399 swcodec="yes"
1400 toolset=$gigabeatbitmaptools
1401 boottool="$rootdir/tools/scramble -gigabeat"
1402 bootoutput="FWIMG01.DAT"
1403 # architecture, manufacturer and model for the target-tree build
1404 t_cpu="arm"
1405 t_manufacturer="s3c2440"
1406 t_model="gigabeat-fx"
1409 41|gigabeats)
1410 target_id=26
1411 modelname="gigabeats"
1412 target="-DGIGABEAT_S"
1413 memory=64
1414 arm1136jfscc
1415 tool="$rootdir/tools/scramble -add=gigs"
1416 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1417 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1418 output="rockbox.gigabeat"
1419 appextra="recorder:gui"
1420 plugins="yes"
1421 swcodec="yes"
1422 toolset="$gigabeatbitmaptools mknkboot"
1423 boottool="$rootdir/tools/scramble -gigabeats"
1424 bootoutput="nk.bin"
1425 # architecture, manufacturer and model for the target-tree build
1426 t_cpu="arm"
1427 t_manufacturer="imx31"
1428 t_model="gigabeat-s"
1431 70|mrobe500)
1432 target_id=36
1433 modelname="mrobe500"
1434 target="-DMROBE_500"
1435 memory=64 # always
1436 arm926ejscc
1437 tool="$rootdir/tools/scramble -add=m500"
1438 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1439 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1440 output="rockbox.mrobe500"
1441 appextra="recorder:gui"
1442 plugins="yes"
1443 swcodec="yes"
1444 toolset=$gigabeatbitmaptools
1445 boottool="cp "
1446 bootoutput="rockbox.mrboot"
1447 # architecture, manufacturer and model for the target-tree build
1448 t_cpu="arm"
1449 t_manufacturer="tms320dm320"
1450 t_model="mrobe-500"
1453 71|mrobe100)
1454 target_id=33
1455 modelname="mrobe100"
1456 target="-DMROBE_100"
1457 memory=32 # always
1458 arm7tdmicc
1459 tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS"
1460 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1461 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1462 output="rockbox.mi4"
1463 appextra="recorder:gui"
1464 plugins="yes"
1465 swcodec="yes"
1466 boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL"
1467 bootoutput="pp5020.mi4"
1468 # toolset is the tools within the tools directory that we build for
1469 # this particular target.
1470 toolset=$scramblebitmaptools
1471 # architecture, manufacturer and model for the target-tree build
1472 t_cpu="arm"
1473 t_manufacturer="olympus"
1474 t_model="mrobe-100"
1477 80|logikdax)
1478 target_id=31
1479 modelname="logikdax"
1480 target="-DLOGIK_DAX"
1481 memory=2 # always
1482 arm946cc
1483 tool="$rootdir/tools/scramble -add=ldax"
1484 boottool="$rootdir/tools/scramble -tcc=crc"
1485 bootoutput="player.rom"
1486 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1487 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1488 output="rockbox.logik"
1489 appextra="recorder:gui"
1490 plugins=""
1491 swcodec="yes"
1492 # toolset is the tools within the tools directory that we build for
1493 # this particular target.
1494 toolset=$tccbitmaptools
1495 # architecture, manufacturer and model for the target-tree build
1496 t_cpu="arm"
1497 t_manufacturer="tcc77x"
1498 t_model="logikdax"
1501 90|creativezvm30gb)
1502 target_id=35
1503 modelname="creativezvm30"
1504 target="-DCREATIVE_ZVM"
1505 memory=64
1506 arm926ejscc
1507 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1508 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1509 tool="$rootdir/tools/scramble -creative=zvm"
1510 USE_ELF="yes"
1511 output="rockbox.zvm"
1512 appextra="recorder:gui"
1513 plugins="yes"
1514 swcodec="yes"
1515 toolset=$ipodbitmaptools
1516 boottool="$rootdir/tools/scramble -creative=zvm -no-ciff"
1517 bootoutput="rockbox.zvmboot"
1518 # architecture, manufacturer and model for the target-tree build
1519 t_cpu="arm"
1520 t_manufacturer="tms320dm320"
1521 t_model="creative-zvm"
1524 91|creativezvm60gb)
1525 target_id=40
1526 modelname="creativezvm60"
1527 target="-DCREATIVE_ZVM60GB"
1528 memory=64
1529 arm926ejscc
1530 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1531 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1532 tool="$rootdir/tools/scramble -creative=zvm60 -no-ciff"
1533 USE_ELF="yes"
1534 output="rockbox.zvm60"
1535 appextra="recorder:gui"
1536 plugins="yes"
1537 swcodec="yes"
1538 toolset=$ipodbitmaptools
1539 boottool="$rootdir/tools/scramble -creative=zvm60"
1540 bootoutput="rockbox.zvm60boot"
1541 # architecture, manufacturer and model for the target-tree build
1542 t_cpu="arm"
1543 t_manufacturer="tms320dm320"
1544 t_model="creative-zvm"
1547 92|creativezenvision)
1548 target_id=39
1549 modelname="creativezv"
1550 target="-DCREATIVE_ZV"
1551 memory=64
1552 arm926ejscc
1553 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1554 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1555 tool="$rootdir/tools/scramble -creative=zenvision -no-ciff"
1556 USE_ELF="yes"
1557 output="rockbox.zv"
1558 appextra="recorder:gui"
1559 plugins=""
1560 swcodec="yes"
1561 toolset=$ipodbitmaptools
1562 boottool="$rootdir/tools/scramble -creative=zenvision"
1563 bootoutput="rockbox.zvboot"
1564 # architecture, manufacturer and model for the target-tree build
1565 t_cpu="arm"
1566 t_manufacturer="tms320dm320"
1567 t_model="creative-zvm"
1570 50|e200)
1571 target_id=23
1572 modelname="e200"
1573 target="-DSANSA_E200"
1574 memory=32 # supposedly
1575 arm7tdmicc
1576 tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1577 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1578 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1579 output="rockbox.mi4"
1580 appextra="recorder:gui"
1581 plugins="yes"
1582 swcodec="yes"
1583 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1584 bootoutput="PP5022.mi4"
1585 # toolset is the tools within the tools directory that we build for
1586 # this particular target.
1587 toolset=$scramblebitmaptools
1588 # architecture, manufacturer and model for the target-tree build
1589 t_cpu="arm"
1590 t_manufacturer="sandisk"
1591 t_model="sansa-e200"
1594 51|e200r)
1595 # the e200R model is pretty much identical to the e200, it only has a
1596 # different option to the scramble tool when building a bootloader and
1597 # makes the bootloader output file name in all lower case.
1598 target_id=27
1599 modelname="e200r"
1600 target="-DSANSA_E200"
1601 memory=32 # supposedly
1602 arm7tdmicc
1603 tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1604 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1605 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1606 output="rockbox.mi4"
1607 appextra="recorder:gui"
1608 plugins="yes"
1609 swcodec="yes"
1610 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1611 bootoutput="pp5022.mi4"
1612 # toolset is the tools within the tools directory that we build for
1613 # this particular target.
1614 toolset=$scramblebitmaptools
1615 # architecture, manufacturer and model for the target-tree build
1616 t_cpu="arm"
1617 t_manufacturer="sandisk"
1618 t_model="sansa-e200"
1621 52|c200)
1622 target_id=30
1623 modelname="c200"
1624 target="-DSANSA_C200"
1625 memory=32 # supposedly
1626 arm7tdmicc
1627 tool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBOS"
1628 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1629 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1630 output="rockbox.mi4"
1631 appextra="recorder:gui"
1632 plugins="yes"
1633 swcodec="yes"
1634 boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
1635 bootoutput="firmware.mi4"
1636 # toolset is the tools within the tools directory that we build for
1637 # this particular target.
1638 toolset=$scramblebitmaptools
1639 # architecture, manufacturer and model for the target-tree build
1640 t_cpu="arm"
1641 t_manufacturer="sandisk"
1642 t_model="sansa-c200"
1645 53|m200)
1646 target_id=48
1647 modelname="m200"
1648 target="-DSANSA_M200"
1649 memory=1 # always
1650 arm946cc
1651 tool="$rootdir/tools/scramble -add=m200"
1652 boottool="$rootdir/tools/scramble -tcc=crc"
1653 bootoutput="player.rom"
1654 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1655 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1656 output="rockbox.m200"
1657 appextra="recorder:gui"
1658 plugins=""
1659 swcodec="yes"
1660 # toolset is the tools within the tools directory that we build for
1661 # this particular target.
1662 toolset=$tccbitmaptools
1663 # architecture, manufacturer and model for the target-tree build
1664 t_cpu="arm"
1665 t_manufacturer="tcc77x"
1666 t_model="m200"
1669 54|c100)
1670 target_id=42
1671 modelname="c100"
1672 target="-DSANSA_C100"
1673 memory=32 # unsure, must check
1674 arm946cc
1675 tool="$rootdir/tools/scramble -add=c100"
1676 boottool="$rootdir/tools/scramble -tcc=crc"
1677 bootoutput="player.rom"
1678 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1679 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1680 output="rockbox.c100"
1681 appextra="recorder:gui"
1682 plugins=""
1683 # toolset is the tools within the tools directory that we build for
1684 # this particular target.
1685 toolset=$tccbitmaptools
1686 # architecture, manufacturer and model for the target-tree build
1687 t_cpu="arm"
1688 t_manufacturer="tcc77x"
1689 t_model="c100"
1692 55|Clip|clip)
1693 target_id=50
1694 modelname="clip"
1695 target="-DSANSA_CLIP"
1696 memory=2
1697 arm9tdmicc
1698 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1699 bmp2rb_native="$bmp2rb_mono"
1700 tool="$rootdir/tools/scramble -add=clip"
1701 output="rockbox.sansa"
1702 bootoutput="bootloader-clip.sansa"
1703 appextra="recorder:gui"
1704 plugins="yes"
1705 swcodec="yes"
1706 toolset=$scramblebitmaptools
1707 t_cpu="arm"
1708 t_manufacturer="as3525"
1709 t_model="sansa-clip"
1713 56|e200v2)
1714 target_id=51
1715 modelname="e200v2"
1716 target="-DSANSA_E200V2"
1717 memory=8
1718 arm9tdmicc
1719 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1720 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1721 tool="$rootdir/tools/scramble -add=e2v2"
1722 output="rockbox.sansa"
1723 bootoutput="bootloader-e200v2.sansa"
1724 appextra="recorder:gui"
1725 plugins="yes"
1726 swcodec="yes"
1727 toolset=$scramblebitmaptools
1728 t_cpu="arm"
1729 t_manufacturer="as3525"
1730 t_model="sansa-e200v2"
1734 57|m200v4)
1735 target_id=52
1736 modelname="m200v4"
1737 target="-DSANSA_M200V4"
1738 memory=2
1739 arm9tdmicc
1740 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1741 bmp2rb_native="$bmp2rb_mono"
1742 tool="$rootdir/tools/scramble -add=m2v4"
1743 output="rockbox.sansa"
1744 bootoutput="bootloader-m200v4.sansa"
1745 appextra="recorder:gui"
1746 plugins="yes"
1747 swcodec="yes"
1748 toolset=$scramblebitmaptools
1749 t_cpu="arm"
1750 t_manufacturer="as3525"
1751 t_model="sansa-m200v4"
1755 58|fuze)
1756 target_id=53
1757 modelname="fuze"
1758 target="-DSANSA_FUZE"
1759 memory=8
1760 arm9tdmicc
1761 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1762 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1763 tool="$rootdir/tools/scramble -add=fuze"
1764 output="rockbox.sansa"
1765 bootoutput="bootloader-fuze.sansa"
1766 appextra="recorder:gui"
1767 plugins="yes"
1768 swcodec="yes"
1769 toolset=$scramblebitmaptools
1770 t_cpu="arm"
1771 t_manufacturer="as3525"
1772 t_model="sansa-fuze"
1776 59|c200v2)
1777 target_id=55
1778 modelname="c200v2"
1779 target="-DSANSA_C200V2"
1780 memory=2 # as per OF diagnosis mode
1781 arm9tdmicc
1782 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1783 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1784 tool="$rootdir/tools/scramble -add=c2v2"
1785 output="rockbox.sansa"
1786 bootoutput="bootloader-c200v2.sansa"
1787 appextra="recorder:gui"
1788 plugins="yes"
1789 swcodec="yes"
1790 # toolset is the tools within the tools directory that we build for
1791 # this particular target.
1792 toolset=$scramblebitmaptools
1793 # architecture, manufacturer and model for the target-tree build
1794 t_cpu="arm"
1795 t_manufacturer="as3525"
1796 t_model="sansa-c200v2"
1799 60|tpj1022)
1800 target_id=25
1801 modelname="tpj1022"
1802 target="-DELIO_TPJ1022"
1803 memory=32 # always
1804 arm7tdmicc
1805 tool="$rootdir/tools/scramble -add tpj2"
1806 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1807 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1808 output="rockbox.elio"
1809 appextra="recorder:gui"
1810 plugins="yes"
1811 swcodec="yes"
1812 boottool="$rootdir/tools/scramble -mi4v2"
1813 bootoutput="pp5020.mi4"
1814 # toolset is the tools within the tools directory that we build for
1815 # this particular target.
1816 toolset=$scramblebitmaptools
1817 # architecture, manufacturer and model for the target-tree build
1818 t_cpu="arm"
1819 t_manufacturer="tatung"
1820 t_model="tpj1022"
1823 100|sa9200)
1824 target_id=41
1825 modelname="sa9200"
1826 target="-DPHILIPS_SA9200"
1827 memory=32 # supposedly
1828 arm7tdmicc
1829 tool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBOS"
1830 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1831 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1832 output="rockbox.mi4"
1833 appextra="recorder:gui"
1834 plugins=""
1835 swcodec="yes"
1836 boottool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBBL"
1837 bootoutput="FWImage.ebn"
1838 # toolset is the tools within the tools directory that we build for
1839 # this particular target.
1840 toolset=$scramblebitmaptools
1841 # architecture, manufacturer and model for the target-tree build
1842 t_cpu="arm"
1843 t_manufacturer="philips"
1844 t_model="sa9200"
1847 101|hdd1630)
1848 target_id=43
1849 modelname="hdd1630"
1850 target="-DPHILIPS_HDD1630"
1851 memory=32 # supposedly
1852 arm7tdmicc
1853 tool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBOS"
1854 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1855 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1856 output="rockbox.mi4"
1857 appextra="recorder:gui"
1858 plugins="yes"
1859 swcodec="yes"
1860 boottool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBBL"
1861 bootoutput="FWImage.ebn"
1862 # toolset is the tools within the tools directory that we build for
1863 # this particular target.
1864 toolset=$scramblebitmaptools
1865 # architecture, manufacturer and model for the target-tree build
1866 t_cpu="arm"
1867 t_manufacturer="philips"
1868 t_model="hdd1630"
1871 110|meizum6sl)
1872 target_id=49
1873 modelname="meizum6sl"
1874 target="-DMEIZU_M6SL"
1875 memory=16 # always
1876 arm940tbecc
1877 tool="cp"
1878 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1879 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1880 output="rockbox.meizu"
1881 appextra="recorder:gui"
1882 plugins="no" #FIXME
1883 swcodec="yes"
1884 toolset=$genericbitmaptools
1885 boottool="cp"
1886 bootoutput="rockboot.ebn"
1887 # architecture, manufacturer and model for the target-tree build
1888 t_cpu="arm"
1889 t_manufacturer="s5l8700"
1890 t_model="meizu-m6sl"
1893 111|meizum6sp)
1894 target_id=46
1895 modelname="meizum6sp"
1896 target="-DMEIZU_M6SP"
1897 memory=16 # always
1898 arm940tbecc
1899 tool="cp"
1900 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1901 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1902 output="rockbox.meizu"
1903 appextra="recorder:gui"
1904 plugins="no" #FIXME
1905 swcodec="yes"
1906 toolset=$genericbitmaptools
1907 boottool="cp"
1908 bootoutput="rockboot.ebn"
1909 # architecture, manufacturer and model for the target-tree build
1910 t_cpu="arm"
1911 t_manufacturer="s5l8700"
1912 t_model="meizu-m6sp"
1915 112|meizum3)
1916 target_id=47
1917 modelname="meizum3"
1918 target="-DMEIZU_M3"
1919 memory=16 # always
1920 arm940tbecc
1921 tool="cp"
1922 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1923 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1924 output="rockbox.meizu"
1925 appextra="recorder:gui"
1926 plugins="no" #FIXME
1927 swcodec="yes"
1928 toolset=$genericbitmaptools
1929 boottool="cp"
1930 bootoutput="rockboot.ebn"
1931 # architecture, manufacturer and model for the target-tree build
1932 t_cpu="arm"
1933 t_manufacturer="s5l8700"
1934 t_model="meizu-m3"
1937 120|ondavx747)
1938 target_id=44
1939 modelname="ondavx747"
1940 target="-DONDA_VX747"
1941 memory=16
1942 mipselcc
1943 tool="$rootdir/tools/scramble -add=x747"
1944 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1945 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1946 output="rockbox.vx747"
1947 appextra="recorder:gui"
1948 plugins="" #FIXME
1949 swcodec="yes"
1950 toolset=$genericbitmaptools
1951 boottool="cp"
1952 bootoutput="rockboot.vx747"
1953 # architecture, manufacturer and model for the target-tree build
1954 t_cpu="mips"
1955 t_manufacturer="ingenic_jz47xx"
1956 t_model="onda_vx747"
1959 121|ondavx767)
1960 target_id=45
1961 modelname="ondavx767"
1962 target="-DONDA_VX767"
1963 memory=16 #FIXME
1964 mipselcc
1965 tool="cp"
1966 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1967 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1968 output="rockbox.vx767"
1969 appextra="recorder:gui"
1970 plugins="" #FIXME
1971 swcodec="yes"
1972 toolset=$genericbitmaptools
1973 boottool="cp"
1974 bootoutput="rockboot.vx767"
1975 # architecture, manufacturer and model for the target-tree build
1976 t_cpu="mips"
1977 t_manufacturer="ingenic_jz47xx"
1978 t_model="onda_vx767"
1981 122|ondavx747p)
1982 target_id=54
1983 modelname="ondavx747p"
1984 target="-DONDA_VX747P"
1985 memory=16 #FIXME
1986 mipselcc
1987 tool="cp"
1988 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1989 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1990 output="rockbox.vx747p"
1991 appextra="recorder:gui"
1992 plugins="" #FIXME
1993 swcodec="yes"
1994 toolset=$genericbitmaptools
1995 boottool="cp"
1996 bootoutput="rockboot.vx747p"
1997 # architecture, manufacturer and model for the target-tree build
1998 t_cpu="mips"
1999 t_manufacturer="ingenic_jz47xx"
2000 t_model="onda_vx747"
2004 echo "Please select a supported target platform!"
2005 exit 7
2008 esac
2010 echo "Platform set to $modelname"
2013 #remove start
2014 ############################################################################
2015 # Amount of memory, for those that can differ. They have $memory unset at
2016 # this point.
2019 if [ -z "$memory" ]; then
2020 case $target_id in
2022 echo "Enter size of your RAM (in MB): (Defaults to 32)"
2023 if [ "1" != `parse_args --ram` ]; then
2024 size=`parse_args --ram`;
2025 else
2026 size=`input`;
2028 case $size in
2029 60|64)
2030 memory="64"
2033 memory="32"
2035 esac
2038 echo "Enter size of your RAM (in MB): (Defaults to 2)"
2039 if [ "1" != `parse_args --ram` ]; then
2040 size=`parse_args --ram`;
2041 else
2042 size=`input`;
2044 case $size in
2046 memory="8"
2049 memory="2"
2051 esac
2053 esac
2054 echo "Memory size selected: $memory MB"
2055 echo ""
2057 #remove end
2059 ##################################################################
2060 # Figure out build "type"
2063 # the ifp7x0 is the only platform that supports building a gdb stub like
2064 # this
2065 case $modelname in
2066 ifp7xx)
2067 gdbstub="(G)DB stub, "
2069 e200r|e200)
2070 gdbstub="(I)installer, "
2072 c200)
2073 gdbstub="(E)raser, "
2077 esac
2078 if [ "1" != `parse_args --type` ]; then
2079 btype=`parse_args --type`;
2080 else
2081 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, $gdbstub(M)anual: (Defaults to N)"
2082 btype=`input`;
2085 case $btype in
2086 [Ii])
2087 appsdir='\$(ROOTDIR)/bootloader'
2088 apps="bootloader"
2089 extradefines="-DBOOTLOADER -DE200R_INSTALLER -ffunction-sections -fdata-sections"
2090 bootloader="1"
2091 echo "e200R-installer build selected"
2093 [Ee])
2094 appsdir='\$(ROOTDIR)/bootloader'
2095 apps="bootloader"
2096 echo "C2(4)0 or C2(5)0"
2097 variant=`input`
2098 case $variant in
2100 extradefines="-DBOOTLOADER -DC200_ERASE -DC240_ERASE -ffunction-sections -fdata-sections"
2101 echo "c240 eraser build selected"
2104 extradefines="-DBOOTLOADER -DC200_ERASE -DC250_ERASE -ffunction-sections -fdata-sections"
2105 echo "c240 eraser build selected"
2107 esac
2108 bootloader="1"
2109 echo "c200 eraser build selected"
2111 [Bb])
2112 if test $t_manufacturer = "archos"; then
2113 # Archos SH-based players do this somewhat differently for
2114 # some reason
2115 appsdir='\$(ROOTDIR)/flash/bootbox'
2116 apps="bootbox"
2117 else
2118 appsdir='\$(ROOTDIR)/bootloader'
2119 apps="bootloader"
2120 flash=""
2121 if test -n "$boottool"; then
2122 tool="$boottool"
2124 if test -n "$bootoutput"; then
2125 output=$bootoutput
2128 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
2129 bootloader="1"
2130 echo "Bootloader build selected"
2132 [Ss])
2133 debug="-DDEBUG"
2134 simulator="yes"
2135 extradefines="-DSIMULATOR"
2136 archosrom=""
2137 flash=""
2138 echo "Simulator build selected"
2140 [Aa])
2141 echo "Advanced build selected"
2142 whichadvanced
2144 [Gg])
2145 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
2146 appsdir='\$(ROOTDIR)/gdb'
2147 apps="stub"
2148 case $modelname in
2149 ifp7xx)
2150 output="stub.wma"
2154 esac
2155 echo "GDB stub build selected"
2157 [Mm])
2158 toolset='';
2159 apps="manual"
2160 echo "Manual build selected"
2163 if [ "$modelname" = "e200r" ]; then
2164 echo "Do not use the e200R target for regular builds. Use e200 instead."
2165 exit 8
2167 debug=""
2168 btype="N" # set it explicitly since RET only gets here as well
2169 echo "Normal build selected"
2172 esac
2173 # to be able running "make manual" from non-manual configuration
2174 case $modelname in
2175 fmrecorder)
2176 manualdev="recorderv2fm"
2178 recorderv2)
2179 manualdev="recorderv2fm"
2181 h1??)
2182 manualdev="h100"
2184 ipodmini2g)
2185 manualdev="ipodmini"
2188 manualdev=$modelname
2190 esac
2192 if [ -z "$debug" ]; then
2193 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
2196 echo "Using source code root directory: $rootdir"
2198 # this was once possible to change at build-time, but no more:
2199 language="english"
2201 uname=`uname`
2203 if [ "yes" = "$simulator" ]; then
2204 # setup compiler and things for simulator
2205 simcc
2207 if [ -d "simdisk" ]; then
2208 echo "Subdirectory 'simdisk' already present"
2209 else
2210 mkdir simdisk
2211 echo "Created a 'simdisk' subdirectory for simulating the hard disk"
2215 # Now, figure out version number of the (gcc) compiler we are about to use
2216 gccver=`$CC -dumpversion`;
2218 # figure out the binutil version too and display it, mostly for the build
2219 # system etc to be able to see it easier
2220 if [ $uname = "Darwin" ]; then
2221 ldver=`$LD -v 2>&1 | sed -e 's/[^0-9.-]//g'`
2222 else
2223 ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
2226 if [ -z "$gccver" ]; then
2227 echo "WARNING: The compiler you must use ($CC) is not in your path!"
2228 echo "WARNING: this may cause your build to fail since we cannot do the"
2229 echo "WARNING: checks we want now."
2230 else
2232 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
2233 # DEPEND on it
2235 num1=`echo $gccver | cut -d . -f1`
2236 num2=`echo $gccver | cut -d . -f2`
2237 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
2239 # This makes:
2240 # 3.3.X => 303
2241 # 3.4.X => 304
2242 # 2.95.3 => 295
2244 echo "Using $CC $gccver ($gccnum)"
2246 if test "$gccnum" -ge "400"; then
2247 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
2248 # so we ignore that warnings for now
2249 # -Wno-pointer-sign
2250 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
2253 if test "$gccnum" -ge "401"; then
2254 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
2255 # will break strict-aliasing rules"
2257 GCCOPTS="$GCCOPTS -fno-strict-aliasing"
2260 if test "$gccnum" -ge "402"; then
2261 # disable warning about "warning: initialized field overwritten" as gcc 4.2
2262 # and later would throw it for several valid cases
2263 GCCOPTS="$GCCOPTS -Wno-override-init"
2266 case $prefix in
2268 # simulator
2270 i586-mingw32msvc-)
2271 # cross-compile for win32
2274 # Verify that the cross-compiler is of a recommended version!
2275 if test "$gccver" != "$gccchoice"; then
2276 echo "WARNING: Your cross-compiler $CC $gccver is not of the recommended"
2277 echo "WARNING: version $gccchoice!"
2278 echo "WARNING: This may cause your build to fail since it may be a version"
2279 echo "WARNING: that isn't functional or known to not be the best choice."
2280 echo "WARNING: If you suffer from build problems, you know that this is"
2281 echo "WARNING: a likely source for them..."
2284 esac
2289 echo "Using $LD $ldver"
2291 # check the compiler for SH platforms
2292 if test "$CC" = "sh-elf-gcc"; then
2293 if test "$gccnum" -lt "400"; then
2294 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
2295 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2296 else
2297 # figure out patch status
2298 gccpatch=`$CC --version`;
2300 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
2301 echo "gcc $gccver is rockbox patched"
2302 # then convert -O to -Os to get smaller binaries!
2303 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2304 else
2305 echo "WARNING: You use an unpatched gcc compiler: $gccver"
2306 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2311 if test "$CC" = "m68k-elf-gcc"; then
2312 # convert -O to -Os to get smaller binaries!
2313 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2316 if [ "1" != `parse_args --ccache` ]; then
2317 echo "Enable ccache for building"
2318 ccache="ccache"
2319 else
2320 if [ "1" = `parse_args --no-ccache` ]; then
2321 ccache=`findtool ccache`
2322 if test -n "$ccache"; then
2323 echo "Found and uses ccache ($ccache)"
2328 # figure out the full path to the various commands if possible
2329 HOSTCC=`findtool gcc --lit`
2330 HOSTAR=`findtool ar --lit`
2331 CC=`findtool ${CC} --lit`
2332 LD=`findtool ${AR} --lit`
2333 AR=`findtool ${AR} --lit`
2334 AS=`findtool ${AS} --lit`
2335 OC=`findtool ${OC} --lit`
2336 WINDRES=`findtool ${WINDRES} --lit`
2337 DLLTOOL=`findtool ${DLLTOOL} --lit`
2338 DLLWRAP=`findtool ${DLLWRAP} --lit`
2339 RANLIB=`findtool ${RANLIB} --lit`
2341 if test -n "$ccache"; then
2342 CC="$ccache $CC"
2345 if test "X$endian" = "Xbig"; then
2346 defendian="ROCKBOX_BIG_ENDIAN"
2347 else
2348 defendian="ROCKBOX_LITTLE_ENDIAN"
2351 if [ "1" != `parse_args --rbdir` ]; then
2352 rbdir=`parse_args --rbdir`;
2353 echo "Using alternate rockbox dir: ${rbdir}"
2356 sed > autoconf.h \
2357 -e "s,@ENDIAN@,${defendian},g" \
2358 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
2359 -e "s,@config_rtc@,$config_rtc,g" \
2360 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
2361 -e "s,@RBDIR@,${rbdir},g" \
2362 <<EOF
2363 /* This header was made by configure */
2364 #ifndef __BUILD_AUTOCONF_H
2365 #define __BUILD_AUTOCONF_H
2367 /* Define endianess for the target or simulator platform */
2368 #define @ENDIAN@ 1
2370 /* Define this if you build rockbox to support the logf logging and display */
2371 #undef ROCKBOX_HAS_LOGF
2373 /* optional defines for RTC mod for h1x0 */
2374 @config_rtc@
2375 @have_rtc_alarm@
2377 /* root of Rockbox */
2378 #define ROCKBOX_DIR "/@RBDIR@"
2380 #endif /* __BUILD_AUTOCONF_H */
2383 if test -n "$t_cpu"; then
2384 TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
2385 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
2386 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
2387 GCCOPTS="$GCCOPTS"
2390 if test "$simulator" = "yes"; then
2391 # add simul make stuff on the #SIMUL# line
2392 simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
2393 simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
2394 else
2395 # delete the lines that match
2396 simmagic1='/@SIMUL1@/D'
2397 simmagic2='/@SIMUL2@/D'
2400 if test "$swcodec" = "yes"; then
2401 voicetoolset="rbspeexenc voicefont wavtrim"
2402 else
2403 voicetoolset="voicefont wavtrim"
2406 if test "$apps" = "apps"; then
2407 # only when we build "real" apps we build the .lng files
2408 buildlangs="langs"
2411 #### Fix the cmdline ###
2412 if test -n "$ccache"; then
2413 cmdline="--ccache"
2416 cmdline="$cmdline --target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype"
2419 ### end of cmdline
2421 sed > Makefile \
2422 -e "s,@ROOTDIR@,${rootdir},g" \
2423 -e "s,@DEBUG@,${debug},g" \
2424 -e "s,@MEMORY@,${memory},g" \
2425 -e "s,@TARGET_ID@,${target_id},g" \
2426 -e "s,@TARGET@,${target},g" \
2427 -e "s,@CPU@,${t_cpu},g" \
2428 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
2429 -e "s,@MODELNAME@,${modelname},g" \
2430 -e "s,@LANGUAGE@,${language},g" \
2431 -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
2432 -e "s,@PWD@,${pwd},g" \
2433 -e "s,@HOSTCC@,${HOSTCC},g" \
2434 -e "s,@HOSTAR@,${HOSTAR},g" \
2435 -e "s,@CC@,${CC},g" \
2436 -e "s,@LD@,${LD},g" \
2437 -e "s,@AR@,${AR},g" \
2438 -e "s,@AS@,${AS},g" \
2439 -e "s,@OC@,${OC},g" \
2440 -e "s,@WINDRES@,${WINDRES},g" \
2441 -e "s,@DLLTOOL@,${DLLTOOL},g" \
2442 -e "s,@DLLWRAP@,${DLLWRAP},g" \
2443 -e "s,@RANLIB@,${RANLIB},g" \
2444 -e "s,@TOOL@,${tool},g" \
2445 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
2446 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
2447 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
2448 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
2449 -e "s,@OUTPUT@,${output},g" \
2450 -e "s,@APPEXTRA@,${appextra},g" \
2451 -e "s,@ARCHOSROM@,${archosrom},g" \
2452 -e "s,@FLASHFILE@,${flash},g" \
2453 -e "s,@PLUGINS@,${plugins},g" \
2454 -e "s,@CODECS@,${swcodec},g" \
2455 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
2456 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
2457 -e "s,@GCCOPTS@,${GCCOPTS},g" \
2458 -e "s,@TARGET_INC@,${TARGET_INC},g" \
2459 -e "s!@LDOPTS@!${LDOPTS}!g" \
2460 -e "s,@LOADADDRESS@,${loadaddress},g" \
2461 -e "s,@EXTRADEF@,${extradefines},g" \
2462 -e "s,@APPSDIR@,${appsdir},g" \
2463 -e "s,@FIRMDIR@,${firmdir},g" \
2464 -e "s,@TOOLSDIR@,${toolsdir},g" \
2465 -e "s,@APPS@,${apps},g" \
2466 -e "s,@SIMVER@,${simver},g" \
2467 -e "s,@GCCVER@,${gccver},g" \
2468 -e "s,@GCCNUM@,${gccnum},g" \
2469 -e "s,@UNAME@,${uname},g" \
2470 -e "s,@ENDIAN@,${defendian},g" \
2471 -e "s,@TOOLSET@,${toolset},g" \
2472 -e "${simmagic1}" \
2473 -e "${simmagic2}" \
2474 -e "s,@MANUALDEV@,${manualdev},g" \
2475 -e "s,@ENCODER@,${ENC_CMD},g" \
2476 -e "s,@ENC_OPTS@,${ENC_OPTS},g" \
2477 -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
2478 -e "s,@TTS_OPTS@,${TTS_OPTS},g" \
2479 -e "s,@VOICETOOLSET@,${voicetoolset},g" \
2480 -e "s,@LANGS@,${buildlangs},g" \
2481 -e "s,@USE_ELF@,${USE_ELF},g" \
2482 -e "s,@RBDIR@,${rbdir},g" \
2483 -e "s,@CMDLINE@,$cmdline,g" \
2484 <<EOF
2485 ## Automatically generated. http://www.rockbox.org/
2487 export ROOTDIR=@ROOTDIR@
2488 export FIRMDIR=@FIRMDIR@
2489 export APPSDIR=@APPSDIR@
2490 export TOOLSDIR=@TOOLSDIR@
2491 export DOCSDIR=\$(ROOTDIR)/docs
2492 export MANUALDIR=\${ROOTDIR}/manual
2493 export DEBUG=@DEBUG@
2494 export MODELNAME=@MODELNAME@
2495 export ARCHOSROM=@ARCHOSROM@
2496 export FLASHFILE=@FLASHFILE@
2497 export TARGET_ID=@TARGET_ID@
2498 export TARGET=@TARGET@
2499 export CPU=@CPU@
2500 export MANUFACTURER=@MANUFACTURER@
2501 export OBJDIR=@PWD@
2502 export BUILDDIR=@PWD@
2503 export LANGUAGE=@LANGUAGE@
2504 export VOICELANGUAGE=@VOICELANGUAGE@
2505 export MEMORYSIZE=@MEMORY@
2506 export VERSION:=\$(shell \$(ROOTDIR)/tools/version.sh \$(ROOTDIR))
2507 export BUILDDATE:=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
2508 export MKFIRMWARE=@TOOL@
2509 export BMP2RB_MONO=@BMP2RB_MONO@
2510 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
2511 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
2512 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
2513 export BINARY=@OUTPUT@
2514 export APPEXTRA=@APPEXTRA@
2515 export ENABLEDPLUGINS=@PLUGINS@
2516 export SOFTWARECODECS=@CODECS@
2517 export EXTRA_DEFINES=@EXTRADEF@
2518 export HOSTCC=@HOSTCC@
2519 export HOSTAR=@HOSTAR@
2520 export CC=@CC@
2521 export LD=@LD@
2522 export AR=@AR@
2523 export AS=@AS@
2524 export OC=@OC@
2525 export WINDRES=@WINDRES@
2526 export DLLTOOL=@DLLTOOL@
2527 export DLLWRAP=@DLLWRAP@
2528 export RANLIB=@RANLIB@
2529 export PROFILE_OPTS=@PROFILE_OPTS@
2530 export SIMVER=@SIMVER@
2531 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
2532 export GCCOPTS=@GCCOPTS@
2533 export TARGET_INC=@TARGET_INC@
2534 export LOADADDRESS=@LOADADDRESS@
2535 export SHARED_FLAG=@SHARED_FLAG@
2536 export LDOPTS=@LDOPTS@
2537 export GCCVER=@GCCVER@
2538 export GCCNUM=@GCCNUM@
2539 export UNAME=@UNAME@
2540 export MANUALDEV=@MANUALDEV@
2541 export TTS_OPTS=@TTS_OPTS@
2542 export TTS_ENGINE=@TTS_ENGINE@
2543 export ENC_OPTS=@ENC_OPTS@
2544 export ENCODER=@ENCODER@
2545 export USE_ELF=@USE_ELF@
2546 export RBDIR=@RBDIR@
2548 CONFIGURE_OPTIONS=@CMDLINE@
2550 include \$(TOOLSDIR)/root.make
2554 echo "Created Makefile"