add the multivolume feature to LANG_DISK_NAME_MMC, to enable building multivolume...
[kugel-rb.git] / tools / configure
blob8ce44b0c395f948ae93c844674695b687d12880f
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: //'`
19 # Begin Function Definitions
21 input() {
22 read response
23 echo $response
26 prefixtools () {
27 prefix="$1"
28 CC=${prefix}gcc
29 WINDRES=${prefix}windres
30 DLLTOOL=${prefix}dlltool
31 DLLWRAP=${prefix}dllwrap
32 RANLIB=${prefix}ranlib
33 LD=${prefix}ld
34 AR=${prefix}ar
35 AS=${prefix}as
36 OC=${prefix}objcopy
39 crosswincc () {
40 # naive approach to selecting a mingw cross-compiler on linux/*nix
41 echo "Enabling win32 crosscompiling"
43 prefixtools i586-mingw32msvc-
45 # add cross-compiler option(s)
46 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
47 LDOPTS="`sdl-config --libs` -mconsole"
49 output="rockboxui.exe" # use this as output binary name
50 crosscompile="yes"
51 endian="little" # windows is little endian
54 # scan the $PATH for the given command
55 findtool(){
56 file="$1"
58 IFS=":"
59 for path in $PATH
61 # echo "checks for $file in $path" >&2
62 if test -f "$path/$file"; then
63 echo "$path/$file"
64 return
66 done
69 # parse the argument list, returns the value after the = in case of a
70 # option=value type option, returns 0 in case of --ccache or --no-ccache,
71 # returns 1 if the searched argument type wasn't fount in the argument list
72 # Usage [var = ]`parse_args <argumenttype>`, e.g. `parse_args --target`
74 # var definitons below are needed so that parse_args can see the arguments
75 arg1=$1 arg2=$2 arg3=$3 arg4=$4 arg5=$5 arg6=$6 arg7=$7 arg8=$8 arg9=$9
77 parse_args() {
78 ret="1"
79 for i in $arg1 $arg2 $arg3 $arg4 $arg5 $arg6 $arg7 $arg8 $arg9
81 if [ "$1" = "--ccache" ]; then
82 if [ "$i" = "--ccache" ]; then
83 ret="0"
85 elif [ "$1" = "--no-ccache" ]; then
86 if [ "$i" = "--no-ccache" ]; then
87 ret="0"
89 elif [ "$1" = `echo $i|cut -d'=' -f1` ]; then
90 ret=`echo $i|cut -d'=' -f2`
92 done
93 echo "$ret"
96 simcc () {
98 # default tool setup for native building
99 prefixtools ""
101 simver=sdl
102 GCCOPTS='-W -Wall -g -fno-builtin'
104 output="rockboxui" # use this as default output binary name
106 # generic sdl-config checker
107 sdl=`findtool sdl-config`
109 if [ -z "$sdl" ]; then
110 echo "configure didn't find sdl-config, which indicates that you"
111 echo "don't have SDL (properly) installed. Please correct and"
112 echo "re-run configure!"
113 exit
116 # default share option, override below if needed
117 SHARED_FLAG="-shared"
119 case $uname in
120 CYGWIN*)
121 echo "Cygwin host detected"
123 # sdl version
124 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
125 LDOPTS="`sdl-config --libs` -mconsole"
127 output="rockboxui.exe" # use this as output binary name
130 Linux)
131 echo "Linux host detected"
132 if [ "0" != `sdl-config --libs |grep -c mwindows` ]; then
133 # Enable crosscompiling if sdl-config is from Windows SDL
134 crosswincc
135 else
136 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
137 LDOPTS="`sdl-config --libs`"
141 FreeBSD)
142 echo "FreeBSD host detected"
143 # sdl version
144 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
145 LDOPTS="`sdl-config --libs`"
148 Darwin)
149 echo "Darwin host detected"
150 # sdl version
151 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
152 LDOPTS="`sdl-config --libs`"
153 SHARED_FLAG="-dynamiclib -Wl\,-single_module"
157 echo "Unsupported system: $uname, fix configure and retry"
158 exit
160 esac
162 GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
164 if test "X$crosscompile" != "Xyes"; then
165 if [ "`uname -m`" = "x86_64" ] || [ "`uname -m`" = "amd64" ]; then
166 # fPIC is needed to make shared objects link
167 # setting visibility to hidden is necessary to avoid strange crashes
168 # due to symbol clashing
169 GCCOPTS="$GCCOPTS -fPIC -fvisibility=hidden"
172 id=$$
173 cat >/tmp/conftest-$id.c <<EOF
174 #include <stdio.h>
175 int main(int argc, char **argv)
177 int var=0;
178 char *varp = (char *)&var;
179 *varp=1;
181 printf("%d\n", var);
182 return 0;
186 $CC -o /tmp/conftest-$id /tmp/conftest-$id.c 2>/dev/null
188 if test `/tmp/conftest-$id 2>/dev/null` -gt "1"; then
189 # big endian
190 endian="big"
191 else
192 # little endian
193 endian="little"
195 echo "Simulator environment deemed $endian endian"
197 # use wildcard here to make it work even if it was named *.exe like
198 # on cygwin
199 rm -f /tmp/conftest-$id*
204 # functions for setting up cross-compiler names and options
205 # also set endianess and what the exact recommended gcc version is
206 # the gcc version should most likely match what versions we build with
207 # rockboxdev.sh
209 shcc () {
210 prefixtools sh-elf-
211 GCCOPTS="$CCOPTS -m1"
212 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
213 endian="big"
214 gccchoice="4.0.3"
217 calmrisccc () {
218 prefixtools calmrisc16-unknown-elf-
219 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
220 GCCOPTIMIZE="-fomit-frame-pointer"
221 endian="big"
224 coldfirecc () {
225 prefixtools m68k-elf-
226 GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
227 GCCOPTIMIZE="-fomit-frame-pointer"
228 endian="big"
229 gccchoice="3.4.6"
232 arm7tdmicc () {
233 prefixtools arm-elf-
234 GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
235 if test "X$1" != "Xshort"; then
236 GCCOPTS="$GCCOPTS -mlong-calls"
238 GCCOPTIMIZE="-fomit-frame-pointer"
239 endian="little"
240 gccchoice="4.0.3"
243 arm9tdmicc () {
244 prefixtools arm-elf-
245 GCCOPTS="$CCOPTS -mcpu=arm9tdmi -mlong-calls"
246 GCCOPTIMIZE="-fomit-frame-pointer"
247 endian="little"
248 gccchoice="4.0.3"
251 arm940tbecc () {
252 prefixtools arm-elf-
253 GCCOPTS="$CCOPTS -mbig-endian -mcpu=arm940t -mlong-calls"
254 GCCOPTIMIZE="-fomit-frame-pointer"
255 endian="big"
256 gccchoice="4.0.3"
259 arm946cc () {
260 prefixtools arm-elf-
261 GCCOPTS="$CCOPTS -mcpu=arm9e -mlong-calls"
262 GCCOPTIMIZE="-fomit-frame-pointer"
263 endian="little"
264 gccchoice="4.0.3"
267 arm926ejscc () {
268 prefixtools arm-elf-
269 GCCOPTS="$CCOPTS -mcpu=arm926ej-s -mlong-calls"
270 GCCOPTIMIZE="-fomit-frame-pointer"
271 endian="little"
272 gccchoice="4.0.3"
275 arm1136jfscc () {
276 prefixtools arm-elf-
277 GCCOPTS="$CCOPTS -mcpu=arm1136jf-s -mlong-calls"
278 GCCOPTIMIZE="-fomit-frame-pointer"
279 endian="little"
280 gccchoice="4.0.3"
283 mipselcc () {
284 prefixtools mipsel-elf-
285 GCCOPTS="$CCOPTS -march=mips32 -mno-mips16 -mno-abicalls -mlong-calls"
286 GCCOPTIMIZE="-fomit-frame-pointer"
287 GCCOPTS="$GCCOPTS -fno-pic -fno-builtin -fno-exceptions -ffunction-sections -msoft-float -G 0"
288 endian="little"
289 gccchoice="4.1.2"
292 whichadvanced () {
293 ##################################################################
294 # Prompt for specific developer options
296 echo ""
297 echo "Enter your developer options (press enter when done)"
298 echo -n "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice"
299 if [ "$memory" = "2" ]; then
300 echo -n ", (8)MB MOD"
302 if [ "$modelname" = "h120" ]; then
303 echo -n ", (R)TC MOD"
305 echo ""
307 cont=1
309 while [ $cont = "1" ]; do
311 option=`input`;
313 case $option in
314 [Dd])
315 if [ "yes" = "$profile" ]; then
316 echo "Debug is incompatible with profiling"
317 else
318 echo "define DEBUG"
319 use_debug="yes"
322 [Ll])
323 echo "logf() support enabled"
324 logf="yes"
326 [Ss])
327 echo "Simulator build enabled"
328 simulator="yes"
330 [Pp])
331 if [ "yes" = "$use_debug" ]; then
332 echo "Profiling is incompatible with debug"
333 else
334 echo "Profiling support is enabled"
335 profile="yes"
338 [Vv])
339 echo "Voice build selected"
340 voice="yes"
343 if [ "$memory" = "2" ]; then
344 memory="8"
345 echo "Memory size selected: 8MB"
346 else
347 cont=0
350 [Rr])
351 if [ "$modelname" = "h120" ]; then
352 config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231"
353 have_rtc_alarm="#define HAVE_RTC_ALARM"
354 echo "RTC functions enabled (DS1339/DS3231)"
355 else
356 cont=0
360 cont=0
362 esac
363 done
364 echo "done"
366 if [ "yes" = "$voice" ]; then
367 # Ask about languages to build
368 echo "Select a number for the language to use (default is english)"
369 # The multiple-language feature is currently broken
370 # echo "You may enter a comma-separated list of languages to build"
372 picklang
373 voicelanguage=`whichlang`
375 if [ -z "$voicelanguage" ]; then
376 # pick a default
377 voicelanguage="english"
379 echo "Voice language set to $voicelanguage"
381 # Configure encoder and TTS engine for each language
382 for thislang in `echo $voicelanguage | sed 's/,/ /g'`; do
383 voiceconfig "$thislang"
384 done
386 if [ "yes" = "$use_debug" ]; then
387 debug="-DDEBUG"
388 GCCOPTS="$GCCOPTS -g -DDEBUG"
390 if [ "yes" = "$logf" ]; then
391 use_logf="#define ROCKBOX_HAS_LOGF 1"
393 if [ "yes" = "$simulator" ]; then
394 debug="-DDEBUG"
395 extradefines="$extradefines -DSIMULATOR"
397 if [ "yes" = "$profile" ]; then
398 extradefines="$extradefines -DRB_PROFILE"
399 PROFILE_OPTS="-finstrument-functions"
403 # Configure voice settings
404 voiceconfig () {
405 thislang=$1
406 echo "Building $thislang voice for $modelname. Select options"
407 echo ""
409 if [ -f "`which flite`" ]; then
410 FLITE="F(l)ite "
411 FLITE_OPTS=""
412 DEFAULT_TTS="flite"
413 DEFAULT_TTS_OPTS=$FLITE_OPTS
414 DEFAULT_NOISEFLOOR="500"
415 DEFAULT_CHOICE="L"
417 if [ -f "`which espeak`" ]; then
418 ESPEAK="(e)Speak "
419 ESPEAK_OPTS=""
420 DEFAULT_TTS="espeak"
421 DEFAULT_TTS_OPTS=$ESPEAK_OPTS
422 DEFAULT_NOISEFLOOR="500"
423 DEFAULT_CHOICE="e"
425 if [ -f "`which festival`" ]; then
426 FESTIVAL="(F)estival "
427 case "$thislang" in
428 "italiano")
429 FESTIVAL_OPTS="--language italian"
431 "espanol")
432 FESTIVAL_OPTS="--language spanish"
434 "finnish")
435 FESTIVAL_OPTS="--language finnish"
437 "czech")
438 FESTIVAL_OPTS="--language czech"
441 FESTIVAL_OPTS=""
443 esac
444 DEFAULT_TTS="festival"
445 DEFAULT_TTS_OPTS=$FESTIVAL_OPTS
446 DEFAULT_NOISEFLOOR="500"
447 DEFAULT_CHOICE="F"
449 if [ -f "`which swift`" ]; then
450 SWIFT="S(w)ift "
451 SWIFT_OPTS=""
452 DEFAULT_TTS="swift"
453 DEFAULT_TTS_OPTS=$SWIFT_OPTS
454 DEFAULT_NOISEFLOOR="500"
455 DEFAULT_CHOICE="w"
457 # Allow SAPI if Windows is in use
458 if [ -f "`which winver`" ]; then
459 SAPI="(S)API "
460 SAPI_OPTS=""
461 DEFAULT_TTS="sapi"
462 DEFAULT_TTS_OPTS=$SAPI_OPTS
463 DEFAULT_NOISEFLOOR="500"
464 DEFAULT_CHOICE="S"
467 if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ] && [ "$ESPEAK" = "$SAPI" ] && [ "$SAPI" = "$SWIFT" ]; then
468 echo "You need Festival, eSpeak or Flite in your path, or SAPI available to build voice files"
469 exit
472 echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?"
473 option=`input`
474 case "$option" in
475 [Ll])
476 TTS_ENGINE="flite"
477 NOISEFLOOR="500" # TODO: check this value
478 TTS_OPTS=$FLITE_OPTS
480 [Ee])
481 TTS_ENGINE="espeak"
482 NOISEFLOOR="500"
483 TTS_OPTS=$ESPEAK_OPTS
485 [Ff])
486 TTS_ENGINE="festival"
487 NOISEFLOOR="500"
488 TTS_OPTS=$FESTIVAL_OPTS
490 [Ss])
491 TTS_ENGINE="sapi"
492 NOISEFLOOR="500"
493 TTS_OPTS=$SAPI_OPTS
495 [Ww])
496 TTS_ENGINE="swift"
497 NOISEFLOOR="500"
498 TTS_OPTS=$SWIFT_OPTS
501 TTS_ENGINE=$DEFAULT_TTS
502 TTS_OPTS=$DEFAULT_TTS_OPTS
503 NOISEFLOOR=$DEFAULT_NOISEFLOOR
504 esac
505 echo "Using $TTS_ENGINE for TTS"
507 # Allow the user to input manual commandline options
508 printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): "
509 USER_TTS_OPTS=`input`
510 if [ -n "$USER_TTS_OPTS" ]; then
511 TTS_OPTS="$USER_TTS_OPTS"
514 echo ""
516 if [ "$swcodec" = "yes" ]; then
517 ENCODER="rbspeexenc"
518 ENC_CMD="rbspeexenc"
519 ENC_OPTS="-q 4 -c 10"
520 else
521 if [ -f "`which lame`" ]; then
522 ENCODER="lame"
523 ENC_CMD="lame"
524 ENC_OPTS="--resample 12 -t -m m -h -V 9 -S -B 64 --vbr-new"
525 else
526 echo "You need LAME in the system path to build voice files for"
527 echo "HWCODEC targets."
528 exit
532 echo "Using $ENCODER for encoding voice clips"
534 # Allow the user to input manual commandline options
535 printf "Enter $ENCODER options (enter for defaults \"$ENC_OPTS\"): "
536 USER_ENC_OPTS=`input`
537 if [ -n "$USER_ENC_OPTS" ]; then
538 ENC_OPTS=$USER_ENC_OPTS
541 TEMPDIR="${pwd}"
542 if [ -f "`which cygpath`" ]; then
543 TEMPDIR=`cygpath . -a -w`
547 picklang() {
548 # figure out which languages that are around
549 for file in $rootdir/apps/lang/*.lang; do
550 clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
551 langs="$langs $clean"
552 done
554 num=1
555 for one in $langs; do
556 echo "$num. $one"
557 num=`expr $num + 1`
558 done
560 read pick
563 whichlang() {
564 output=""
565 # Allow the user to pass a comma-separated list of langauges
566 for thispick in `echo $pick | sed 's/,/ /g'`; do
567 num=1
568 for one in $langs; do
569 # Accept both the language number and name
570 if [ "$num" = "$thispick" ] || [ "$thispick" = "$one" ]; then
571 if [ "$output" = "" ]; then
572 output=$one
573 else
574 output=$output,$one
577 num=`expr $num + 1`
578 done
579 done
580 echo $output
583 opt=$1
585 if test "$opt" = "--help"; then
586 echo "Rockbox configure script."
587 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
588 echo "Do *NOT* run this within the tools directory!"
589 echo ""
590 cat <<EOF
591 Usage: configure [OPTION]...
592 Options:
593 --target=TARGET Sets the target, TARGET can be either the target ID or
594 corresponding string. Run without this option to see all
595 available targets.
597 --ram=RAM Sets the RAM for certain targets. Even though any number
598 is accepted, not every number is correct. The default
599 value will be applied, if you entered a wrong number
600 (which depends on the target). Watch the output. Run
601 without this option if you are not sure which the right
602 number is.
604 --type=TYPE Sets the build type. The shortcut is also valid.
605 Run without this option to see available types.
606 --ccache Enable ccache use (done by default these days)
607 --no-ccache Disable ccache use
608 --help Shows this message (must not be used with other options)
612 exit
615 if test -r "configure"; then
616 # this is a check for a configure script in the current directory, it there
617 # is one, try to figure out if it is this one!
619 if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
620 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
621 echo "It will only cause you pain and grief. Instead do this:"
622 echo ""
623 echo " cd .."
624 echo " mkdir build-dir"
625 echo " cd build-dir"
626 echo " ../tools/configure"
627 echo ""
628 echo "Much happiness will arise from this. Enjoy"
629 exit
633 # get our current directory
634 pwd=`pwd`;
636 if { echo $pwd | grep " "; } then
637 echo "You're running this script in a path that contains space. The build"
638 echo "system is unfortunately not clever enough to deal with this. Please"
639 echo "run the script from a different path, rename the path or fix the build"
640 echo "system!"
641 exit
644 if [ -z "$rootdir" ]; then
645 ##################################################################
646 # Figure out where the source code root is!
648 rootdir=`dirname $0`/../
650 #####################################################################
651 # Convert the possibly relative directory name to an absolute version
653 now=`pwd`
654 cd $rootdir
655 rootdir=`pwd`
657 # cd back to the build dir
658 cd $now
661 apps="apps"
662 appsdir='\$(ROOTDIR)/apps'
663 firmdir='\$(ROOTDIR)/firmware'
664 toolsdir='\$(ROOTDIR)/tools'
667 ##################################################################
668 # Figure out target platform
671 if [ "1" != `parse_args --target` ]; then
672 buildfor=`parse_args --target`;
673 else
674 echo "Enter target platform:"
675 cat <<EOF
676 ==Archos== ==iriver== ==Apple iPod==
677 0) Player/Studio 10) H120/H140 20) Color/Photo
678 1) Recorder 11) H320/H340 21) Nano
679 2) FM Recorder 12) iHP-100/110/115 22) Video
680 3) Recorder v2 13) iFP-790 23) 3G
681 4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
682 5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
683 6) AV300 26) Mini 2G
684 27) 1G, 2G
686 ==iAudio== ==Toshiba== ==SanDisk==
687 30) X5/X5V/X5L 40) Gigabeat F 50) Sansa e200
688 31) M5/M5L 41) Gigabeat S 51) Sansa e200R
689 32) 7 52) Sansa c200
690 33) Cowon D2 53) Sansa m200
691 34) M3/M3L 54) Sansa c100
693 ==Tatung== ==Olympus== ==Logik==
694 60) Elio TPJ-1022 70) M:Robe 500 80) DAX 1GB MP3/DAB
695 71) M:Robe 100
697 ==Creative== ==Philips== ==Meizu==
698 90) Zen Vision:M 30GB 100) GoGear SA9200 110) M6SL
699 91) Zen Vision:M 60GB 101) GoGear HDD1630 111) M6SP
700 92) Zen Vision 112) M3
702 ==Onda==
703 120) VX747
704 121) VX767
707 buildfor=`input`;
710 # Set of tools built for all target platforms:
711 toolset="rdf2binary convbdf codepages"
713 # Toolsets for some target families:
714 archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
715 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
716 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
717 ipodbitmaptools="$toolset scramble bmp2rb"
718 gigabeatbitmaptools="$toolset scramble descramble bmp2rb"
719 tccbitmaptools="$toolset scramble mktccboot bmp2rb"
720 # generic is used by IFP, H10, Sansa-e200
721 genericbitmaptools="$toolset bmp2rb"
724 # ---- For each target ----
726 # *Variables*
727 # target_id: a unique number identifying this target, IS NOT the menu number.
728 # Just use the currently highest number+1 when you add a new
729 # target.
730 # modelname: short model name used all over to identify this target
731 # memory: number of megabytes of RAM this target has. If the amount can
732 # be selected by the size prompt, let memory be unset here
733 # target: -Ddefine passed to the build commands to make the correct
734 # config-*.h file get included etc
735 # tool: the tool that takes a plain binary and converts that into a
736 # working "firmware" file for your target
737 # output: the final output file name
738 # boottool: the tool that takes a plain binary and generates a bootloader
739 # file for your target (or blank to use $tool)
740 # bootoutput:the final output file name for the bootloader (or blank to use
741 # $output)
742 # appextra: passed to the APPEXTRA variable in the Makefiles.
743 # TODO: add proper explanation
744 # archosrom: used only for Archos targets that build a special flashable .ucl
745 # image.
746 # flash: name of output for flashing, for targets where there's a special
747 # file output for this.
748 # plugins: set to 'yes' to build the plugins. Early development builds can
749 # set this to no in the early stages to have an easier life for a
750 # while
751 # swcodec: set 'yes' on swcodec targets
752 # toolset: lists what particular tools in the tools/ directory that this
753 # target needs to have built prior to building Rockbox
755 # *Functions*
756 # *cc: sets up gcc and compiler options for your target builds. Note
757 # that if you select a simulator build, the compiler selection is
758 # overridden later in the script.
760 case $buildfor in
762 0|player)
763 target_id=1
764 modelname="player"
765 target="-DARCHOS_PLAYER"
766 shcc
767 tool="$rootdir/tools/scramble"
768 output="archos.mod"
769 appextra="player:gui"
770 archosrom="$pwd/rombox.ucl"
771 flash="$pwd/rockbox.ucl"
772 plugins="yes"
773 swcodec=""
775 # toolset is the tools within the tools directory that we build for
776 # this particular target.
777 toolset="$toolset scramble descramble sh2d player_unifont uclpack"
779 # Note: the convbdf is present in the toolset just because: 1) the
780 # firmware/Makefile assumes it is present always, and 2) we will need it when we
781 # build the player simulator
783 t_cpu="sh"
784 t_manufacturer="archos"
785 t_model="player"
788 1|recorder)
789 target_id=2
790 modelname="recorder"
791 target="-DARCHOS_RECORDER"
792 shcc
793 tool="$rootdir/tools/scramble"
794 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
795 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
796 output="ajbrec.ajz"
797 appextra="recorder:gui"
798 #archosrom="$pwd/rombox.ucl"
799 flash="$pwd/rockbox.ucl"
800 plugins="yes"
801 swcodec=""
802 # toolset is the tools within the tools directory that we build for
803 # this particular target.
804 toolset=$archosbitmaptools
805 t_cpu="sh"
806 t_manufacturer="archos"
807 t_model="recorder"
810 2|fmrecorder)
811 target_id=3
812 modelname="fmrecorder"
813 target="-DARCHOS_FMRECORDER"
814 shcc
815 tool="$rootdir/tools/scramble -fm"
816 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
817 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
818 output="ajbrec.ajz"
819 appextra="recorder:gui"
820 #archosrom="$pwd/rombox.ucl"
821 flash="$pwd/rockbox.ucl"
822 plugins="yes"
823 swcodec=""
824 # toolset is the tools within the tools directory that we build for
825 # this particular target.
826 toolset=$archosbitmaptools
827 t_cpu="sh"
828 t_manufacturer="archos"
829 t_model="fm_v2"
832 3|recorderv2)
833 target_id=4
834 modelname="recorderv2"
835 target="-DARCHOS_RECORDERV2"
836 shcc
837 tool="$rootdir/tools/scramble -v2"
838 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
839 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
840 output="ajbrec.ajz"
841 appextra="recorder:gui"
842 #archosrom="$pwd/rombox.ucl"
843 flash="$pwd/rockbox.ucl"
844 plugins="yes"
845 swcodec=""
846 # toolset is the tools within the tools directory that we build for
847 # this particular target.
848 toolset=$archosbitmaptools
849 t_cpu="sh"
850 t_manufacturer="archos"
851 t_model="fm_v2"
854 4|ondiosp)
855 target_id=7
856 modelname="ondiosp"
857 target="-DARCHOS_ONDIOSP"
858 shcc
859 tool="$rootdir/tools/scramble -osp"
860 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
861 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
862 output="ajbrec.ajz"
863 appextra="recorder:gui"
864 archosrom="$pwd/rombox.ucl"
865 flash="$pwd/rockbox.ucl"
866 plugins="yes"
867 swcodec=""
868 # toolset is the tools within the tools directory that we build for
869 # this particular target.
870 toolset=$archosbitmaptools
871 t_cpu="sh"
872 t_manufacturer="archos"
873 t_model="ondio"
876 5|ondiofm)
877 target_id=8
878 modelname="ondiofm"
879 target="-DARCHOS_ONDIOFM"
880 shcc
881 tool="$rootdir/tools/scramble -ofm"
882 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
883 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
884 output="ajbrec.ajz"
885 appextra="recorder:gui"
886 #archosrom="$pwd/rombox.ucl"
887 flash="$pwd/rockbox.ucl"
888 plugins="yes"
889 swcodec=""
890 toolset=$archosbitmaptools
891 t_cpu="sh"
892 t_manufacturer="archos"
893 t_model="ondio"
896 6|av300)
897 target_id=38
898 modelname="av300"
899 target="-DARCHOS_AV300"
900 memory=16 # always
901 arm7tdmicc
902 tool="$rootdir/tools/scramble -mm=C"
903 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
904 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
905 output="cjbm.ajz"
906 appextra="recorder:gui"
907 plugins="yes"
908 swcodec=""
909 # toolset is the tools within the tools directory that we build for
910 # this particular target.
911 toolset="$toolset scramble descramble bmp2rb"
912 # architecture, manufacturer and model for the target-tree build
913 t_cpu="arm"
914 t_manufacturer="archos"
915 t_model="av300"
918 10|h120)
919 target_id=9
920 modelname="h120"
921 target="-DIRIVER_H120"
922 memory=32 # always
923 coldfirecc
924 tool="$rootdir/tools/scramble -add=h120"
925 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
926 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
927 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
928 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
929 output="rockbox.iriver"
930 appextra="recorder:gui"
931 flash="$pwd/rombox.iriver"
932 plugins="yes"
933 swcodec="yes"
934 # toolset is the tools within the tools directory that we build for
935 # this particular target.
936 toolset=$iriverbitmaptools
937 t_cpu="coldfire"
938 t_manufacturer="iriver"
939 t_model="h100"
942 11|h300)
943 target_id=10
944 modelname="h300"
945 target="-DIRIVER_H300"
946 memory=32 # always
947 coldfirecc
948 tool="$rootdir/tools/scramble -add=h300"
949 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
950 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
951 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
952 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
953 output="rockbox.iriver"
954 appextra="recorder:gui"
955 plugins="yes"
956 swcodec="yes"
957 # toolset is the tools within the tools directory that we build for
958 # this particular target.
959 toolset=$iriverbitmaptools
960 t_cpu="coldfire"
961 t_manufacturer="iriver"
962 t_model="h300"
965 12|h100)
966 target_id=11
967 modelname="h100"
968 target="-DIRIVER_H100"
969 memory=16 # always
970 coldfirecc
971 tool="$rootdir/tools/scramble -add=h100"
972 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
973 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
974 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
975 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
976 output="rockbox.iriver"
977 appextra="recorder:gui"
978 flash="$pwd/rombox.iriver"
979 plugins="yes"
980 swcodec="yes"
981 # toolset is the tools within the tools directory that we build for
982 # this particular target.
983 toolset=$iriverbitmaptools
984 t_cpu="coldfire"
985 t_manufacturer="iriver"
986 t_model="h100"
989 13|ifp7xx)
990 target_id=19
991 modelname="ifp7xx"
992 target="-DIRIVER_IFP7XX"
993 memory=1
994 arm7tdmicc short
995 tool="cp"
996 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
997 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
998 output="rockbox.wma"
999 appextra="recorder:gui"
1000 plugins="yes"
1001 swcodec="yes"
1002 # toolset is the tools within the tools directory that we build for
1003 # this particular target.
1004 toolset=$genericbitmaptools
1005 t_cpu="arm"
1006 t_manufacturer="pnx0101"
1007 t_model="iriver-ifp7xx"
1010 14|h10)
1011 target_id=22
1012 modelname="h10"
1013 target="-DIRIVER_H10"
1014 memory=32 # always
1015 arm7tdmicc
1016 tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
1017 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1018 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1019 output="rockbox.mi4"
1020 appextra="recorder:gui"
1021 plugins="yes"
1022 swcodec="yes"
1023 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
1024 bootoutput="H10_20GC.mi4"
1025 # toolset is the tools within the tools directory that we build for
1026 # this particular target.
1027 toolset="$genericbitmaptools scramble"
1028 # architecture, manufacturer and model for the target-tree build
1029 t_cpu="arm"
1030 t_manufacturer="iriver"
1031 t_model="h10"
1034 15|h10_5gb)
1035 target_id=24
1036 modelname="h10_5gb"
1037 target="-DIRIVER_H10_5GB"
1038 memory=32 # always
1039 arm7tdmicc
1040 tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
1041 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1042 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1043 output="rockbox.mi4"
1044 appextra="recorder:gui"
1045 plugins="yes"
1046 swcodec="yes"
1047 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
1048 bootoutput="H10.mi4"
1049 # toolset is the tools within the tools directory that we build for
1050 # this particular target.
1051 toolset="$genericbitmaptools scramble"
1052 # architecture, manufacturer and model for the target-tree build
1053 t_cpu="arm"
1054 t_manufacturer="iriver"
1055 t_model="h10"
1058 20|ipodcolor)
1059 target_id=13
1060 modelname="ipodcolor"
1061 target="-DIPOD_COLOR"
1062 memory=32 # always
1063 arm7tdmicc
1064 tool="$rootdir/tools/scramble -add=ipco"
1065 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1066 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1067 output="rockbox.ipod"
1068 appextra="recorder:gui"
1069 plugins="yes"
1070 swcodec="yes"
1071 bootoutput="bootloader-$modelname.ipod"
1072 # toolset is the tools within the tools directory that we build for
1073 # this particular target.
1074 toolset=$ipodbitmaptools
1075 # architecture, manufacturer and model for the target-tree build
1076 t_cpu="arm"
1077 t_manufacturer="ipod"
1078 t_model="color"
1081 21|ipodnano)
1082 target_id=14
1083 modelname="ipodnano"
1084 target="-DIPOD_NANO"
1085 memory=32 # always
1086 arm7tdmicc
1087 tool="$rootdir/tools/scramble -add=nano"
1088 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1089 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1090 output="rockbox.ipod"
1091 appextra="recorder:gui"
1092 plugins="yes"
1093 swcodec="yes"
1094 bootoutput="bootloader-$modelname.ipod"
1095 # toolset is the tools within the tools directory that we build for
1096 # this particular target.
1097 toolset=$ipodbitmaptools
1098 # architecture, manufacturer and model for the target-tree build
1099 t_cpu="arm"
1100 t_manufacturer="ipod"
1101 t_model="nano"
1104 22|ipodvideo)
1105 target_id=15
1106 modelname="ipodvideo"
1107 target="-DIPOD_VIDEO"
1108 arm7tdmicc
1109 tool="$rootdir/tools/scramble -add=ipvd"
1110 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1111 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1112 output="rockbox.ipod"
1113 appextra="recorder:gui"
1114 plugins="yes"
1115 swcodec="yes"
1116 bootoutput="bootloader-$modelname.ipod"
1117 # toolset is the tools within the tools directory that we build for
1118 # this particular target.
1119 toolset=$ipodbitmaptools
1120 # architecture, manufacturer and model for the target-tree build
1121 t_cpu="arm"
1122 t_manufacturer="ipod"
1123 t_model="video"
1126 23|ipod3g)
1127 target_id=16
1128 modelname="ipod3g"
1129 target="-DIPOD_3G"
1130 memory=32 # always
1131 arm7tdmicc
1132 tool="$rootdir/tools/scramble -add=ip3g"
1133 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1134 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1135 output="rockbox.ipod"
1136 appextra="recorder:gui"
1137 plugins="yes"
1138 swcodec="yes"
1139 bootoutput="bootloader-$modelname.ipod"
1140 # toolset is the tools within the tools directory that we build for
1141 # this particular target.
1142 toolset=$ipodbitmaptools
1143 # architecture, manufacturer and model for the target-tree build
1144 t_cpu="arm"
1145 t_manufacturer="ipod"
1146 t_model="3g"
1149 24|ipod4g)
1150 target_id=17
1151 modelname="ipod4g"
1152 target="-DIPOD_4G"
1153 memory=32 # always
1154 arm7tdmicc
1155 tool="$rootdir/tools/scramble -add=ip4g"
1156 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1157 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1158 output="rockbox.ipod"
1159 appextra="recorder:gui"
1160 plugins="yes"
1161 swcodec="yes"
1162 bootoutput="bootloader-$modelname.ipod"
1163 # toolset is the tools within the tools directory that we build for
1164 # this particular target.
1165 toolset=$ipodbitmaptools
1166 # architecture, manufacturer and model for the target-tree build
1167 t_cpu="arm"
1168 t_manufacturer="ipod"
1169 t_model="4g"
1172 25|ipodmini)
1173 target_id=18
1174 modelname="ipodmini"
1175 target="-DIPOD_MINI"
1176 memory=32 # always
1177 arm7tdmicc
1178 tool="$rootdir/tools/scramble -add=mini"
1179 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1180 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1181 output="rockbox.ipod"
1182 appextra="recorder:gui"
1183 plugins="yes"
1184 swcodec="yes"
1185 bootoutput="bootloader-$modelname.ipod"
1186 # toolset is the tools within the tools directory that we build for
1187 # this particular target.
1188 toolset=$ipodbitmaptools
1189 # architecture, manufacturer and model for the target-tree build
1190 t_cpu="arm"
1191 t_manufacturer="ipod"
1192 t_model="mini"
1195 26|ipodmini2g)
1196 target_id=21
1197 modelname="ipodmini2g"
1198 target="-DIPOD_MINI2G"
1199 memory=32 # always
1200 arm7tdmicc
1201 tool="$rootdir/tools/scramble -add=mn2g"
1202 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1203 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1204 output="rockbox.ipod"
1205 appextra="recorder:gui"
1206 plugins="yes"
1207 swcodec="yes"
1208 bootoutput="bootloader-$modelname.ipod"
1209 # toolset is the tools within the tools directory that we build for
1210 # this particular target.
1211 toolset=$ipodbitmaptools
1212 # architecture, manufacturer and model for the target-tree build
1213 t_cpu="arm"
1214 t_manufacturer="ipod"
1215 t_model="mini2g"
1218 27|ipod1g2g)
1219 target_id=29
1220 modelname="ipod1g2g"
1221 target="-DIPOD_1G2G"
1222 memory=32 # always
1223 arm7tdmicc
1224 tool="$rootdir/tools/scramble -add=1g2g"
1225 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1226 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1227 output="rockbox.ipod"
1228 appextra="recorder:gui"
1229 plugins="yes"
1230 swcodec="yes"
1231 bootoutput="bootloader-$modelname.ipod"
1232 # toolset is the tools within the tools directory that we build for
1233 # this particular target.
1234 toolset=$ipodbitmaptools
1235 # architecture, manufacturer and model for the target-tree build
1236 t_cpu="arm"
1237 t_manufacturer="ipod"
1238 t_model="1g2g"
1241 30|x5)
1242 target_id=12
1243 modelname="x5"
1244 target="-DIAUDIO_X5"
1245 memory=16 # always
1246 coldfirecc
1247 tool="$rootdir/tools/scramble -add=iax5"
1248 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1249 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1250 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1251 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1252 output="rockbox.iaudio"
1253 appextra="recorder:gui"
1254 plugins="yes"
1255 swcodec="yes"
1256 # toolset is the tools within the tools directory that we build for
1257 # this particular target.
1258 toolset="$iaudiobitmaptools"
1259 # architecture, manufacturer and model for the target-tree build
1260 t_cpu="coldfire"
1261 t_manufacturer="iaudio"
1262 t_model="x5"
1265 31|m5)
1266 target_id=28
1267 modelname="m5"
1268 target="-DIAUDIO_M5"
1269 memory=16 # always
1270 coldfirecc
1271 tool="$rootdir/tools/scramble -add=iam5"
1272 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1273 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1274 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1275 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1276 output="rockbox.iaudio"
1277 appextra="recorder:gui"
1278 plugins="yes"
1279 swcodec="yes"
1280 # toolset is the tools within the tools directory that we build for
1281 # this particular target.
1282 toolset="$iaudiobitmaptools"
1283 # architecture, manufacturer and model for the target-tree build
1284 t_cpu="coldfire"
1285 t_manufacturer="iaudio"
1286 t_model="m5"
1289 32|iaudio7)
1290 target_id=32
1291 modelname="iaudio7"
1292 target="-DIAUDIO_7"
1293 memory=16 # always
1294 arm946cc
1295 tool="$rootdir/tools/scramble -add=i7"
1296 boottool="$rootdir/tools/scramble -tcc=crc"
1297 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1298 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1299 output="rockbox.iaudio"
1300 appextra="recorder:gui"
1301 plugins="yes"
1302 swcodec="yes"
1303 bootoutput="I7_FW.BIN"
1304 # toolset is the tools within the tools directory that we build for
1305 # this particular target.
1306 toolset="$tccbitmaptools"
1307 # architecture, manufacturer and model for the target-tree build
1308 t_cpu="arm"
1309 t_manufacturer="tcc77x"
1310 t_model="iaudio7"
1313 33|cowond2)
1314 target_id=34
1315 modelname="cowond2"
1316 target="-DCOWON_D2"
1317 memory=32
1318 arm926ejscc
1319 tool="$rootdir/tools/scramble -add=d2"
1320 boottool="$rootdir/tools/scramble -tcc=crc"
1321 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1322 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1323 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1324 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1325 output="rockbox.iaudio"
1326 appextra="recorder:gui"
1327 plugins="yes"
1328 swcodec="yes"
1329 toolset="$tccbitmaptools"
1330 # architecture, manufacturer and model for the target-tree build
1331 t_cpu="arm"
1332 t_manufacturer="tcc780x"
1333 t_model="cowond2"
1336 34|m3)
1337 target_id=37
1338 modelname="m3"
1339 target="-DIAUDIO_M3"
1340 memory=16 # always
1341 coldfirecc
1342 tool="$rootdir/tools/scramble -add=iam3"
1343 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1344 bmp2rb_native="$rootdir/tools/bmp2rb -f 7"
1345 output="rockbox.iaudio"
1346 appextra="recorder:gui"
1347 plugins="yes"
1348 swcodec="yes"
1349 # toolset is the tools within the tools directory that we build for
1350 # this particular target.
1351 toolset="$iaudiobitmaptools"
1352 # architecture, manufacturer and model for the target-tree build
1353 t_cpu="coldfire"
1354 t_manufacturer="iaudio"
1355 t_model="m3"
1358 40|gigabeatf)
1359 target_id=20
1360 modelname="gigabeatf"
1361 target="-DGIGABEAT_F"
1362 memory=32 # always
1363 arm9tdmicc
1364 tool="$rootdir/tools/scramble -add=giga"
1365 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1366 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1367 output="rockbox.gigabeat"
1368 appextra="recorder:gui"
1369 plugins="yes"
1370 swcodec="yes"
1371 toolset=$gigabeatbitmaptools
1372 boottool="$rootdir/tools/scramble -gigabeat"
1373 bootoutput="FWIMG01.DAT"
1374 # architecture, manufacturer and model for the target-tree build
1375 t_cpu="arm"
1376 t_manufacturer="s3c2440"
1377 t_model="gigabeat-fx"
1380 41|gigabeats)
1381 target_id=26
1382 modelname="gigabeats"
1383 target="-DGIGABEAT_S"
1384 memory=64
1385 arm1136jfscc
1386 tool="$rootdir/tools/scramble -add=gigs"
1387 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1388 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1389 output="rockbox.gigabeat"
1390 appextra="recorder:gui"
1391 plugins="yes"
1392 swcodec="yes"
1393 toolset="$gigabeatbitmaptools mknkboot"
1394 boottool="$rootdir/tools/scramble -gigabeats"
1395 bootoutput="nk.bin"
1396 # architecture, manufacturer and model for the target-tree build
1397 t_cpu="arm"
1398 t_manufacturer="imx31"
1399 t_model="gigabeat-s"
1402 70|mrobe500)
1403 target_id=36
1404 modelname="mrobe500"
1405 target="-DMROBE_500"
1406 memory=64 # always
1407 arm926ejscc
1408 # tool="$rootdir/tools/scramble -add=m500"
1409 tool="cp "
1410 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1411 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1412 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1413 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1414 output="rockbox.mrobe500"
1415 appextra="recorder:gui"
1416 plugins="yes"
1417 swcodec="yes"
1418 toolset=$gigabeatbitmaptools
1419 boottool="cp "
1420 bootoutput="rockbox.mrboot"
1421 # architecture, manufacturer and model for the target-tree build
1422 t_cpu="arm"
1423 t_manufacturer="tms320dm320"
1424 t_model="mrobe-500"
1427 71|mrobe100)
1428 target_id=33
1429 modelname="mrobe100"
1430 target="-DMROBE_100"
1431 memory=32 # always
1432 arm7tdmicc
1433 tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS"
1434 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1435 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1436 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1437 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1438 output="rockbox.mi4"
1439 appextra="recorder:gui"
1440 plugins="yes"
1441 swcodec="yes"
1442 boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL"
1443 bootoutput="pp5020.mi4"
1444 # toolset is the tools within the tools directory that we build for
1445 # this particular target.
1446 toolset="$genericbitmaptools scramble"
1447 # architecture, manufacturer and model for the target-tree build
1448 t_cpu="arm"
1449 t_manufacturer="olympus"
1450 t_model="mrobe-100"
1453 80|logikdax)
1454 target_id=31
1455 modelname="logikdax"
1456 target="-DLOGIK_DAX"
1457 memory=2 # always
1458 arm946cc
1459 tool="$rootdir/tools/scramble -add=ldax"
1460 boottool="$rootdir/tools/scramble -tcc=crc"
1461 bootoutput="player.rom"
1462 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1463 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1464 output="rockbox.logik"
1465 appextra="recorder:gui"
1466 plugins=""
1467 swcodec="yes"
1468 # toolset is the tools within the tools directory that we build for
1469 # this particular target.
1470 toolset=$tccbitmaptools
1471 # architecture, manufacturer and model for the target-tree build
1472 t_cpu="arm"
1473 t_manufacturer="tcc77x"
1474 t_model="logikdax"
1477 90|creativezvm30gb)
1478 target_id=35
1479 modelname="creativezvm30"
1480 target="-DCREATIVE_ZVM"
1481 memory=64
1482 arm926ejscc
1483 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1484 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1485 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1486 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1487 tool="$rootdir/tools/scramble -creative=zvm"
1488 USE_ELF="yes"
1489 output="rockbox.zvm"
1490 appextra="recorder:gui"
1491 plugins=""
1492 swcodec="yes"
1493 toolset=$ipodbitmaptools
1494 boottool="$rootdir/tools/scramble -creative=zvm -no-ciff"
1495 bootoutput="rockbox.zvmboot"
1496 # architecture, manufacturer and model for the target-tree build
1497 t_cpu="arm"
1498 t_manufacturer="tms320dm320"
1499 t_model="creative-zvm"
1502 91|creativezvm60gb)
1503 target_id=40
1504 modelname="creativezvm60"
1505 target="-DCREATIVE_ZVM60GB"
1506 memory=64
1507 arm926ejscc
1508 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1509 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1510 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1511 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1512 tool="$rootdir/tools/scramble -creative=zvm60 -no-ciff"
1513 USE_ELF="yes"
1514 output="rockbox.zvm60"
1515 appextra="recorder:gui"
1516 plugins=""
1517 swcodec="yes"
1518 toolset=$ipodbitmaptools
1519 boottool="$rootdir/tools/scramble -creative=zvm60"
1520 bootoutput="rockbox.zvm60boot"
1521 # architecture, manufacturer and model for the target-tree build
1522 t_cpu="arm"
1523 t_manufacturer="tms320dm320"
1524 t_model="creative-zvm"
1527 92|creativezenvision)
1528 target_id=39
1529 modelname="creativezv"
1530 target="-DCREATIVE_ZV"
1531 memory=64
1532 arm926ejscc
1533 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1534 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1535 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1536 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
1537 tool="$rootdir/tools/scramble -creative=zenvision -no-ciff"
1538 USE_ELF="yes"
1539 output="rockbox.zv"
1540 appextra="recorder:gui"
1541 plugins=""
1542 swcodec="yes"
1543 toolset=$ipodbitmaptools
1544 boottool="$rootdir/tools/scramble -creative=zenvision"
1545 bootoutput="rockbox.zvboot"
1546 # architecture, manufacturer and model for the target-tree build
1547 t_cpu="arm"
1548 t_manufacturer="tms320dm320"
1549 t_model="creative-zvm"
1552 50|e200)
1553 target_id=23
1554 modelname="e200"
1555 target="-DSANSA_E200"
1556 memory=32 # supposedly
1557 arm7tdmicc
1558 tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1559 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1560 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1561 output="rockbox.mi4"
1562 appextra="recorder:gui"
1563 plugins="yes"
1564 swcodec="yes"
1565 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1566 bootoutput="PP5022.mi4"
1567 # toolset is the tools within the tools directory that we build for
1568 # this particular target.
1569 toolset="$genericbitmaptools scramble"
1570 # architecture, manufacturer and model for the target-tree build
1571 t_cpu="arm"
1572 t_manufacturer="sandisk"
1573 t_model="sansa-e200"
1576 51|e200r)
1577 # the e200R model is pretty much identical to the e200, it only has a
1578 # different option to the scramble tool when building a bootloader and
1579 # makes the bootloader output file name in all lower case.
1580 target_id=27
1581 modelname="e200r"
1582 target="-DSANSA_E200"
1583 memory=32 # supposedly
1584 arm7tdmicc
1585 tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1586 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1587 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1588 output="rockbox.mi4"
1589 appextra="recorder:gui"
1590 plugins="yes"
1591 swcodec="yes"
1592 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1593 bootoutput="pp5022.mi4"
1594 # toolset is the tools within the tools directory that we build for
1595 # this particular target.
1596 toolset="$genericbitmaptools scramble"
1597 # architecture, manufacturer and model for the target-tree build
1598 t_cpu="arm"
1599 t_manufacturer="sandisk"
1600 t_model="sansa-e200"
1603 52|c200)
1604 target_id=30
1605 modelname="c200"
1606 target="-DSANSA_C200"
1607 memory=32 # supposedly
1608 arm7tdmicc
1609 tool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBOS"
1610 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1611 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1612 output="rockbox.mi4"
1613 appextra="recorder:gui"
1614 plugins="yes"
1615 swcodec="yes"
1616 boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
1617 bootoutput="firmware.mi4"
1618 # toolset is the tools within the tools directory that we build for
1619 # this particular target.
1620 toolset="$genericbitmaptools scramble"
1621 # architecture, manufacturer and model for the target-tree build
1622 t_cpu="arm"
1623 t_manufacturer="sandisk"
1624 t_model="sansa-c200"
1627 53|m200)
1628 target_id=48
1629 modelname="m200"
1630 target="-DSANSA_M200"
1631 memory=2 # always
1632 arm946cc
1633 tool="$rootdir/tools/scramble -add=m200"
1634 boottool="$rootdir/tools/scramble -tcc=crc"
1635 bootoutput="player.rom"
1636 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1637 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1638 output="rockbox.m200"
1639 appextra="recorder:gui"
1640 plugins=""
1641 swcodec="yes"
1642 # toolset is the tools within the tools directory that we build for
1643 # this particular target.
1644 toolset=$tccbitmaptools
1645 # architecture, manufacturer and model for the target-tree build
1646 t_cpu="arm"
1647 t_manufacturer="tcc77x"
1648 t_model="m200"
1651 54|c100)
1652 target_id=42
1653 modelname="c100"
1654 target="-DSANSA_C100"
1655 memory=32 # unsure, must check
1656 arm946cc
1657 tool="$rootdir/tools/scramble -add=c100"
1658 boottool="$rootdir/tools/scramble -tcc=crc"
1659 bootoutput="player.rom"
1660 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1661 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1662 output="rockbox.c100"
1663 appextra="recorder:gui"
1664 plugins=""
1665 # toolset is the tools within the tools directory that we build for
1666 # this particular target.
1667 toolset=$tccbitmaptools
1668 # architecture, manufacturer and model for the target-tree build
1669 t_cpu="arm"
1670 t_manufacturer="tcc77x"
1671 t_model="c100"
1674 60|tpj1022)
1675 target_id=25
1676 modelname="tpj1022"
1677 target="-DELIO_TPJ1022"
1678 memory=32 # always
1679 arm7tdmicc
1680 tool="$rootdir/tools/scramble -add tpj2"
1681 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1682 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1683 output="rockbox.elio"
1684 appextra="recorder:gui"
1685 plugins="yes"
1686 swcodec="yes"
1687 boottool="$rootdir/tools/scramble -mi4v2"
1688 bootoutput="pp5020.mi4"
1689 # toolset is the tools within the tools directory that we build for
1690 # this particular target.
1691 toolset="$genericbitmaptools scramble"
1692 # architecture, manufacturer and model for the target-tree build
1693 t_cpu="arm"
1694 t_manufacturer="tatung"
1695 t_model="tpj1022"
1698 100|sa9200)
1699 target_id=41
1700 modelname="sa9200"
1701 target="-DPHILIPS_SA9200"
1702 memory=32 # supposedly
1703 arm7tdmicc
1704 tool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBOS"
1705 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1706 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1707 output="rockbox.mi4"
1708 appextra="recorder:gui"
1709 plugins=""
1710 swcodec="yes"
1711 boottool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBBL"
1712 bootoutput="FWImage.ebn"
1713 # toolset is the tools within the tools directory that we build for
1714 # this particular target.
1715 toolset="$genericbitmaptools scramble"
1716 # architecture, manufacturer and model for the target-tree build
1717 t_cpu="arm"
1718 t_manufacturer="philips"
1719 t_model="sa9200"
1722 101|hdd1630)
1723 target_id=43
1724 modelname="hdd1630"
1725 target="-DPHILIPS_HDD1630"
1726 memory=32 # supposedly
1727 arm7tdmicc
1728 tool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBOS"
1729 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1730 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1731 output="rockbox.mi4"
1732 appextra="recorder:gui"
1733 plugins=""
1734 swcodec="yes"
1735 boottool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBBL"
1736 bootoutput="FWImage.ebn"
1737 # toolset is the tools within the tools directory that we build for
1738 # this particular target.
1739 toolset="$genericbitmaptools scramble"
1740 # architecture, manufacturer and model for the target-tree build
1741 t_cpu="arm"
1742 t_manufacturer="philips"
1743 t_model="hdd1630"
1746 110|meizum6sl)
1747 target_id=49
1748 modelname="meizum6sl"
1749 target="-DMEIZU_M6SL"
1750 memory=16 # always
1751 arm940tbecc
1752 tool="cp"
1753 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1754 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1755 output="rockbox.meizu"
1756 appextra="recorder:gui"
1757 plugins="no" #FIXME
1758 swcodec="yes"
1759 toolset=$genericbitmaptools
1760 boottool="cp"
1761 bootoutput="rockboot.ebn"
1762 # architecture, manufacturer and model for the target-tree build
1763 t_cpu="arm"
1764 t_manufacturer="s5l8700"
1765 t_model="meizu-m6sl"
1768 111|meizum6sp)
1769 target_id=46
1770 modelname="meizum6sp"
1771 target="-DMEIZU_M6SP"
1772 memory=16 # always
1773 arm940tbecc
1774 tool="cp"
1775 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1776 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1777 output="rockbox.meizu"
1778 appextra="recorder:gui"
1779 plugins="no" #FIXME
1780 swcodec="yes"
1781 toolset=$genericbitmaptools
1782 boottool="cp"
1783 bootoutput="rockboot.ebn"
1784 # architecture, manufacturer and model for the target-tree build
1785 t_cpu="arm"
1786 t_manufacturer="s5l8700"
1787 t_model="meizu-m6sp"
1790 112|meizum3)
1791 target_id=47
1792 modelname="meizum3"
1793 target="-DMEIZU_M3"
1794 memory=16 # always
1795 arm940tbecc
1796 tool="cp"
1797 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1798 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1799 output="rockbox.meizu"
1800 appextra="recorder:gui"
1801 plugins="no" #FIXME
1802 swcodec="yes"
1803 toolset=$genericbitmaptools
1804 boottool="cp"
1805 bootoutput="rockboot.ebn"
1806 # architecture, manufacturer and model for the target-tree build
1807 t_cpu="arm"
1808 t_manufacturer="s5l8700"
1809 t_model="meizu-m3"
1812 120|ondavx747)
1813 target_id=44
1814 modelname="ondavx747"
1815 target="-DONDA_VX747"
1816 memory=16 #FIXME
1817 mipselcc
1818 tool="cp"
1819 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1820 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1821 output="rockbox.vx747"
1822 appextra="recorder:gui"
1823 plugins="no" #FIXME
1824 swcodec="yes"
1825 toolset=$genericbitmaptools
1826 boottool="cp"
1827 bootoutput="rockboot.vx747"
1828 # architecture, manufacturer and model for the target-tree build
1829 t_cpu="mips"
1830 t_manufacturer="ingenic_jz47xx"
1831 t_model="onda_vx747"
1834 121|ondavx767)
1835 target_id=45
1836 modelname="ondavx767"
1837 target="-DONDA_VX767"
1838 memory=16 #FIXME
1839 mipselcc
1840 tool="cp"
1841 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1842 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1843 output="rockbox.vx767"
1844 appextra="recorder:gui"
1845 plugins="no" #FIXME
1846 swcodec="yes"
1847 toolset=$genericbitmaptools
1848 boottool="cp"
1849 bootoutput="rockboot.vx767"
1850 # architecture, manufacturer and model for the target-tree build
1851 t_cpu="mips"
1852 t_manufacturer="ingenic_jz47xx"
1853 t_model="onda_vx767"
1856 echo "Please select a supported target platform!"
1857 exit
1860 esac
1862 echo "Platform set to $modelname"
1865 #remove start
1866 ############################################################################
1867 # Amount of memory, for those that can differ. They have $memory unset at
1868 # this point.
1871 if [ -z "$memory" ]; then
1872 case $target_id in
1874 echo "Enter size of your RAM (in MB): (Defaults to 32)"
1875 if [ "1" != `parse_args --ram` ]; then
1876 size=`parse_args --ram`;
1877 else
1878 size=`input`;
1880 case $size in
1881 60|64)
1882 memory="64"
1885 memory="32"
1887 esac
1890 echo "Enter size of your RAM (in MB): (Defaults to 2)"
1891 if [ "1" != `parse_args --ram` ]; then
1892 size=`parse_args --ram`;
1893 else
1894 size=`input`;
1896 case $size in
1898 memory="8"
1901 memory="2"
1903 esac
1905 esac
1906 echo "Memory size selected: $memory MB"
1907 echo ""
1909 #remove end
1911 ##################################################################
1912 # Figure out build "type"
1915 # the ifp7x0 is the only platform that supports building a gdb stub like
1916 # this
1917 case $modelname in
1918 ifp7xx)
1919 gdbstub="(G)DB stub, "
1921 e200r|e200)
1922 gdbstub="(I)installer, "
1926 esac
1927 if [ "1" != `parse_args --type` ]; then
1928 option=`parse_args --type`;
1929 else
1930 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, $gdbstub(M)anual: (Defaults to N)"
1931 option=`input`;
1934 case $option in
1935 [Ii])
1936 appsdir='\$(ROOTDIR)/bootloader'
1937 apps="bootloader"
1938 extradefines="-DBOOTLOADER -DE200R_INSTALLER -ffunction-sections -fdata-sections"
1939 bootloader="1"
1940 echo "e200R-installer build selected"
1942 [Bb])
1943 if test $t_manufacturer = "archos"; then
1944 # Archos SH-based players do this somewhat differently for
1945 # some reason
1946 appsdir='\$(ROOTDIR)/flash/bootbox'
1947 apps="bootbox"
1948 else
1949 appsdir='\$(ROOTDIR)/bootloader'
1950 apps="bootloader"
1951 flash=""
1952 if test -n "$boottool"; then
1953 tool="$boottool"
1955 if test -n "$bootoutput"; then
1956 output=$bootoutput
1959 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
1960 bootloader="1"
1961 echo "Bootloader build selected"
1963 [Ss])
1964 debug="-DDEBUG"
1965 simulator="yes"
1966 extradefines="-DSIMULATOR"
1967 echo "Simulator build selected"
1969 [Aa])
1970 echo "Advanced build selected"
1971 whichadvanced
1973 [Gg])
1974 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
1975 appsdir='\$(ROOTDIR)/gdb'
1976 apps="stub"
1977 case $modelname in
1978 ifp7xx)
1979 output="stub.wma"
1983 esac
1984 echo "GDB stub build selected"
1986 [Mm])
1987 toolset='';
1988 apps="manual"
1989 echo "Manual build selected"
1992 if [ "$modelname" = "e200r" ]; then
1993 echo "Do not use the e200R target for regular builds. Use e200 instead."
1994 exit
1996 debug=""
1997 echo "Normal build selected"
2000 esac
2001 # to be able running "make manual" from non-manual configuration
2002 case $modelname in
2003 fmrecorder)
2004 manualdev="recorderv2fm"
2006 recorderv2)
2007 manualdev="recorderv2fm"
2009 h1??)
2010 manualdev="h1xx"
2012 ipodmini2g)
2013 manualdev="ipodmini"
2016 manualdev=$modelname
2018 esac
2020 if [ -z "$debug" ]; then
2021 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
2024 echo "Using source code root directory: $rootdir"
2026 # this was once possible to change at build-time, but no more:
2027 language="english"
2029 uname=`uname`
2031 if [ "yes" = "$simulator" ]; then
2032 # setup compiler and things for simulator
2033 simcc
2035 if [ -d "archos" ]; then
2036 echo "sub directory archos already present"
2037 else
2038 mkdir archos
2039 echo "created an archos subdirectory for simulating the hard disk"
2043 # Now, figure out version number of the (gcc) compiler we are about to use
2044 gccver=`$CC -dumpversion`;
2046 # figure out the binutil version too and display it, mostly for the build
2047 # system etc to be able to see it easier
2048 ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
2050 if [ -z "$gccver" ]; then
2051 echo "WARNING: The compiler you must use ($CC) is not in your path!"
2052 echo "WARNING: this may cause your build to fail since we cannot do the"
2053 echo "WARNING: checks we want now."
2054 else
2056 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
2057 # DEPEND on it
2059 num1=`echo $gccver | cut -d . -f1`
2060 num2=`echo $gccver | cut -d . -f2`
2061 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
2063 # This makes:
2064 # 3.3.X => 303
2065 # 3.4.X => 304
2066 # 2.95.3 => 295
2068 echo "Using $CC $gccver ($gccnum)"
2070 if test "$gccnum" -ge "400"; then
2071 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
2072 # so we ignore that warnings for now
2073 # -Wno-pointer-sign
2074 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
2077 if test "$gccnum" -ge "401"; then
2078 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
2079 # will break strict-aliasing rules"
2081 GCCOPTS="$GCCOPTS -fno-strict-aliasing"
2084 if test "$gccnum" -ge "402"; then
2085 # disable warning about "warning: initialized field overwritten" as gcc 4.2
2086 # and later would throw it for several valid cases
2087 GCCOPTS="$GCCOPTS -Wno-override-init"
2090 case $prefix in
2092 # simulator
2094 i586-mingw32msvc-)
2095 # cross-compile for win32
2098 # Verify that the cross-compiler is of a recommended version!
2099 if test "$gccver" != "$gccchoice"; then
2100 echo "WARNING: Your cross-compiler $CC $gccver is not of the recommended"
2101 echo "WARNING: version $gccchoice!"
2102 echo "WARNING: This may cause your build to fail since it may be a version"
2103 echo "WARNING: that isn't functional or known to not be the best choice."
2104 echo "WARNING: If you suffer from build problems, you know that this is"
2105 echo "WARNING: a likely source for them..."
2108 esac
2113 echo "Using $LD $ldver"
2115 # check the compiler for SH platforms
2116 if test "$CC" = "sh-elf-gcc"; then
2117 if test "$gccnum" -lt "400"; then
2118 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
2119 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2120 else
2121 # figure out patch status
2122 gccpatch=`$CC --version`;
2124 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
2125 echo "gcc $gccver is rockbox patched"
2126 # then convert -O to -Os to get smaller binaries!
2127 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2128 else
2129 echo "WARNING: You use an unpatched gcc compiler: $gccver"
2130 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
2135 if test "$CC" = "m68k-elf-gcc"; then
2136 # convert -O to -Os to get smaller binaries!
2137 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2140 if [ "1" != `parse_args --ccache` ]; then
2141 echo "Enable ccache for building"
2142 ccache="ccache"
2143 else
2144 if [ "1" = `parse_args --no-ccache` ]; then
2145 ccache=`findtool ccache`
2146 if test -n "$ccache"; then
2147 echo "Found and uses ccache ($ccache)"
2152 if test -n "$ccache"; then
2153 CC="$ccache $CC"
2156 if test "X$endian" = "Xbig"; then
2157 defendian="ROCKBOX_BIG_ENDIAN"
2158 else
2159 defendian="ROCKBOX_LITTLE_ENDIAN"
2162 sed > autoconf.h \
2163 -e "s,@ENDIAN@,${defendian},g" \
2164 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
2165 -e "s,@config_rtc@,$config_rtc,g" \
2166 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
2167 <<EOF
2168 /* This header was made by configure */
2169 #ifndef __BUILD_AUTOCONF_H
2170 #define __BUILD_AUTOCONF_H
2172 /* Define endianess for the target or simulator platform */
2173 #define @ENDIAN@ 1
2175 /* Define this if you build rockbox to support the logf logging and display */
2176 #undef ROCKBOX_HAS_LOGF
2178 /* optional defines for RTC mod for h1x0 */
2179 @config_rtc@
2180 @have_rtc_alarm@
2182 #endif /* __BUILD_AUTOCONF_H */
2185 if test -n "$t_cpu"; then
2186 TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
2187 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
2188 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
2189 GCCOPTS="$GCCOPTS"
2192 if test "$simulator" = "yes"; then
2193 # add simul make stuff on the #SIMUL# line
2194 simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
2195 simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
2196 else
2197 # delete the lines that match
2198 simmagic1='/@SIMUL1@/D'
2199 simmagic2='/@SIMUL2@/D'
2202 if test "$swcodec" = "yes"; then
2203 voicetoolset="rbspeexenc voicefont wavtrim"
2204 else
2205 voicetoolset="voicefont wavtrim"
2208 if test "$apps" = "apps"; then
2209 # only when we build "real" apps we build the .lng files
2210 buildlangs="langs"
2213 sed > Makefile \
2214 -e "s,@ROOTDIR@,${rootdir},g" \
2215 -e "s,@DEBUG@,${debug},g" \
2216 -e "s,@MEMORY@,${memory},g" \
2217 -e "s,@TARGET_ID@,${target_id},g" \
2218 -e "s,@TARGET@,${target},g" \
2219 -e "s,@CPU@,${t_cpu},g" \
2220 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
2221 -e "s,@MODELNAME@,${modelname},g" \
2222 -e "s,@LANGUAGE@,${language},g" \
2223 -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
2224 -e "s,@PWD@,${pwd},g" \
2225 -e "s,@CC@,${CC},g" \
2226 -e "s,@LD@,${LD},g" \
2227 -e "s,@AR@,${AR},g" \
2228 -e "s,@AS@,${AS},g" \
2229 -e "s,@OC@,${OC},g" \
2230 -e "s,@WINDRES@,${WINDRES},g" \
2231 -e "s,@DLLTOOL@,${DLLTOOL},g" \
2232 -e "s,@DLLWRAP@,${DLLWRAP},g" \
2233 -e "s,@RANLIB@,${RANLIB},g" \
2234 -e "s,@TOOL@,${tool},g" \
2235 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
2236 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
2237 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
2238 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
2239 -e "s,@OUTPUT@,${output},g" \
2240 -e "s,@APPEXTRA@,${appextra},g" \
2241 -e "s,@ARCHOSROM@,${archosrom},g" \
2242 -e "s,@FLASHFILE@,${flash},g" \
2243 -e "s,@PLUGINS@,${plugins},g" \
2244 -e "s,@CODECS@,${swcodec},g" \
2245 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
2246 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
2247 -e "s,@GCCOPTS@,${GCCOPTS},g" \
2248 -e "s,@TARGET_INC@,${TARGET_INC},g" \
2249 -e "s!@LDOPTS@!${LDOPTS}!g" \
2250 -e "s,@LOADADDRESS@,${loadaddress},g" \
2251 -e "s,@EXTRADEF@,${extradefines},g" \
2252 -e "s,@APPSDIR@,${appsdir},g" \
2253 -e "s,@FIRMDIR@,${firmdir},g" \
2254 -e "s,@TOOLSDIR@,${toolsdir},g" \
2255 -e "s,@APPS@,${apps},g" \
2256 -e "s,@SIMVER@,${simver},g" \
2257 -e "s,@GCCVER@,${gccver},g" \
2258 -e "s,@GCCNUM@,${gccnum},g" \
2259 -e "s,@UNAME@,${uname},g" \
2260 -e "s,@ENDIAN@,${defendian},g" \
2261 -e "s,@TOOLSET@,${toolset},g" \
2262 -e "${simmagic1}" \
2263 -e "${simmagic2}" \
2264 -e "s,@MANUALDEV@,${manualdev},g" \
2265 -e "s,@ENCODER@,${ENC_CMD},g" \
2266 -e "s,@ENC_OPTS@,${ENC_OPTS},g" \
2267 -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
2268 -e "s,@TTS_OPTS@,${TTS_OPTS},g" \
2269 -e "s,@VOICETOOLSET@,${voicetoolset},g" \
2270 -e "s,@LANGS@,${buildlangs},g" \
2271 -e "s,@USE_ELF@,${USE_ELF},g" \
2272 <<EOF
2273 ## Automatically generated. http://www.rockbox.org/
2275 ifndef V
2276 SILENT=@
2277 else
2278 VERBOSEOPT=-v
2279 endif
2281 # old 'make' versions don't have the built-in 'info' function
2282 info=old\$(shell echo >&2 "Consider upgrading to GNU make 3.81+ for optimum build performance.")
2283 ifeq (\$(call info),old)
2284 export info=echo "\$\$(1)";
2285 endif
2287 export ROOTDIR=@ROOTDIR@
2288 export FIRMDIR=@FIRMDIR@
2289 export APPSDIR=@APPSDIR@
2290 export TOOLSDIR=@TOOLSDIR@
2291 export DOCSDIR=\$(ROOTDIR)/docs
2292 export MANUALDIR=\${ROOTDIR}/manual
2293 export DEBUG=@DEBUG@
2294 export MODELNAME=@MODELNAME@
2295 export ARCHOSROM=@ARCHOSROM@
2296 export FLASHFILE=@FLASHFILE@
2297 export TARGET_ID=@TARGET_ID@
2298 export TARGET=@TARGET@
2299 export CPU=@CPU@
2300 export MANUFACTURER=@MANUFACTURER@
2301 export OBJDIR=@PWD@
2302 export BUILDDIR=@PWD@
2303 export LANGUAGE=@LANGUAGE@
2304 export VOICELANGUAGE=@VOICELANGUAGE@
2305 export MEMORYSIZE=@MEMORY@
2306 export VERSION=\$(shell \$(ROOTDIR)/tools/svnversion.sh \$(ROOTDIR))
2307 export BUILDDATE=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
2308 export MKFIRMWARE=@TOOL@
2309 export BMP2RB_MONO=@BMP2RB_MONO@
2310 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
2311 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
2312 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
2313 export BINARY=@OUTPUT@
2314 export APPEXTRA=@APPEXTRA@
2315 export ENABLEDPLUGINS=@PLUGINS@
2316 export SOFTWARECODECS=@CODECS@
2317 export EXTRA_DEFINES=@EXTRADEF@
2318 export HOSTCC=gcc
2319 export HOSTAR=ar
2320 export CC=@CC@
2321 export LD=@LD@
2322 export AR=@AR@
2323 export AS=@AS@
2324 export OC=@OC@
2325 export WINDRES=@WINDRES@
2326 export DLLTOOL=@DLLTOOL@
2327 export DLLWRAP=@DLLWRAP@
2328 export RANLIB=@RANLIB@
2329 export PROFILE_OPTS=@PROFILE_OPTS@
2330 export SIMVER=@SIMVER@
2331 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
2332 export GCCOPTS=@GCCOPTS@
2333 export TARGET_INC=@TARGET_INC@
2334 export LOADADDRESS=@LOADADDRESS@
2335 export SHARED_FLAG=@SHARED_FLAG@
2336 export LDOPTS=@LDOPTS@
2337 export GCCVER=@GCCVER@
2338 export GCCNUM=@GCCNUM@
2339 export UNAME=@UNAME@
2340 export MANUALDEV=@MANUALDEV@
2341 export TTS_OPTS=@TTS_OPTS@
2342 export TTS_ENGINE=@TTS_ENGINE@
2343 export ENC_OPTS=@ENC_OPTS@
2344 export ENCODER=@ENCODER@
2345 export USE_ELF=@USE_ELF@
2347 # Do not print "Entering directory ..."
2348 MAKEFLAGS += --no-print-directory
2350 .PHONY: all clean tags zip tools manual bin build info langs
2352 all: info
2354 info: build
2355 \$(SILENT)\$(TOOLSDIR)/mkinfo.pl \$(BUILDDIR)/rockbox-info.txt
2357 build: tools @LANGS@
2358 @SIMUL1@
2359 @SIMUL2@
2360 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
2361 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@
2363 bin: tools @LANGS@
2364 @SIMUL1@
2365 @SIMUL2@
2366 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
2367 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ \$(BUILDDIR)/\$(BINARY)
2369 rocks: tools
2370 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ rocks
2372 veryclean: clean toolsclean
2374 toolsclean:
2375 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) clean
2377 clean:
2378 \$(SILENT)echo Cleaning build directory
2379 \$(SILENT)rm -rf rockbox.zip rockbox.7z rockbox.tar rockbox.tar.gz \
2380 rockbox.tar.bz2 TAGS @APPS@ firmware comsim sim lang.[ch] \
2381 manual *.pdf *.a credits.raw @OUTPUT@ bitmaps pluginbitmaps \
2382 @ARCHOSROM@ @FLASHFILE@ UI256.bmp rockbox-full.zip \
2383 html txt rockbox-manual*.zip sysfont.h rockbox-info.txt \
2384 voicefontids *.wav *.mp3 *.voice max_language_size.h
2386 tools:
2387 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) AR=\$(HOSTAR) @TOOLSET@
2389 voicetools:
2390 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) AR=\$(HOSTAR) @VOICETOOLSET@
2392 tags:
2393 \$(SILENT)rm -f TAGS
2394 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) tags
2395 \$(SILENT)\$(MAKE) -C \$(APPSDIR) tags
2396 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins tags
2397 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins/lib tags
2399 fontzip:
2400 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\" -r "\$(ROOTDIR)" -f 1 -o rockbox-fonts.zip \$(TARGET) \$(BINARY)
2402 zip:
2403 \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done ; \\
2404 \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\$\$feat\" -i \"\$(TARGET_ID)\" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
2406 mapzip:
2407 \$(SILENT)find . -name "*.map" | xargs zip rockbox-maps.zip
2409 fullzip:
2410 \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\
2411 \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\$\$feat\" -i \"\$(TARGET_ID)\" -r "\$(ROOTDIR)" -f 2 -o rockbox-full.zip \$(TARGET) \$(BINARY)
2413 7zip:
2414 \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\
2415 \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\$\$feat\" -i \"\$(TARGET_ID)\" -o "rockbox.7z" -z "7za a -mx=9" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
2417 tar:
2418 \$(SILENT)rm -f rockbox.tar
2419 \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\
2420 \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\$\$feat\" -i \"\$(TARGET_ID)\" -o "rockbox.tar" -z "tar -cf" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
2422 bzip2: tar
2423 \$(SILENT)bzip2 -f9 rockbox.tar
2425 gzip: tar
2426 \$(SILENT)gzip -f9 rockbox.tar
2428 langs: features
2429 \$(SILENT)mkdir -p \$(BUILDDIR)/apps/lang
2430 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/lang OBJDIR=\$(BUILDDIR)/apps/lang
2432 manual: manual-pdf
2433 manual-pdf:
2434 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-pdf
2435 manual-html:
2436 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-html
2437 manual-zhtml: manual-zip
2438 manual-txt:
2439 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-txt
2440 manual-ztxt:
2441 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-txt-zip
2442 manual-zip:
2443 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-zip
2445 features: tools
2446 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ features
2448 help:
2449 @echo "A few helpful make targets"
2450 @echo ""
2451 @echo "all - builds a full Rockbox (default), including tools"
2452 @echo "bin - builds only the Rockbox.<target name> file"
2453 @echo "rocks - builds only plugins and codecs"
2454 @echo "clean - cleans a build directory (not tools)"
2455 @echo "veryclean - cleans the build and tools directories"
2456 @echo "manual - builds a manual"
2457 @echo "manual-html - HTML manual"
2458 @echo "manual-zip - HTML manual (zipped)"
2459 @echo "manual-txt - txt manual"
2460 @echo "fullzip - creates a rockbox.zip of your build with fonts"
2461 @echo "zip - creates a rockbox.zip of your build (no fonts)"
2462 @echo "gzip - creates a rockbox.tar.gz of your build (no fonts)"
2463 @echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)"
2464 @echo "7zip - creates a rockbox.7z of your build (no fonts)"
2465 @echo "fontzip - creates rockbox-fonts.zip"
2466 @echo "mapzip - creates rockbox-maps.zip with all .map files"
2467 @echo "tools - builds the tools only"
2468 @echo "voicetools - builds the voice tools only"
2469 @echo "install - installs your build (for simulator builds only)"
2473 if [ "yes" = "$simulator" ]; then
2475 cat >> Makefile <<EOF
2477 install:
2478 @echo "installing a full setup in your archos dir"
2479 @(\$(MAKE) fullzip && cd archos && unzip -oq ../rockbox-full.zip)
2484 if [ "yes" = "$voice" ]; then
2486 cat >> Makefile <<EOF
2488 voice: voicetools features
2489 \$(SILENT)for f in \`cat \$(BUILDDIR)/${apps}/features\`; do feat="\$\$feat:\$\$f" ; done ; \\
2490 for lang in \`echo \$(VOICELANGUAGE) |sed "s/,/ /g"\`; do \$(TOOLSDIR)/voice.pl -V -l=\$\$lang -t=\$(MODELNAME)\$\$feat -i=\$(TARGET_ID) -e="\$(ENCODER)" -E="\$(ENC_OPTS)" -s=\$(TTS_ENGINE) -S="\$(TTS_OPTS)"; done \\
2495 echo "Created Makefile"