Rename h100 specific screenshots so they are used again
[kugel-rb.git] / tools / configure
blob8b02d16dca866b2b70e36770594e33ebc8a0d962
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 echo -n "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice"
321 if [ "$memory" = "2" ]; then
322 echo -n ", (8)MB MOD"
324 if [ "$modelname" = "h120" ]; then
325 echo -n ", (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 ==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 tool="cp "
1439 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1440 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1441 output="rockbox.mrobe500"
1442 appextra="recorder:gui"
1443 plugins="yes"
1444 swcodec="yes"
1445 toolset=$gigabeatbitmaptools
1446 boottool="cp "
1447 bootoutput="rockbox.mrboot"
1448 # architecture, manufacturer and model for the target-tree build
1449 t_cpu="arm"
1450 t_manufacturer="tms320dm320"
1451 t_model="mrobe-500"
1454 71|mrobe100)
1455 target_id=33
1456 modelname="mrobe100"
1457 target="-DMROBE_100"
1458 memory=32 # always
1459 arm7tdmicc
1460 tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS"
1461 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1462 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1463 output="rockbox.mi4"
1464 appextra="recorder:gui"
1465 plugins="yes"
1466 swcodec="yes"
1467 boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL"
1468 bootoutput="pp5020.mi4"
1469 # toolset is the tools within the tools directory that we build for
1470 # this particular target.
1471 toolset=$scramblebitmaptools
1472 # architecture, manufacturer and model for the target-tree build
1473 t_cpu="arm"
1474 t_manufacturer="olympus"
1475 t_model="mrobe-100"
1478 80|logikdax)
1479 target_id=31
1480 modelname="logikdax"
1481 target="-DLOGIK_DAX"
1482 memory=2 # always
1483 arm946cc
1484 tool="$rootdir/tools/scramble -add=ldax"
1485 boottool="$rootdir/tools/scramble -tcc=crc"
1486 bootoutput="player.rom"
1487 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1488 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1489 output="rockbox.logik"
1490 appextra="recorder:gui"
1491 plugins=""
1492 swcodec="yes"
1493 # toolset is the tools within the tools directory that we build for
1494 # this particular target.
1495 toolset=$tccbitmaptools
1496 # architecture, manufacturer and model for the target-tree build
1497 t_cpu="arm"
1498 t_manufacturer="tcc77x"
1499 t_model="logikdax"
1502 90|creativezvm30gb)
1503 target_id=35
1504 modelname="creativezvm30"
1505 target="-DCREATIVE_ZVM"
1506 memory=64
1507 arm926ejscc
1508 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1509 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1510 tool="$rootdir/tools/scramble -creative=zvm"
1511 USE_ELF="yes"
1512 output="rockbox.zvm"
1513 appextra="recorder:gui"
1514 plugins="yes"
1515 swcodec="yes"
1516 toolset=$ipodbitmaptools
1517 boottool="$rootdir/tools/scramble -creative=zvm -no-ciff"
1518 bootoutput="rockbox.zvmboot"
1519 # architecture, manufacturer and model for the target-tree build
1520 t_cpu="arm"
1521 t_manufacturer="tms320dm320"
1522 t_model="creative-zvm"
1525 91|creativezvm60gb)
1526 target_id=40
1527 modelname="creativezvm60"
1528 target="-DCREATIVE_ZVM60GB"
1529 memory=64
1530 arm926ejscc
1531 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1532 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1533 tool="$rootdir/tools/scramble -creative=zvm60 -no-ciff"
1534 USE_ELF="yes"
1535 output="rockbox.zvm60"
1536 appextra="recorder:gui"
1537 plugins="yes"
1538 swcodec="yes"
1539 toolset=$ipodbitmaptools
1540 boottool="$rootdir/tools/scramble -creative=zvm60"
1541 bootoutput="rockbox.zvm60boot"
1542 # architecture, manufacturer and model for the target-tree build
1543 t_cpu="arm"
1544 t_manufacturer="tms320dm320"
1545 t_model="creative-zvm"
1548 92|creativezenvision)
1549 target_id=39
1550 modelname="creativezv"
1551 target="-DCREATIVE_ZV"
1552 memory=64
1553 arm926ejscc
1554 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1555 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1556 tool="$rootdir/tools/scramble -creative=zenvision -no-ciff"
1557 USE_ELF="yes"
1558 output="rockbox.zv"
1559 appextra="recorder:gui"
1560 plugins=""
1561 swcodec="yes"
1562 toolset=$ipodbitmaptools
1563 boottool="$rootdir/tools/scramble -creative=zenvision"
1564 bootoutput="rockbox.zvboot"
1565 # architecture, manufacturer and model for the target-tree build
1566 t_cpu="arm"
1567 t_manufacturer="tms320dm320"
1568 t_model="creative-zvm"
1571 50|e200)
1572 target_id=23
1573 modelname="e200"
1574 target="-DSANSA_E200"
1575 memory=32 # supposedly
1576 arm7tdmicc
1577 tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1578 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1579 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1580 output="rockbox.mi4"
1581 appextra="recorder:gui"
1582 plugins="yes"
1583 swcodec="yes"
1584 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1585 bootoutput="PP5022.mi4"
1586 # toolset is the tools within the tools directory that we build for
1587 # this particular target.
1588 toolset=$scramblebitmaptools
1589 # architecture, manufacturer and model for the target-tree build
1590 t_cpu="arm"
1591 t_manufacturer="sandisk"
1592 t_model="sansa-e200"
1595 51|e200r)
1596 # the e200R model is pretty much identical to the e200, it only has a
1597 # different option to the scramble tool when building a bootloader and
1598 # makes the bootloader output file name in all lower case.
1599 target_id=27
1600 modelname="e200r"
1601 target="-DSANSA_E200"
1602 memory=32 # supposedly
1603 arm7tdmicc
1604 tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1605 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1606 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1607 output="rockbox.mi4"
1608 appextra="recorder:gui"
1609 plugins="yes"
1610 swcodec="yes"
1611 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1612 bootoutput="pp5022.mi4"
1613 # toolset is the tools within the tools directory that we build for
1614 # this particular target.
1615 toolset=$scramblebitmaptools
1616 # architecture, manufacturer and model for the target-tree build
1617 t_cpu="arm"
1618 t_manufacturer="sandisk"
1619 t_model="sansa-e200"
1622 52|c200)
1623 target_id=30
1624 modelname="c200"
1625 target="-DSANSA_C200"
1626 memory=32 # supposedly
1627 arm7tdmicc
1628 tool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBOS"
1629 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1630 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1631 output="rockbox.mi4"
1632 appextra="recorder:gui"
1633 plugins="yes"
1634 swcodec="yes"
1635 boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
1636 bootoutput="firmware.mi4"
1637 # toolset is the tools within the tools directory that we build for
1638 # this particular target.
1639 toolset=$scramblebitmaptools
1640 # architecture, manufacturer and model for the target-tree build
1641 t_cpu="arm"
1642 t_manufacturer="sandisk"
1643 t_model="sansa-c200"
1646 53|m200)
1647 target_id=48
1648 modelname="m200"
1649 target="-DSANSA_M200"
1650 memory=1 # always
1651 arm946cc
1652 tool="$rootdir/tools/scramble -add=m200"
1653 boottool="$rootdir/tools/scramble -tcc=crc"
1654 bootoutput="player.rom"
1655 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1656 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1657 output="rockbox.m200"
1658 appextra="recorder:gui"
1659 plugins=""
1660 swcodec="yes"
1661 # toolset is the tools within the tools directory that we build for
1662 # this particular target.
1663 toolset=$tccbitmaptools
1664 # architecture, manufacturer and model for the target-tree build
1665 t_cpu="arm"
1666 t_manufacturer="tcc77x"
1667 t_model="m200"
1670 54|c100)
1671 target_id=42
1672 modelname="c100"
1673 target="-DSANSA_C100"
1674 memory=32 # unsure, must check
1675 arm946cc
1676 tool="$rootdir/tools/scramble -add=c100"
1677 boottool="$rootdir/tools/scramble -tcc=crc"
1678 bootoutput="player.rom"
1679 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1680 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1681 output="rockbox.c100"
1682 appextra="recorder:gui"
1683 plugins=""
1684 # toolset is the tools within the tools directory that we build for
1685 # this particular target.
1686 toolset=$tccbitmaptools
1687 # architecture, manufacturer and model for the target-tree build
1688 t_cpu="arm"
1689 t_manufacturer="tcc77x"
1690 t_model="c100"
1693 55|Clip|clip)
1694 target_id=50
1695 modelname="clip"
1696 target="-DSANSA_CLIP"
1697 memory=2
1698 arm9tdmicc
1699 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1700 bmp2rb_native="$bmp2rb_mono"
1701 tool="$rootdir/tools/scramble -add=clip"
1702 output="rockbox.sansa"
1703 bootoutput="bootloader-clip.sansa"
1704 appextra="recorder:gui"
1705 plugins="yes"
1706 swcodec="yes"
1707 toolset=$scramblebitmaptools
1708 t_cpu="arm"
1709 t_manufacturer="as3525"
1710 t_model="sansa-clip"
1714 56|e200v2)
1715 target_id=51
1716 modelname="e200v2"
1717 target="-DSANSA_E200V2"
1718 memory=8
1719 arm9tdmicc
1720 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1721 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1722 tool="$rootdir/tools/scramble -add=e2v2"
1723 output="rockbox.sansa"
1724 bootoutput="bootloader-e200v2.sansa"
1725 appextra="recorder:gui"
1726 plugins="yes"
1727 swcodec="yes"
1728 toolset=$scramblebitmaptools
1729 t_cpu="arm"
1730 t_manufacturer="as3525"
1731 t_model="sansa-e200v2"
1735 57|m200v4)
1736 target_id=52
1737 modelname="m200v4"
1738 target="-DSANSA_M200V4"
1739 memory=2
1740 arm9tdmicc
1741 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1742 bmp2rb_native="$bmp2rb_mono"
1743 tool="$rootdir/tools/scramble -add=m2v4"
1744 output="rockbox.sansa"
1745 bootoutput="bootloader-m200v4.sansa"
1746 appextra="recorder:gui"
1747 plugins="yes"
1748 swcodec="yes"
1749 toolset=$scramblebitmaptools
1750 t_cpu="arm"
1751 t_manufacturer="as3525"
1752 t_model="sansa-m200v4"
1756 58|fuze)
1757 target_id=53
1758 modelname="fuze"
1759 target="-DSANSA_FUZE"
1760 memory=8
1761 arm9tdmicc
1762 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1763 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1764 tool="$rootdir/tools/scramble -add=fuze"
1765 output="rockbox.sansa"
1766 bootoutput="bootloader-fuze.sansa"
1767 appextra="recorder:gui"
1768 plugins="yes"
1769 swcodec="yes"
1770 toolset=$scramblebitmaptools
1771 t_cpu="arm"
1772 t_manufacturer="as3525"
1773 t_model="sansa-fuze"
1777 59|c200v2)
1778 target_id=55
1779 modelname="c200v2"
1780 target="-DSANSA_C200V2"
1781 memory=2 # as per OF diagnosis mode
1782 arm9tdmicc
1783 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1784 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1785 tool="$rootdir/tools/scramble -add=c2v2"
1786 output="rockbox.sansa"
1787 bootoutput="bootloader-c200v2.sansa"
1788 appextra="recorder:gui"
1789 plugins="yes"
1790 swcodec="yes"
1791 # toolset is the tools within the tools directory that we build for
1792 # this particular target.
1793 toolset=$scramblebitmaptools
1794 # architecture, manufacturer and model for the target-tree build
1795 t_cpu="arm"
1796 t_manufacturer="as3525"
1797 t_model="sansa-c200v2"
1800 60|tpj1022)
1801 target_id=25
1802 modelname="tpj1022"
1803 target="-DELIO_TPJ1022"
1804 memory=32 # always
1805 arm7tdmicc
1806 tool="$rootdir/tools/scramble -add tpj2"
1807 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1808 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1809 output="rockbox.elio"
1810 appextra="recorder:gui"
1811 plugins="yes"
1812 swcodec="yes"
1813 boottool="$rootdir/tools/scramble -mi4v2"
1814 bootoutput="pp5020.mi4"
1815 # toolset is the tools within the tools directory that we build for
1816 # this particular target.
1817 toolset=$scramblebitmaptools
1818 # architecture, manufacturer and model for the target-tree build
1819 t_cpu="arm"
1820 t_manufacturer="tatung"
1821 t_model="tpj1022"
1824 100|sa9200)
1825 target_id=41
1826 modelname="sa9200"
1827 target="-DPHILIPS_SA9200"
1828 memory=32 # supposedly
1829 arm7tdmicc
1830 tool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBOS"
1831 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1832 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1833 output="rockbox.mi4"
1834 appextra="recorder:gui"
1835 plugins=""
1836 swcodec="yes"
1837 boottool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBBL"
1838 bootoutput="FWImage.ebn"
1839 # toolset is the tools within the tools directory that we build for
1840 # this particular target.
1841 toolset=$scramblebitmaptools
1842 # architecture, manufacturer and model for the target-tree build
1843 t_cpu="arm"
1844 t_manufacturer="philips"
1845 t_model="sa9200"
1848 101|hdd1630)
1849 target_id=43
1850 modelname="hdd1630"
1851 target="-DPHILIPS_HDD1630"
1852 memory=32 # supposedly
1853 arm7tdmicc
1854 tool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBOS"
1855 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1856 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1857 output="rockbox.mi4"
1858 appextra="recorder:gui"
1859 plugins="yes"
1860 swcodec="yes"
1861 boottool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBBL"
1862 bootoutput="FWImage.ebn"
1863 # toolset is the tools within the tools directory that we build for
1864 # this particular target.
1865 toolset=$scramblebitmaptools
1866 # architecture, manufacturer and model for the target-tree build
1867 t_cpu="arm"
1868 t_manufacturer="philips"
1869 t_model="hdd1630"
1872 110|meizum6sl)
1873 target_id=49
1874 modelname="meizum6sl"
1875 target="-DMEIZU_M6SL"
1876 memory=16 # always
1877 arm940tbecc
1878 tool="cp"
1879 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1880 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1881 output="rockbox.meizu"
1882 appextra="recorder:gui"
1883 plugins="no" #FIXME
1884 swcodec="yes"
1885 toolset=$genericbitmaptools
1886 boottool="cp"
1887 bootoutput="rockboot.ebn"
1888 # architecture, manufacturer and model for the target-tree build
1889 t_cpu="arm"
1890 t_manufacturer="s5l8700"
1891 t_model="meizu-m6sl"
1894 111|meizum6sp)
1895 target_id=46
1896 modelname="meizum6sp"
1897 target="-DMEIZU_M6SP"
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-m6sp"
1916 112|meizum3)
1917 target_id=47
1918 modelname="meizum3"
1919 target="-DMEIZU_M3"
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-m3"
1938 120|ondavx747)
1939 target_id=44
1940 modelname="ondavx747"
1941 target="-DONDA_VX747"
1942 memory=16
1943 mipselcc
1944 tool="$rootdir/tools/scramble -add=x747"
1945 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1946 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1947 output="rockbox.vx747"
1948 appextra="recorder:gui"
1949 plugins="" #FIXME
1950 swcodec="yes"
1951 toolset=$genericbitmaptools
1952 boottool="cp"
1953 bootoutput="rockboot.vx747"
1954 # architecture, manufacturer and model for the target-tree build
1955 t_cpu="mips"
1956 t_manufacturer="ingenic_jz47xx"
1957 t_model="onda_vx747"
1960 121|ondavx767)
1961 target_id=45
1962 modelname="ondavx767"
1963 target="-DONDA_VX767"
1964 memory=16 #FIXME
1965 mipselcc
1966 tool="cp"
1967 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1968 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1969 output="rockbox.vx767"
1970 appextra="recorder:gui"
1971 plugins="" #FIXME
1972 swcodec="yes"
1973 toolset=$genericbitmaptools
1974 boottool="cp"
1975 bootoutput="rockboot.vx767"
1976 # architecture, manufacturer and model for the target-tree build
1977 t_cpu="mips"
1978 t_manufacturer="ingenic_jz47xx"
1979 t_model="onda_vx767"
1982 122|ondavx747p)
1983 target_id=54
1984 modelname="ondavx747p"
1985 target="-DONDA_VX747P"
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.vx747p"
1992 appextra="recorder:gui"
1993 plugins="" #FIXME
1994 swcodec="yes"
1995 toolset=$genericbitmaptools
1996 boottool="cp"
1997 bootoutput="rockboot.vx747p"
1998 # architecture, manufacturer and model for the target-tree build
1999 t_cpu="mips"
2000 t_manufacturer="ingenic_jz47xx"
2001 t_model="onda_vx747"
2005 echo "Please select a supported target platform!"
2006 exit 7
2009 esac
2011 echo "Platform set to $modelname"
2014 #remove start
2015 ############################################################################
2016 # Amount of memory, for those that can differ. They have $memory unset at
2017 # this point.
2020 if [ -z "$memory" ]; then
2021 case $target_id in
2023 echo "Enter size of your RAM (in MB): (Defaults to 32)"
2024 if [ "1" != `parse_args --ram` ]; then
2025 size=`parse_args --ram`;
2026 else
2027 size=`input`;
2029 case $size in
2030 60|64)
2031 memory="64"
2034 memory="32"
2036 esac
2039 echo "Enter size of your RAM (in MB): (Defaults to 2)"
2040 if [ "1" != `parse_args --ram` ]; then
2041 size=`parse_args --ram`;
2042 else
2043 size=`input`;
2045 case $size in
2047 memory="8"
2050 memory="2"
2052 esac
2054 esac
2055 echo "Memory size selected: $memory MB"
2056 echo ""
2058 #remove end
2060 ##################################################################
2061 # Figure out build "type"
2064 # the ifp7x0 is the only platform that supports building a gdb stub like
2065 # this
2066 case $modelname in
2067 ifp7xx)
2068 gdbstub="(G)DB stub, "
2070 e200r|e200)
2071 gdbstub="(I)installer, "
2073 c200)
2074 gdbstub="(E)raser, "
2078 esac
2079 if [ "1" != `parse_args --type` ]; then
2080 btype=`parse_args --type`;
2081 else
2082 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, $gdbstub(M)anual: (Defaults to N)"
2083 btype=`input`;
2086 case $btype in
2087 [Ii])
2088 appsdir='\$(ROOTDIR)/bootloader'
2089 apps="bootloader"
2090 extradefines="-DBOOTLOADER -DE200R_INSTALLER -ffunction-sections -fdata-sections"
2091 bootloader="1"
2092 echo "e200R-installer build selected"
2094 [Ee])
2095 appsdir='\$(ROOTDIR)/bootloader'
2096 apps="bootloader"
2097 echo "C2(4)0 or C2(5)0"
2098 variant=`input`
2099 case $variant in
2101 extradefines="-DBOOTLOADER -DC200_ERASE -DC240_ERASE -ffunction-sections -fdata-sections"
2102 echo "c240 eraser build selected"
2105 extradefines="-DBOOTLOADER -DC200_ERASE -DC250_ERASE -ffunction-sections -fdata-sections"
2106 echo "c240 eraser build selected"
2108 esac
2109 bootloader="1"
2110 echo "c200 eraser build selected"
2112 [Bb])
2113 if test $t_manufacturer = "archos"; then
2114 # Archos SH-based players do this somewhat differently for
2115 # some reason
2116 appsdir='\$(ROOTDIR)/flash/bootbox'
2117 apps="bootbox"
2118 else
2119 appsdir='\$(ROOTDIR)/bootloader'
2120 apps="bootloader"
2121 flash=""
2122 if test -n "$boottool"; then
2123 tool="$boottool"
2125 if test -n "$bootoutput"; then
2126 output=$bootoutput
2129 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
2130 bootloader="1"
2131 echo "Bootloader build selected"
2133 [Ss])
2134 debug="-DDEBUG"
2135 simulator="yes"
2136 extradefines="-DSIMULATOR"
2137 archosrom=""
2138 flash=""
2139 echo "Simulator build selected"
2141 [Aa])
2142 echo "Advanced build selected"
2143 whichadvanced
2145 [Gg])
2146 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
2147 appsdir='\$(ROOTDIR)/gdb'
2148 apps="stub"
2149 case $modelname in
2150 ifp7xx)
2151 output="stub.wma"
2155 esac
2156 echo "GDB stub build selected"
2158 [Mm])
2159 toolset='';
2160 apps="manual"
2161 echo "Manual build selected"
2164 if [ "$modelname" = "e200r" ]; then
2165 echo "Do not use the e200R target for regular builds. Use e200 instead."
2166 exit 8
2168 debug=""
2169 btype="N" # set it explicitly since RET only gets here as well
2170 echo "Normal build selected"
2173 esac
2174 # to be able running "make manual" from non-manual configuration
2175 case $modelname in
2176 fmrecorder)
2177 manualdev="recorderv2fm"
2179 recorderv2)
2180 manualdev="recorderv2fm"
2182 h1??)
2183 manualdev="h100"
2185 ipodmini2g)
2186 manualdev="ipodmini"
2189 manualdev=$modelname
2191 esac
2193 if [ -z "$debug" ]; then
2194 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
2197 echo "Using source code root directory: $rootdir"
2199 # this was once possible to change at build-time, but no more:
2200 language="english"
2202 uname=`uname`
2204 if [ "yes" = "$simulator" ]; then
2205 # setup compiler and things for simulator
2206 simcc
2208 if [ -d "simdisk" ]; then
2209 echo "Subdirectory 'simdisk' already present"
2210 else
2211 mkdir simdisk
2212 echo "Created a 'simdisk' subdirectory for simulating the hard disk"
2216 # Now, figure out version number of the (gcc) compiler we are about to use
2217 gccver=`$CC -dumpversion`;
2219 # figure out the binutil version too and display it, mostly for the build
2220 # system etc to be able to see it easier
2221 ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
2223 if [ -z "$gccver" ]; then
2224 echo "WARNING: The compiler you must use ($CC) is not in your path!"
2225 echo "WARNING: this may cause your build to fail since we cannot do the"
2226 echo "WARNING: checks we want now."
2227 else
2229 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
2230 # DEPEND on it
2232 num1=`echo $gccver | cut -d . -f1`
2233 num2=`echo $gccver | cut -d . -f2`
2234 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
2236 # This makes:
2237 # 3.3.X => 303
2238 # 3.4.X => 304
2239 # 2.95.3 => 295
2241 echo "Using $CC $gccver ($gccnum)"
2243 if test "$gccnum" -ge "400"; then
2244 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
2245 # so we ignore that warnings for now
2246 # -Wno-pointer-sign
2247 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
2250 if test "$gccnum" -ge "401"; then
2251 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
2252 # will break strict-aliasing rules"
2254 GCCOPTS="$GCCOPTS -fno-strict-aliasing"
2257 if test "$gccnum" -ge "402"; then
2258 # disable warning about "warning: initialized field overwritten" as gcc 4.2
2259 # and later would throw it for several valid cases
2260 GCCOPTS="$GCCOPTS -Wno-override-init"
2263 case $prefix in
2265 # simulator
2267 i586-mingw32msvc-)
2268 # cross-compile for win32
2271 # Verify that the cross-compiler is of a recommended version!
2272 if test "$gccver" != "$gccchoice"; then
2273 echo "WARNING: Your cross-compiler $CC $gccver is not of the recommended"
2274 echo "WARNING: version $gccchoice!"
2275 echo "WARNING: This may cause your build to fail since it may be a version"
2276 echo "WARNING: that isn't functional or known to not be the best choice."
2277 echo "WARNING: If you suffer from build problems, you know that this is"
2278 echo "WARNING: a likely source for them..."
2281 esac
2286 echo "Using $LD $ldver"
2288 # check the compiler for SH platforms
2289 if test "$CC" = "sh-elf-gcc"; then
2290 if test "$gccnum" -lt "400"; then
2291 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
2292 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2293 else
2294 # figure out patch status
2295 gccpatch=`$CC --version`;
2297 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
2298 echo "gcc $gccver is rockbox patched"
2299 # then convert -O to -Os to get smaller binaries!
2300 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2301 else
2302 echo "WARNING: You use an unpatched gcc compiler: $gccver"
2303 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2308 if test "$CC" = "m68k-elf-gcc"; then
2309 # convert -O to -Os to get smaller binaries!
2310 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2313 if [ "1" != `parse_args --ccache` ]; then
2314 echo "Enable ccache for building"
2315 ccache="ccache"
2316 else
2317 if [ "1" = `parse_args --no-ccache` ]; then
2318 ccache=`findtool ccache`
2319 if test -n "$ccache"; then
2320 echo "Found and uses ccache ($ccache)"
2325 # figure out the full path to the various commands if possible
2326 HOSTCC=`findtool gcc --lit`
2327 HOSTAR=`findtool ar --lit`
2328 CC=`findtool ${CC} --lit`
2329 LD=`findtool ${AR} --lit`
2330 AR=`findtool ${AR} --lit`
2331 AS=`findtool ${AS} --lit`
2332 OC=`findtool ${OC} --lit`
2333 WINDRES=`findtool ${WINDRES} --lit`
2334 DLLTOOL=`findtool ${DLLTOOL} --lit`
2335 DLLWRAP=`findtool ${DLLWRAP} --lit`
2336 RANLIB=`findtool ${RANLIB} --lit`
2338 if test -n "$ccache"; then
2339 CC="$ccache $CC"
2342 if test "X$endian" = "Xbig"; then
2343 defendian="ROCKBOX_BIG_ENDIAN"
2344 else
2345 defendian="ROCKBOX_LITTLE_ENDIAN"
2348 if [ "1" != `parse_args --rbdir` ]; then
2349 rbdir=`parse_args --rbdir`;
2350 echo "Using alternate rockbox dir: ${rbdir}"
2353 sed > autoconf.h \
2354 -e "s,@ENDIAN@,${defendian},g" \
2355 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
2356 -e "s,@config_rtc@,$config_rtc,g" \
2357 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
2358 -e "s,@RBDIR@,${rbdir},g" \
2359 <<EOF
2360 /* This header was made by configure */
2361 #ifndef __BUILD_AUTOCONF_H
2362 #define __BUILD_AUTOCONF_H
2364 /* Define endianess for the target or simulator platform */
2365 #define @ENDIAN@ 1
2367 /* Define this if you build rockbox to support the logf logging and display */
2368 #undef ROCKBOX_HAS_LOGF
2370 /* optional defines for RTC mod for h1x0 */
2371 @config_rtc@
2372 @have_rtc_alarm@
2374 /* root of Rockbox */
2375 #define ROCKBOX_DIR "/@RBDIR@"
2377 #endif /* __BUILD_AUTOCONF_H */
2380 if test -n "$t_cpu"; then
2381 TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
2382 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
2383 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
2384 GCCOPTS="$GCCOPTS"
2387 if test "$simulator" = "yes"; then
2388 # add simul make stuff on the #SIMUL# line
2389 simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
2390 simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
2391 else
2392 # delete the lines that match
2393 simmagic1='/@SIMUL1@/D'
2394 simmagic2='/@SIMUL2@/D'
2397 if test "$swcodec" = "yes"; then
2398 voicetoolset="rbspeexenc voicefont wavtrim"
2399 else
2400 voicetoolset="voicefont wavtrim"
2403 if test "$apps" = "apps"; then
2404 # only when we build "real" apps we build the .lng files
2405 buildlangs="langs"
2408 #### Fix the cmdline ###
2409 if test -n "$ccache"; then
2410 cmdline="--ccache"
2413 cmdline="$cmdline --target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype"
2416 ### end of cmdline
2418 sed > Makefile \
2419 -e "s,@ROOTDIR@,${rootdir},g" \
2420 -e "s,@DEBUG@,${debug},g" \
2421 -e "s,@MEMORY@,${memory},g" \
2422 -e "s,@TARGET_ID@,${target_id},g" \
2423 -e "s,@TARGET@,${target},g" \
2424 -e "s,@CPU@,${t_cpu},g" \
2425 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
2426 -e "s,@MODELNAME@,${modelname},g" \
2427 -e "s,@LANGUAGE@,${language},g" \
2428 -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
2429 -e "s,@PWD@,${pwd},g" \
2430 -e "s,@HOSTCC@,${HOSTCC},g" \
2431 -e "s,@HOSTAR@,${HOSTAR},g" \
2432 -e "s,@CC@,${CC},g" \
2433 -e "s,@LD@,${LD},g" \
2434 -e "s,@AR@,${AR},g" \
2435 -e "s,@AS@,${AS},g" \
2436 -e "s,@OC@,${OC},g" \
2437 -e "s,@WINDRES@,${WINDRES},g" \
2438 -e "s,@DLLTOOL@,${DLLTOOL},g" \
2439 -e "s,@DLLWRAP@,${DLLWRAP},g" \
2440 -e "s,@RANLIB@,${RANLIB},g" \
2441 -e "s,@TOOL@,${tool},g" \
2442 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
2443 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
2444 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
2445 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
2446 -e "s,@OUTPUT@,${output},g" \
2447 -e "s,@APPEXTRA@,${appextra},g" \
2448 -e "s,@ARCHOSROM@,${archosrom},g" \
2449 -e "s,@FLASHFILE@,${flash},g" \
2450 -e "s,@PLUGINS@,${plugins},g" \
2451 -e "s,@CODECS@,${swcodec},g" \
2452 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
2453 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
2454 -e "s,@GCCOPTS@,${GCCOPTS},g" \
2455 -e "s,@TARGET_INC@,${TARGET_INC},g" \
2456 -e "s!@LDOPTS@!${LDOPTS}!g" \
2457 -e "s,@LOADADDRESS@,${loadaddress},g" \
2458 -e "s,@EXTRADEF@,${extradefines},g" \
2459 -e "s,@APPSDIR@,${appsdir},g" \
2460 -e "s,@FIRMDIR@,${firmdir},g" \
2461 -e "s,@TOOLSDIR@,${toolsdir},g" \
2462 -e "s,@APPS@,${apps},g" \
2463 -e "s,@SIMVER@,${simver},g" \
2464 -e "s,@GCCVER@,${gccver},g" \
2465 -e "s,@GCCNUM@,${gccnum},g" \
2466 -e "s,@UNAME@,${uname},g" \
2467 -e "s,@ENDIAN@,${defendian},g" \
2468 -e "s,@TOOLSET@,${toolset},g" \
2469 -e "${simmagic1}" \
2470 -e "${simmagic2}" \
2471 -e "s,@MANUALDEV@,${manualdev},g" \
2472 -e "s,@ENCODER@,${ENC_CMD},g" \
2473 -e "s,@ENC_OPTS@,${ENC_OPTS},g" \
2474 -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
2475 -e "s,@TTS_OPTS@,${TTS_OPTS},g" \
2476 -e "s,@VOICETOOLSET@,${voicetoolset},g" \
2477 -e "s,@LANGS@,${buildlangs},g" \
2478 -e "s,@USE_ELF@,${USE_ELF},g" \
2479 -e "s,@RBDIR@,${rbdir},g" \
2480 -e "s,@CMDLINE@,$cmdline,g" \
2481 <<EOF
2482 ## Automatically generated. http://www.rockbox.org/
2484 export ROOTDIR=@ROOTDIR@
2485 export FIRMDIR=@FIRMDIR@
2486 export APPSDIR=@APPSDIR@
2487 export TOOLSDIR=@TOOLSDIR@
2488 export DOCSDIR=\$(ROOTDIR)/docs
2489 export MANUALDIR=\${ROOTDIR}/manual
2490 export DEBUG=@DEBUG@
2491 export MODELNAME=@MODELNAME@
2492 export ARCHOSROM=@ARCHOSROM@
2493 export FLASHFILE=@FLASHFILE@
2494 export TARGET_ID=@TARGET_ID@
2495 export TARGET=@TARGET@
2496 export CPU=@CPU@
2497 export MANUFACTURER=@MANUFACTURER@
2498 export OBJDIR=@PWD@
2499 export BUILDDIR=@PWD@
2500 export LANGUAGE=@LANGUAGE@
2501 export VOICELANGUAGE=@VOICELANGUAGE@
2502 export MEMORYSIZE=@MEMORY@
2503 export VERSION:=\$(shell \$(ROOTDIR)/tools/version.sh \$(ROOTDIR))
2504 export BUILDDATE:=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
2505 export MKFIRMWARE=@TOOL@
2506 export BMP2RB_MONO=@BMP2RB_MONO@
2507 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
2508 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
2509 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
2510 export BINARY=@OUTPUT@
2511 export APPEXTRA=@APPEXTRA@
2512 export ENABLEDPLUGINS=@PLUGINS@
2513 export SOFTWARECODECS=@CODECS@
2514 export EXTRA_DEFINES=@EXTRADEF@
2515 export HOSTCC=@HOSTCC@
2516 export HOSTAR=@HOSTAR@
2517 export CC=@CC@
2518 export LD=@LD@
2519 export AR=@AR@
2520 export AS=@AS@
2521 export OC=@OC@
2522 export WINDRES=@WINDRES@
2523 export DLLTOOL=@DLLTOOL@
2524 export DLLWRAP=@DLLWRAP@
2525 export RANLIB=@RANLIB@
2526 export PROFILE_OPTS=@PROFILE_OPTS@
2527 export SIMVER=@SIMVER@
2528 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
2529 export GCCOPTS=@GCCOPTS@
2530 export TARGET_INC=@TARGET_INC@
2531 export LOADADDRESS=@LOADADDRESS@
2532 export SHARED_FLAG=@SHARED_FLAG@
2533 export LDOPTS=@LDOPTS@
2534 export GCCVER=@GCCVER@
2535 export GCCNUM=@GCCNUM@
2536 export UNAME=@UNAME@
2537 export MANUALDEV=@MANUALDEV@
2538 export TTS_OPTS=@TTS_OPTS@
2539 export TTS_ENGINE=@TTS_ENGINE@
2540 export ENC_OPTS=@ENC_OPTS@
2541 export ENCODER=@ENCODER@
2542 export USE_ELF=@USE_ELF@
2543 export RBDIR=@RBDIR@
2545 CONFIGURE_OPTIONS=@CMDLINE@
2547 include \$(TOOLSDIR)/root.make
2551 echo "Created Makefile"