Fix up ZVM builds. It appeared to share common definitions with PP502x targets so...
[kugel-rb.git] / tools / configure
blobfc12c312c1758baaa79b88c6a7bba67c2d92ab57
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 Linux)
137 echo "Linux host detected"
138 if [ "0" != `sdl-config --libs |grep -c mwindows` ]; then
139 # Enable crosscompiling if sdl-config is from Windows SDL
140 crosswincc
141 else
142 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
143 LDOPTS="`sdl-config --libs`"
147 FreeBSD)
148 echo "FreeBSD host detected"
149 # sdl version
150 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
151 LDOPTS="`sdl-config --libs`"
154 Darwin)
155 echo "Darwin host detected"
156 # sdl version
157 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
158 LDOPTS="`sdl-config --libs`"
159 SHARED_FLAG="-dynamiclib -Wl\,-single_module"
163 echo "Unsupported system: $uname, fix configure and retry"
164 exit 2
166 esac
168 GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
170 if test "X$crosscompile" != "Xyes"; then
171 if [ "`uname -m`" = "x86_64" ] || [ "`uname -m`" = "amd64" ]; then
172 # fPIC is needed to make shared objects link
173 # setting visibility to hidden is necessary to avoid strange crashes
174 # due to symbol clashing
175 GCCOPTS="$GCCOPTS -fPIC -fvisibility=hidden"
178 id=$$
179 cat >/tmp/conftest-$id.c <<EOF
180 #include <stdio.h>
181 int main(int argc, char **argv)
183 int var=0;
184 char *varp = (char *)&var;
185 *varp=1;
187 printf("%d\n", var);
188 return 0;
192 $CC -o /tmp/conftest-$id /tmp/conftest-$id.c 2>/dev/null
194 if test `/tmp/conftest-$id 2>/dev/null` -gt "1"; then
195 # big endian
196 endian="big"
197 else
198 # little endian
199 endian="little"
201 echo "Simulator environment deemed $endian endian"
203 # use wildcard here to make it work even if it was named *.exe like
204 # on cygwin
205 rm -f /tmp/conftest-$id*
210 # functions for setting up cross-compiler names and options
211 # also set endianess and what the exact recommended gcc version is
212 # the gcc version should most likely match what versions we build with
213 # rockboxdev.sh
215 shcc () {
216 prefixtools sh-elf-
217 GCCOPTS="$CCOPTS -m1"
218 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
219 endian="big"
220 gccchoice="4.0.3"
223 calmrisccc () {
224 prefixtools calmrisc16-unknown-elf-
225 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
226 GCCOPTIMIZE="-fomit-frame-pointer"
227 endian="big"
230 coldfirecc () {
231 prefixtools m68k-elf-
232 GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
233 GCCOPTIMIZE="-fomit-frame-pointer"
234 endian="big"
235 gccchoice="3.4.6"
238 arm7tdmicc () {
239 prefixtools arm-elf-
240 GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
241 if test "X$1" != "Xshort"; then
242 GCCOPTS="$GCCOPTS -mlong-calls"
244 GCCOPTIMIZE="-fomit-frame-pointer"
245 endian="little"
246 gccchoice="4.0.3"
249 arm9tdmicc () {
250 prefixtools arm-elf-
251 GCCOPTS="$CCOPTS -mcpu=arm9tdmi -mlong-calls"
252 GCCOPTIMIZE="-fomit-frame-pointer"
253 endian="little"
254 gccchoice="4.0.3"
257 arm940tbecc () {
258 prefixtools arm-elf-
259 GCCOPTS="$CCOPTS -mbig-endian -mcpu=arm940t -mlong-calls"
260 GCCOPTIMIZE="-fomit-frame-pointer"
261 endian="big"
262 gccchoice="4.0.3"
265 arm946cc () {
266 prefixtools arm-elf-
267 GCCOPTS="$CCOPTS -mcpu=arm9e -mlong-calls"
268 GCCOPTIMIZE="-fomit-frame-pointer"
269 endian="little"
270 gccchoice="4.0.3"
273 arm926ejscc () {
274 prefixtools arm-elf-
275 GCCOPTS="$CCOPTS -mcpu=arm926ej-s -mlong-calls"
276 GCCOPTIMIZE="-fomit-frame-pointer"
277 endian="little"
278 gccchoice="4.0.3"
281 arm1136jfscc () {
282 prefixtools arm-elf-
283 GCCOPTS="$CCOPTS -mcpu=arm1136jf-s -mlong-calls"
284 GCCOPTIMIZE="-fomit-frame-pointer"
285 endian="little"
286 gccchoice="4.0.3"
289 mipselcc () {
290 prefixtools mipsel-elf-
291 GCCOPTS="$CCOPTS -march=mips32 -mno-mips16 -mno-abicalls -mlong-calls"
292 GCCOPTIMIZE="-fomit-frame-pointer"
293 GCCOPTS="$GCCOPTS -fno-pic -fno-builtin -fno-exceptions -ffunction-sections -msoft-float -G 0"
294 endian="little"
295 gccchoice="4.1.2"
298 whichadvanced () {
299 ##################################################################
300 # Prompt for specific developer options
302 echo ""
303 echo "Enter your developer options (press enter when done)"
304 echo -n "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice"
305 if [ "$memory" = "2" ]; then
306 echo -n ", (8)MB MOD"
308 if [ "$modelname" = "h120" ]; then
309 echo -n ", (R)TC MOD"
311 echo ""
313 cont=1
315 while [ $cont = "1" ]; do
317 option=`input`;
319 case $option in
320 [Dd])
321 if [ "yes" = "$profile" ]; then
322 echo "Debug is incompatible with profiling"
323 else
324 echo "define DEBUG"
325 use_debug="yes"
328 [Ll])
329 echo "logf() support enabled"
330 logf="yes"
332 [Ss])
333 echo "Simulator build enabled"
334 simulator="yes"
336 [Pp])
337 if [ "yes" = "$use_debug" ]; then
338 echo "Profiling is incompatible with debug"
339 else
340 echo "Profiling support is enabled"
341 profile="yes"
344 [Vv])
345 echo "Voice build selected"
346 voice="yes"
349 if [ "$memory" = "2" ]; then
350 memory="8"
351 echo "Memory size selected: 8MB"
352 else
353 cont=0
356 [Rr])
357 if [ "$modelname" = "h120" ]; then
358 config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231"
359 have_rtc_alarm="#define HAVE_RTC_ALARM"
360 echo "RTC functions enabled (DS1339/DS3231)"
361 else
362 cont=0
366 cont=0
368 esac
369 done
370 echo "done"
372 if [ "yes" = "$voice" ]; then
373 # Ask about languages to build
374 echo "Select a number for the language to use (default is english)"
375 # The multiple-language feature is currently broken
376 # echo "You may enter a comma-separated list of languages to build"
378 picklang
379 voicelanguage=`whichlang`
381 if [ -z "$voicelanguage" ]; then
382 # pick a default
383 voicelanguage="english"
385 echo "Voice language set to $voicelanguage"
387 # Configure encoder and TTS engine for each language
388 for thislang in `echo $voicelanguage | sed 's/,/ /g'`; do
389 voiceconfig "$thislang"
390 done
392 if [ "yes" = "$use_debug" ]; then
393 debug="-DDEBUG"
394 GCCOPTS="$GCCOPTS -g -DDEBUG"
396 if [ "yes" = "$logf" ]; then
397 use_logf="#define ROCKBOX_HAS_LOGF 1"
399 if [ "yes" = "$simulator" ]; then
400 debug="-DDEBUG"
401 extradefines="$extradefines -DSIMULATOR"
403 if [ "yes" = "$profile" ]; then
404 extradefines="$extradefines -DRB_PROFILE"
405 PROFILE_OPTS="-finstrument-functions"
409 # Configure voice settings
410 voiceconfig () {
411 thislang=$1
412 echo "Building $thislang voice for $modelname. Select options"
413 echo ""
415 if [ -n "`findtool flite`" ]; then
416 FLITE="F(l)ite "
417 FLITE_OPTS=""
418 DEFAULT_TTS="flite"
419 DEFAULT_TTS_OPTS=$FLITE_OPTS
420 DEFAULT_NOISEFLOOR="500"
421 DEFAULT_CHOICE="L"
423 if [ -n "`findtool espeak`" ]; then
424 ESPEAK="(e)Speak "
425 ESPEAK_OPTS=""
426 DEFAULT_TTS="espeak"
427 DEFAULT_TTS_OPTS=$ESPEAK_OPTS
428 DEFAULT_NOISEFLOOR="500"
429 DEFAULT_CHOICE="e"
431 if [ -n "`findtool festival`" ]; then
432 FESTIVAL="(F)estival "
433 case "$thislang" in
434 "italiano")
435 FESTIVAL_OPTS="--language italian"
437 "espanol")
438 FESTIVAL_OPTS="--language spanish"
440 "finnish")
441 FESTIVAL_OPTS="--language finnish"
443 "czech")
444 FESTIVAL_OPTS="--language czech"
447 FESTIVAL_OPTS=""
449 esac
450 DEFAULT_TTS="festival"
451 DEFAULT_TTS_OPTS=$FESTIVAL_OPTS
452 DEFAULT_NOISEFLOOR="500"
453 DEFAULT_CHOICE="F"
455 if [ -n "`findtool swift`" ]; then
456 SWIFT="S(w)ift "
457 SWIFT_OPTS=""
458 DEFAULT_TTS="swift"
459 DEFAULT_TTS_OPTS=$SWIFT_OPTS
460 DEFAULT_NOISEFLOOR="500"
461 DEFAULT_CHOICE="w"
463 # Allow SAPI if Windows is in use
464 if [ -n "`findtool winver`" ]; then
465 SAPI="(S)API "
466 SAPI_OPTS=""
467 DEFAULT_TTS="sapi"
468 DEFAULT_TTS_OPTS=$SAPI_OPTS
469 DEFAULT_NOISEFLOOR="500"
470 DEFAULT_CHOICE="S"
473 if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ] && [ "$ESPEAK" = "$SAPI" ] && [ "$SAPI" = "$SWIFT" ]; then
474 echo "You need Festival, eSpeak or Flite in your path, or SAPI available to build voice files"
475 exit 3
478 echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?"
479 option=`input`
480 case "$option" in
481 [Ll])
482 TTS_ENGINE="flite"
483 NOISEFLOOR="500" # TODO: check this value
484 TTS_OPTS=$FLITE_OPTS
486 [Ee])
487 TTS_ENGINE="espeak"
488 NOISEFLOOR="500"
489 TTS_OPTS=$ESPEAK_OPTS
491 [Ff])
492 TTS_ENGINE="festival"
493 NOISEFLOOR="500"
494 TTS_OPTS=$FESTIVAL_OPTS
496 [Ss])
497 TTS_ENGINE="sapi"
498 NOISEFLOOR="500"
499 TTS_OPTS=$SAPI_OPTS
501 [Ww])
502 TTS_ENGINE="swift"
503 NOISEFLOOR="500"
504 TTS_OPTS=$SWIFT_OPTS
507 TTS_ENGINE=$DEFAULT_TTS
508 TTS_OPTS=$DEFAULT_TTS_OPTS
509 NOISEFLOOR=$DEFAULT_NOISEFLOOR
510 esac
511 echo "Using $TTS_ENGINE for TTS"
513 # Allow the user to input manual commandline options
514 printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): "
515 USER_TTS_OPTS=`input`
516 if [ -n "$USER_TTS_OPTS" ]; then
517 TTS_OPTS="$USER_TTS_OPTS"
520 echo ""
522 if [ "$swcodec" = "yes" ]; then
523 ENCODER="rbspeexenc"
524 ENC_CMD="rbspeexenc"
525 ENC_OPTS="-q 4 -c 10"
526 else
527 if [ -n "`findtool lame`" ]; then
528 ENCODER="lame"
529 ENC_CMD="lame"
530 ENC_OPTS="--resample 12 -t -m m -h -V 9 -S -B 64 --vbr-new"
531 else
532 echo "You need LAME in the system path to build voice files for"
533 echo "HWCODEC targets."
534 exit 4
538 echo "Using $ENCODER for encoding voice clips"
540 # Allow the user to input manual commandline options
541 printf "Enter $ENCODER options (enter for defaults \"$ENC_OPTS\"): "
542 USER_ENC_OPTS=`input`
543 if [ -n "$USER_ENC_OPTS" ]; then
544 ENC_OPTS=$USER_ENC_OPTS
547 TEMPDIR="${pwd}"
548 if [ -n "`findtool cygpath`" ]; then
549 TEMPDIR=`cygpath . -a -w`
553 picklang() {
554 # figure out which languages that are around
555 for file in $rootdir/apps/lang/*.lang; do
556 clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
557 langs="$langs $clean"
558 done
560 num=1
561 for one in $langs; do
562 echo "$num. $one"
563 num=`expr $num + 1`
564 done
566 read pick
569 whichlang() {
570 output=""
571 # Allow the user to pass a comma-separated list of langauges
572 for thispick in `echo $pick | sed 's/,/ /g'`; do
573 num=1
574 for one in $langs; do
575 # Accept both the language number and name
576 if [ "$num" = "$thispick" ] || [ "$thispick" = "$one" ]; then
577 if [ "$output" = "" ]; then
578 output=$one
579 else
580 output=$output,$one
583 num=`expr $num + 1`
584 done
585 done
586 echo $output
589 opt=$1
591 if test "$opt" = "--help"; then
592 echo "Rockbox configure script."
593 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
594 echo "Do *NOT* run this within the tools directory!"
595 echo ""
596 cat <<EOF
597 Usage: configure [OPTION]...
598 Options:
599 --target=TARGET Sets the target, TARGET can be either the target ID or
600 corresponding string. Run without this option to see all
601 available targets.
603 --ram=RAM Sets the RAM for certain targets. Even though any number
604 is accepted, not every number is correct. The default
605 value will be applied, if you entered a wrong number
606 (which depends on the target). Watch the output. Run
607 without this option if you are not sure which the right
608 number is.
610 --type=TYPE Sets the build type. The shortcut is also valid.
611 Run without this option to see available types.
613 --rbdir=dir Use alternative rockbox directory (default: ${rbdir}).
614 This is useful for having multiple alternate builds on
615 your device that you can load with ROLO. However as the
616 bootloader looks for .rockbox you won't be able to boot
617 into this build.
619 --ccache Enable ccache use (done by default these days)
620 --no-ccache Disable ccache use
621 --help Shows this message (must not be used with other options)
625 exit
628 if test -r "configure"; then
629 # this is a check for a configure script in the current directory, it there
630 # is one, try to figure out if it is this one!
632 if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
633 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
634 echo "It will only cause you pain and grief. Instead do this:"
635 echo ""
636 echo " cd .."
637 echo " mkdir build-dir"
638 echo " cd build-dir"
639 echo " ../tools/configure"
640 echo ""
641 echo "Much happiness will arise from this. Enjoy"
642 exit 5
646 # get our current directory
647 pwd=`pwd`;
649 if { echo $pwd | grep " "; } then
650 echo "You're running this script in a path that contains space. The build"
651 echo "system is unfortunately not clever enough to deal with this. Please"
652 echo "run the script from a different path, rename the path or fix the build"
653 echo "system!"
654 exit 6
657 if [ -z "$rootdir" ]; then
658 ##################################################################
659 # Figure out where the source code root is!
661 rootdir=`dirname $0`/../
663 #####################################################################
664 # Convert the possibly relative directory name to an absolute version
666 now=`pwd`
667 cd $rootdir
668 rootdir=`pwd`
670 # cd back to the build dir
671 cd $now
674 apps="apps"
675 appsdir='\$(ROOTDIR)/apps'
676 firmdir='\$(ROOTDIR)/firmware'
677 toolsdir='\$(ROOTDIR)/tools'
680 ##################################################################
681 # Figure out target platform
684 if [ "1" != `parse_args --target` ]; then
685 buildfor=`parse_args --target`;
686 else
687 echo "Enter target platform:"
688 cat <<EOF
689 ==Archos== ==iriver== ==Apple iPod==
690 0) Player/Studio 10) H120/H140 20) Color/Photo
691 1) Recorder 11) H320/H340 21) Nano
692 2) FM Recorder 12) iHP-100/110/115 22) Video
693 3) Recorder v2 13) iFP-790 23) 3G
694 4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
695 5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
696 6) AV300 26) Mini 2G
697 ==Toshiba== 27) 1G, 2G
698 40) Gigabeat F
699 ==Cowon/iAudio== 41) Gigabeat S ==SanDisk==
700 30) X5/X5V/X5L 50) Sansa e200
701 31) M5/M5L ==Tatung== 51) Sansa e200R
702 32) 7 60) Elio TPJ-1022 52) Sansa c200
703 33) D2 53) Sansa m200
704 34) M3/M3L ==Olympus== 54) Sansa c100
705 70) M:Robe 500 55) Sansa Clip
706 ==Creative== 71) M:Robe 100 56) Sansa e200v2
707 90) Zen Vision:M 30GB 57) Sansa m200v4
708 91) Zen Vision:M 60GB ==Philips== 58) Sansa Fuze
709 92) Zen Vision 100) GoGear SA9200 59) Sansa c200v2
710 101) GoGear HDD1630
711 ==Logik==
712 ==Onda== 80) DAX 1GB MP3/DAB
713 120) VX747 ==Meizu==
714 121) VX767 110) M6SL
715 122) VX747+ 111) M6SP
716 112) M3
720 buildfor=`input`;
723 # Set of tools built for all target platforms:
724 toolset="rdf2binary convbdf codepages"
726 # Toolsets for some target families:
727 archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
728 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
729 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
730 ipodbitmaptools="$toolset scramble bmp2rb"
731 gigabeatbitmaptools="$toolset scramble descramble bmp2rb"
732 tccbitmaptools="$toolset scramble mktccboot bmp2rb"
733 # generic is used by IFP, Meizu and Onda
734 genericbitmaptools="$toolset bmp2rb"
735 # scramble is used by all other targets
736 scramblebitmaptools="$genericbitmaptools scramble"
739 # ---- For each target ----
741 # *Variables*
742 # target_id: a unique number identifying this target, IS NOT the menu number.
743 # Just use the currently highest number+1 when you add a new
744 # target.
745 # modelname: short model name used all over to identify this target
746 # memory: number of megabytes of RAM this target has. If the amount can
747 # be selected by the size prompt, let memory be unset here
748 # target: -Ddefine passed to the build commands to make the correct
749 # config-*.h file get included etc
750 # tool: the tool that takes a plain binary and converts that into a
751 # working "firmware" file for your target
752 # output: the final output file name
753 # boottool: the tool that takes a plain binary and generates a bootloader
754 # file for your target (or blank to use $tool)
755 # bootoutput:the final output file name for the bootloader (or blank to use
756 # $output)
757 # appextra: passed to the APPEXTRA variable in the Makefiles.
758 # TODO: add proper explanation
759 # archosrom: used only for Archos targets that build a special flashable .ucl
760 # image.
761 # flash: name of output for flashing, for targets where there's a special
762 # file output for this.
763 # plugins: set to 'yes' to build the plugins. Early development builds can
764 # set this to no in the early stages to have an easier life for a
765 # while
766 # swcodec: set 'yes' on swcodec targets
767 # toolset: lists what particular tools in the tools/ directory that this
768 # target needs to have built prior to building Rockbox
770 # *Functions*
771 # *cc: sets up gcc and compiler options for your target builds. Note
772 # that if you select a simulator build, the compiler selection is
773 # overridden later in the script.
775 case $buildfor in
777 0|player)
778 target_id=1
779 modelname="player"
780 target="-DARCHOS_PLAYER"
781 shcc
782 tool="$rootdir/tools/scramble"
783 output="archos.mod"
784 appextra="player:gui"
785 archosrom="$pwd/rombox.ucl"
786 flash="$pwd/rockbox.ucl"
787 plugins="yes"
788 swcodec=""
790 # toolset is the tools within the tools directory that we build for
791 # this particular target.
792 toolset="$toolset scramble descramble sh2d player_unifont uclpack"
794 # Note: the convbdf is present in the toolset just because: 1) the
795 # firmware/Makefile assumes it is present always, and 2) we will need it when we
796 # build the player simulator
798 t_cpu="sh"
799 t_manufacturer="archos"
800 t_model="player"
803 1|recorder)
804 target_id=2
805 modelname="recorder"
806 target="-DARCHOS_RECORDER"
807 shcc
808 tool="$rootdir/tools/scramble"
809 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
810 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
811 output="ajbrec.ajz"
812 appextra="recorder:gui"
813 #archosrom="$pwd/rombox.ucl"
814 flash="$pwd/rockbox.ucl"
815 plugins="yes"
816 swcodec=""
817 # toolset is the tools within the tools directory that we build for
818 # this particular target.
819 toolset=$archosbitmaptools
820 t_cpu="sh"
821 t_manufacturer="archos"
822 t_model="recorder"
825 2|fmrecorder)
826 target_id=3
827 modelname="fmrecorder"
828 target="-DARCHOS_FMRECORDER"
829 shcc
830 tool="$rootdir/tools/scramble -fm"
831 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
832 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
833 output="ajbrec.ajz"
834 appextra="recorder:gui"
835 #archosrom="$pwd/rombox.ucl"
836 flash="$pwd/rockbox.ucl"
837 plugins="yes"
838 swcodec=""
839 # toolset is the tools within the tools directory that we build for
840 # this particular target.
841 toolset=$archosbitmaptools
842 t_cpu="sh"
843 t_manufacturer="archos"
844 t_model="fm_v2"
847 3|recorderv2)
848 target_id=4
849 modelname="recorderv2"
850 target="-DARCHOS_RECORDERV2"
851 shcc
852 tool="$rootdir/tools/scramble -v2"
853 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
854 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
855 output="ajbrec.ajz"
856 appextra="recorder:gui"
857 #archosrom="$pwd/rombox.ucl"
858 flash="$pwd/rockbox.ucl"
859 plugins="yes"
860 swcodec=""
861 # toolset is the tools within the tools directory that we build for
862 # this particular target.
863 toolset=$archosbitmaptools
864 t_cpu="sh"
865 t_manufacturer="archos"
866 t_model="fm_v2"
869 4|ondiosp)
870 target_id=7
871 modelname="ondiosp"
872 target="-DARCHOS_ONDIOSP"
873 shcc
874 tool="$rootdir/tools/scramble -osp"
875 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
876 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
877 output="ajbrec.ajz"
878 appextra="recorder:gui"
879 archosrom="$pwd/rombox.ucl"
880 flash="$pwd/rockbox.ucl"
881 plugins="yes"
882 swcodec=""
883 # toolset is the tools within the tools directory that we build for
884 # this particular target.
885 toolset=$archosbitmaptools
886 t_cpu="sh"
887 t_manufacturer="archos"
888 t_model="ondio"
891 5|ondiofm)
892 target_id=8
893 modelname="ondiofm"
894 target="-DARCHOS_ONDIOFM"
895 shcc
896 tool="$rootdir/tools/scramble -ofm"
897 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
898 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
899 output="ajbrec.ajz"
900 appextra="recorder:gui"
901 #archosrom="$pwd/rombox.ucl"
902 flash="$pwd/rockbox.ucl"
903 plugins="yes"
904 swcodec=""
905 toolset=$archosbitmaptools
906 t_cpu="sh"
907 t_manufacturer="archos"
908 t_model="ondio"
911 6|av300)
912 target_id=38
913 modelname="av300"
914 target="-DARCHOS_AV300"
915 memory=16 # always
916 arm7tdmicc
917 tool="$rootdir/tools/scramble -mm=C"
918 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
919 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
920 output="cjbm.ajz"
921 appextra="recorder:gui"
922 plugins="yes"
923 swcodec=""
924 # toolset is the tools within the tools directory that we build for
925 # this particular target.
926 toolset="$toolset scramble descramble bmp2rb"
927 # architecture, manufacturer and model for the target-tree build
928 t_cpu="arm"
929 t_manufacturer="archos"
930 t_model="av300"
933 10|h120)
934 target_id=9
935 modelname="h120"
936 target="-DIRIVER_H120"
937 memory=32 # always
938 coldfirecc
939 tool="$rootdir/tools/scramble -add=h120"
940 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
941 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
942 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
943 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
944 output="rockbox.iriver"
945 appextra="recorder:gui"
946 flash="$pwd/rombox.iriver"
947 plugins="yes"
948 swcodec="yes"
949 # toolset is the tools within the tools directory that we build for
950 # this particular target.
951 toolset=$iriverbitmaptools
952 t_cpu="coldfire"
953 t_manufacturer="iriver"
954 t_model="h100"
957 11|h300)
958 target_id=10
959 modelname="h300"
960 target="-DIRIVER_H300"
961 memory=32 # always
962 coldfirecc
963 tool="$rootdir/tools/scramble -add=h300"
964 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
965 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
966 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
967 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
968 output="rockbox.iriver"
969 appextra="recorder:gui"
970 plugins="yes"
971 swcodec="yes"
972 # toolset is the tools within the tools directory that we build for
973 # this particular target.
974 toolset=$iriverbitmaptools
975 t_cpu="coldfire"
976 t_manufacturer="iriver"
977 t_model="h300"
980 12|h100)
981 target_id=11
982 modelname="h100"
983 target="-DIRIVER_H100"
984 memory=16 # always
985 coldfirecc
986 tool="$rootdir/tools/scramble -add=h100"
987 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
988 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
989 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
990 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
991 output="rockbox.iriver"
992 appextra="recorder:gui"
993 flash="$pwd/rombox.iriver"
994 plugins="yes"
995 swcodec="yes"
996 # toolset is the tools within the tools directory that we build for
997 # this particular target.
998 toolset=$iriverbitmaptools
999 t_cpu="coldfire"
1000 t_manufacturer="iriver"
1001 t_model="h100"
1004 13|ifp7xx)
1005 target_id=19
1006 modelname="ifp7xx"
1007 target="-DIRIVER_IFP7XX"
1008 memory=1
1009 arm7tdmicc short
1010 tool="cp"
1011 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1012 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1013 output="rockbox.wma"
1014 appextra="recorder:gui"
1015 plugins="yes"
1016 swcodec="yes"
1017 # toolset is the tools within the tools directory that we build for
1018 # this particular target.
1019 toolset=$genericbitmaptools
1020 t_cpu="arm"
1021 t_manufacturer="pnx0101"
1022 t_model="iriver-ifp7xx"
1025 14|h10)
1026 target_id=22
1027 modelname="h10"
1028 target="-DIRIVER_H10"
1029 memory=32 # always
1030 arm7tdmicc
1031 tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
1032 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1033 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1034 output="rockbox.mi4"
1035 appextra="recorder:gui"
1036 plugins="yes"
1037 swcodec="yes"
1038 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
1039 bootoutput="H10_20GC.mi4"
1040 # toolset is the tools within the tools directory that we build for
1041 # this particular target.
1042 toolset=$scramblebitmaptools
1043 # architecture, manufacturer and model for the target-tree build
1044 t_cpu="arm"
1045 t_manufacturer="iriver"
1046 t_model="h10"
1049 15|h10_5gb)
1050 target_id=24
1051 modelname="h10_5gb"
1052 target="-DIRIVER_H10_5GB"
1053 memory=32 # always
1054 arm7tdmicc
1055 tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
1056 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1057 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1058 output="rockbox.mi4"
1059 appextra="recorder:gui"
1060 plugins="yes"
1061 swcodec="yes"
1062 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
1063 bootoutput="H10.mi4"
1064 # toolset is the tools within the tools directory that we build for
1065 # this particular target.
1066 toolset=$scramblebitmaptools
1067 # architecture, manufacturer and model for the target-tree build
1068 t_cpu="arm"
1069 t_manufacturer="iriver"
1070 t_model="h10"
1073 20|ipodcolor)
1074 target_id=13
1075 modelname="ipodcolor"
1076 target="-DIPOD_COLOR"
1077 memory=32 # always
1078 arm7tdmicc
1079 tool="$rootdir/tools/scramble -add=ipco"
1080 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1081 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1082 output="rockbox.ipod"
1083 appextra="recorder:gui"
1084 plugins="yes"
1085 swcodec="yes"
1086 bootoutput="bootloader-$modelname.ipod"
1087 # toolset is the tools within the tools directory that we build for
1088 # this particular target.
1089 toolset=$ipodbitmaptools
1090 # architecture, manufacturer and model for the target-tree build
1091 t_cpu="arm"
1092 t_manufacturer="ipod"
1093 t_model="color"
1096 21|ipodnano)
1097 target_id=14
1098 modelname="ipodnano"
1099 target="-DIPOD_NANO"
1100 memory=32 # always
1101 arm7tdmicc
1102 tool="$rootdir/tools/scramble -add=nano"
1103 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1104 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1105 output="rockbox.ipod"
1106 appextra="recorder:gui"
1107 plugins="yes"
1108 swcodec="yes"
1109 bootoutput="bootloader-$modelname.ipod"
1110 # toolset is the tools within the tools directory that we build for
1111 # this particular target.
1112 toolset=$ipodbitmaptools
1113 # architecture, manufacturer and model for the target-tree build
1114 t_cpu="arm"
1115 t_manufacturer="ipod"
1116 t_model="nano"
1119 22|ipodvideo)
1120 target_id=15
1121 modelname="ipodvideo"
1122 target="-DIPOD_VIDEO"
1123 arm7tdmicc
1124 tool="$rootdir/tools/scramble -add=ipvd"
1125 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1126 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1127 output="rockbox.ipod"
1128 appextra="recorder:gui"
1129 plugins="yes"
1130 swcodec="yes"
1131 bootoutput="bootloader-$modelname.ipod"
1132 # toolset is the tools within the tools directory that we build for
1133 # this particular target.
1134 toolset=$ipodbitmaptools
1135 # architecture, manufacturer and model for the target-tree build
1136 t_cpu="arm"
1137 t_manufacturer="ipod"
1138 t_model="video"
1141 23|ipod3g)
1142 target_id=16
1143 modelname="ipod3g"
1144 target="-DIPOD_3G"
1145 memory=32 # always
1146 arm7tdmicc
1147 tool="$rootdir/tools/scramble -add=ip3g"
1148 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1149 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1150 output="rockbox.ipod"
1151 appextra="recorder:gui"
1152 plugins="yes"
1153 swcodec="yes"
1154 bootoutput="bootloader-$modelname.ipod"
1155 # toolset is the tools within the tools directory that we build for
1156 # this particular target.
1157 toolset=$ipodbitmaptools
1158 # architecture, manufacturer and model for the target-tree build
1159 t_cpu="arm"
1160 t_manufacturer="ipod"
1161 t_model="3g"
1164 24|ipod4g)
1165 target_id=17
1166 modelname="ipod4g"
1167 target="-DIPOD_4G"
1168 memory=32 # always
1169 arm7tdmicc
1170 tool="$rootdir/tools/scramble -add=ip4g"
1171 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1172 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1173 output="rockbox.ipod"
1174 appextra="recorder:gui"
1175 plugins="yes"
1176 swcodec="yes"
1177 bootoutput="bootloader-$modelname.ipod"
1178 # toolset is the tools within the tools directory that we build for
1179 # this particular target.
1180 toolset=$ipodbitmaptools
1181 # architecture, manufacturer and model for the target-tree build
1182 t_cpu="arm"
1183 t_manufacturer="ipod"
1184 t_model="4g"
1187 25|ipodmini)
1188 target_id=18
1189 modelname="ipodmini"
1190 target="-DIPOD_MINI"
1191 memory=32 # always
1192 arm7tdmicc
1193 tool="$rootdir/tools/scramble -add=mini"
1194 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1195 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1196 output="rockbox.ipod"
1197 appextra="recorder:gui"
1198 plugins="yes"
1199 swcodec="yes"
1200 bootoutput="bootloader-$modelname.ipod"
1201 # toolset is the tools within the tools directory that we build for
1202 # this particular target.
1203 toolset=$ipodbitmaptools
1204 # architecture, manufacturer and model for the target-tree build
1205 t_cpu="arm"
1206 t_manufacturer="ipod"
1207 t_model="mini"
1210 26|ipodmini2g)
1211 target_id=21
1212 modelname="ipodmini2g"
1213 target="-DIPOD_MINI2G"
1214 memory=32 # always
1215 arm7tdmicc
1216 tool="$rootdir/tools/scramble -add=mn2g"
1217 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1218 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1219 output="rockbox.ipod"
1220 appextra="recorder:gui"
1221 plugins="yes"
1222 swcodec="yes"
1223 bootoutput="bootloader-$modelname.ipod"
1224 # toolset is the tools within the tools directory that we build for
1225 # this particular target.
1226 toolset=$ipodbitmaptools
1227 # architecture, manufacturer and model for the target-tree build
1228 t_cpu="arm"
1229 t_manufacturer="ipod"
1230 t_model="mini2g"
1233 27|ipod1g2g)
1234 target_id=29
1235 modelname="ipod1g2g"
1236 target="-DIPOD_1G2G"
1237 memory=32 # always
1238 arm7tdmicc
1239 tool="$rootdir/tools/scramble -add=1g2g"
1240 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1241 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1242 output="rockbox.ipod"
1243 appextra="recorder:gui"
1244 plugins="yes"
1245 swcodec="yes"
1246 bootoutput="bootloader-$modelname.ipod"
1247 # toolset is the tools within the tools directory that we build for
1248 # this particular target.
1249 toolset=$ipodbitmaptools
1250 # architecture, manufacturer and model for the target-tree build
1251 t_cpu="arm"
1252 t_manufacturer="ipod"
1253 t_model="1g2g"
1256 30|x5)
1257 target_id=12
1258 modelname="x5"
1259 target="-DIAUDIO_X5"
1260 memory=16 # always
1261 coldfirecc
1262 tool="$rootdir/tools/scramble -add=iax5"
1263 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1264 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1265 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1266 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1267 output="rockbox.iaudio"
1268 appextra="recorder:gui"
1269 plugins="yes"
1270 swcodec="yes"
1271 # toolset is the tools within the tools directory that we build for
1272 # this particular target.
1273 toolset="$iaudiobitmaptools"
1274 # architecture, manufacturer and model for the target-tree build
1275 t_cpu="coldfire"
1276 t_manufacturer="iaudio"
1277 t_model="x5"
1280 31|m5)
1281 target_id=28
1282 modelname="m5"
1283 target="-DIAUDIO_M5"
1284 memory=16 # always
1285 coldfirecc
1286 tool="$rootdir/tools/scramble -add=iam5"
1287 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1288 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1289 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1290 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1291 output="rockbox.iaudio"
1292 appextra="recorder:gui"
1293 plugins="yes"
1294 swcodec="yes"
1295 # toolset is the tools within the tools directory that we build for
1296 # this particular target.
1297 toolset="$iaudiobitmaptools"
1298 # architecture, manufacturer and model for the target-tree build
1299 t_cpu="coldfire"
1300 t_manufacturer="iaudio"
1301 t_model="m5"
1304 32|iaudio7)
1305 target_id=32
1306 modelname="iaudio7"
1307 target="-DIAUDIO_7"
1308 memory=16 # always
1309 arm946cc
1310 tool="$rootdir/tools/scramble -add=i7"
1311 boottool="$rootdir/tools/scramble -tcc=crc"
1312 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1313 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1314 output="rockbox.iaudio"
1315 appextra="recorder:gui"
1316 plugins="yes"
1317 swcodec="yes"
1318 bootoutput="I7_FW.BIN"
1319 # toolset is the tools within the tools directory that we build for
1320 # this particular target.
1321 toolset="$tccbitmaptools"
1322 # architecture, manufacturer and model for the target-tree build
1323 t_cpu="arm"
1324 t_manufacturer="tcc77x"
1325 t_model="iaudio7"
1328 33|cowond2)
1329 target_id=34
1330 modelname="cowond2"
1331 target="-DCOWON_D2"
1332 memory=32
1333 arm926ejscc
1334 tool="$rootdir/tools/scramble -add=d2"
1335 boottool="$rootdir/tools/scramble -tcc=crc"
1336 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1337 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1338 output="rockbox.d2"
1339 appextra="recorder:gui"
1340 plugins="yes"
1341 swcodec="yes"
1342 toolset="$tccbitmaptools"
1343 # architecture, manufacturer and model for the target-tree build
1344 t_cpu="arm"
1345 t_manufacturer="tcc780x"
1346 t_model="cowond2"
1349 34|m3)
1350 target_id=37
1351 modelname="m3"
1352 target="-DIAUDIO_M3"
1353 memory=16 # always
1354 coldfirecc
1355 tool="$rootdir/tools/scramble -add=iam3"
1356 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1357 bmp2rb_native="$rootdir/tools/bmp2rb -f 7"
1358 output="rockbox.iaudio"
1359 appextra="recorder:gui"
1360 plugins="yes"
1361 swcodec="yes"
1362 # toolset is the tools within the tools directory that we build for
1363 # this particular target.
1364 toolset="$iaudiobitmaptools"
1365 # architecture, manufacturer and model for the target-tree build
1366 t_cpu="coldfire"
1367 t_manufacturer="iaudio"
1368 t_model="m3"
1371 40|gigabeatf)
1372 target_id=20
1373 modelname="gigabeatf"
1374 target="-DGIGABEAT_F"
1375 memory=32 # always
1376 arm9tdmicc
1377 tool="$rootdir/tools/scramble -add=giga"
1378 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1379 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1380 output="rockbox.gigabeat"
1381 appextra="recorder:gui"
1382 plugins="yes"
1383 swcodec="yes"
1384 toolset=$gigabeatbitmaptools
1385 boottool="$rootdir/tools/scramble -gigabeat"
1386 bootoutput="FWIMG01.DAT"
1387 # architecture, manufacturer and model for the target-tree build
1388 t_cpu="arm"
1389 t_manufacturer="s3c2440"
1390 t_model="gigabeat-fx"
1393 41|gigabeats)
1394 target_id=26
1395 modelname="gigabeats"
1396 target="-DGIGABEAT_S"
1397 memory=64
1398 arm1136jfscc
1399 tool="$rootdir/tools/scramble -add=gigs"
1400 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1401 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1402 output="rockbox.gigabeat"
1403 appextra="recorder:gui"
1404 plugins="yes"
1405 swcodec="yes"
1406 toolset="$gigabeatbitmaptools mknkboot"
1407 boottool="$rootdir/tools/scramble -gigabeats"
1408 bootoutput="nk.bin"
1409 # architecture, manufacturer and model for the target-tree build
1410 t_cpu="arm"
1411 t_manufacturer="imx31"
1412 t_model="gigabeat-s"
1415 70|mrobe500)
1416 target_id=36
1417 modelname="mrobe500"
1418 target="-DMROBE_500"
1419 memory=64 # always
1420 arm926ejscc
1421 # tool="$rootdir/tools/scramble -add=m500"
1422 tool="cp "
1423 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1424 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1425 output="rockbox.mrobe500"
1426 appextra="recorder:gui"
1427 plugins="yes"
1428 swcodec="yes"
1429 toolset=$gigabeatbitmaptools
1430 boottool="cp "
1431 bootoutput="rockbox.mrboot"
1432 # architecture, manufacturer and model for the target-tree build
1433 t_cpu="arm"
1434 t_manufacturer="tms320dm320"
1435 t_model="mrobe-500"
1438 71|mrobe100)
1439 target_id=33
1440 modelname="mrobe100"
1441 target="-DMROBE_100"
1442 memory=32 # always
1443 arm7tdmicc
1444 tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS"
1445 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1446 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1447 output="rockbox.mi4"
1448 appextra="recorder:gui"
1449 plugins="yes"
1450 swcodec="yes"
1451 boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL"
1452 bootoutput="pp5020.mi4"
1453 # toolset is the tools within the tools directory that we build for
1454 # this particular target.
1455 toolset=$scramblebitmaptools
1456 # architecture, manufacturer and model for the target-tree build
1457 t_cpu="arm"
1458 t_manufacturer="olympus"
1459 t_model="mrobe-100"
1462 80|logikdax)
1463 target_id=31
1464 modelname="logikdax"
1465 target="-DLOGIK_DAX"
1466 memory=2 # always
1467 arm946cc
1468 tool="$rootdir/tools/scramble -add=ldax"
1469 boottool="$rootdir/tools/scramble -tcc=crc"
1470 bootoutput="player.rom"
1471 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1472 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1473 output="rockbox.logik"
1474 appextra="recorder:gui"
1475 plugins=""
1476 swcodec="yes"
1477 # toolset is the tools within the tools directory that we build for
1478 # this particular target.
1479 toolset=$tccbitmaptools
1480 # architecture, manufacturer and model for the target-tree build
1481 t_cpu="arm"
1482 t_manufacturer="tcc77x"
1483 t_model="logikdax"
1486 90|creativezvm30gb)
1487 target_id=35
1488 modelname="creativezvm30"
1489 target="-DCREATIVE_ZVM"
1490 memory=64
1491 arm926ejscc
1492 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1493 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1494 tool="$rootdir/tools/scramble -creative=zvm"
1495 USE_ELF="yes"
1496 output="rockbox.zvm"
1497 appextra="recorder:gui"
1498 plugins="yes"
1499 swcodec="yes"
1500 toolset=$ipodbitmaptools
1501 boottool="$rootdir/tools/scramble -creative=zvm -no-ciff"
1502 bootoutput="rockbox.zvmboot"
1503 # architecture, manufacturer and model for the target-tree build
1504 t_cpu="arm"
1505 t_manufacturer="tms320dm320"
1506 t_model="creative-zvm"
1509 91|creativezvm60gb)
1510 target_id=40
1511 modelname="creativezvm60"
1512 target="-DCREATIVE_ZVM60GB"
1513 memory=64
1514 arm926ejscc
1515 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1516 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1517 tool="$rootdir/tools/scramble -creative=zvm60 -no-ciff"
1518 USE_ELF="yes"
1519 output="rockbox.zvm60"
1520 appextra="recorder:gui"
1521 plugins="yes"
1522 swcodec="yes"
1523 toolset=$ipodbitmaptools
1524 boottool="$rootdir/tools/scramble -creative=zvm60"
1525 bootoutput="rockbox.zvm60boot"
1526 # architecture, manufacturer and model for the target-tree build
1527 t_cpu="arm"
1528 t_manufacturer="tms320dm320"
1529 t_model="creative-zvm"
1532 92|creativezenvision)
1533 target_id=39
1534 modelname="creativezv"
1535 target="-DCREATIVE_ZV"
1536 memory=64
1537 arm926ejscc
1538 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1539 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1540 tool="$rootdir/tools/scramble -creative=zenvision -no-ciff"
1541 USE_ELF="yes"
1542 output="rockbox.zv"
1543 appextra="recorder:gui"
1544 plugins=""
1545 swcodec="yes"
1546 toolset=$ipodbitmaptools
1547 boottool="$rootdir/tools/scramble -creative=zenvision"
1548 bootoutput="rockbox.zvboot"
1549 # architecture, manufacturer and model for the target-tree build
1550 t_cpu="arm"
1551 t_manufacturer="tms320dm320"
1552 t_model="creative-zvm"
1555 50|e200)
1556 target_id=23
1557 modelname="e200"
1558 target="-DSANSA_E200"
1559 memory=32 # supposedly
1560 arm7tdmicc
1561 tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1562 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1563 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1564 output="rockbox.mi4"
1565 appextra="recorder:gui"
1566 plugins="yes"
1567 swcodec="yes"
1568 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1569 bootoutput="PP5022.mi4"
1570 # toolset is the tools within the tools directory that we build for
1571 # this particular target.
1572 toolset=$scramblebitmaptools
1573 # architecture, manufacturer and model for the target-tree build
1574 t_cpu="arm"
1575 t_manufacturer="sandisk"
1576 t_model="sansa-e200"
1579 51|e200r)
1580 # the e200R model is pretty much identical to the e200, it only has a
1581 # different option to the scramble tool when building a bootloader and
1582 # makes the bootloader output file name in all lower case.
1583 target_id=27
1584 modelname="e200r"
1585 target="-DSANSA_E200"
1586 memory=32 # supposedly
1587 arm7tdmicc
1588 tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1589 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1590 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1591 output="rockbox.mi4"
1592 appextra="recorder:gui"
1593 plugins="yes"
1594 swcodec="yes"
1595 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1596 bootoutput="pp5022.mi4"
1597 # toolset is the tools within the tools directory that we build for
1598 # this particular target.
1599 toolset=$scramblebitmaptools
1600 # architecture, manufacturer and model for the target-tree build
1601 t_cpu="arm"
1602 t_manufacturer="sandisk"
1603 t_model="sansa-e200"
1606 52|c200)
1607 target_id=30
1608 modelname="c200"
1609 target="-DSANSA_C200"
1610 memory=32 # supposedly
1611 arm7tdmicc
1612 tool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBOS"
1613 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1614 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1615 output="rockbox.mi4"
1616 appextra="recorder:gui"
1617 plugins="yes"
1618 swcodec="yes"
1619 boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
1620 bootoutput="firmware.mi4"
1621 # toolset is the tools within the tools directory that we build for
1622 # this particular target.
1623 toolset=$scramblebitmaptools
1624 # architecture, manufacturer and model for the target-tree build
1625 t_cpu="arm"
1626 t_manufacturer="sandisk"
1627 t_model="sansa-c200"
1630 53|m200)
1631 target_id=48
1632 modelname="m200"
1633 target="-DSANSA_M200"
1634 memory=1 # always
1635 arm946cc
1636 tool="$rootdir/tools/scramble -add=m200"
1637 boottool="$rootdir/tools/scramble -tcc=crc"
1638 bootoutput="player.rom"
1639 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1640 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1641 output="rockbox.m200"
1642 appextra="recorder:gui"
1643 plugins=""
1644 swcodec="yes"
1645 # toolset is the tools within the tools directory that we build for
1646 # this particular target.
1647 toolset=$tccbitmaptools
1648 # architecture, manufacturer and model for the target-tree build
1649 t_cpu="arm"
1650 t_manufacturer="tcc77x"
1651 t_model="m200"
1654 54|c100)
1655 target_id=42
1656 modelname="c100"
1657 target="-DSANSA_C100"
1658 memory=32 # unsure, must check
1659 arm946cc
1660 tool="$rootdir/tools/scramble -add=c100"
1661 boottool="$rootdir/tools/scramble -tcc=crc"
1662 bootoutput="player.rom"
1663 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1664 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1665 output="rockbox.c100"
1666 appextra="recorder:gui"
1667 plugins=""
1668 # toolset is the tools within the tools directory that we build for
1669 # this particular target.
1670 toolset=$tccbitmaptools
1671 # architecture, manufacturer and model for the target-tree build
1672 t_cpu="arm"
1673 t_manufacturer="tcc77x"
1674 t_model="c100"
1677 55|Clip|clip)
1678 target_id=50
1679 modelname="clip"
1680 target="-DSANSA_CLIP"
1681 memory=2
1682 arm9tdmicc
1683 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1684 bmp2rb_native="$bmp2rb_mono"
1685 tool="$rootdir/tools/scramble -add=clip"
1686 output="rockbox.sansa"
1687 bootoutput="bootloader-clip.sansa"
1688 appextra="recorder:gui"
1689 plugins="yes"
1690 swcodec="yes"
1691 toolset=$scramblebitmaptools
1692 t_cpu="arm"
1693 t_manufacturer="as3525"
1694 t_model="sansa-clip"
1698 56|e200v2)
1699 target_id=51
1700 modelname="e200v2"
1701 target="-DSANSA_E200V2"
1702 memory=8
1703 arm9tdmicc
1704 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1705 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1706 tool="$rootdir/tools/scramble -add=e2v2"
1707 output="rockbox.sansa"
1708 bootoutput="bootloader-e200v2.sansa"
1709 appextra="recorder:gui"
1710 plugins="yes"
1711 swcodec="yes"
1712 toolset=$scramblebitmaptools
1713 t_cpu="arm"
1714 t_manufacturer="as3525"
1715 t_model="sansa-e200v2"
1719 57|m200v4)
1720 target_id=52
1721 modelname="m200v4"
1722 target="-DSANSA_M200V4"
1723 memory=2
1724 arm9tdmicc
1725 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1726 bmp2rb_native="$bmp2rb_mono"
1727 tool="$rootdir/tools/scramble -add=m2v4"
1728 output="rockbox.sansa"
1729 bootoutput="bootloader-m200v4.sansa"
1730 appextra="recorder:gui"
1731 plugins="yes"
1732 swcodec="yes"
1733 toolset=$scramblebitmaptools
1734 t_cpu="arm"
1735 t_manufacturer="as3525"
1736 t_model="sansa-m200v4"
1740 58|fuze)
1741 target_id=53
1742 modelname="fuze"
1743 target="-DSANSA_FUZE"
1744 memory=8
1745 arm9tdmicc
1746 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1747 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1748 tool="$rootdir/tools/scramble -add=fuze"
1749 output="rockbox.sansa"
1750 bootoutput="bootloader-fuze.sansa"
1751 appextra="recorder:gui"
1752 plugins="yes"
1753 swcodec="yes"
1754 toolset=$scramblebitmaptools
1755 t_cpu="arm"
1756 t_manufacturer="as3525"
1757 t_model="sansa-fuze"
1761 59|c200v2)
1762 target_id=55
1763 modelname="c200v2"
1764 target="-DSANSA_C200V2"
1765 memory=2 # as per OF diagnosis mode
1766 arm9tdmicc
1767 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1768 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1769 tool="$rootdir/tools/scramble -add=c2v2"
1770 output="rockbox.sansa"
1771 bootoutput="bootloader-c200v2.sansa"
1772 appextra="recorder:gui"
1773 plugins="yes"
1774 swcodec="yes"
1775 # toolset is the tools within the tools directory that we build for
1776 # this particular target.
1777 toolset=$scramblebitmaptools
1778 # architecture, manufacturer and model for the target-tree build
1779 t_cpu="arm"
1780 t_manufacturer="as3525"
1781 t_model="sansa-c200v2"
1784 60|tpj1022)
1785 target_id=25
1786 modelname="tpj1022"
1787 target="-DELIO_TPJ1022"
1788 memory=32 # always
1789 arm7tdmicc
1790 tool="$rootdir/tools/scramble -add tpj2"
1791 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1792 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1793 output="rockbox.elio"
1794 appextra="recorder:gui"
1795 plugins="yes"
1796 swcodec="yes"
1797 boottool="$rootdir/tools/scramble -mi4v2"
1798 bootoutput="pp5020.mi4"
1799 # toolset is the tools within the tools directory that we build for
1800 # this particular target.
1801 toolset=$scramblebitmaptools
1802 # architecture, manufacturer and model for the target-tree build
1803 t_cpu="arm"
1804 t_manufacturer="tatung"
1805 t_model="tpj1022"
1808 100|sa9200)
1809 target_id=41
1810 modelname="sa9200"
1811 target="-DPHILIPS_SA9200"
1812 memory=32 # supposedly
1813 arm7tdmicc
1814 tool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBOS"
1815 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1816 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1817 output="rockbox.mi4"
1818 appextra="recorder:gui"
1819 plugins=""
1820 swcodec="yes"
1821 boottool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBBL"
1822 bootoutput="FWImage.ebn"
1823 # toolset is the tools within the tools directory that we build for
1824 # this particular target.
1825 toolset=$scramblebitmaptools
1826 # architecture, manufacturer and model for the target-tree build
1827 t_cpu="arm"
1828 t_manufacturer="philips"
1829 t_model="sa9200"
1832 101|hdd1630)
1833 target_id=43
1834 modelname="hdd1630"
1835 target="-DPHILIPS_HDD1630"
1836 memory=32 # supposedly
1837 arm7tdmicc
1838 tool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBOS"
1839 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1840 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1841 output="rockbox.mi4"
1842 appextra="recorder:gui"
1843 plugins=""
1844 swcodec="yes"
1845 boottool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBBL"
1846 bootoutput="FWImage.ebn"
1847 # toolset is the tools within the tools directory that we build for
1848 # this particular target.
1849 toolset=$scramblebitmaptools
1850 # architecture, manufacturer and model for the target-tree build
1851 t_cpu="arm"
1852 t_manufacturer="philips"
1853 t_model="hdd1630"
1856 110|meizum6sl)
1857 target_id=49
1858 modelname="meizum6sl"
1859 target="-DMEIZU_M6SL"
1860 memory=16 # always
1861 arm940tbecc
1862 tool="cp"
1863 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1864 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1865 output="rockbox.meizu"
1866 appextra="recorder:gui"
1867 plugins="no" #FIXME
1868 swcodec="yes"
1869 toolset=$genericbitmaptools
1870 boottool="cp"
1871 bootoutput="rockboot.ebn"
1872 # architecture, manufacturer and model for the target-tree build
1873 t_cpu="arm"
1874 t_manufacturer="s5l8700"
1875 t_model="meizu-m6sl"
1878 111|meizum6sp)
1879 target_id=46
1880 modelname="meizum6sp"
1881 target="-DMEIZU_M6SP"
1882 memory=16 # always
1883 arm940tbecc
1884 tool="cp"
1885 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1886 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1887 output="rockbox.meizu"
1888 appextra="recorder:gui"
1889 plugins="no" #FIXME
1890 swcodec="yes"
1891 toolset=$genericbitmaptools
1892 boottool="cp"
1893 bootoutput="rockboot.ebn"
1894 # architecture, manufacturer and model for the target-tree build
1895 t_cpu="arm"
1896 t_manufacturer="s5l8700"
1897 t_model="meizu-m6sp"
1900 112|meizum3)
1901 target_id=47
1902 modelname="meizum3"
1903 target="-DMEIZU_M3"
1904 memory=16 # always
1905 arm940tbecc
1906 tool="cp"
1907 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1908 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1909 output="rockbox.meizu"
1910 appextra="recorder:gui"
1911 plugins="no" #FIXME
1912 swcodec="yes"
1913 toolset=$genericbitmaptools
1914 boottool="cp"
1915 bootoutput="rockboot.ebn"
1916 # architecture, manufacturer and model for the target-tree build
1917 t_cpu="arm"
1918 t_manufacturer="s5l8700"
1919 t_model="meizu-m3"
1922 120|ondavx747)
1923 target_id=44
1924 modelname="ondavx747"
1925 target="-DONDA_VX747"
1926 memory=16 #FIXME
1927 mipselcc
1928 tool="cp"
1929 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1930 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1931 output="rockbox.vx747"
1932 appextra="recorder:gui"
1933 plugins="no" #FIXME
1934 swcodec="yes"
1935 toolset=$genericbitmaptools
1936 boottool="cp"
1937 bootoutput="rockboot.vx747"
1938 # architecture, manufacturer and model for the target-tree build
1939 t_cpu="mips"
1940 t_manufacturer="ingenic_jz47xx"
1941 t_model="onda_vx747"
1944 121|ondavx767)
1945 target_id=45
1946 modelname="ondavx767"
1947 target="-DONDA_VX767"
1948 memory=16 #FIXME
1949 mipselcc
1950 tool="cp"
1951 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1952 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1953 output="rockbox.vx767"
1954 appextra="recorder:gui"
1955 plugins="no" #FIXME
1956 swcodec="yes"
1957 toolset=$genericbitmaptools
1958 boottool="cp"
1959 bootoutput="rockboot.vx767"
1960 # architecture, manufacturer and model for the target-tree build
1961 t_cpu="mips"
1962 t_manufacturer="ingenic_jz47xx"
1963 t_model="onda_vx767"
1966 122|ondavx747p)
1967 target_id=54
1968 modelname="ondavx747p"
1969 target="-DONDA_VX747P"
1970 memory=16 #FIXME
1971 mipselcc
1972 tool="cp"
1973 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1974 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1975 output="rockbox.vx747p"
1976 appextra="recorder:gui"
1977 plugins="no" #FIXME
1978 swcodec="yes"
1979 toolset=$genericbitmaptools
1980 boottool="cp"
1981 bootoutput="rockboot.vx747p"
1982 # architecture, manufacturer and model for the target-tree build
1983 t_cpu="mips"
1984 t_manufacturer="ingenic_jz47xx"
1985 t_model="onda_vx747"
1989 echo "Please select a supported target platform!"
1990 exit 7
1993 esac
1995 echo "Platform set to $modelname"
1998 #remove start
1999 ############################################################################
2000 # Amount of memory, for those that can differ. They have $memory unset at
2001 # this point.
2004 if [ -z "$memory" ]; then
2005 case $target_id in
2007 echo "Enter size of your RAM (in MB): (Defaults to 32)"
2008 if [ "1" != `parse_args --ram` ]; then
2009 size=`parse_args --ram`;
2010 else
2011 size=`input`;
2013 case $size in
2014 60|64)
2015 memory="64"
2018 memory="32"
2020 esac
2023 echo "Enter size of your RAM (in MB): (Defaults to 2)"
2024 if [ "1" != `parse_args --ram` ]; then
2025 size=`parse_args --ram`;
2026 else
2027 size=`input`;
2029 case $size in
2031 memory="8"
2034 memory="2"
2036 esac
2038 esac
2039 echo "Memory size selected: $memory MB"
2040 echo ""
2042 #remove end
2044 ##################################################################
2045 # Figure out build "type"
2048 # the ifp7x0 is the only platform that supports building a gdb stub like
2049 # this
2050 case $modelname in
2051 ifp7xx)
2052 gdbstub="(G)DB stub, "
2054 e200r|e200)
2055 gdbstub="(I)installer, "
2057 c200)
2058 gdbstub="(E)raser, "
2062 esac
2063 if [ "1" != `parse_args --type` ]; then
2064 btype=`parse_args --type`;
2065 else
2066 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, $gdbstub(M)anual: (Defaults to N)"
2067 btype=`input`;
2070 case $btype in
2071 [Ii])
2072 appsdir='\$(ROOTDIR)/bootloader'
2073 apps="bootloader"
2074 extradefines="-DBOOTLOADER -DE200R_INSTALLER -ffunction-sections -fdata-sections"
2075 bootloader="1"
2076 echo "e200R-installer build selected"
2078 [Ee])
2079 appsdir='\$(ROOTDIR)/bootloader'
2080 apps="bootloader"
2081 echo "C2(4)0 or C2(5)0"
2082 variant=`input`
2083 case $variant in
2085 extradefines="-DBOOTLOADER -DC200_ERASE -DC240_ERASE -ffunction-sections -fdata-sections"
2086 echo "c240 eraser build selected"
2089 extradefines="-DBOOTLOADER -DC200_ERASE -DC250_ERASE -ffunction-sections -fdata-sections"
2090 echo "c240 eraser build selected"
2092 esac
2093 bootloader="1"
2094 echo "c200 eraser build selected"
2096 [Bb])
2097 if test $t_manufacturer = "archos"; then
2098 # Archos SH-based players do this somewhat differently for
2099 # some reason
2100 appsdir='\$(ROOTDIR)/flash/bootbox'
2101 apps="bootbox"
2102 else
2103 appsdir='\$(ROOTDIR)/bootloader'
2104 apps="bootloader"
2105 flash=""
2106 if test -n "$boottool"; then
2107 tool="$boottool"
2109 if test -n "$bootoutput"; then
2110 output=$bootoutput
2113 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
2114 bootloader="1"
2115 echo "Bootloader build selected"
2117 [Ss])
2118 debug="-DDEBUG"
2119 simulator="yes"
2120 extradefines="-DSIMULATOR"
2121 archosrom=""
2122 flash=""
2123 echo "Simulator build selected"
2125 [Aa])
2126 echo "Advanced build selected"
2127 whichadvanced
2129 [Gg])
2130 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
2131 appsdir='\$(ROOTDIR)/gdb'
2132 apps="stub"
2133 case $modelname in
2134 ifp7xx)
2135 output="stub.wma"
2139 esac
2140 echo "GDB stub build selected"
2142 [Mm])
2143 toolset='';
2144 apps="manual"
2145 echo "Manual build selected"
2148 if [ "$modelname" = "e200r" ]; then
2149 echo "Do not use the e200R target for regular builds. Use e200 instead."
2150 exit 8
2152 debug=""
2153 btype="N" # set it explicitly since RET only gets here as well
2154 echo "Normal build selected"
2157 esac
2158 # to be able running "make manual" from non-manual configuration
2159 case $modelname in
2160 fmrecorder)
2161 manualdev="recorderv2fm"
2163 recorderv2)
2164 manualdev="recorderv2fm"
2166 h1??)
2167 manualdev="h100"
2169 ipodmini2g)
2170 manualdev="ipodmini"
2173 manualdev=$modelname
2175 esac
2177 if [ -z "$debug" ]; then
2178 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
2181 echo "Using source code root directory: $rootdir"
2183 # this was once possible to change at build-time, but no more:
2184 language="english"
2186 uname=`uname`
2188 if [ "yes" = "$simulator" ]; then
2189 # setup compiler and things for simulator
2190 simcc
2192 if [ -d "simdisk" ]; then
2193 echo "Subdirectory 'simdisk' already present"
2194 else
2195 mkdir simdisk
2196 echo "Created a 'simdisk' subdirectory for simulating the hard disk"
2200 # Now, figure out version number of the (gcc) compiler we are about to use
2201 gccver=`$CC -dumpversion`;
2203 # figure out the binutil version too and display it, mostly for the build
2204 # system etc to be able to see it easier
2205 ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
2207 if [ -z "$gccver" ]; then
2208 echo "WARNING: The compiler you must use ($CC) is not in your path!"
2209 echo "WARNING: this may cause your build to fail since we cannot do the"
2210 echo "WARNING: checks we want now."
2211 else
2213 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
2214 # DEPEND on it
2216 num1=`echo $gccver | cut -d . -f1`
2217 num2=`echo $gccver | cut -d . -f2`
2218 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
2220 # This makes:
2221 # 3.3.X => 303
2222 # 3.4.X => 304
2223 # 2.95.3 => 295
2225 echo "Using $CC $gccver ($gccnum)"
2227 if test "$gccnum" -ge "400"; then
2228 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
2229 # so we ignore that warnings for now
2230 # -Wno-pointer-sign
2231 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
2234 if test "$gccnum" -ge "401"; then
2235 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
2236 # will break strict-aliasing rules"
2238 GCCOPTS="$GCCOPTS -fno-strict-aliasing"
2241 if test "$gccnum" -ge "402"; then
2242 # disable warning about "warning: initialized field overwritten" as gcc 4.2
2243 # and later would throw it for several valid cases
2244 GCCOPTS="$GCCOPTS -Wno-override-init"
2247 case $prefix in
2249 # simulator
2251 i586-mingw32msvc-)
2252 # cross-compile for win32
2255 # Verify that the cross-compiler is of a recommended version!
2256 if test "$gccver" != "$gccchoice"; then
2257 echo "WARNING: Your cross-compiler $CC $gccver is not of the recommended"
2258 echo "WARNING: version $gccchoice!"
2259 echo "WARNING: This may cause your build to fail since it may be a version"
2260 echo "WARNING: that isn't functional or known to not be the best choice."
2261 echo "WARNING: If you suffer from build problems, you know that this is"
2262 echo "WARNING: a likely source for them..."
2265 esac
2270 echo "Using $LD $ldver"
2272 # check the compiler for SH platforms
2273 if test "$CC" = "sh-elf-gcc"; then
2274 if test "$gccnum" -lt "400"; then
2275 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
2276 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2277 else
2278 # figure out patch status
2279 gccpatch=`$CC --version`;
2281 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
2282 echo "gcc $gccver is rockbox patched"
2283 # then convert -O to -Os to get smaller binaries!
2284 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2285 else
2286 echo "WARNING: You use an unpatched gcc compiler: $gccver"
2287 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2292 if test "$CC" = "m68k-elf-gcc"; then
2293 # convert -O to -Os to get smaller binaries!
2294 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2297 if [ "1" != `parse_args --ccache` ]; then
2298 echo "Enable ccache for building"
2299 ccache="ccache"
2300 else
2301 if [ "1" = `parse_args --no-ccache` ]; then
2302 ccache=`findtool ccache`
2303 if test -n "$ccache"; then
2304 echo "Found and uses ccache ($ccache)"
2309 # figure out the full path to the various commands if possible
2310 HOSTCC=`findtool gcc --lit`
2311 HOSTAR=`findtool ar --lit`
2312 CC=`findtool ${CC} --lit`
2313 LD=`findtool ${AR} --lit`
2314 AR=`findtool ${AR} --lit`
2315 AS=`findtool ${AS} --lit`
2316 OC=`findtool ${OC} --lit`
2317 WINDRES=`findtool ${WINDRES} --lit`
2318 DLLTOOL=`findtool ${DLLTOOL} --lit`
2319 DLLWRAP=`findtool ${DLLWRAP} --lit`
2320 RANLIB=`findtool ${RANLIB} --lit`
2322 if test -n "$ccache"; then
2323 CC="$ccache $CC"
2326 if test "X$endian" = "Xbig"; then
2327 defendian="ROCKBOX_BIG_ENDIAN"
2328 else
2329 defendian="ROCKBOX_LITTLE_ENDIAN"
2332 if [ "1" != `parse_args --rbdir` ]; then
2333 rbdir=`parse_args --rbdir`;
2334 echo "Using alternate rockbox dir: ${rbdir}"
2337 sed > autoconf.h \
2338 -e "s,@ENDIAN@,${defendian},g" \
2339 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
2340 -e "s,@config_rtc@,$config_rtc,g" \
2341 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
2342 -e "s,@RBDIR@,${rbdir},g" \
2343 <<EOF
2344 /* This header was made by configure */
2345 #ifndef __BUILD_AUTOCONF_H
2346 #define __BUILD_AUTOCONF_H
2348 /* Define endianess for the target or simulator platform */
2349 #define @ENDIAN@ 1
2351 /* Define this if you build rockbox to support the logf logging and display */
2352 #undef ROCKBOX_HAS_LOGF
2354 /* optional defines for RTC mod for h1x0 */
2355 @config_rtc@
2356 @have_rtc_alarm@
2358 /* root of Rockbox */
2359 #define ROCKBOX_DIR "/@RBDIR@"
2361 #endif /* __BUILD_AUTOCONF_H */
2364 if test -n "$t_cpu"; then
2365 TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
2366 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
2367 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
2368 GCCOPTS="$GCCOPTS"
2371 if test "$simulator" = "yes"; then
2372 # add simul make stuff on the #SIMUL# line
2373 simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
2374 simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
2375 else
2376 # delete the lines that match
2377 simmagic1='/@SIMUL1@/D'
2378 simmagic2='/@SIMUL2@/D'
2381 if test "$swcodec" = "yes"; then
2382 voicetoolset="rbspeexenc voicefont wavtrim"
2383 else
2384 voicetoolset="voicefont wavtrim"
2387 if test "$apps" = "apps"; then
2388 # only when we build "real" apps we build the .lng files
2389 buildlangs="langs"
2392 #### Fix the cmdline ###
2393 if test -n "$ccache"; then
2394 cmdline="--ccache"
2397 cmdline="$cmdline --target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype"
2400 ### end of cmdline
2402 sed > Makefile \
2403 -e "s,@ROOTDIR@,${rootdir},g" \
2404 -e "s,@DEBUG@,${debug},g" \
2405 -e "s,@MEMORY@,${memory},g" \
2406 -e "s,@TARGET_ID@,${target_id},g" \
2407 -e "s,@TARGET@,${target},g" \
2408 -e "s,@CPU@,${t_cpu},g" \
2409 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
2410 -e "s,@MODELNAME@,${modelname},g" \
2411 -e "s,@LANGUAGE@,${language},g" \
2412 -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
2413 -e "s,@PWD@,${pwd},g" \
2414 -e "s,@HOSTCC@,${HOSTCC},g" \
2415 -e "s,@HOSTAR@,${HOSTAR},g" \
2416 -e "s,@CC@,${CC},g" \
2417 -e "s,@LD@,${LD},g" \
2418 -e "s,@AR@,${AR},g" \
2419 -e "s,@AS@,${AS},g" \
2420 -e "s,@OC@,${OC},g" \
2421 -e "s,@WINDRES@,${WINDRES},g" \
2422 -e "s,@DLLTOOL@,${DLLTOOL},g" \
2423 -e "s,@DLLWRAP@,${DLLWRAP},g" \
2424 -e "s,@RANLIB@,${RANLIB},g" \
2425 -e "s,@TOOL@,${tool},g" \
2426 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
2427 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
2428 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
2429 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
2430 -e "s,@OUTPUT@,${output},g" \
2431 -e "s,@APPEXTRA@,${appextra},g" \
2432 -e "s,@ARCHOSROM@,${archosrom},g" \
2433 -e "s,@FLASHFILE@,${flash},g" \
2434 -e "s,@PLUGINS@,${plugins},g" \
2435 -e "s,@CODECS@,${swcodec},g" \
2436 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
2437 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
2438 -e "s,@GCCOPTS@,${GCCOPTS},g" \
2439 -e "s,@TARGET_INC@,${TARGET_INC},g" \
2440 -e "s!@LDOPTS@!${LDOPTS}!g" \
2441 -e "s,@LOADADDRESS@,${loadaddress},g" \
2442 -e "s,@EXTRADEF@,${extradefines},g" \
2443 -e "s,@APPSDIR@,${appsdir},g" \
2444 -e "s,@FIRMDIR@,${firmdir},g" \
2445 -e "s,@TOOLSDIR@,${toolsdir},g" \
2446 -e "s,@APPS@,${apps},g" \
2447 -e "s,@SIMVER@,${simver},g" \
2448 -e "s,@GCCVER@,${gccver},g" \
2449 -e "s,@GCCNUM@,${gccnum},g" \
2450 -e "s,@UNAME@,${uname},g" \
2451 -e "s,@ENDIAN@,${defendian},g" \
2452 -e "s,@TOOLSET@,${toolset},g" \
2453 -e "${simmagic1}" \
2454 -e "${simmagic2}" \
2455 -e "s,@MANUALDEV@,${manualdev},g" \
2456 -e "s,@ENCODER@,${ENC_CMD},g" \
2457 -e "s,@ENC_OPTS@,${ENC_OPTS},g" \
2458 -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
2459 -e "s,@TTS_OPTS@,${TTS_OPTS},g" \
2460 -e "s,@VOICETOOLSET@,${voicetoolset},g" \
2461 -e "s,@LANGS@,${buildlangs},g" \
2462 -e "s,@USE_ELF@,${USE_ELF},g" \
2463 -e "s,@RBDIR@,${rbdir},g" \
2464 -e "s,@CMDLINE@,$cmdline,g" \
2465 <<EOF
2466 ## Automatically generated. http://www.rockbox.org/
2468 export ROOTDIR=@ROOTDIR@
2469 export FIRMDIR=@FIRMDIR@
2470 export APPSDIR=@APPSDIR@
2471 export TOOLSDIR=@TOOLSDIR@
2472 export DOCSDIR=\$(ROOTDIR)/docs
2473 export MANUALDIR=\${ROOTDIR}/manual
2474 export DEBUG=@DEBUG@
2475 export MODELNAME=@MODELNAME@
2476 export ARCHOSROM=@ARCHOSROM@
2477 export FLASHFILE=@FLASHFILE@
2478 export TARGET_ID=@TARGET_ID@
2479 export TARGET=@TARGET@
2480 export CPU=@CPU@
2481 export MANUFACTURER=@MANUFACTURER@
2482 export OBJDIR=@PWD@
2483 export BUILDDIR=@PWD@
2484 export LANGUAGE=@LANGUAGE@
2485 export VOICELANGUAGE=@VOICELANGUAGE@
2486 export MEMORYSIZE=@MEMORY@
2487 export VERSION:=\$(shell \$(ROOTDIR)/tools/svnversion.sh \$(ROOTDIR))
2488 export BUILDDATE:=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
2489 export MKFIRMWARE=@TOOL@
2490 export BMP2RB_MONO=@BMP2RB_MONO@
2491 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
2492 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
2493 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
2494 export BINARY=@OUTPUT@
2495 export APPEXTRA=@APPEXTRA@
2496 export ENABLEDPLUGINS=@PLUGINS@
2497 export SOFTWARECODECS=@CODECS@
2498 export EXTRA_DEFINES=@EXTRADEF@
2499 export HOSTCC=@HOSTCC@
2500 export HOSTAR=@HOSTAR@
2501 export CC=@CC@
2502 export LD=@LD@
2503 export AR=@AR@
2504 export AS=@AS@
2505 export OC=@OC@
2506 export WINDRES=@WINDRES@
2507 export DLLTOOL=@DLLTOOL@
2508 export DLLWRAP=@DLLWRAP@
2509 export RANLIB=@RANLIB@
2510 export PROFILE_OPTS=@PROFILE_OPTS@
2511 export SIMVER=@SIMVER@
2512 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
2513 export GCCOPTS=@GCCOPTS@
2514 export TARGET_INC=@TARGET_INC@
2515 export LOADADDRESS=@LOADADDRESS@
2516 export SHARED_FLAG=@SHARED_FLAG@
2517 export LDOPTS=@LDOPTS@
2518 export GCCVER=@GCCVER@
2519 export GCCNUM=@GCCNUM@
2520 export UNAME=@UNAME@
2521 export MANUALDEV=@MANUALDEV@
2522 export TTS_OPTS=@TTS_OPTS@
2523 export TTS_ENGINE=@TTS_ENGINE@
2524 export ENC_OPTS=@ENC_OPTS@
2525 export ENCODER=@ENCODER@
2526 export USE_ELF=@USE_ELF@
2527 export RBDIR=@RBDIR@
2529 CONFIGURE_OPTIONS=@CMDLINE@
2531 include \$(TOOLSDIR)/root.make
2535 echo "Created Makefile"