The M5 is greyscale, not color.
[Rockbox.git] / tools / configure
blob63e5512c01172d6df4c0192eb6d20d14a6e9b8d2
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 LDOPTS="-lgdi32 -luser32 -mwindows"
46 # add cross-compiler option(s)
47 GCCOPTS="$GCCOPTS -mno-cygwin"
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
70 simcc () {
72 # default tool setup for native building
73 prefixtools ""
75 simver=sdl
76 GCCOPTS='-W -Wall -g -fno-builtin'
78 output="rockboxui" # use this as default output binary name
80 # generic sdl-config checker
81 sdl=`findtool sdl-config`
83 if [ -z "$sdl" ]; then
84 echo "configure didn't find sdl-config, which indicates that you"
85 echo "don't have SDL (properly) installed. Please correct and"
86 echo "re-run configure!"
87 exit
90 # default share option, override below if needed
91 SHARED_FLAG="-shared"
93 case $uname in
94 CYGWIN*)
95 echo "Cygwin host detected"
97 # sdl version
98 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
99 LDOPTS="`sdl-config --libs` -mconsole"
101 output="rockboxui.exe" # use this as output binary name
104 Linux)
105 echo "Linux host detected"
106 GCCOPTS="$GCCOPTS"
107 if [ "0" != `sdl-config --libs |grep -c mwindows` ]; then
108 # Enable crosscompiling if sdl-config is from Windows SDL
109 crosswincc
111 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
112 LDOPTS="`sdl-config --libs`"
115 FreeBSD)
116 echo "FreeBSD host detected"
117 # sdl version
118 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
119 LDOPTS="`sdl-config --libs`"
122 Darwin)
123 echo "Darwin host detected"
124 # sdl version
125 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
126 LDOPTS="`sdl-config --libs`"
127 SHARED_FLAG="-dynamiclib -Wl\,-single_module"
131 echo "Unsupported system: $uname, fix configure and retry"
132 exit
134 esac
136 if [ "`uname -m`" = "x86_64" ]; then
137 GCCOPTS="$GCCOPTS -fPIC" # needed to make shared objects link
140 GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
142 if test "X$crosscompile" != "Xyes"; then
143 id=$$
144 cat >/tmp/conftest-$id.c <<EOF
145 #include <stdio.h>
146 int main(int argc, char **argv)
148 int var=0;
149 char *varp = (char *)&var;
150 *varp=1;
152 printf("%d\n", var);
153 return 0;
157 $CC -o /tmp/conftest-$id /tmp/conftest-$id.c 2>/dev/null
159 if test `/tmp/conftest-$id 2>/dev/null` -gt "1"; then
160 # big endian
161 endian="big"
162 else
163 # little endian
164 endian="little"
166 echo "Simulator environment deemed $endian endian"
168 # use wildcard here to make it work even if it was named *.exe like
169 # on cygwin
170 rm -f /tmp/conftest-$id*
174 shcc () {
175 prefixtools sh-elf-
176 GCCOPTS="$CCOPTS -m1"
177 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
178 endian="big"
181 calmrisccc () {
182 prefixtools calmrisc16-unknown-elf-
183 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
184 GCCOPTIMIZE="-fomit-frame-pointer"
185 endian="big"
188 coldfirecc () {
189 prefixtools m68k-elf-
190 GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
191 GCCOPTIMIZE="-fomit-frame-pointer"
192 endian="big"
195 arm7tdmicc () {
196 prefixtools arm-elf-
197 GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
198 if test "X$1" != "Xshort"; then
199 GCCOPTS="$GCCOPTS -mlong-calls"
201 GCCOPTIMIZE="-fomit-frame-pointer"
202 endian="little"
205 arm9tdmicc () {
206 prefixtools arm-elf-
207 GCCOPTS="$CCOPTS -mcpu=arm9tdmi -mlong-calls"
208 GCCOPTIMIZE="-fomit-frame-pointer"
209 endian="little"
212 whichadvanced () {
213 ##################################################################
214 # Prompt for specific developer options
216 echo ""
217 echo "Enter your developer options (press enter when done)"
218 echo -n "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice"
219 if [ "$memory" = "2" ]; then
220 echo -n ", (8)MB MOD"
222 if [ "$archos" = "h120" ]; then
223 echo -n ", (R)TC MOD"
225 echo ""
227 cont=1
229 while [ $cont = "1" ]; do
231 option=`input`;
233 case $option in
234 [Dd])
235 if [ "yes" = "$profile" ]; then
236 echo "Debug is incompatible with profiling"
237 else
238 echo "define DEBUG"
239 use_debug="yes"
242 [Ll])
243 echo "logf() support enabled"
244 logf="yes"
246 [Ss])
247 echo "Simulator build enabled"
248 simulator="yes"
250 [Pp])
251 if [ "yes" = "$use_debug" ]; then
252 echo "Profiling is incompatible with debug"
253 else
254 echo "Profiling support is enabled"
255 profile="yes"
258 [Vv])
259 echo "Voice build selected"
260 voice="yes"
263 if [ "$memory" = "2" ]; then
264 memory="8"
265 echo "Memory size selected: 8MB"
266 else
267 cont=0
270 [Rr])
271 if [ "$archos" = "h120" ]; then
272 config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231"
273 have_rtc_alarm="#define HAVE_RTC_ALARM"
274 echo "RTC functions enabled (DS1339/DS3231)"
275 else
276 cont=0
280 cont=0
282 esac
283 done
284 echo "done"
286 if [ "yes" = "$voice" ]; then
287 toolset="${toolset} voicefont wavtrim"
289 # Ask about languages to build
290 echo "Select a number for the language to use (default is english)"
291 # The multiple-language feature is currently broken
292 # echo "You may enter a comma-separated list of languages to build"
294 picklang
295 voicelanguage=`whichlang`
297 if [ -z "$voicelanguage" ]; then
298 # pick a default
299 voicelanguage="english"
301 echo "Voice language set to $voicelanguage"
303 # Configure encoder and TTS engine for each language
304 for thislang in `echo $voicelanguage | sed 's/,/ /g'`; do
305 voiceconfig "$thislang"
306 done
308 if [ "yes" = "$use_debug" ]; then
309 debug="-DDEBUG"
310 GCCOPTS="$GCCOPTS -g -DDEBUG"
312 if [ "yes" = "$logf" ]; then
313 use_logf="#define ROCKBOX_HAS_LOGF 1"
315 if [ "yes" = "$simulator" ]; then
316 debug="-DDEBUG"
317 extradefines="$extradefines -DSIMULATOR"
319 if [ "yes" = "$profile" ]; then
320 extradefines="$extradefines -DRB_PROFILE"
321 PROFILE_OPTS="-finstrument-functions"
325 # Configure voice settings
326 voiceconfig () {
327 thislang=$1
328 echo "Building $thislang voice for $archos. Select options"
329 echo ""
331 if [ -f "`which flite`" ]; then
332 FLITE="F(l)ite "
333 FLITE_OPTS=""
334 DEFAULT_TTS="flite"
335 DEFAULT_TTS_OPTS=$FLITE_OPTS
336 DEFAULT_NOISEFLOOR="500"
337 DEFAULT_CHOICE="L"
339 if [ -f "`which espeak`" ]; then
340 ESPEAK="(e)Speak "
341 ESPEAK_OPTS=""
342 DEFAULT_TTS="espeak"
343 DEFAULT_TTS_OPTS=$ESPEAK_OPTS
344 DEFAULT_NOISEFLOOR="500"
345 DEFAULT_CHOICE="e"
347 if [ -f "`which festival`" ]; then
348 FESTIVAL="(F)estival "
349 case "$thislang" in
350 "italiano")
351 FESTIVAL_OPTS="--language italian"
353 "espanol")
354 FESTIVAL_OPTS="--language spanish"
356 "finnish")
357 FESTIVAL_OPTS="--language finnish"
359 "czech")
360 FESTIVAL_OPTS="--language czech"
363 FESTIVAL_OPTS=""
365 esac
366 DEFAULT_TTS="festival"
367 DEFAULT_TTS_OPTS=$FESTIVAL_OPTS
368 DEFAULT_NOISEFLOOR="500"
369 DEFAULT_CHOICE="F"
371 if [ -f "`which swift`" ]; then
372 SWIFT="S(w)ift "
373 SWIFT_OPTS=""
374 DEFAULT_TTS="swift"
375 DEFAULT_TTS_OPTS=$SWIFT_OPTS
376 DEFAULT_NOISEFLOOR="500"
377 DEFAULT_CHOICE="w"
379 # Allow SAPI if Windows is in use
380 if [ -f "`which winver`" ]; then
381 SAPI="(S)API "
382 SAPI_OPTS=""
383 DEFAULT_TTS="sapi"
384 DEFAULT_TTS_OPTS=$SAPI_OPTS
385 DEFAULT_NOISEFLOOR="500"
386 DEFAULT_CHOICE="S"
389 if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ] && [ "$ESPEAK" = "$SAPI" ] && [ "$SAPI" = "$SWIFT" ]; then
390 echo "You need Festival, eSpeak or Flite in your path, or SAPI available to build voice files"
391 exit
394 echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?"
395 option=`input`
396 case "$option" in
397 [Ll])
398 TTS_ENGINE="flite"
399 NOISEFLOOR="500" # TODO: check this value
400 TTS_OPTS=$FLITE_OPTS
402 [Ee])
403 TTS_ENGINE="espeak"
404 NOISEFLOOR="500"
405 TTS_OPTS=$ESPEAK_OPTS
407 [Ff])
408 TTS_ENGINE="festival"
409 NOISEFLOOR="500"
410 TTS_OPTS=$FESTIVAL_OPTS
412 [Ss])
413 TTS_ENGINE="sapi"
414 NOISEFLOOR="500"
415 TTS_OPTS=$SAPI_OPTS
417 [Ww])
418 TTS_ENGINE="swift"
419 NOISEFLOOR="500"
420 TTS_OPTS=$SWIFT_OPTS
423 TTS_ENGINE=$DEFAULT_TTS
424 TTS_OPTS=$DEFAULT_TTS_OPTS
425 NOISEFLOOR=$DEFAULT_NOISEFLOOR
426 esac
427 echo "Using $TTS_ENGINE for TTS"
429 # Allow the user to input manual commandline options
430 printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): "
431 USER_TTS_OPTS=`input`
432 if [ -n "$USER_TTS_OPTS" ]; then
433 TTS_OPTS="$USER_TTS_OPTS"
436 echo ""
438 if [ -f "`which oggenc`" ]; then
439 OGGENC="(O)ggenc "
440 DEFAULT_ENC="oggenc"
441 VORBIS_OPTS="-q0 --downmix"
442 DEFAULT_ENC_OPTS=$VORBIS_OPTS
443 DEFAULT_CHOICE="O"
445 if [ -f "`which speexenc`" ]; then
446 SPEEXENC="(S)peexenc "
447 DEFAULT_ENC="speexenc"
448 SPEEX_OPTS="" # TODO: find appropriate options for speex
449 DEFAULT_ENC_OPTS=$SPEEX_OPTS
450 DEFAULT_CHOICE="S"
452 if [ -f "`which lame`" ]; then
453 LAME="(L)ame "
454 DEFAULT_ENC="lame"
455 LAME_OPTS="--resample 12 -t -m m -h -V 9 -S -B 64 --vbr-new"
456 DEFAULT_ENC_OPTS=$LAME_OPTS
457 DEFAULT_CHOICE="L"
460 if [ "$LAME" = "" ]; then
461 echo "You currently need to have Lame installed to build voice files"
464 # echo "Encoder to use: ${LAME}${OGGENC}${SPEEXENC}(${DEFAULT_CHOICE})?"
465 # echo ""
466 # echo "Note: Use Lame - the other options won't work"
467 # option=`input`
468 option="l"
469 case "$option" in
470 [Oo])
471 ENCODER="oggenc"
472 ENC_OPTS=$VORBIS_OPTS
474 [Ss])
475 ENCODER="speexenc"
476 ENC_OPTS=$SPEEX_OPTS
478 [Ll])
479 ENCODER="lame"
480 ENC_OPTS=$LAME_OPTS
483 ENCODER=$DEFAULT_ENC
484 ENC_OPTS=$DEFAULT_ENC_OPTS
485 esac
486 echo "Using $ENCODER for encoding voice clips"
488 # Allow the user to input manual commandline options
489 printf "Enter $ENCODER options (enter for defaults \"$ENC_OPTS\"): "
490 USER_ENC_OPTS=`input`
491 if [ -n "$USER_ENC_OPTS" ]; then
492 ENC_OPTS=$USER_ENC_OPTS
495 TEMPDIR="${pwd}"
496 if [ -f "`which cygpath`" ]; then
497 TEMPDIR=`cygpath . -a -w`
501 picklang() {
502 # figure out which languages that are around
503 for file in $rootdir/apps/lang/*.lang; do
504 clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
505 langs="$langs $clean"
506 done
508 num=1
509 for one in $langs; do
510 echo "$num. $one"
511 num=`expr $num + 1`
512 done
514 read pick
517 whichlang() {
518 output=""
519 # Allow the user to pass a comma-separated list of langauges
520 for thispick in `echo $pick | sed 's/,/ /g'`; do
521 num=1
522 for one in $langs; do
523 # Accept both the language number and name
524 if [ "$num" = "$thispick" ] || [ "$thispick" = "$one" ]; then
525 if [ "$output" = "" ]; then
526 output=$one
527 else
528 output=$output,$one
531 num=`expr $num + 1`
532 done
533 done
534 echo $output
537 opt=$1
539 if test "$opt" = "--help"; then
540 echo "Rockbox configure script."
541 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
542 echo "Do *NOT* run this within the tools directory!"
543 echo ""
544 echo "Usage: configure [--ccache][--no-ccache]"
545 exit
548 if test -r "configure"; then
549 # this is a check for a configure script in the current directory, it there
550 # is one, try to figure out if it is this one!
552 if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
553 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
554 echo "It will only cause you pain and grief. Instead do this:"
555 echo ""
556 echo " cd .."
557 echo " mkdir build-dir"
558 echo " cd build-dir"
559 echo " ../tools/configure"
560 echo ""
561 echo "Much happiness will arise from this. Enjoy"
562 exit
566 # get our current directory
567 pwd=`pwd`;
569 if { echo $pwd | grep " "; } then
570 echo "You're running this script in a path that contains space. The build"
571 echo "system is unfortunately not clever enough to deal with this. Please"
572 echo "run the script from a different path, rename the path or fix the build"
573 echo "system!"
574 exit
577 if [ -z "$rootdir" ]; then
578 ##################################################################
579 # Figure out where the source code root is!
581 rootdir=`dirname $0`/../
583 #####################################################################
584 # Convert the possibly relative directory name to an absolute version
586 now=`pwd`
587 cd $rootdir
588 rootdir=`pwd`
590 # cd back to the build dir
591 cd $now
594 apps="apps"
595 appsdir='\$(ROOTDIR)/apps'
596 firmdir='\$(ROOTDIR)/firmware'
597 toolsdir='\$(ROOTDIR)/tools'
600 ##################################################################
601 # Figure out target platform
604 echo "Enter target platform:"
605 cat <<EOF
606 ==Archos== ==iriver== ==Apple iPod==
607 0) Player/Studio 10) H120/H140 20) Color/Photo
608 1) Recorder 11) H320/H340 21) Nano
609 2) FM Recorder 12) iHP-100/110/115 22) Video
610 3) Recorder v2 13) iFP-790 23) 3G
611 4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
612 5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
613 6) AV300 26) Mini 2G
614 27) 1G, 2G
616 ==iAudio== ==Toshiba== ==SanDisk==
617 30) X5/X5V/X5L 40) Gigabeat F 50) Sansa e200
618 31) M5/M5L 51) Sansa e200R
619 52) Sansa c200
621 ==Tatung== ==Olympus==
622 60) Elio TPJ-1022 70) M:Robe 500
625 buildfor=`input`;
627 # Set of tools built for all target platforms:
628 toolset="rdf2binary convbdf codepages"
630 # Toolsets for some target families:
631 archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
632 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
633 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
634 ipodbitmaptools="$toolset scramble ipod_fw bmp2rb"
635 gigabeatbitmaptools="$toolset scramble descramble bmp2rb"
636 # generic is used by IFP, H10, Sansa-e200
637 genericbitmaptools="$toolset bmp2rb"
640 # ---- For each target ----
642 # *Variables*
643 # target_id: a unique number identifying this target, DOES NOT necessarily
644 # have to be the menu number. Just use the currently highest
645 # number+1 when you add a new target.
646 # archos: short model name used all over to identify this target
647 # memory: number of megabytes of RAM this target has. If the amount can
648 # be selected by the size prompt, let memory be unset here
649 # target: -Ddefine passed to the build commands to make the correct
650 # config-*.h file get included etc
651 # tool: the tool that takes a plain binary and converts that into a
652 # working "firmware" file for your target
653 # output: the final output file name
654 # boottool: the tool that takes a plain binary and generates a bootloader
655 # file for your target (or blank to use $tool)
656 # bootoutput:the final output file name for the bootloader (or blank to use
657 # $output)
658 # appextra: passed to the APPEXTRA variable in the Makefiles.
659 # TODO: add proper explanation
660 # archosrom: used only for Archos targets that build a special flashable .ucl
661 # image. Set to blank for other builds.
662 # flash: the same as archosrom. These two should be merged
663 # plugins: set to 'yes' to build the plugins. Early development builds can
664 # set this to no in the early stages to have an easier life for a
665 # while
666 # swcodec: set 'yes' on swcodec targets
667 # toolset: lists what particular tools in the tools/ directory that this
668 # target needs to have built prior to building Rockbox
670 # *Functions*
671 # *cc: sets up gcc and compiler options for your target builds. Note
672 # that if you select a simulator build, the compiler selection is
673 # overridden later in the script.
675 case $buildfor in
677 0|player)
678 target_id=1
679 archos="player"
680 target="-DARCHOS_PLAYER"
681 shcc
682 tool="$rootdir/tools/scramble"
683 output="archos.mod"
684 appextra="player:gui"
685 archosrom="$pwd/rombox.ucl"
686 flash="$pwd/rockbox.ucl"
687 plugins="yes"
688 swcodec=""
690 # toolset is the tools within the tools directory that we build for
691 # this particular target.
692 toolset="$toolset scramble descramble sh2d player_unifont uclpack"
694 # Note: the convbdf is present in the toolset just because: 1) the
695 # firmware/Makefile assumes it is present always, and 2) we will need it when we
696 # build the player simulator
698 t_cpu="sh"
699 t_manufacturer="archos"
700 t_model="player"
703 1|recorder)
704 target_id=2
705 archos="recorder"
706 target="-DARCHOS_RECORDER"
707 shcc
708 tool="$rootdir/tools/scramble"
709 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
710 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
711 output="ajbrec.ajz"
712 appextra="recorder:gui"
713 archosrom="" #"$pwd/rombox.ucl"
714 flash="$pwd/rockbox.ucl"
715 plugins="yes"
716 swcodec=""
717 # toolset is the tools within the tools directory that we build for
718 # this particular target.
719 toolset=$archosbitmaptools
720 t_cpu="sh"
721 t_manufacturer="archos"
722 t_model="recorder"
725 2|fmrecorder)
726 target_id=3
727 archos="fmrecorder"
728 target="-DARCHOS_FMRECORDER"
729 shcc
730 tool="$rootdir/tools/scramble -fm"
731 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
732 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
733 output="ajbrec.ajz"
734 appextra="recorder:gui"
735 archosrom="" #"$pwd/rombox.ucl"
736 flash="$pwd/rockbox.ucl"
737 plugins="yes"
738 swcodec=""
739 # toolset is the tools within the tools directory that we build for
740 # this particular target.
741 toolset=$archosbitmaptools
742 t_cpu="sh"
743 t_manufacturer="archos"
744 t_model="fm_v2"
747 3|recorderv2)
748 target_id=4
749 archos="recorderv2"
750 target="-DARCHOS_RECORDERV2"
751 shcc
752 tool="$rootdir/tools/scramble -v2"
753 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
754 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
755 output="ajbrec.ajz"
756 appextra="recorder:gui"
757 archosrom="" #"$pwd/rombox.ucl"
758 flash="$pwd/rockbox.ucl"
759 plugins="yes"
760 swcodec=""
761 # toolset is the tools within the tools directory that we build for
762 # this particular target.
763 toolset=$archosbitmaptools
764 t_cpu="sh"
765 t_manufacturer="archos"
766 t_model="fm_v2"
769 4|ondiosp)
770 target_id=7
771 archos="ondiosp"
772 target="-DARCHOS_ONDIOSP"
773 shcc
774 tool="$rootdir/tools/scramble -osp"
775 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
776 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
777 output="ajbrec.ajz"
778 appextra="recorder:gui"
779 archosrom="$pwd/rombox.ucl"
780 flash="$pwd/rockbox.ucl"
781 plugins="yes"
782 swcodec=""
783 # toolset is the tools within the tools directory that we build for
784 # this particular target.
785 toolset=$archosbitmaptools
786 t_cpu="sh"
787 t_manufacturer="archos"
788 t_model="ondio"
791 5|ondiofm)
792 target_id=8
793 archos="ondiofm"
794 target="-DARCHOS_ONDIOFM"
795 shcc
796 tool="$rootdir/tools/scramble -ofm"
797 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
798 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
799 output="ajbrec.ajz"
800 appextra="recorder:gui"
801 archosrom="" #"$pwd/rombox.ucl"
802 flash="$pwd/rockbox.ucl"
803 plugins="yes"
804 swcodec=""
805 toolset=$archosbitmaptools
806 t_cpu="sh"
807 t_manufacturer="archos"
808 t_model="ondio"
811 6|av300)
812 target_id=26
813 archos="av300"
814 target="-DARCHOS_AV300"
815 memory=16 # always
816 arm7tdmicc
817 tool="$rootdir/tools/scramble -mm=C"
818 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
819 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
820 output="cjbm.ajz"
821 appextra="recorder:gui"
822 archosrom=""
823 flash=""
824 plugins="yes"
825 swcodec=""
826 # toolset is the tools within the tools directory that we build for
827 # this particular target.
828 toolset="$toolset scramble descramble bmp2rb"
829 # architecture, manufacturer and model for the target-tree build
830 t_cpu="arm"
831 t_manufacturer="archos"
832 t_model="av300"
835 10|h120)
836 target_id=9
837 archos="h120"
838 target="-DIRIVER_H120"
839 memory=32 # always
840 coldfirecc
841 tool="$rootdir/tools/scramble -add=h120"
842 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
843 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
844 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
845 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
846 output="rockbox.iriver"
847 appextra="recorder:gui"
848 archosrom=""
849 flash="$pwd/rombox.iriver"
850 plugins="yes"
851 swcodec="yes"
852 # toolset is the tools within the tools directory that we build for
853 # this particular target.
854 toolset=$iriverbitmaptools
855 t_cpu="coldfire"
856 t_manufacturer="iriver"
857 t_model="h100"
860 11|h300)
861 target_id=10
862 archos="h300"
863 target="-DIRIVER_H300"
864 memory=32 # always
865 coldfirecc
866 tool="$rootdir/tools/scramble -add=h300"
867 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
868 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
869 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
870 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
871 output="rockbox.iriver"
872 appextra="recorder:gui"
873 archosrom=""
874 flash=""
875 plugins="yes"
876 swcodec="yes"
877 # toolset is the tools within the tools directory that we build for
878 # this particular target.
879 toolset=$iriverbitmaptools
880 t_cpu="coldfire"
881 t_manufacturer="iriver"
882 t_model="h300"
885 12|h100)
886 target_id=11
887 archos="h100"
888 target="-DIRIVER_H100"
889 memory=16 # always
890 coldfirecc
891 tool="$rootdir/tools/scramble -add=h100"
892 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
893 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
894 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
895 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
896 output="rockbox.iriver"
897 appextra="recorder:gui"
898 archosrom=""
899 flash=""
900 plugins="yes"
901 swcodec="yes"
902 # toolset is the tools within the tools directory that we build for
903 # this particular target.
904 toolset=$iriverbitmaptools
905 t_cpu="coldfire"
906 t_manufacturer="iriver"
907 t_model="h100"
910 13|ifp7xx)
911 target_id=19
912 archos="ifp7xx"
913 target="-DIRIVER_IFP7XX"
914 memory=1
915 arm7tdmicc short
916 tool="cp"
917 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
918 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
919 output="rockbox.wma"
920 appextra="recorder:gui"
921 archosrom=""
922 flash=""
923 plugins="yes"
924 swcodec="yes"
925 # toolset is the tools within the tools directory that we build for
926 # this particular target.
927 toolset=$genericbitmaptools
928 t_cpu="arm"
929 t_manufacturer="pnx0101"
930 t_model="iriver-ifp7xx"
933 14|h10)
934 target_id=22
935 archos="h10"
936 target="-DIRIVER_H10"
937 memory=32 # always
938 arm7tdmicc
939 tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
940 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
941 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
942 output="rockbox.mi4"
943 appextra="recorder:gui"
944 archosrom=""
945 flash=""
946 plugins="yes"
947 swcodec="yes"
948 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
949 bootoutput="H10_20GC.mi4"
950 # toolset is the tools within the tools directory that we build for
951 # this particular target.
952 toolset="$genericbitmaptools scramble"
953 # architecture, manufacturer and model for the target-tree build
954 t_cpu="arm"
955 t_manufacturer="iriver"
956 t_model="h10"
959 15|h10_5gb)
960 target_id=24
961 archos="h10_5gb"
962 target="-DIRIVER_H10_5GB"
963 memory=32 # always
964 arm7tdmicc
965 tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
966 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
967 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
968 output="rockbox.mi4"
969 appextra="recorder:gui"
970 archosrom=""
971 flash=""
972 plugins="yes"
973 swcodec="yes"
974 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
975 bootoutput="H10.mi4"
976 # toolset is the tools within the tools directory that we build for
977 # this particular target.
978 toolset="$genericbitmaptools scramble"
979 # architecture, manufacturer and model for the target-tree build
980 t_cpu="arm"
981 t_manufacturer="iriver"
982 t_model="h10"
985 20|ipodcolor)
986 target_id=13
987 archos="ipodcolor"
988 target="-DIPOD_COLOR"
989 memory=32 # always
990 arm7tdmicc
991 tool="$rootdir/tools/scramble -add=ipco"
992 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
993 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
994 output="rockbox.ipod"
995 appextra="recorder:gui"
996 archosrom=""
997 flash=""
998 plugins="yes"
999 swcodec="yes"
1000 bootoutput="bootloader-$archos.ipod"
1001 # toolset is the tools within the tools directory that we build for
1002 # this particular target.
1003 toolset=$ipodbitmaptools
1004 # architecture, manufacturer and model for the target-tree build
1005 t_cpu="arm"
1006 t_manufacturer="ipod"
1007 t_model="color"
1010 21|ipodnano)
1011 target_id=14
1012 archos="ipodnano"
1013 target="-DIPOD_NANO"
1014 memory=32 # always
1015 arm7tdmicc
1016 tool="$rootdir/tools/scramble -add=nano"
1017 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1018 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1019 output="rockbox.ipod"
1020 appextra="recorder:gui"
1021 archosrom=""
1022 flash=""
1023 plugins="yes"
1024 swcodec="yes"
1025 bootoutput="bootloader-$archos.ipod"
1026 # toolset is the tools within the tools directory that we build for
1027 # this particular target.
1028 toolset=$ipodbitmaptools
1029 # architecture, manufacturer and model for the target-tree build
1030 t_cpu="arm"
1031 t_manufacturer="ipod"
1032 t_model="nano"
1035 22|ipodvideo)
1036 target_id=15
1037 archos="ipodvideo"
1038 target="-DIPOD_VIDEO"
1039 arm7tdmicc
1040 tool="$rootdir/tools/scramble -add=ipvd"
1041 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1042 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1043 output="rockbox.ipod"
1044 appextra="recorder:gui"
1045 archosrom=""
1046 flash=""
1047 plugins="yes"
1048 swcodec="yes"
1049 bootoutput="bootloader-$archos.ipod"
1050 # toolset is the tools within the tools directory that we build for
1051 # this particular target.
1052 toolset=$ipodbitmaptools
1053 # architecture, manufacturer and model for the target-tree build
1054 t_cpu="arm"
1055 t_manufacturer="ipod"
1056 t_model="video"
1059 23|ipod3g)
1060 target_id=16
1061 archos="ipod3g"
1062 target="-DIPOD_3G"
1063 memory=32 # always
1064 arm7tdmicc
1065 tool="$rootdir/tools/scramble -add=ip3g"
1066 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1067 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1068 output="rockbox.ipod"
1069 appextra="recorder:gui"
1070 archosrom=""
1071 flash=""
1072 plugins="yes"
1073 swcodec="yes"
1074 bootoutput="bootloader-$archos.ipod"
1075 # toolset is the tools within the tools directory that we build for
1076 # this particular target.
1077 toolset=$ipodbitmaptools
1078 # architecture, manufacturer and model for the target-tree build
1079 t_cpu="arm"
1080 t_manufacturer="ipod"
1081 t_model="3g"
1084 24|ipod4g)
1085 target_id=17
1086 archos="ipod4g"
1087 target="-DIPOD_4G"
1088 memory=32 # always
1089 arm7tdmicc
1090 tool="$rootdir/tools/scramble -add=ip4g"
1091 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1092 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1093 output="rockbox.ipod"
1094 appextra="recorder:gui"
1095 archosrom=""
1096 flash=""
1097 plugins="yes"
1098 swcodec="yes"
1099 bootoutput="bootloader-$archos.ipod"
1100 # toolset is the tools within the tools directory that we build for
1101 # this particular target.
1102 toolset=$ipodbitmaptools
1103 # architecture, manufacturer and model for the target-tree build
1104 t_cpu="arm"
1105 t_manufacturer="ipod"
1106 t_model="4g"
1109 25|ipodmini)
1110 target_id=18
1111 archos="ipodmini"
1112 target="-DIPOD_MINI"
1113 memory=32 # always
1114 arm7tdmicc
1115 tool="$rootdir/tools/scramble -add=mini"
1116 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1117 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1118 output="rockbox.ipod"
1119 appextra="recorder:gui"
1120 archosrom=""
1121 flash=""
1122 plugins="yes"
1123 swcodec="yes"
1124 bootoutput="bootloader-$archos.ipod"
1125 # toolset is the tools within the tools directory that we build for
1126 # this particular target.
1127 toolset=$ipodbitmaptools
1128 # architecture, manufacturer and model for the target-tree build
1129 t_cpu="arm"
1130 t_manufacturer="ipod"
1131 t_model="mini"
1134 26|ipodmini2g)
1135 target_id=21
1136 archos="ipodmini2g"
1137 target="-DIPOD_MINI2G"
1138 memory=32 # always
1139 arm7tdmicc
1140 tool="$rootdir/tools/scramble -add=mn2g"
1141 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1142 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1143 output="rockbox.ipod"
1144 appextra="recorder:gui"
1145 archosrom=""
1146 flash=""
1147 plugins="yes"
1148 swcodec="yes"
1149 bootoutput="bootloader-$archos.ipod"
1150 # toolset is the tools within the tools directory that we build for
1151 # this particular target.
1152 toolset=$ipodbitmaptools
1153 # architecture, manufacturer and model for the target-tree build
1154 t_cpu="arm"
1155 t_manufacturer="ipod"
1156 t_model="mini2g"
1159 27|ipod1g2g)
1160 target_id=29
1161 archos="ipod1g2g"
1162 target="-DIPOD_1G2G"
1163 memory=32 # always
1164 arm7tdmicc
1165 tool="$rootdir/tools/scramble -add=1g2g"
1166 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1167 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1168 output="rockbox.ipod"
1169 appextra="recorder:gui"
1170 archosrom=""
1171 flash=""
1172 plugins="yes"
1173 swcodec="yes"
1174 bootoutput="bootloader-$archos.ipod"
1175 # toolset is the tools within the tools directory that we build for
1176 # this particular target.
1177 toolset=$ipodbitmaptools
1178 # architecture, manufacturer and model for the target-tree build
1179 t_cpu="arm"
1180 t_manufacturer="ipod"
1181 t_model="1g2g"
1184 30|x5)
1185 target_id=12
1186 archos="x5"
1187 target="-DIAUDIO_X5"
1188 memory=16 # always
1189 coldfirecc
1190 tool="$rootdir/tools/scramble -add=iax5"
1191 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1192 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1193 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1194 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1195 output="rockbox.iaudio"
1196 appextra="recorder:gui"
1197 archosrom=""
1198 flash=""
1199 plugins="yes"
1200 swcodec="yes"
1201 # toolset is the tools within the tools directory that we build for
1202 # this particular target.
1203 toolset="$iaudiobitmaptools"
1204 # architecture, manufacturer and model for the target-tree build
1205 t_cpu="coldfire"
1206 t_manufacturer="iaudio"
1207 t_model="x5"
1210 31|m5)
1211 target_id=28
1212 archos="m5"
1213 target="-DIAUDIO_M5"
1214 memory=16 # always
1215 coldfirecc
1216 tool="$rootdir/tools/scramble -add=iam5"
1217 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1218 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1219 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1220 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1221 output="rockbox.iaudio"
1222 appextra="recorder:gui"
1223 archosrom=""
1224 flash=""
1225 plugins="yes"
1226 swcodec="yes"
1227 # toolset is the tools within the tools directory that we build for
1228 # this particular target.
1229 toolset="$iaudiobitmaptools"
1230 # architecture, manufacturer and model for the target-tree build
1231 t_cpu="coldfire"
1232 t_manufacturer="iaudio"
1233 t_model="m5"
1236 40|gigabeatf)
1237 target_id=20
1238 archos="gigabeatf"
1239 target="-DGIGABEAT_F"
1240 memory=32 # always
1241 arm9tdmicc
1242 tool="$rootdir/tools/scramble -add=giga"
1243 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1244 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1245 output="rockbox.gigabeat"
1246 appextra="recorder:gui"
1247 archosrom=""
1248 flash=""
1249 plugins="yes"
1250 swcodec="yes"
1251 toolset=$gigabeatbitmaptools
1252 boottool="$rootdir/tools/scramble -gigabeat"
1253 bootoutput="FWIMG01.DAT"
1254 # architecture, manufacturer and model for the target-tree build
1255 t_cpu="arm"
1256 t_manufacturer="s3c2440"
1257 t_model="gigabeat-fx"
1260 70|mrobe500)
1261 target_id=20
1262 archos="mrobe500"
1263 target="-DMROBE_500"
1264 memory=64 # always
1265 arm9tdmicc
1266 tool="$rootdir/tools/scramble -add=giga"
1267 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1268 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1269 output="rockbox.mrobe500"
1270 appextra="recorder:gui"
1271 archosrom=""
1272 flash=""
1273 plugins="no"
1274 swcodec="yes"
1275 toolset=$gigabeatbitmaptools
1276 boottool="cp "
1277 bootoutput="rockbox.mrboot"
1278 # architecture, manufacturer and model for the target-tree build
1279 t_cpu="arm"
1280 t_manufacturer="olympus"
1281 t_model="mrobe-500"
1284 50|e200)
1285 target_id=23
1286 archos="e200"
1287 target="-DSANSA_E200"
1288 memory=32 # supposedly
1289 arm7tdmicc
1290 tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1291 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1292 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1293 output="rockbox.mi4"
1294 appextra="recorder:gui"
1295 archosrom=""
1296 flash=""
1297 plugins="yes"
1298 swcodec="yes"
1299 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1300 bootoutput="PP5022.mi4"
1301 # toolset is the tools within the tools directory that we build for
1302 # this particular target.
1303 toolset="$genericbitmaptools scramble"
1304 # architecture, manufacturer and model for the target-tree build
1305 t_cpu="arm"
1306 t_manufacturer="sandisk"
1307 t_model="sansa-e200"
1310 51|e200r)
1311 # the e200R model is pretty much identical to the e200, it only has a
1312 # different option to the scramble tool when building a bootloader and
1313 # makes the bootloader output file name in all lower case.
1314 target_id=27
1315 archos="e200r"
1316 target="-DSANSA_E200"
1317 memory=32 # supposedly
1318 arm7tdmicc
1319 tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1320 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1321 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1322 output="rockbox.mi4"
1323 appextra="recorder:gui"
1324 archosrom=""
1325 flash=""
1326 plugins="yes"
1327 swcodec="yes"
1328 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1329 bootoutput="pp5022.mi4"
1330 # toolset is the tools within the tools directory that we build for
1331 # this particular target.
1332 toolset="$genericbitmaptools scramble"
1333 # architecture, manufacturer and model for the target-tree build
1334 t_cpu="arm"
1335 t_manufacturer="sandisk"
1336 t_model="sansa-e200"
1339 52|c200)
1340 target_id=30
1341 archos="c200"
1342 target="-DSANSA_C200"
1343 memory=32 # supposedly
1344 arm7tdmicc
1345 tool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBOS"
1346 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1347 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1348 output="rockbox.mi4"
1349 appextra="recorder:gui"
1350 archosrom=""
1351 flash=""
1352 plugins="yes"
1353 swcodec="yes"
1354 boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
1355 bootoutput="firmware.mi4"
1356 # toolset is the tools within the tools directory that we build for
1357 # this particular target.
1358 toolset="$genericbitmaptools scramble"
1359 # architecture, manufacturer and model for the target-tree build
1360 t_cpu="arm"
1361 t_manufacturer="sandisk"
1362 t_model="sansa-c200"
1365 60|tpj1022)
1366 target_id=25
1367 archos="tpj1022"
1368 target="-DELIO_TPJ1022"
1369 memory=32 # always
1370 arm7tdmicc
1371 tool="$rootdir/tools/scramble -add tpj2"
1372 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1373 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1374 output="rockbox.elio"
1375 appextra="recorder:gui"
1376 archosrom=""
1377 flash=""
1378 plugins="yes"
1379 swcodec="yes"
1380 boottool="$rootdir/tools/scramble -mi4v2"
1381 bootoutput="pp5020.mi4"
1382 # toolset is the tools within the tools directory that we build for
1383 # this particular target.
1384 toolset="$genericbitmaptools scramble"
1385 # architecture, manufacturer and model for the target-tree build
1386 t_cpu="arm"
1387 t_manufacturer="tatung"
1388 t_model="tpj1022"
1392 echo "Please select a supported target platform!"
1393 exit
1396 esac
1398 echo "Platform set to $archos"
1401 #remove start
1402 ############################################################################
1403 # Amount of memory, for those that can differ. They have $memory unset at
1404 # this point.
1407 if [ -z "$memory" ]; then
1409 case $target_id in
1411 echo "Enter size of your RAM (in MB): (Defaults to 32)"
1412 size=`input`;
1413 case $size in
1414 60|64)
1415 memory="64"
1418 memory="32"
1420 esac
1424 echo "Enter size of your RAM (in MB): (defaults to 2)"
1425 size=`input`;
1426 case $size in
1428 memory="8"
1431 memory="2"
1433 esac
1435 esac
1437 echo "Memory size selected: $memory MB"
1439 #remove end
1441 ##################################################################
1442 # Figure out build "type"
1445 # the ifp7x0 is the only platform that supports building a gdb stub like
1446 # this
1447 case $archos in
1448 ifp7xx)
1449 gdbstub="(G)DB stub, "
1451 e200r|e200)
1452 gdbstub="(I)installer, "
1456 esac
1458 echo ""
1459 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, $gdbstub(M)anual (N)"
1461 option=`input`;
1463 case $option in
1464 [Ii])
1465 appsdir='\$(ROOTDIR)/bootloader'
1466 apps="bootloader"
1467 extradefines="-DBOOTLOADER -DE200R_INSTALLER -ffunction-sections -fdata-sections"
1468 bootloader="1"
1469 output="bootloader.bin"
1470 echo "e200R-installer build selected"
1472 [Bb])
1473 if test $t_manufacturer = "archos"; then
1474 # Archos SH-based players do this somewhat differently for
1475 # some reason
1476 appsdir='\$(ROOTDIR)/flash/bootbox'
1477 apps="bootbox"
1478 else
1479 appsdir='\$(ROOTDIR)/bootloader'
1480 apps="bootloader"
1481 flash=""
1482 if test -n "$boottool"; then
1483 tool="$boottool"
1485 if test -n "$bootoutput"; then
1486 output=$bootoutput
1489 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
1490 bootloader="1"
1491 echo "Bootloader build selected"
1493 [Ss])
1494 debug="-DDEBUG"
1495 simulator="yes"
1496 extradefines="-DSIMULATOR"
1497 echo "Simulator build selected"
1499 [Aa])
1500 echo "Advanced build selected"
1501 whichadvanced
1503 [Gg])
1504 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
1505 appsdir='\$(ROOTDIR)/gdb'
1506 apps="stub"
1507 case $archos in
1508 ifp7xx)
1509 output="stub.wma"
1513 esac
1514 echo "GDB stub build selected"
1516 [Mm])
1517 appsdir='\$(ROOTDIR)/manual'
1518 firmdir='\$(ROOTDIR)/manual/platform' # No Makefile here. Effectively ig:res target
1519 toolsdir=$firmdir;
1520 toolset='';
1521 apps="manual"
1522 echo "Manual build selected"
1525 debug=""
1526 echo "Normal build selected"
1529 esac
1530 # to be able running "make manual" from non-manual configuration
1531 case $archos in
1532 fmrecorder)
1533 manualdev="recorderv2fm"
1535 recorderv2)
1536 manualdev="recorderv2fm"
1538 h1??)
1539 manualdev="h1xx"
1541 ipodmini2g)
1542 manualdev="ipodmini"
1545 manualdev=$archos
1547 esac
1549 if [ -z "$debug" ]; then
1550 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
1553 echo "Using source code root directory: $rootdir"
1555 # this was once possible to change at build-time, but no more:
1556 language="english"
1558 uname=`uname`
1560 if [ "yes" = "$simulator" ]; then
1561 # setup compiler and things for simulator
1562 simcc
1564 if [ -d "archos" ]; then
1565 echo "sub directory archos already present"
1566 else
1567 mkdir archos
1568 echo "created an archos subdirectory for simulating the hard disk"
1572 # Now, figure out version number of the (gcc) compiler we are about to use
1573 gccver=`$CC -dumpversion`;
1575 # figure out the binutil version too and display it, mostly for the build
1576 # system etc to be able to see it easier
1577 ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
1579 if [ -z "$gccver" ]; then
1580 echo "WARNING: The compiler you must use ($CC) is not in your path!"
1581 echo "WARNING: this may cause your build to fail since we cannot do the"
1582 echo "WARNING: checks we want now."
1583 else
1585 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
1586 # DEPEND on it
1588 num1=`echo $gccver | cut -d . -f1`
1589 num2=`echo $gccver | cut -d . -f2`
1590 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
1592 # This makes:
1593 # 3.3.X => 303
1594 # 3.4.X => 304
1595 # 2.95.3 => 295
1597 echo "Using $CC $gccver ($gccnum)"
1599 if test "$gccnum" -ge "400"; then
1600 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
1601 # so we ignore that warnings for now
1602 # -Wno-pointer-sign
1603 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
1606 if test "$gccnum" -ge "401"; then
1607 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
1608 # will break strict-aliasing rules"
1610 GCCOPTS="$GCCOPTS -fno-strict-aliasing"
1613 if test "$gccnum" -ge "402"; then
1614 # disable warning about "warning: initialized field overwritten" as gcc 4.2
1615 # and later would throw it for several valid cases
1616 GCCOPTS="$GCCOPTS -Wno-override-init"
1621 echo "Using $LD $ldver"
1623 # check the compiler for SH platforms
1624 if test "$CC" = "sh-elf-gcc"; then
1625 if test "$gccnum" -lt "400"; then
1626 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
1627 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
1628 else
1629 # figure out patch status
1630 gccpatch=`$CC --version`;
1632 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
1633 echo "gcc $gccver is rockbox patched"
1634 # then convert -O to -Os to get smaller binaries!
1635 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
1636 else
1637 echo "WARNING: You use an unpatched gcc compiler: $gccver"
1638 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
1643 if test "$CC" = "m68k-elf-gcc"; then
1644 # convert -O to -Os to get smaller binaries!
1645 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
1648 if test "$1" = "--ccache"; then
1649 echo "Enable ccache for building"
1650 ccache="ccache"
1651 else
1652 if test "$1" != "--no-ccache"; then
1653 ccache=`findtool ccache`
1654 if test -n "$ccache"; then
1655 echo "Found and uses ccache ($ccache)"
1660 if test -n "$ccache"; then
1661 CC="$ccache $CC"
1664 if test "X$endian" = "Xbig"; then
1665 defendian="ROCKBOX_BIG_ENDIAN"
1666 else
1667 defendian="ROCKBOX_LITTLE_ENDIAN"
1670 sed > autoconf.h \
1671 -e "s,@ENDIAN@,${defendian},g" \
1672 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
1673 -e "s,@config_rtc@,$config_rtc,g" \
1674 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
1675 <<EOF
1676 /* This header was made by configure */
1677 #ifndef __BUILD_AUTOCONF_H
1678 #define __BUILD_AUTOCONF_H
1680 /* Define endianess for the target or simulator platform */
1681 #define @ENDIAN@ 1
1683 /* Define this if you build rockbox to support the logf logging and display */
1684 #undef ROCKBOX_HAS_LOGF
1686 /* optional defines for RTC mod for h1x0 */
1687 @config_rtc@
1688 @have_rtc_alarm@
1690 #endif /* __BUILD_AUTOCONF_H */
1693 if test -n "$t_cpu"; then
1694 TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
1695 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
1696 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
1697 GCCOPTS="$GCCOPTS"
1700 if test "$simulator" = "yes"; then
1701 # add simul make stuff on the #SIMUL# line
1702 simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
1703 simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
1704 else
1705 # delete the lines that match
1706 simmagic1='/@SIMUL1@/D'
1707 simmagic2='/@SIMUL2@/D'
1710 sed > Makefile \
1711 -e "s,@ROOTDIR@,${rootdir},g" \
1712 -e "s,@DEBUG@,${debug},g" \
1713 -e "s,@MEMORY@,${memory},g" \
1714 -e "s,@TARGET_ID@,${target_id},g" \
1715 -e "s,@TARGET@,${target},g" \
1716 -e "s,@CPU@,${t_cpu},g" \
1717 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
1718 -e "s,@ARCHOS@,${archos},g" \
1719 -e "s,@LANGUAGE@,${language},g" \
1720 -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
1721 -e "s,@PWD@,${pwd},g" \
1722 -e "s,@CC@,${CC},g" \
1723 -e "s,@LD@,${LD},g" \
1724 -e "s,@AR@,${AR},g" \
1725 -e "s,@AS@,${AS},g" \
1726 -e "s,@OC@,${OC},g" \
1727 -e "s,@WINDRES@,${WINDRES},g" \
1728 -e "s,@DLLTOOL@,${DLLTOOL},g" \
1729 -e "s,@DLLWRAP@,${DLLWRAP},g" \
1730 -e "s,@RANLIB@,${RANLIB},g" \
1731 -e "s,@TOOL@,${tool},g" \
1732 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
1733 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
1734 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
1735 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
1736 -e "s,@OUTPUT@,${output},g" \
1737 -e "s,@APPEXTRA@,${appextra},g" \
1738 -e "s,@ARCHOSROM@,${archosrom},g" \
1739 -e "s,@FLASHFILE@,${flash},g" \
1740 -e "s,@PLUGINS@,${plugins},g" \
1741 -e "s,@CODECS@,${swcodec},g" \
1742 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
1743 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
1744 -e "s,@GCCOPTS@,${GCCOPTS},g" \
1745 -e "s,@TARGET_INC@,${TARGET_INC},g" \
1746 -e "s!@LDOPTS@!${LDOPTS}!g" \
1747 -e "s,@LOADADDRESS@,${loadaddress},g" \
1748 -e "s,@EXTRADEF@,${extradefines},g" \
1749 -e "s,@APPSDIR@,${appsdir},g" \
1750 -e "s,@FIRMDIR@,${firmdir},g" \
1751 -e "s,@TOOLSDIR@,${toolsdir},g" \
1752 -e "s,@APPS@,${apps},g" \
1753 -e "s,@SIMVER@,${simver},g" \
1754 -e "s,@GCCVER@,${gccver},g" \
1755 -e "s,@GCCNUM@,${gccnum},g" \
1756 -e "s,@UNAME@,${uname},g" \
1757 -e "s,@ENDIAN@,${defendian},g" \
1758 -e "s,@TOOLSET@,${toolset},g" \
1759 -e "${simmagic1}" \
1760 -e "${simmagic2}" \
1761 -e "s,@MANUALDEV@,${manualdev},g" \
1762 -e "s,@ENCODER@,${ENCODER},g" \
1763 -e "s,@ENC_OPTS@,${ENC_OPTS},g" \
1764 -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
1765 -e "s,@TTS_OPTS@,${TTS_OPTS},g" \
1766 <<EOF
1767 ## Automaticly generated. http://www.rockbox.org/
1769 ifndef V
1770 SILENT=@
1771 else
1772 VERBOSEOPT=-v
1773 endif
1775 # old 'make' versions don't have the built-in 'info' function
1776 info=old\$(shell echo >&2 "Consider upgrading to GNU make 3.81+ for optimum build performance.")
1777 ifeq (\$(call info),old)
1778 export info=echo "\$\$(1)";
1779 endif
1781 export ROOTDIR=@ROOTDIR@
1782 export FIRMDIR=@FIRMDIR@
1783 export APPSDIR=@APPSDIR@
1784 export TOOLSDIR=@TOOLSDIR@
1785 export DOCSDIR=\$(ROOTDIR)/docs
1786 export MANUALDIR=\${ROOTDIR}/manual
1787 export DEBUG=@DEBUG@
1788 export ARCHOS=@ARCHOS@
1789 export ARCHOSROM=@ARCHOSROM@
1790 export FLASHFILE=@FLASHFILE@
1791 export TARGET_ID=@TARGET_ID@
1792 export TARGET=@TARGET@
1793 export CPU=@CPU@
1794 export MANUFACTURER=@MANUFACTURER@
1795 export OBJDIR=@PWD@
1796 export BUILDDIR=@PWD@
1797 export LANGUAGE=@LANGUAGE@
1798 export VOICELANGUAGE=@VOICELANGUAGE@
1799 export MEMORYSIZE=@MEMORY@
1800 export VERSION=\$(shell \$(ROOTDIR)/tools/svnversion.sh \$(ROOTDIR))
1801 export BUILDDATE=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
1802 export MKFIRMWARE=@TOOL@
1803 export BMP2RB_MONO=@BMP2RB_MONO@
1804 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
1805 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
1806 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
1807 export BINARY=@OUTPUT@
1808 export APPEXTRA=@APPEXTRA@
1809 export ENABLEDPLUGINS=@PLUGINS@
1810 export SOFTWARECODECS=@CODECS@
1811 export EXTRA_DEFINES=@EXTRADEF@
1812 export HOSTCC=gcc
1813 export CC=@CC@
1814 export LD=@LD@
1815 export AR=@AR@
1816 export AS=@AS@
1817 export OC=@OC@
1818 export WINDRES=@WINDRES@
1819 export DLLTOOL=@DLLTOOL@
1820 export DLLWRAP=@DLLWRAP@
1821 export RANLIB=@RANLIB@
1822 export PROFILE_OPTS=@PROFILE_OPTS@
1823 export SIMVER=@SIMVER@
1824 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
1825 export GCCOPTS=@GCCOPTS@
1826 export TARGET_INC=@TARGET_INC@
1827 export LOADADDRESS=@LOADADDRESS@
1828 export SHARED_FLAG=@SHARED_FLAG@
1829 export LDOPTS=@LDOPTS@
1830 export GCCVER=@GCCVER@
1831 export GCCNUM=@GCCNUM@
1832 export UNAME=@UNAME@
1833 export MANUALDEV=@MANUALDEV@
1834 export TTS_OPTS=@TTS_OPTS@
1835 export TTS_ENGINE=@TTS_ENGINE@
1836 export ENC_OPTS=@ENC_OPTS@
1837 export ENCODER=@ENCODER@
1839 # Do not print "Entering directory ..."
1840 MAKEFLAGS += --no-print-directory
1842 .PHONY: all clean tags zip tools manual bin build info
1844 all: info
1846 info: build
1847 \$(SILENT)\$(TOOLSDIR)/mkinfo.pl \$(BUILDDIR)/rockbox-info.txt
1849 build: tools
1850 @SIMUL1@
1851 @SIMUL2@
1852 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
1853 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@
1855 bin: tools
1856 @SIMUL1@
1857 @SIMUL2@
1858 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
1859 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ \$(BUILDDIR)/\$(BINARY)
1861 rocks: tools
1862 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ rocks
1864 veryclean: clean toolsclean
1866 toolsclean:
1867 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) clean
1869 clean:
1870 \$(SILENT)echo Cleaning build directory
1871 \$(SILENT)rm -rf rockbox.zip TAGS @APPS@ firmware comsim sim lang.[ch]\
1872 manual *.pdf *.a credits.raw @OUTPUT@ bitmaps pluginbitmaps \
1873 @ARCHOSROM@ @FLASHFILE@ UI256.bmp rockbox-full.zip \
1874 html txt rockbox-manual*.zip sysfont.h rockbox-info.txt \
1875 voicefontids *.wav *.mp3 *.voice
1877 tools:
1878 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) @TOOLSET@
1880 tags:
1881 \$(SILENT)rm -f TAGS
1882 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) tags
1883 \$(SILENT)\$(MAKE) -C \$(APPSDIR) tags
1884 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins tags
1885 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins/lib tags
1887 fontzip:
1888 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" -f 1 -o rockbox-fonts.zip \$(TARGET) \$(BINARY)
1890 zip:
1891 \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done ; \\
1892 \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\$\$feat\" -i \"\$(TARGET_ID)\" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1894 mapzip:
1895 \$(SILENT)find . -name "*.map" | xargs zip rockbox-maps.zip
1897 fullzip:
1898 \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\
1899 \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\$\$feat\" -i \"\$(TARGET_ID)\" -r "\$(ROOTDIR)" -f 2 -o rockbox-full.zip \$(TARGET) \$(BINARY)
1901 7zip:
1902 \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\
1903 \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\$\$feat\" -i \"\$(TARGET_ID)\" -o "rockbox.7z" -z "7za a" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1905 tar:
1906 \$(SILENT)rm -f rockbox.tar
1907 \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\
1908 \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\$\$feat\" -i \"\$(TARGET_ID)\" -o "rockbox.tar" -z "tar --no-recursion -uf" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1910 bzip2: tar
1911 \$(SILENT)bzip2 -f9 rockbox.tar
1913 gzip: tar
1914 \$(SILENT)gzip -f9 rockbox.tar
1916 manual: manual-pdf
1917 manual-pdf:
1918 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-pdf
1919 manual-html:
1920 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-html
1921 manual-zhtml: manual-zip
1922 manual-txt:
1923 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-txt
1924 manual-ztxt:
1925 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-txt-zip
1926 manual-zip:
1927 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-zip
1929 features:
1930 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ features
1932 help:
1933 @echo "A few helpful make targets"
1934 @echo ""
1935 @echo "all - builds a full Rockbox (default), including tools"
1936 @echo "bin - builds only the Rockbox.<target name> file"
1937 @echo "clean - cleans a build directory (not tools)"
1938 @echo "veryclean - cleans the build and tools directories"
1939 @echo "manual - builds a manual"
1940 @echo "manual-html - HTML manual"
1941 @echo "manual-zip - HTML manual (zipped)"
1942 @echo "manual-txt - txt manual"
1943 @echo "fullzip - creates a rockbox.zip of your build with fonts"
1944 @echo "zip - creates a rockbox.zip of your build (no fonts)"
1945 @echo "gzip - creates a rockbox.tar.gz of your build (no fonts)"
1946 @echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)"
1947 @echo "7zip - creates a rockbox.7z of your build (no fonts)"
1948 @echo "fontzip - creates rockbox-fonts.zip"
1949 @echo "mapzip - creates rockbox-maps.zip with all .map files"
1950 @echo "tools - builds the tools only"
1951 @echo "install - installs your build (for simulator builds only)"
1955 if [ "yes" = "$simulator" ]; then
1957 cat >> Makefile <<EOF
1959 install:
1960 @echo "installing a full setup in your archos dir"
1961 @(\$(MAKE) fullzip && cd archos && unzip -oq ../rockbox-full.zip)
1966 if [ "yes" = "$voice" ]; then
1968 cat >> Makefile <<EOF
1970 voice: tools features
1971 \$(SILENT)for f in \`cat \$(BUILDDIR)/${apps}/features\`; do feat="\$\$feat:\$\$f" ; done ; \\
1972 for lang in \`echo \$(VOICELANGUAGE) |sed "s/,/ /g"\`; do \$(TOOLSDIR)/voice.pl -V -l=\$\$lang -t=\$(ARCHOS)\$\$feat -i=\$(TARGET_ID) -e=\$(ENCODER) -E="\$(ENC_OPTS)" -s=\$(TTS_ENGINE) -S="\$(TTS_OPTS)"; done \\
1977 echo "Created Makefile"