Optimize hline, fillrect and mono bitmap drawing for chunky displays (16 bit colour...
[kugel-rb.git] / tools / configure
blobcc5c76e0fc6a9b2dc20bd30d693f005cfce3fda7
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 # Select which voice to use for Festival
530 if [ "$TTS_ENGINE" = "festival" ]; then
532 for voice in `echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1/'|sort`; do
533 if [ "$i" = "1" ]; then
534 TTS_FESTIVAL_VOICE="$voice" # Default choice
536 printf "%3d. %s\n" "$i" "$voice"
537 i=`expr $i + 1`
538 done
539 printf "Please select which Festival voice to use (default is $TTS_FESTIVAL_VOICE): "
540 CHOICE=`input`
542 for voice in `echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1/'|sort`; do
543 if [ "$i" = "$CHOICE" -o "$voice" = "$CHOICE" ]; then
544 TTS_FESTIVAL_VOICE="$voice"
546 i=`expr $i + 1`
547 done
548 echo "Festival voice set to $TTS_FESTIVAL_VOICE"
549 echo "(voice_$TTS_FESTIVAL_VOICE)" > festival-prolog.scm
552 # Allow the user to input manual commandline options
553 printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): "
554 USER_TTS_OPTS=`input`
555 if [ -n "$USER_TTS_OPTS" ]; then
556 TTS_OPTS="$USER_TTS_OPTS"
559 echo ""
561 if [ "$swcodec" = "yes" ]; then
562 ENCODER="rbspeexenc"
563 ENC_CMD="rbspeexenc"
564 ENC_OPTS="-q 4 -c 10"
565 else
566 if [ -n "`findtool lame`" ]; then
567 ENCODER="lame"
568 ENC_CMD="lame"
569 ENC_OPTS="--resample 12 -t -m m -h -V 9 -S -B 64 --vbr-new"
570 else
571 echo "You need LAME in the system path to build voice files for"
572 echo "HWCODEC targets."
573 exit 4
577 echo "Using $ENCODER for encoding voice clips"
579 # Allow the user to input manual commandline options
580 printf "Enter $ENCODER options (enter for defaults \"$ENC_OPTS\"): "
581 USER_ENC_OPTS=`input`
582 if [ -n "$USER_ENC_OPTS" ]; then
583 ENC_OPTS=$USER_ENC_OPTS
586 TEMPDIR="${pwd}"
587 if [ -n "`findtool cygpath`" ]; then
588 TEMPDIR=`cygpath . -a -w`
592 picklang() {
593 # figure out which languages that are around
594 for file in $rootdir/apps/lang/*.lang; do
595 clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
596 langs="$langs $clean"
597 done
599 num=1
600 for one in $langs; do
601 echo "$num. $one"
602 num=`expr $num + 1`
603 done
605 read pick
608 whichlang() {
609 output=""
610 # Allow the user to pass a comma-separated list of langauges
611 for thispick in `echo $pick | sed 's/,/ /g'`; do
612 num=1
613 for one in $langs; do
614 # Accept both the language number and name
615 if [ "$num" = "$thispick" ] || [ "$thispick" = "$one" ]; then
616 if [ "$output" = "" ]; then
617 output=$one
618 else
619 output=$output,$one
622 num=`expr $num + 1`
623 done
624 done
625 echo $output
628 opt=$1
630 if test "$opt" = "--help"; then
631 echo "Rockbox configure script."
632 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
633 echo "Do *NOT* run this within the tools directory!"
634 echo ""
635 cat <<EOF
636 Usage: configure [OPTION]...
637 Options:
638 --target=TARGET Sets the target, TARGET can be either the target ID or
639 corresponding string. Run without this option to see all
640 available targets.
642 --ram=RAM Sets the RAM for certain targets. Even though any number
643 is accepted, not every number is correct. The default
644 value will be applied, if you entered a wrong number
645 (which depends on the target). Watch the output. Run
646 without this option if you are not sure which the right
647 number is.
649 --type=TYPE Sets the build type. The shortcut is also valid.
650 Run without this option to see available types.
652 --rbdir=dir Use alternative rockbox directory (default: ${rbdir}).
653 This is useful for having multiple alternate builds on
654 your device that you can load with ROLO. However as the
655 bootloader looks for .rockbox you won't be able to boot
656 into this build.
658 --ccache Enable ccache use (done by default these days)
659 --no-ccache Disable ccache use
660 --help Shows this message (must not be used with other options)
664 exit
667 if test -r "configure"; then
668 # this is a check for a configure script in the current directory, it there
669 # is one, try to figure out if it is this one!
671 if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
672 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
673 echo "It will only cause you pain and grief. Instead do this:"
674 echo ""
675 echo " cd .."
676 echo " mkdir build-dir"
677 echo " cd build-dir"
678 echo " ../tools/configure"
679 echo ""
680 echo "Much happiness will arise from this. Enjoy"
681 exit 5
685 # get our current directory
686 pwd=`pwd`;
688 if { echo $pwd | grep " "; } then
689 echo "You're running this script in a path that contains space. The build"
690 echo "system is unfortunately not clever enough to deal with this. Please"
691 echo "run the script from a different path, rename the path or fix the build"
692 echo "system!"
693 exit 6
696 if [ -z "$rootdir" ]; then
697 ##################################################################
698 # Figure out where the source code root is!
700 rootdir=`dirname $0`/../
702 #####################################################################
703 # Convert the possibly relative directory name to an absolute version
705 now=`pwd`
706 cd $rootdir
707 rootdir=`pwd`
709 # cd back to the build dir
710 cd $now
713 apps="apps"
714 appsdir='\$(ROOTDIR)/apps'
715 firmdir='\$(ROOTDIR)/firmware'
716 toolsdir='\$(ROOTDIR)/tools'
719 ##################################################################
720 # Figure out target platform
723 if [ "1" != `parse_args --target` ]; then
724 buildfor=`parse_args --target`;
725 else
726 echo "Enter target platform:"
727 cat <<EOF
728 ==Archos== ==iriver== ==Apple iPod==
729 0) Player/Studio 10) H120/H140 20) Color/Photo
730 1) Recorder 11) H320/H340 21) Nano
731 2) FM Recorder 12) iHP-100/110/115 22) Video
732 3) Recorder v2 13) iFP-790 23) 3G
733 4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
734 5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
735 6) AV300 26) Mini 2G
736 ==Toshiba== 27) 1G, 2G
737 40) Gigabeat F
738 ==Cowon/iAudio== 41) Gigabeat S ==SanDisk==
739 30) X5/X5V/X5L 50) Sansa e200
740 31) M5/M5L ==Tatung== 51) Sansa e200R
741 32) 7 60) Elio TPJ-1022 52) Sansa c200
742 33) D2 53) Sansa m200
743 34) M3/M3L ==Olympus== 54) Sansa c100
744 70) M:Robe 500 55) Sansa Clip
745 ==Creative== 71) M:Robe 100 56) Sansa e200v2
746 90) Zen Vision:M 30GB 57) Sansa m200v4
747 91) Zen Vision:M 60GB ==Philips== 58) Sansa Fuze
748 92) Zen Vision 100) GoGear SA9200 59) Sansa c200v2
749 101) GoGear HDD1630/
750 HDD1830 ==Logik==
751 ==Onda== 80) DAX 1GB MP3/DAB
752 120) VX747 ==Meizu==
753 121) VX767 110) M6SL
754 122) VX747+ 111) M6SP
755 112) M3
759 buildfor=`input`;
762 # Set of tools built for all target platforms:
763 toolset="rdf2binary convbdf codepages"
765 # Toolsets for some target families:
766 archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
767 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
768 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
769 ipodbitmaptools="$toolset scramble bmp2rb"
770 gigabeatbitmaptools="$toolset scramble descramble bmp2rb"
771 tccbitmaptools="$toolset scramble mktccboot bmp2rb"
772 # generic is used by IFP, Meizu and Onda
773 genericbitmaptools="$toolset bmp2rb"
774 # scramble is used by all other targets
775 scramblebitmaptools="$genericbitmaptools scramble"
778 # ---- For each target ----
780 # *Variables*
781 # target_id: a unique number identifying this target, IS NOT the menu number.
782 # Just use the currently highest number+1 when you add a new
783 # target.
784 # modelname: short model name used all over to identify this target
785 # memory: number of megabytes of RAM this target has. If the amount can
786 # be selected by the size prompt, let memory be unset here
787 # target: -Ddefine passed to the build commands to make the correct
788 # config-*.h file get included etc
789 # tool: the tool that takes a plain binary and converts that into a
790 # working "firmware" file for your target
791 # output: the final output file name
792 # boottool: the tool that takes a plain binary and generates a bootloader
793 # file for your target (or blank to use $tool)
794 # bootoutput:the final output file name for the bootloader (or blank to use
795 # $output)
796 # appextra: passed to the APPEXTRA variable in the Makefiles.
797 # TODO: add proper explanation
798 # archosrom: used only for Archos targets that build a special flashable .ucl
799 # image.
800 # flash: name of output for flashing, for targets where there's a special
801 # file output for this.
802 # plugins: set to 'yes' to build the plugins. Early development builds can
803 # set this to no in the early stages to have an easier life for a
804 # while
805 # swcodec: set 'yes' on swcodec targets
806 # toolset: lists what particular tools in the tools/ directory that this
807 # target needs to have built prior to building Rockbox
809 # *Functions*
810 # *cc: sets up gcc and compiler options for your target builds. Note
811 # that if you select a simulator build, the compiler selection is
812 # overridden later in the script.
814 case $buildfor in
816 0|player)
817 target_id=1
818 modelname="player"
819 target="-DARCHOS_PLAYER"
820 shcc
821 tool="$rootdir/tools/scramble"
822 output="archos.mod"
823 appextra="player:gui"
824 archosrom="$pwd/rombox.ucl"
825 flash="$pwd/rockbox.ucl"
826 plugins="yes"
827 swcodec=""
829 # toolset is the tools within the tools directory that we build for
830 # this particular target.
831 toolset="$toolset scramble descramble sh2d player_unifont uclpack"
833 # Note: the convbdf is present in the toolset just because: 1) the
834 # firmware/Makefile assumes it is present always, and 2) we will need it when we
835 # build the player simulator
837 t_cpu="sh"
838 t_manufacturer="archos"
839 t_model="player"
842 1|recorder)
843 target_id=2
844 modelname="recorder"
845 target="-DARCHOS_RECORDER"
846 shcc
847 tool="$rootdir/tools/scramble"
848 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
849 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
850 output="ajbrec.ajz"
851 appextra="recorder:gui"
852 #archosrom="$pwd/rombox.ucl"
853 flash="$pwd/rockbox.ucl"
854 plugins="yes"
855 swcodec=""
856 # toolset is the tools within the tools directory that we build for
857 # this particular target.
858 toolset=$archosbitmaptools
859 t_cpu="sh"
860 t_manufacturer="archos"
861 t_model="recorder"
864 2|fmrecorder)
865 target_id=3
866 modelname="fmrecorder"
867 target="-DARCHOS_FMRECORDER"
868 shcc
869 tool="$rootdir/tools/scramble -fm"
870 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
871 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
872 output="ajbrec.ajz"
873 appextra="recorder:gui"
874 #archosrom="$pwd/rombox.ucl"
875 flash="$pwd/rockbox.ucl"
876 plugins="yes"
877 swcodec=""
878 # toolset is the tools within the tools directory that we build for
879 # this particular target.
880 toolset=$archosbitmaptools
881 t_cpu="sh"
882 t_manufacturer="archos"
883 t_model="fm_v2"
886 3|recorderv2)
887 target_id=4
888 modelname="recorderv2"
889 target="-DARCHOS_RECORDERV2"
890 shcc
891 tool="$rootdir/tools/scramble -v2"
892 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
893 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
894 output="ajbrec.ajz"
895 appextra="recorder:gui"
896 #archosrom="$pwd/rombox.ucl"
897 flash="$pwd/rockbox.ucl"
898 plugins="yes"
899 swcodec=""
900 # toolset is the tools within the tools directory that we build for
901 # this particular target.
902 toolset=$archosbitmaptools
903 t_cpu="sh"
904 t_manufacturer="archos"
905 t_model="fm_v2"
908 4|ondiosp)
909 target_id=7
910 modelname="ondiosp"
911 target="-DARCHOS_ONDIOSP"
912 shcc
913 tool="$rootdir/tools/scramble -osp"
914 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
915 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
916 output="ajbrec.ajz"
917 appextra="recorder:gui"
918 archosrom="$pwd/rombox.ucl"
919 flash="$pwd/rockbox.ucl"
920 plugins="yes"
921 swcodec=""
922 # toolset is the tools within the tools directory that we build for
923 # this particular target.
924 toolset=$archosbitmaptools
925 t_cpu="sh"
926 t_manufacturer="archos"
927 t_model="ondio"
930 5|ondiofm)
931 target_id=8
932 modelname="ondiofm"
933 target="-DARCHOS_ONDIOFM"
934 shcc
935 tool="$rootdir/tools/scramble -ofm"
936 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
937 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
938 output="ajbrec.ajz"
939 appextra="recorder:gui"
940 #archosrom="$pwd/rombox.ucl"
941 flash="$pwd/rockbox.ucl"
942 plugins="yes"
943 swcodec=""
944 toolset=$archosbitmaptools
945 t_cpu="sh"
946 t_manufacturer="archos"
947 t_model="ondio"
950 6|av300)
951 target_id=38
952 modelname="av300"
953 target="-DARCHOS_AV300"
954 memory=16 # always
955 arm7tdmicc
956 tool="$rootdir/tools/scramble -mm=C"
957 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
958 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
959 output="cjbm.ajz"
960 appextra="recorder:gui"
961 plugins="yes"
962 swcodec=""
963 # toolset is the tools within the tools directory that we build for
964 # this particular target.
965 toolset="$toolset scramble descramble bmp2rb"
966 # architecture, manufacturer and model for the target-tree build
967 t_cpu="arm"
968 t_manufacturer="archos"
969 t_model="av300"
972 10|h120)
973 target_id=9
974 modelname="h120"
975 target="-DIRIVER_H120"
976 memory=32 # always
977 coldfirecc
978 tool="$rootdir/tools/scramble -add=h120"
979 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
980 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
981 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
982 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
983 output="rockbox.iriver"
984 appextra="recorder:gui"
985 flash="$pwd/rombox.iriver"
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="h100"
996 11|h300)
997 target_id=10
998 modelname="h300"
999 target="-DIRIVER_H300"
1000 memory=32 # always
1001 coldfirecc
1002 tool="$rootdir/tools/scramble -add=h300"
1003 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1004 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
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 plugins="yes"
1010 swcodec="yes"
1011 # toolset is the tools within the tools directory that we build for
1012 # this particular target.
1013 toolset=$iriverbitmaptools
1014 t_cpu="coldfire"
1015 t_manufacturer="iriver"
1016 t_model="h300"
1019 12|h100)
1020 target_id=11
1021 modelname="h100"
1022 target="-DIRIVER_H100"
1023 memory=16 # always
1024 coldfirecc
1025 tool="$rootdir/tools/scramble -add=h100"
1026 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1027 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1028 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1029 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1030 output="rockbox.iriver"
1031 appextra="recorder:gui"
1032 flash="$pwd/rombox.iriver"
1033 plugins="yes"
1034 swcodec="yes"
1035 # toolset is the tools within the tools directory that we build for
1036 # this particular target.
1037 toolset=$iriverbitmaptools
1038 t_cpu="coldfire"
1039 t_manufacturer="iriver"
1040 t_model="h100"
1043 13|ifp7xx)
1044 target_id=19
1045 modelname="ifp7xx"
1046 target="-DIRIVER_IFP7XX"
1047 memory=1
1048 arm7tdmicc short
1049 tool="cp"
1050 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1051 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1052 output="rockbox.wma"
1053 appextra="recorder:gui"
1054 plugins="yes"
1055 swcodec="yes"
1056 # toolset is the tools within the tools directory that we build for
1057 # this particular target.
1058 toolset=$genericbitmaptools
1059 t_cpu="arm"
1060 t_manufacturer="pnx0101"
1061 t_model="iriver-ifp7xx"
1064 14|h10)
1065 target_id=22
1066 modelname="h10"
1067 target="-DIRIVER_H10"
1068 memory=32 # always
1069 arm7tdmicc
1070 tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
1071 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1072 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1073 output="rockbox.mi4"
1074 appextra="recorder:gui"
1075 plugins="yes"
1076 swcodec="yes"
1077 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
1078 bootoutput="H10_20GC.mi4"
1079 # toolset is the tools within the tools directory that we build for
1080 # this particular target.
1081 toolset=$scramblebitmaptools
1082 # architecture, manufacturer and model for the target-tree build
1083 t_cpu="arm"
1084 t_manufacturer="iriver"
1085 t_model="h10"
1088 15|h10_5gb)
1089 target_id=24
1090 modelname="h10_5gb"
1091 target="-DIRIVER_H10_5GB"
1092 memory=32 # always
1093 arm7tdmicc
1094 tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
1095 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1096 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1097 output="rockbox.mi4"
1098 appextra="recorder:gui"
1099 plugins="yes"
1100 swcodec="yes"
1101 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
1102 bootoutput="H10.mi4"
1103 # toolset is the tools within the tools directory that we build for
1104 # this particular target.
1105 toolset=$scramblebitmaptools
1106 # architecture, manufacturer and model for the target-tree build
1107 t_cpu="arm"
1108 t_manufacturer="iriver"
1109 t_model="h10"
1112 20|ipodcolor)
1113 target_id=13
1114 modelname="ipodcolor"
1115 target="-DIPOD_COLOR"
1116 memory=32 # always
1117 arm7tdmicc
1118 tool="$rootdir/tools/scramble -add=ipco"
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="color"
1135 21|ipodnano)
1136 target_id=14
1137 modelname="ipodnano"
1138 target="-DIPOD_NANO"
1139 memory=32 # always
1140 arm7tdmicc
1141 tool="$rootdir/tools/scramble -add=nano"
1142 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1143 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1144 output="rockbox.ipod"
1145 appextra="recorder:gui"
1146 plugins="yes"
1147 swcodec="yes"
1148 bootoutput="bootloader-$modelname.ipod"
1149 # toolset is the tools within the tools directory that we build for
1150 # this particular target.
1151 toolset=$ipodbitmaptools
1152 # architecture, manufacturer and model for the target-tree build
1153 t_cpu="arm"
1154 t_manufacturer="ipod"
1155 t_model="nano"
1158 22|ipodvideo)
1159 target_id=15
1160 modelname="ipodvideo"
1161 target="-DIPOD_VIDEO"
1162 arm7tdmicc
1163 tool="$rootdir/tools/scramble -add=ipvd"
1164 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1165 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
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="video"
1180 23|ipod3g)
1181 target_id=16
1182 modelname="ipod3g"
1183 target="-DIPOD_3G"
1184 memory=32 # always
1185 arm7tdmicc
1186 tool="$rootdir/tools/scramble -add=ip3g"
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="3g"
1203 24|ipod4g)
1204 target_id=17
1205 modelname="ipod4g"
1206 target="-DIPOD_4G"
1207 memory=32 # always
1208 arm7tdmicc
1209 tool="$rootdir/tools/scramble -add=ip4g"
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="4g"
1226 25|ipodmini)
1227 target_id=18
1228 modelname="ipodmini"
1229 target="-DIPOD_MINI"
1230 memory=32 # always
1231 arm7tdmicc
1232 tool="$rootdir/tools/scramble -add=mini"
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="mini"
1249 26|ipodmini2g)
1250 target_id=21
1251 modelname="ipodmini2g"
1252 target="-DIPOD_MINI2G"
1253 memory=32 # always
1254 arm7tdmicc
1255 tool="$rootdir/tools/scramble -add=mn2g"
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="mini2g"
1272 27|ipod1g2g)
1273 target_id=29
1274 modelname="ipod1g2g"
1275 target="-DIPOD_1G2G"
1276 memory=32 # always
1277 arm7tdmicc
1278 tool="$rootdir/tools/scramble -add=1g2g"
1279 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1280 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1281 output="rockbox.ipod"
1282 appextra="recorder:gui"
1283 plugins="yes"
1284 swcodec="yes"
1285 bootoutput="bootloader-$modelname.ipod"
1286 # toolset is the tools within the tools directory that we build for
1287 # this particular target.
1288 toolset=$ipodbitmaptools
1289 # architecture, manufacturer and model for the target-tree build
1290 t_cpu="arm"
1291 t_manufacturer="ipod"
1292 t_model="1g2g"
1295 30|x5)
1296 target_id=12
1297 modelname="x5"
1298 target="-DIAUDIO_X5"
1299 memory=16 # always
1300 coldfirecc
1301 tool="$rootdir/tools/scramble -add=iax5"
1302 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1303 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1304 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1305 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1306 output="rockbox.iaudio"
1307 appextra="recorder:gui"
1308 plugins="yes"
1309 swcodec="yes"
1310 # toolset is the tools within the tools directory that we build for
1311 # this particular target.
1312 toolset="$iaudiobitmaptools"
1313 # architecture, manufacturer and model for the target-tree build
1314 t_cpu="coldfire"
1315 t_manufacturer="iaudio"
1316 t_model="x5"
1319 31|m5)
1320 target_id=28
1321 modelname="m5"
1322 target="-DIAUDIO_M5"
1323 memory=16 # always
1324 coldfirecc
1325 tool="$rootdir/tools/scramble -add=iam5"
1326 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1327 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1328 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1329 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1330 output="rockbox.iaudio"
1331 appextra="recorder:gui"
1332 plugins="yes"
1333 swcodec="yes"
1334 # toolset is the tools within the tools directory that we build for
1335 # this particular target.
1336 toolset="$iaudiobitmaptools"
1337 # architecture, manufacturer and model for the target-tree build
1338 t_cpu="coldfire"
1339 t_manufacturer="iaudio"
1340 t_model="m5"
1343 32|iaudio7)
1344 target_id=32
1345 modelname="iaudio7"
1346 target="-DIAUDIO_7"
1347 memory=16 # always
1348 arm946cc
1349 tool="$rootdir/tools/scramble -add=i7"
1350 boottool="$rootdir/tools/scramble -tcc=crc"
1351 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1352 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1353 output="rockbox.iaudio"
1354 appextra="recorder:gui"
1355 plugins="yes"
1356 swcodec="yes"
1357 bootoutput="I7_FW.BIN"
1358 # toolset is the tools within the tools directory that we build for
1359 # this particular target.
1360 toolset="$tccbitmaptools"
1361 # architecture, manufacturer and model for the target-tree build
1362 t_cpu="arm"
1363 t_manufacturer="tcc77x"
1364 t_model="iaudio7"
1367 33|cowond2)
1368 target_id=34
1369 modelname="cowond2"
1370 target="-DCOWON_D2"
1371 memory=32
1372 arm926ejscc
1373 tool="$rootdir/tools/scramble -add=d2"
1374 boottool="$rootdir/tools/scramble -tcc=crc"
1375 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1376 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1377 output="rockbox.d2"
1378 appextra="recorder:gui"
1379 plugins="yes"
1380 swcodec="yes"
1381 toolset="$tccbitmaptools"
1382 # architecture, manufacturer and model for the target-tree build
1383 t_cpu="arm"
1384 t_manufacturer="tcc780x"
1385 t_model="cowond2"
1388 34|m3)
1389 target_id=37
1390 modelname="m3"
1391 target="-DIAUDIO_M3"
1392 memory=16 # always
1393 coldfirecc
1394 tool="$rootdir/tools/scramble -add=iam3"
1395 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1396 bmp2rb_native="$rootdir/tools/bmp2rb -f 7"
1397 output="rockbox.iaudio"
1398 appextra="recorder:gui"
1399 plugins="yes"
1400 swcodec="yes"
1401 # toolset is the tools within the tools directory that we build for
1402 # this particular target.
1403 toolset="$iaudiobitmaptools"
1404 # architecture, manufacturer and model for the target-tree build
1405 t_cpu="coldfire"
1406 t_manufacturer="iaudio"
1407 t_model="m3"
1410 40|gigabeatf)
1411 target_id=20
1412 modelname="gigabeatf"
1413 target="-DGIGABEAT_F"
1414 memory=32 # always
1415 arm9tdmicc
1416 tool="$rootdir/tools/scramble -add=giga"
1417 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1418 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1419 output="rockbox.gigabeat"
1420 appextra="recorder:gui"
1421 plugins="yes"
1422 swcodec="yes"
1423 toolset=$gigabeatbitmaptools
1424 boottool="$rootdir/tools/scramble -gigabeat"
1425 bootoutput="FWIMG01.DAT"
1426 # architecture, manufacturer and model for the target-tree build
1427 t_cpu="arm"
1428 t_manufacturer="s3c2440"
1429 t_model="gigabeat-fx"
1432 41|gigabeats)
1433 target_id=26
1434 modelname="gigabeats"
1435 target="-DGIGABEAT_S"
1436 memory=64
1437 arm1136jfscc
1438 tool="$rootdir/tools/scramble -add=gigs"
1439 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1440 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1441 output="rockbox.gigabeat"
1442 appextra="recorder:gui"
1443 plugins="yes"
1444 swcodec="yes"
1445 toolset="$gigabeatbitmaptools mknkboot"
1446 boottool="$rootdir/tools/scramble -gigabeats"
1447 bootoutput="nk.bin"
1448 # architecture, manufacturer and model for the target-tree build
1449 t_cpu="arm"
1450 t_manufacturer="imx31"
1451 t_model="gigabeat-s"
1454 70|mrobe500)
1455 target_id=36
1456 modelname="mrobe500"
1457 target="-DMROBE_500"
1458 memory=64 # always
1459 arm926ejscc
1460 tool="$rootdir/tools/scramble -add=m500"
1461 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1462 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1463 output="rockbox.mrobe500"
1464 appextra="recorder:gui"
1465 plugins="yes"
1466 swcodec="yes"
1467 toolset=$gigabeatbitmaptools
1468 boottool="cp "
1469 bootoutput="rockbox.mrboot"
1470 # architecture, manufacturer and model for the target-tree build
1471 t_cpu="arm"
1472 t_manufacturer="tms320dm320"
1473 t_model="mrobe-500"
1476 71|mrobe100)
1477 target_id=33
1478 modelname="mrobe100"
1479 target="-DMROBE_100"
1480 memory=32 # always
1481 arm7tdmicc
1482 tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS"
1483 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1484 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1485 output="rockbox.mi4"
1486 appextra="recorder:gui"
1487 plugins="yes"
1488 swcodec="yes"
1489 boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL"
1490 bootoutput="pp5020.mi4"
1491 # toolset is the tools within the tools directory that we build for
1492 # this particular target.
1493 toolset=$scramblebitmaptools
1494 # architecture, manufacturer and model for the target-tree build
1495 t_cpu="arm"
1496 t_manufacturer="olympus"
1497 t_model="mrobe-100"
1500 80|logikdax)
1501 target_id=31
1502 modelname="logikdax"
1503 target="-DLOGIK_DAX"
1504 memory=2 # always
1505 arm946cc
1506 tool="$rootdir/tools/scramble -add=ldax"
1507 boottool="$rootdir/tools/scramble -tcc=crc"
1508 bootoutput="player.rom"
1509 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1510 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1511 output="rockbox.logik"
1512 appextra="recorder:gui"
1513 plugins=""
1514 swcodec="yes"
1515 # toolset is the tools within the tools directory that we build for
1516 # this particular target.
1517 toolset=$tccbitmaptools
1518 # architecture, manufacturer and model for the target-tree build
1519 t_cpu="arm"
1520 t_manufacturer="tcc77x"
1521 t_model="logikdax"
1524 90|creativezvm30gb)
1525 target_id=35
1526 modelname="creativezvm30"
1527 target="-DCREATIVE_ZVM"
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=zvm"
1533 USE_ELF="yes"
1534 output="rockbox.zvm"
1535 appextra="recorder:gui"
1536 plugins="yes"
1537 swcodec="yes"
1538 toolset=$ipodbitmaptools
1539 boottool="$rootdir/tools/scramble -creative=zvm -no-ciff"
1540 bootoutput="rockbox.zvmboot"
1541 # architecture, manufacturer and model for the target-tree build
1542 t_cpu="arm"
1543 t_manufacturer="tms320dm320"
1544 t_model="creative-zvm"
1547 91|creativezvm60gb)
1548 target_id=40
1549 modelname="creativezvm60"
1550 target="-DCREATIVE_ZVM60GB"
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=zvm60 -no-ciff"
1556 USE_ELF="yes"
1557 output="rockbox.zvm60"
1558 appextra="recorder:gui"
1559 plugins="yes"
1560 swcodec="yes"
1561 toolset=$ipodbitmaptools
1562 boottool="$rootdir/tools/scramble -creative=zvm60"
1563 bootoutput="rockbox.zvm60boot"
1564 # architecture, manufacturer and model for the target-tree build
1565 t_cpu="arm"
1566 t_manufacturer="tms320dm320"
1567 t_model="creative-zvm"
1570 92|creativezenvision)
1571 target_id=39
1572 modelname="creativezv"
1573 target="-DCREATIVE_ZV"
1574 memory=64
1575 arm926ejscc
1576 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1577 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1578 tool="$rootdir/tools/scramble -creative=zenvision -no-ciff"
1579 USE_ELF="yes"
1580 output="rockbox.zv"
1581 appextra="recorder:gui"
1582 plugins=""
1583 swcodec="yes"
1584 toolset=$ipodbitmaptools
1585 boottool="$rootdir/tools/scramble -creative=zenvision"
1586 bootoutput="rockbox.zvboot"
1587 # architecture, manufacturer and model for the target-tree build
1588 t_cpu="arm"
1589 t_manufacturer="tms320dm320"
1590 t_model="creative-zvm"
1593 50|e200)
1594 target_id=23
1595 modelname="e200"
1596 target="-DSANSA_E200"
1597 memory=32 # supposedly
1598 arm7tdmicc
1599 tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1600 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1601 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1602 output="rockbox.mi4"
1603 appextra="recorder:gui"
1604 plugins="yes"
1605 swcodec="yes"
1606 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1607 bootoutput="PP5022.mi4"
1608 # toolset is the tools within the tools directory that we build for
1609 # this particular target.
1610 toolset=$scramblebitmaptools
1611 # architecture, manufacturer and model for the target-tree build
1612 t_cpu="arm"
1613 t_manufacturer="sandisk"
1614 t_model="sansa-e200"
1617 51|e200r)
1618 # the e200R model is pretty much identical to the e200, it only has a
1619 # different option to the scramble tool when building a bootloader and
1620 # makes the bootloader output file name in all lower case.
1621 target_id=27
1622 modelname="e200r"
1623 target="-DSANSA_E200"
1624 memory=32 # supposedly
1625 arm7tdmicc
1626 tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1627 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1628 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1629 output="rockbox.mi4"
1630 appextra="recorder:gui"
1631 plugins="yes"
1632 swcodec="yes"
1633 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1634 bootoutput="pp5022.mi4"
1635 # toolset is the tools within the tools directory that we build for
1636 # this particular target.
1637 toolset=$scramblebitmaptools
1638 # architecture, manufacturer and model for the target-tree build
1639 t_cpu="arm"
1640 t_manufacturer="sandisk"
1641 t_model="sansa-e200"
1644 52|c200)
1645 target_id=30
1646 modelname="c200"
1647 target="-DSANSA_C200"
1648 memory=32 # supposedly
1649 arm7tdmicc
1650 tool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBOS"
1651 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1652 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1653 output="rockbox.mi4"
1654 appextra="recorder:gui"
1655 plugins="yes"
1656 swcodec="yes"
1657 boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
1658 bootoutput="firmware.mi4"
1659 # toolset is the tools within the tools directory that we build for
1660 # this particular target.
1661 toolset=$scramblebitmaptools
1662 # architecture, manufacturer and model for the target-tree build
1663 t_cpu="arm"
1664 t_manufacturer="sandisk"
1665 t_model="sansa-c200"
1668 53|m200)
1669 target_id=48
1670 modelname="m200"
1671 target="-DSANSA_M200"
1672 memory=1 # always
1673 arm946cc
1674 tool="$rootdir/tools/scramble -add=m200"
1675 boottool="$rootdir/tools/scramble -tcc=crc"
1676 bootoutput="player.rom"
1677 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1678 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1679 output="rockbox.m200"
1680 appextra="recorder:gui"
1681 plugins=""
1682 swcodec="yes"
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="m200"
1692 54|c100)
1693 target_id=42
1694 modelname="c100"
1695 target="-DSANSA_C100"
1696 memory=32 # unsure, must check
1697 arm946cc
1698 tool="$rootdir/tools/scramble -add=c100"
1699 boottool="$rootdir/tools/scramble -tcc=crc"
1700 bootoutput="player.rom"
1701 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1702 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1703 output="rockbox.c100"
1704 appextra="recorder:gui"
1705 plugins=""
1706 # toolset is the tools within the tools directory that we build for
1707 # this particular target.
1708 toolset=$tccbitmaptools
1709 # architecture, manufacturer and model for the target-tree build
1710 t_cpu="arm"
1711 t_manufacturer="tcc77x"
1712 t_model="c100"
1715 55|Clip|clip)
1716 target_id=50
1717 modelname="clip"
1718 target="-DSANSA_CLIP"
1719 memory=2
1720 arm9tdmicc
1721 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1722 bmp2rb_native="$bmp2rb_mono"
1723 tool="$rootdir/tools/scramble -add=clip"
1724 output="rockbox.sansa"
1725 bootoutput="bootloader-clip.sansa"
1726 appextra="recorder:gui"
1727 plugins="yes"
1728 swcodec="yes"
1729 toolset=$scramblebitmaptools
1730 t_cpu="arm"
1731 t_manufacturer="as3525"
1732 t_model="sansa-clip"
1736 56|e200v2)
1737 target_id=51
1738 modelname="e200v2"
1739 target="-DSANSA_E200V2"
1740 memory=8
1741 arm9tdmicc
1742 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1743 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1744 tool="$rootdir/tools/scramble -add=e2v2"
1745 output="rockbox.sansa"
1746 bootoutput="bootloader-e200v2.sansa"
1747 appextra="recorder:gui"
1748 plugins="yes"
1749 swcodec="yes"
1750 toolset=$scramblebitmaptools
1751 t_cpu="arm"
1752 t_manufacturer="as3525"
1753 t_model="sansa-e200v2"
1757 57|m200v4)
1758 target_id=52
1759 modelname="m200v4"
1760 target="-DSANSA_M200V4"
1761 memory=2
1762 arm9tdmicc
1763 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1764 bmp2rb_native="$bmp2rb_mono"
1765 tool="$rootdir/tools/scramble -add=m2v4"
1766 output="rockbox.sansa"
1767 bootoutput="bootloader-m200v4.sansa"
1768 appextra="recorder:gui"
1769 plugins="yes"
1770 swcodec="yes"
1771 toolset=$scramblebitmaptools
1772 t_cpu="arm"
1773 t_manufacturer="as3525"
1774 t_model="sansa-m200v4"
1778 58|fuze)
1779 target_id=53
1780 modelname="fuze"
1781 target="-DSANSA_FUZE"
1782 memory=8
1783 arm9tdmicc
1784 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1785 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1786 tool="$rootdir/tools/scramble -add=fuze"
1787 output="rockbox.sansa"
1788 bootoutput="bootloader-fuze.sansa"
1789 appextra="recorder:gui"
1790 plugins="yes"
1791 swcodec="yes"
1792 toolset=$scramblebitmaptools
1793 t_cpu="arm"
1794 t_manufacturer="as3525"
1795 t_model="sansa-fuze"
1799 59|c200v2)
1800 target_id=55
1801 modelname="c200v2"
1802 target="-DSANSA_C200V2"
1803 memory=2 # as per OF diagnosis mode
1804 arm9tdmicc
1805 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1806 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1807 tool="$rootdir/tools/scramble -add=c2v2"
1808 output="rockbox.sansa"
1809 bootoutput="bootloader-c200v2.sansa"
1810 appextra="recorder:gui"
1811 plugins="yes"
1812 swcodec="yes"
1813 # toolset is the tools within the tools directory that we build for
1814 # this particular target.
1815 toolset=$scramblebitmaptools
1816 # architecture, manufacturer and model for the target-tree build
1817 t_cpu="arm"
1818 t_manufacturer="as3525"
1819 t_model="sansa-c200v2"
1822 60|tpj1022)
1823 target_id=25
1824 modelname="tpj1022"
1825 target="-DELIO_TPJ1022"
1826 memory=32 # always
1827 arm7tdmicc
1828 tool="$rootdir/tools/scramble -add tpj2"
1829 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1830 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1831 output="rockbox.elio"
1832 appextra="recorder:gui"
1833 plugins="yes"
1834 swcodec="yes"
1835 boottool="$rootdir/tools/scramble -mi4v2"
1836 bootoutput="pp5020.mi4"
1837 # toolset is the tools within the tools directory that we build for
1838 # this particular target.
1839 toolset=$scramblebitmaptools
1840 # architecture, manufacturer and model for the target-tree build
1841 t_cpu="arm"
1842 t_manufacturer="tatung"
1843 t_model="tpj1022"
1846 100|sa9200)
1847 target_id=41
1848 modelname="sa9200"
1849 target="-DPHILIPS_SA9200"
1850 memory=32 # supposedly
1851 arm7tdmicc
1852 tool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBOS"
1853 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1854 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1855 output="rockbox.mi4"
1856 appextra="recorder:gui"
1857 plugins=""
1858 swcodec="yes"
1859 boottool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBBL"
1860 bootoutput="FWImage.ebn"
1861 # toolset is the tools within the tools directory that we build for
1862 # this particular target.
1863 toolset=$scramblebitmaptools
1864 # architecture, manufacturer and model for the target-tree build
1865 t_cpu="arm"
1866 t_manufacturer="philips"
1867 t_model="sa9200"
1870 101|hdd1630)
1871 target_id=43
1872 modelname="hdd1630"
1873 target="-DPHILIPS_HDD1630"
1874 memory=32 # supposedly
1875 arm7tdmicc
1876 tool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBOS"
1877 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1878 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1879 output="rockbox.mi4"
1880 appextra="recorder:gui"
1881 plugins="yes"
1882 swcodec="yes"
1883 boottool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBBL"
1884 bootoutput="FWImage.ebn"
1885 # toolset is the tools within the tools directory that we build for
1886 # this particular target.
1887 toolset=$scramblebitmaptools
1888 # architecture, manufacturer and model for the target-tree build
1889 t_cpu="arm"
1890 t_manufacturer="philips"
1891 t_model="hdd1630"
1894 110|meizum6sl)
1895 target_id=49
1896 modelname="meizum6sl"
1897 target="-DMEIZU_M6SL"
1898 memory=16 # always
1899 arm940tbecc
1900 tool="cp"
1901 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1902 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1903 output="rockbox.meizu"
1904 appextra="recorder:gui"
1905 plugins="no" #FIXME
1906 swcodec="yes"
1907 toolset=$genericbitmaptools
1908 boottool="cp"
1909 bootoutput="rockboot.ebn"
1910 # architecture, manufacturer and model for the target-tree build
1911 t_cpu="arm"
1912 t_manufacturer="s5l8700"
1913 t_model="meizu-m6sl"
1916 111|meizum6sp)
1917 target_id=46
1918 modelname="meizum6sp"
1919 target="-DMEIZU_M6SP"
1920 memory=16 # always
1921 arm940tbecc
1922 tool="cp"
1923 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1924 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1925 output="rockbox.meizu"
1926 appextra="recorder:gui"
1927 plugins="no" #FIXME
1928 swcodec="yes"
1929 toolset=$genericbitmaptools
1930 boottool="cp"
1931 bootoutput="rockboot.ebn"
1932 # architecture, manufacturer and model for the target-tree build
1933 t_cpu="arm"
1934 t_manufacturer="s5l8700"
1935 t_model="meizu-m6sp"
1938 112|meizum3)
1939 target_id=47
1940 modelname="meizum3"
1941 target="-DMEIZU_M3"
1942 memory=16 # always
1943 arm940tbecc
1944 tool="cp"
1945 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1946 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1947 output="rockbox.meizu"
1948 appextra="recorder:gui"
1949 plugins="no" #FIXME
1950 swcodec="yes"
1951 toolset=$genericbitmaptools
1952 boottool="cp"
1953 bootoutput="rockboot.ebn"
1954 # architecture, manufacturer and model for the target-tree build
1955 t_cpu="arm"
1956 t_manufacturer="s5l8700"
1957 t_model="meizu-m3"
1960 120|ondavx747)
1961 target_id=44
1962 modelname="ondavx747"
1963 target="-DONDA_VX747"
1964 memory=16
1965 mipselcc
1966 tool="$rootdir/tools/scramble -add=x747"
1967 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1968 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1969 output="rockbox.vx747"
1970 appextra="recorder:gui"
1971 plugins="" #FIXME
1972 swcodec="yes"
1973 toolset=$genericbitmaptools
1974 boottool="cp"
1975 bootoutput="rockboot.vx747"
1976 # architecture, manufacturer and model for the target-tree build
1977 t_cpu="mips"
1978 t_manufacturer="ingenic_jz47xx"
1979 t_model="onda_vx747"
1982 121|ondavx767)
1983 target_id=45
1984 modelname="ondavx767"
1985 target="-DONDA_VX767"
1986 memory=16 #FIXME
1987 mipselcc
1988 tool="cp"
1989 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1990 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1991 output="rockbox.vx767"
1992 appextra="recorder:gui"
1993 plugins="" #FIXME
1994 swcodec="yes"
1995 toolset=$genericbitmaptools
1996 boottool="cp"
1997 bootoutput="rockboot.vx767"
1998 # architecture, manufacturer and model for the target-tree build
1999 t_cpu="mips"
2000 t_manufacturer="ingenic_jz47xx"
2001 t_model="onda_vx767"
2004 122|ondavx747p)
2005 target_id=54
2006 modelname="ondavx747p"
2007 target="-DONDA_VX747P"
2008 memory=16 #FIXME
2009 mipselcc
2010 tool="cp"
2011 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2012 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2013 output="rockbox.vx747p"
2014 appextra="recorder:gui"
2015 plugins="" #FIXME
2016 swcodec="yes"
2017 toolset=$genericbitmaptools
2018 boottool="cp"
2019 bootoutput="rockboot.vx747p"
2020 # architecture, manufacturer and model for the target-tree build
2021 t_cpu="mips"
2022 t_manufacturer="ingenic_jz47xx"
2023 t_model="onda_vx747"
2027 echo "Please select a supported target platform!"
2028 exit 7
2031 esac
2033 echo "Platform set to $modelname"
2036 #remove start
2037 ############################################################################
2038 # Amount of memory, for those that can differ. They have $memory unset at
2039 # this point.
2042 if [ -z "$memory" ]; then
2043 case $target_id in
2045 echo "Enter size of your RAM (in MB): (Defaults to 32)"
2046 if [ "1" != `parse_args --ram` ]; then
2047 size=`parse_args --ram`;
2048 else
2049 size=`input`;
2051 case $size in
2052 60|64)
2053 memory="64"
2056 memory="32"
2058 esac
2061 echo "Enter size of your RAM (in MB): (Defaults to 2)"
2062 if [ "1" != `parse_args --ram` ]; then
2063 size=`parse_args --ram`;
2064 else
2065 size=`input`;
2067 case $size in
2069 memory="8"
2072 memory="2"
2074 esac
2076 esac
2077 echo "Memory size selected: $memory MB"
2078 echo ""
2080 #remove end
2082 ##################################################################
2083 # Figure out build "type"
2086 # the ifp7x0 is the only platform that supports building a gdb stub like
2087 # this
2088 case $modelname in
2089 ifp7xx)
2090 gdbstub="(G)DB stub, "
2092 e200r|e200)
2093 gdbstub="(I)installer, "
2095 c200)
2096 gdbstub="(E)raser, "
2100 esac
2101 if [ "1" != `parse_args --type` ]; then
2102 btype=`parse_args --type`;
2103 else
2104 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, $gdbstub(M)anual: (Defaults to N)"
2105 btype=`input`;
2108 case $btype in
2109 [Ii])
2110 appsdir='\$(ROOTDIR)/bootloader'
2111 apps="bootloader"
2112 extradefines="-DBOOTLOADER -DE200R_INSTALLER -ffunction-sections -fdata-sections"
2113 bootloader="1"
2114 echo "e200R-installer build selected"
2116 [Ee])
2117 appsdir='\$(ROOTDIR)/bootloader'
2118 apps="bootloader"
2119 echo "C2(4)0 or C2(5)0"
2120 variant=`input`
2121 case $variant in
2123 extradefines="-DBOOTLOADER -DC200_ERASE -DC240_ERASE -ffunction-sections -fdata-sections"
2124 echo "c240 eraser build selected"
2127 extradefines="-DBOOTLOADER -DC200_ERASE -DC250_ERASE -ffunction-sections -fdata-sections"
2128 echo "c240 eraser build selected"
2130 esac
2131 bootloader="1"
2132 echo "c200 eraser build selected"
2134 [Bb])
2135 if test $t_manufacturer = "archos"; then
2136 # Archos SH-based players do this somewhat differently for
2137 # some reason
2138 appsdir='\$(ROOTDIR)/flash/bootbox'
2139 apps="bootbox"
2140 else
2141 appsdir='\$(ROOTDIR)/bootloader'
2142 apps="bootloader"
2143 flash=""
2144 if test -n "$boottool"; then
2145 tool="$boottool"
2147 if test -n "$bootoutput"; then
2148 output=$bootoutput
2151 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
2152 bootloader="1"
2153 echo "Bootloader build selected"
2155 [Ss])
2156 debug="-DDEBUG"
2157 simulator="yes"
2158 extradefines="-DSIMULATOR"
2159 archosrom=""
2160 flash=""
2161 echo "Simulator build selected"
2163 [Aa])
2164 echo "Advanced build selected"
2165 whichadvanced
2167 [Gg])
2168 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
2169 appsdir='\$(ROOTDIR)/gdb'
2170 apps="stub"
2171 case $modelname in
2172 ifp7xx)
2173 output="stub.wma"
2177 esac
2178 echo "GDB stub build selected"
2180 [Mm])
2181 toolset='';
2182 apps="manual"
2183 echo "Manual build selected"
2186 if [ "$modelname" = "e200r" ]; then
2187 echo "Do not use the e200R target for regular builds. Use e200 instead."
2188 exit 8
2190 debug=""
2191 btype="N" # set it explicitly since RET only gets here as well
2192 echo "Normal build selected"
2195 esac
2196 # to be able running "make manual" from non-manual configuration
2197 case $modelname in
2198 fmrecorder)
2199 manualdev="recorderv2fm"
2201 recorderv2)
2202 manualdev="recorderv2fm"
2204 h1??)
2205 manualdev="h100"
2207 ipodmini2g)
2208 manualdev="ipodmini"
2211 manualdev=$modelname
2213 esac
2215 if [ -z "$debug" ]; then
2216 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
2219 echo "Using source code root directory: $rootdir"
2221 # this was once possible to change at build-time, but no more:
2222 language="english"
2224 uname=`uname`
2226 if [ "yes" = "$simulator" ]; then
2227 # setup compiler and things for simulator
2228 simcc
2230 if [ -d "simdisk" ]; then
2231 echo "Subdirectory 'simdisk' already present"
2232 else
2233 mkdir simdisk
2234 echo "Created a 'simdisk' subdirectory for simulating the hard disk"
2238 # Now, figure out version number of the (gcc) compiler we are about to use
2239 gccver=`$CC -dumpversion`;
2241 # figure out the binutil version too and display it, mostly for the build
2242 # system etc to be able to see it easier
2243 if [ $uname = "Darwin" ]; then
2244 ldver=`$LD -v 2>&1 | sed -e 's/[^0-9.-]//g'`
2245 else
2246 ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
2249 if [ -z "$gccver" ]; then
2250 echo "WARNING: The compiler you must use ($CC) is not in your path!"
2251 echo "WARNING: this may cause your build to fail since we cannot do the"
2252 echo "WARNING: checks we want now."
2253 else
2255 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
2256 # DEPEND on it
2258 num1=`echo $gccver | cut -d . -f1`
2259 num2=`echo $gccver | cut -d . -f2`
2260 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
2262 # This makes:
2263 # 3.3.X => 303
2264 # 3.4.X => 304
2265 # 2.95.3 => 295
2267 echo "Using $CC $gccver ($gccnum)"
2269 if test "$gccnum" -ge "400"; then
2270 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
2271 # so we ignore that warnings for now
2272 # -Wno-pointer-sign
2273 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
2276 if test "$gccnum" -ge "401"; then
2277 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
2278 # will break strict-aliasing rules"
2280 GCCOPTS="$GCCOPTS -fno-strict-aliasing"
2283 if test "$gccnum" -ge "402"; then
2284 # disable warning about "warning: initialized field overwritten" as gcc 4.2
2285 # and later would throw it for several valid cases
2286 GCCOPTS="$GCCOPTS -Wno-override-init"
2289 case $prefix in
2291 # simulator
2293 i586-mingw32msvc-)
2294 # cross-compile for win32
2297 # Verify that the cross-compiler is of a recommended version!
2298 if test "$gccver" != "$gccchoice"; then
2299 echo "WARNING: Your cross-compiler $CC $gccver is not of the recommended"
2300 echo "WARNING: version $gccchoice!"
2301 echo "WARNING: This may cause your build to fail since it may be a version"
2302 echo "WARNING: that isn't functional or known to not be the best choice."
2303 echo "WARNING: If you suffer from build problems, you know that this is"
2304 echo "WARNING: a likely source for them..."
2307 esac
2312 echo "Using $LD $ldver"
2314 # check the compiler for SH platforms
2315 if test "$CC" = "sh-elf-gcc"; then
2316 if test "$gccnum" -lt "400"; then
2317 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
2318 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2319 else
2320 # figure out patch status
2321 gccpatch=`$CC --version`;
2323 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
2324 echo "gcc $gccver is rockbox patched"
2325 # then convert -O to -Os to get smaller binaries!
2326 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2327 else
2328 echo "WARNING: You use an unpatched gcc compiler: $gccver"
2329 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2334 if test "$CC" = "m68k-elf-gcc"; then
2335 # convert -O to -Os to get smaller binaries!
2336 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2339 if [ "1" != `parse_args --ccache` ]; then
2340 echo "Enable ccache for building"
2341 ccache="ccache"
2342 else
2343 if [ "1" = `parse_args --no-ccache` ]; then
2344 ccache=`findtool ccache`
2345 if test -n "$ccache"; then
2346 echo "Found and uses ccache ($ccache)"
2351 # figure out the full path to the various commands if possible
2352 HOSTCC=`findtool gcc --lit`
2353 HOSTAR=`findtool ar --lit`
2354 CC=`findtool ${CC} --lit`
2355 LD=`findtool ${AR} --lit`
2356 AR=`findtool ${AR} --lit`
2357 AS=`findtool ${AS} --lit`
2358 OC=`findtool ${OC} --lit`
2359 WINDRES=`findtool ${WINDRES} --lit`
2360 DLLTOOL=`findtool ${DLLTOOL} --lit`
2361 DLLWRAP=`findtool ${DLLWRAP} --lit`
2362 RANLIB=`findtool ${RANLIB} --lit`
2364 if test -n "$ccache"; then
2365 CC="$ccache $CC"
2368 if test "X$endian" = "Xbig"; then
2369 defendian="ROCKBOX_BIG_ENDIAN"
2370 else
2371 defendian="ROCKBOX_LITTLE_ENDIAN"
2374 if [ "1" != `parse_args --rbdir` ]; then
2375 rbdir=`parse_args --rbdir`;
2376 echo "Using alternate rockbox dir: ${rbdir}"
2379 sed > autoconf.h \
2380 -e "s,@ENDIAN@,${defendian},g" \
2381 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
2382 -e "s,@config_rtc@,$config_rtc,g" \
2383 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
2384 -e "s,@RBDIR@,${rbdir},g" \
2385 <<EOF
2386 /* This header was made by configure */
2387 #ifndef __BUILD_AUTOCONF_H
2388 #define __BUILD_AUTOCONF_H
2390 /* Define endianess for the target or simulator platform */
2391 #define @ENDIAN@ 1
2393 /* Define this if you build rockbox to support the logf logging and display */
2394 #undef ROCKBOX_HAS_LOGF
2396 /* optional defines for RTC mod for h1x0 */
2397 @config_rtc@
2398 @have_rtc_alarm@
2400 /* root of Rockbox */
2401 #define ROCKBOX_DIR "/@RBDIR@"
2403 #endif /* __BUILD_AUTOCONF_H */
2406 if test -n "$t_cpu"; then
2407 TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
2408 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
2409 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
2410 GCCOPTS="$GCCOPTS"
2413 if test "$simulator" = "yes"; then
2414 # add simul make stuff on the #SIMUL# line
2415 simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
2416 simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
2417 else
2418 # delete the lines that match
2419 simmagic1='/@SIMUL1@/D'
2420 simmagic2='/@SIMUL2@/D'
2423 if test "$swcodec" = "yes"; then
2424 voicetoolset="rbspeexenc voicefont wavtrim"
2425 else
2426 voicetoolset="voicefont wavtrim"
2429 if test "$apps" = "apps"; then
2430 # only when we build "real" apps we build the .lng files
2431 buildlangs="langs"
2434 #### Fix the cmdline ###
2435 if test -n "$ccache"; then
2436 cmdline="--ccache"
2439 cmdline="$cmdline --target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype"
2442 ### end of cmdline
2444 sed > Makefile \
2445 -e "s,@ROOTDIR@,${rootdir},g" \
2446 -e "s,@DEBUG@,${debug},g" \
2447 -e "s,@MEMORY@,${memory},g" \
2448 -e "s,@TARGET_ID@,${target_id},g" \
2449 -e "s,@TARGET@,${target},g" \
2450 -e "s,@CPU@,${t_cpu},g" \
2451 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
2452 -e "s,@MODELNAME@,${modelname},g" \
2453 -e "s,@LANGUAGE@,${language},g" \
2454 -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
2455 -e "s,@PWD@,${pwd},g" \
2456 -e "s,@HOSTCC@,${HOSTCC},g" \
2457 -e "s,@HOSTAR@,${HOSTAR},g" \
2458 -e "s,@CC@,${CC},g" \
2459 -e "s,@LD@,${LD},g" \
2460 -e "s,@AR@,${AR},g" \
2461 -e "s,@AS@,${AS},g" \
2462 -e "s,@OC@,${OC},g" \
2463 -e "s,@WINDRES@,${WINDRES},g" \
2464 -e "s,@DLLTOOL@,${DLLTOOL},g" \
2465 -e "s,@DLLWRAP@,${DLLWRAP},g" \
2466 -e "s,@RANLIB@,${RANLIB},g" \
2467 -e "s,@TOOL@,${tool},g" \
2468 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
2469 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
2470 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
2471 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
2472 -e "s,@OUTPUT@,${output},g" \
2473 -e "s,@APPEXTRA@,${appextra},g" \
2474 -e "s,@ARCHOSROM@,${archosrom},g" \
2475 -e "s,@FLASHFILE@,${flash},g" \
2476 -e "s,@PLUGINS@,${plugins},g" \
2477 -e "s,@CODECS@,${swcodec},g" \
2478 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
2479 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
2480 -e "s,@GCCOPTS@,${GCCOPTS},g" \
2481 -e "s,@TARGET_INC@,${TARGET_INC},g" \
2482 -e "s!@LDOPTS@!${LDOPTS}!g" \
2483 -e "s,@LOADADDRESS@,${loadaddress},g" \
2484 -e "s,@EXTRADEF@,${extradefines},g" \
2485 -e "s,@APPSDIR@,${appsdir},g" \
2486 -e "s,@FIRMDIR@,${firmdir},g" \
2487 -e "s,@TOOLSDIR@,${toolsdir},g" \
2488 -e "s,@APPS@,${apps},g" \
2489 -e "s,@SIMVER@,${simver},g" \
2490 -e "s,@GCCVER@,${gccver},g" \
2491 -e "s,@GCCNUM@,${gccnum},g" \
2492 -e "s,@UNAME@,${uname},g" \
2493 -e "s,@ENDIAN@,${defendian},g" \
2494 -e "s,@TOOLSET@,${toolset},g" \
2495 -e "${simmagic1}" \
2496 -e "${simmagic2}" \
2497 -e "s,@MANUALDEV@,${manualdev},g" \
2498 -e "s,@ENCODER@,${ENC_CMD},g" \
2499 -e "s,@ENC_OPTS@,${ENC_OPTS},g" \
2500 -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
2501 -e "s,@TTS_OPTS@,${TTS_OPTS},g" \
2502 -e "s,@VOICETOOLSET@,${voicetoolset},g" \
2503 -e "s,@LANGS@,${buildlangs},g" \
2504 -e "s,@USE_ELF@,${USE_ELF},g" \
2505 -e "s,@RBDIR@,${rbdir},g" \
2506 -e "s,@CMDLINE@,$cmdline,g" \
2507 <<EOF
2508 ## Automatically generated. http://www.rockbox.org/
2510 export ROOTDIR=@ROOTDIR@
2511 export FIRMDIR=@FIRMDIR@
2512 export APPSDIR=@APPSDIR@
2513 export TOOLSDIR=@TOOLSDIR@
2514 export DOCSDIR=\$(ROOTDIR)/docs
2515 export MANUALDIR=\${ROOTDIR}/manual
2516 export DEBUG=@DEBUG@
2517 export MODELNAME=@MODELNAME@
2518 export ARCHOSROM=@ARCHOSROM@
2519 export FLASHFILE=@FLASHFILE@
2520 export TARGET_ID=@TARGET_ID@
2521 export TARGET=@TARGET@
2522 export CPU=@CPU@
2523 export MANUFACTURER=@MANUFACTURER@
2524 export OBJDIR=@PWD@
2525 export BUILDDIR=@PWD@
2526 export LANGUAGE=@LANGUAGE@
2527 export VOICELANGUAGE=@VOICELANGUAGE@
2528 export MEMORYSIZE=@MEMORY@
2529 export VERSION:=\$(shell \$(ROOTDIR)/tools/version.sh \$(ROOTDIR))
2530 export BUILDDATE:=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
2531 export MKFIRMWARE=@TOOL@
2532 export BMP2RB_MONO=@BMP2RB_MONO@
2533 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
2534 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
2535 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
2536 export BINARY=@OUTPUT@
2537 export APPEXTRA=@APPEXTRA@
2538 export ENABLEDPLUGINS=@PLUGINS@
2539 export SOFTWARECODECS=@CODECS@
2540 export EXTRA_DEFINES=@EXTRADEF@
2541 export HOSTCC=@HOSTCC@
2542 export HOSTAR=@HOSTAR@
2543 export CC=@CC@
2544 export LD=@LD@
2545 export AR=@AR@
2546 export AS=@AS@
2547 export OC=@OC@
2548 export WINDRES=@WINDRES@
2549 export DLLTOOL=@DLLTOOL@
2550 export DLLWRAP=@DLLWRAP@
2551 export RANLIB=@RANLIB@
2552 export PROFILE_OPTS=@PROFILE_OPTS@
2553 export SIMVER=@SIMVER@
2554 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
2555 export GCCOPTS=@GCCOPTS@
2556 export TARGET_INC=@TARGET_INC@
2557 export LOADADDRESS=@LOADADDRESS@
2558 export SHARED_FLAG=@SHARED_FLAG@
2559 export LDOPTS=@LDOPTS@
2560 export GCCVER=@GCCVER@
2561 export GCCNUM=@GCCNUM@
2562 export UNAME=@UNAME@
2563 export MANUALDEV=@MANUALDEV@
2564 export TTS_OPTS=@TTS_OPTS@
2565 export TTS_ENGINE=@TTS_ENGINE@
2566 export ENC_OPTS=@ENC_OPTS@
2567 export ENCODER=@ENCODER@
2568 export USE_ELF=@USE_ELF@
2569 export RBDIR=@RBDIR@
2571 CONFIGURE_OPTIONS=@CMDLINE@
2573 include \$(TOOLSDIR)/root.make
2577 echo "Created Makefile"