3 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
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
29 WINDRES
=${prefix}windres
30 DLLTOOL
=${prefix}dlltool
31 DLLWRAP
=${prefix}dllwrap
32 RANLIB
=${prefix}ranlib
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
51 endian
="little" # windows is little endian
54 # scan the $PATH for the given command
61 # echo "checks for $file in $path" >&2
62 if test -f "$path/$file"; then
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>`, i.e. `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
79 for i
in $arg1 $arg2 $arg3 $arg4 $arg5 $arg6 $arg7 $arg8 $arg9
81 if [ "$1" = "--ccache" ]; then
82 if [ "$i" = "--ccache" ]; then
85 elif [ "$1" = "--no-ccache" ]; then
86 if [ "$i" = "--no-ccache" ]; then
89 elif [ "$1" = `echo $i|cut -d'=' -f1` ]; then
90 ret
=`echo $i|cut -d'=' -f2`
98 # default tool setup for native building
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!"
116 # default share option, override below if needed
117 SHARED_FLAG
="-shared"
121 echo "Cygwin host detected"
124 GCCOPTS
="$GCCOPTS `sdl-config --cflags`"
125 LDOPTS
="`sdl-config --libs` -mconsole"
127 output
="rockboxui.exe" # use this as output binary name
131 echo "Linux host detected"
133 if [ "0" != `sdl-config --libs |grep -c mwindows` ]; then
134 # Enable crosscompiling if sdl-config is from Windows SDL
137 GCCOPTS
="$GCCOPTS `sdl-config --cflags`"
138 LDOPTS
="`sdl-config --libs`"
142 echo "FreeBSD host detected"
144 GCCOPTS
="$GCCOPTS `sdl-config --cflags`"
145 LDOPTS
="`sdl-config --libs`"
149 echo "Darwin host detected"
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"
162 if [ "`uname -m`" = "x86_64" ] ||
[ "`uname -m`" = "amd64" ]; then
163 # fPIC is needed to make shared objects link
164 # setting visibility to hidden is necessary to avoid strange crashes
165 # due to symbol clashing
166 GCCOPTS
="$GCCOPTS -fPIC -fvisibility=hidden"
169 GCCOPTS
="$GCCOPTS -I\$(SIMDIR)"
171 if test "X$crosscompile" != "Xyes"; then
173 cat >/tmp
/conftest-
$id.c
<<EOF
175 int main(int argc, char **argv)
178 char *varp = (char *)&var;
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
195 echo "Simulator environment deemed $endian endian"
197 # use wildcard here to make it work even if it was named *.exe like
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
211 GCCOPTS
="$CCOPTS -m1"
212 GCCOPTIMIZE
="-fomit-frame-pointer -fschedule-insns"
218 prefixtools calmrisc16-unknown-elf-
219 GCCOPTS
="-Wl\,--no-check-sections $CCOPTS"
220 GCCOPTIMIZE
="-fomit-frame-pointer"
225 prefixtools m68k-elf-
226 GCCOPTS
="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
227 GCCOPTIMIZE
="-fomit-frame-pointer"
234 GCCOPTS
="$CCOPTS -mcpu=arm7tdmi"
235 if test "X$1" != "Xshort"; then
236 GCCOPTS
="$GCCOPTS -mlong-calls"
238 GCCOPTIMIZE
="-fomit-frame-pointer"
245 GCCOPTS
="$CCOPTS -mcpu=arm9tdmi -mlong-calls"
246 GCCOPTIMIZE
="-fomit-frame-pointer"
253 GCCOPTS
="$CCOPTS -mcpu=arm9e -mlong-calls"
254 GCCOPTIMIZE
="-fomit-frame-pointer"
261 GCCOPTS
="$CCOPTS -mcpu=arm926ej-s -mlong-calls"
262 GCCOPTIMIZE
="-fomit-frame-pointer"
269 GCCOPTS
="$CCOPTS -mcpu=arm1136jf-s -mlong-calls"
270 GCCOPTIMIZE
="-fomit-frame-pointer"
276 ##################################################################
277 # Prompt for specific developer options
280 echo "Enter your developer options (press enter when done)"
281 echo -n "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice"
282 if [ "$memory" = "2" ]; then
283 echo -n ", (8)MB MOD"
285 if [ "$modelname" = "h120" ]; then
286 echo -n ", (R)TC MOD"
292 while [ $cont = "1" ]; do
298 if [ "yes" = "$profile" ]; then
299 echo "Debug is incompatible with profiling"
306 echo "logf() support enabled"
310 echo "Simulator build enabled"
314 if [ "yes" = "$use_debug" ]; then
315 echo "Profiling is incompatible with debug"
317 echo "Profiling support is enabled"
322 echo "Voice build selected"
326 if [ "$memory" = "2" ]; then
328 echo "Memory size selected: 8MB"
334 if [ "$modelname" = "h120" ]; then
335 config_rtc
="#define CONFIG_RTC RTC_DS1339_DS3231"
336 have_rtc_alarm
="#define HAVE_RTC_ALARM"
337 echo "RTC functions enabled (DS1339/DS3231)"
349 if [ "yes" = "$voice" ]; then
350 # Ask about languages to build
351 echo "Select a number for the language to use (default is english)"
352 # The multiple-language feature is currently broken
353 # echo "You may enter a comma-separated list of languages to build"
356 voicelanguage
=`whichlang`
358 if [ -z "$voicelanguage" ]; then
360 voicelanguage
="english"
362 echo "Voice language set to $voicelanguage"
364 # Configure encoder and TTS engine for each language
365 for thislang
in `echo $voicelanguage | sed 's/,/ /g'`; do
366 voiceconfig
"$thislang"
369 if [ "yes" = "$use_debug" ]; then
371 GCCOPTS
="$GCCOPTS -g -DDEBUG"
373 if [ "yes" = "$logf" ]; then
374 use_logf
="#define ROCKBOX_HAS_LOGF 1"
376 if [ "yes" = "$simulator" ]; then
378 extradefines
="$extradefines -DSIMULATOR"
380 if [ "yes" = "$profile" ]; then
381 extradefines
="$extradefines -DRB_PROFILE"
382 PROFILE_OPTS
="-finstrument-functions"
386 # Configure voice settings
389 echo "Building $thislang voice for $modelname. Select options"
392 if [ -f "`which flite`" ]; then
396 DEFAULT_TTS_OPTS
=$FLITE_OPTS
397 DEFAULT_NOISEFLOOR
="500"
400 if [ -f "`which espeak`" ]; then
404 DEFAULT_TTS_OPTS
=$ESPEAK_OPTS
405 DEFAULT_NOISEFLOOR
="500"
408 if [ -f "`which festival`" ]; then
409 FESTIVAL
="(F)estival "
412 FESTIVAL_OPTS
="--language italian"
415 FESTIVAL_OPTS
="--language spanish"
418 FESTIVAL_OPTS
="--language finnish"
421 FESTIVAL_OPTS
="--language czech"
427 DEFAULT_TTS
="festival"
428 DEFAULT_TTS_OPTS
=$FESTIVAL_OPTS
429 DEFAULT_NOISEFLOOR
="500"
432 if [ -f "`which swift`" ]; then
436 DEFAULT_TTS_OPTS
=$SWIFT_OPTS
437 DEFAULT_NOISEFLOOR
="500"
440 # Allow SAPI if Windows is in use
441 if [ -f "`which winver`" ]; then
445 DEFAULT_TTS_OPTS
=$SAPI_OPTS
446 DEFAULT_NOISEFLOOR
="500"
450 if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ] && [ "$ESPEAK" = "$SAPI" ] && [ "$SAPI" = "$SWIFT" ]; then
451 echo "You need Festival, eSpeak or Flite in your path, or SAPI available to build voice files"
455 echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?"
460 NOISEFLOOR
="500" # TODO: check this value
466 TTS_OPTS
=$ESPEAK_OPTS
469 TTS_ENGINE
="festival"
471 TTS_OPTS
=$FESTIVAL_OPTS
484 TTS_ENGINE
=$DEFAULT_TTS
485 TTS_OPTS
=$DEFAULT_TTS_OPTS
486 NOISEFLOOR
=$DEFAULT_NOISEFLOOR
488 echo "Using $TTS_ENGINE for TTS"
490 # Allow the user to input manual commandline options
491 printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): "
492 USER_TTS_OPTS
=`input`
493 if [ -n "$USER_TTS_OPTS" ]; then
494 TTS_OPTS
="$USER_TTS_OPTS"
499 if [ "$swcodec" = "yes" ]; then
502 ENC_OPTS
="-q 4 -c 10"
504 if [ -f "`which lame`" ]; then
507 ENC_OPTS
="--resample 12 -t -m m -h -V 9 -S -B 64 --vbr-new"
509 echo "You need LAME in the system path to build voice files for"
510 echo "HWCODEC targets."
515 echo "Using $ENCODER for encoding voice clips"
517 # Allow the user to input manual commandline options
518 printf "Enter $ENCODER options (enter for defaults \"$ENC_OPTS\"): "
519 USER_ENC_OPTS
=`input`
520 if [ -n "$USER_ENC_OPTS" ]; then
521 ENC_OPTS
=$USER_ENC_OPTS
525 if [ -f "`which cygpath`" ]; then
526 TEMPDIR
=`cygpath . -a -w`
531 # figure out which languages that are around
532 for file in $rootdir/apps
/lang
/*.lang
; do
533 clean
=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
534 langs
="$langs $clean"
538 for one
in $langs; do
548 # Allow the user to pass a comma-separated list of langauges
549 for thispick
in `echo $pick | sed 's/,/ /g'`; do
551 for one
in $langs; do
552 # Accept both the language number and name
553 if [ "$num" = "$thispick" ] ||
[ "$thispick" = "$one" ]; then
554 if [ "$output" = "" ]; then
568 if test "$opt" = "--help"; then
569 echo "Rockbox configure script."
570 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
571 echo "Do *NOT* run this within the tools directory!"
574 Usage: configure [OPTION]...
576 --target=TARGET Sets the target, TARGET can be either the target ID or
577 corresponding string. Run without this option to see the
580 --ram=RAM Sets the RAM for certain targets. Even though any number
581 is accepted, not every number is correct. The default
582 value will be applied, if you entered a wrong number
583 (which depends on the target). Watch the output. Run
584 without this option if you are not sure which the right
587 --type=TYPE Sets the build type. The shortcut is valied.
588 Run without this option to see available types.
589 --ccache Enable ccache use (done by default these days)
590 --no-ccache Disable ccache use
591 --help Shows this message (must not be used with other options)
598 if test -r "configure"; then
599 # this is a check for a configure script in the current directory, it there
600 # is one, try to figure out if it is this one!
602 if { grep "^# Jukebox" configure
>/dev
/null
2>&1 ; } then
603 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
604 echo "It will only cause you pain and grief. Instead do this:"
607 echo " mkdir build-dir"
609 echo " ../tools/configure"
611 echo "Much happiness will arise from this. Enjoy"
616 # get our current directory
619 if { echo $pwd |
grep " "; } then
620 echo "You're running this script in a path that contains space. The build"
621 echo "system is unfortunately not clever enough to deal with this. Please"
622 echo "run the script from a different path, rename the path or fix the build"
627 if [ -z "$rootdir" ]; then
628 ##################################################################
629 # Figure out where the source code root is!
631 rootdir
=`dirname $0`/..
/
633 #####################################################################
634 # Convert the possibly relative directory name to an absolute version
640 # cd back to the build dir
645 appsdir
='\$(ROOTDIR)/apps'
646 firmdir
='\$(ROOTDIR)/firmware'
647 toolsdir
='\$(ROOTDIR)/tools'
650 ##################################################################
651 # Figure out target platform
654 if [ "1" != `parse_args --target` ]; then
655 buildfor
=`parse_args --target`;
657 echo "Enter target platform:"
659 ==Archos== ==iriver== ==Apple iPod==
660 0) Player/Studio 10) H120/H140 20) Color/Photo
661 1) Recorder 11) H320/H340 21) Nano
662 2) FM Recorder 12) iHP-100/110/115 22) Video
663 3) Recorder v2 13) iFP-790 23) 3G
664 4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
665 5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
669 ==iAudio== ==Toshiba== ==SanDisk==
670 30) X5/X5V/X5L 40) Gigabeat F 50) Sansa e200
671 31) M5/M5L 41) Gigabeat S 51) Sansa e200R
673 33) Cowon D2 53) Sansa m200
676 ==Tatung== ==Olympus== ==Logik==
677 60) Elio TPJ-1022 70) M:Robe 500 80) DAX 1GB MP3/DAB
680 ==Creative== ==Philips==
681 90) Zen Vision:M 30GB 100) GoGear SA9200
682 91) Zen Vision:M 60GB
690 # Set of tools built for all target platforms:
691 toolset
="rdf2binary convbdf codepages"
693 # Toolsets for some target families:
694 archosbitmaptools
="$toolset scramble descramble sh2d uclpack bmp2rb"
695 iriverbitmaptools
="$toolset scramble descramble mkboot bmp2rb"
696 iaudiobitmaptools
="$toolset scramble descramble mkboot bmp2rb"
697 ipodbitmaptools
="$toolset scramble bmp2rb"
698 gigabeatbitmaptools
="$toolset scramble descramble bmp2rb"
699 tccbitmaptools
="$toolset scramble mktccboot bmp2rb"
700 # generic is used by IFP, H10, Sansa-e200
701 genericbitmaptools
="$toolset bmp2rb"
704 # ---- For each target ----
707 # target_id: a unique number identifying this target, IS NOT the menu number.
708 # Just use the currently highest number+1 when you add a new
710 # modelname: short model name used all over to identify this target
711 # memory: number of megabytes of RAM this target has. If the amount can
712 # be selected by the size prompt, let memory be unset here
713 # target: -Ddefine passed to the build commands to make the correct
714 # config-*.h file get included etc
715 # tool: the tool that takes a plain binary and converts that into a
716 # working "firmware" file for your target
717 # output: the final output file name
718 # boottool: the tool that takes a plain binary and generates a bootloader
719 # file for your target (or blank to use $tool)
720 # bootoutput:the final output file name for the bootloader (or blank to use
722 # appextra: passed to the APPEXTRA variable in the Makefiles.
723 # TODO: add proper explanation
724 # archosrom: used only for Archos targets that build a special flashable .ucl
726 # flash: name of output for flashing, for targets where there's a special
727 # file output for this.
728 # plugins: set to 'yes' to build the plugins. Early development builds can
729 # set this to no in the early stages to have an easier life for a
731 # swcodec: set 'yes' on swcodec targets
732 # toolset: lists what particular tools in the tools/ directory that this
733 # target needs to have built prior to building Rockbox
736 # *cc: sets up gcc and compiler options for your target builds. Note
737 # that if you select a simulator build, the compiler selection is
738 # overridden later in the script.
745 target
="-DARCHOS_PLAYER"
747 tool
="$rootdir/tools/scramble"
749 appextra
="player:gui"
750 archosrom
="$pwd/rombox.ucl"
751 flash
="$pwd/rockbox.ucl"
755 # toolset is the tools within the tools directory that we build for
756 # this particular target.
757 toolset
="$toolset scramble descramble sh2d player_unifont uclpack"
759 # Note: the convbdf is present in the toolset just because: 1) the
760 # firmware/Makefile assumes it is present always, and 2) we will need it when we
761 # build the player simulator
764 t_manufacturer
="archos"
771 target
="-DARCHOS_RECORDER"
773 tool
="$rootdir/tools/scramble"
774 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
775 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
777 appextra
="recorder:gui"
778 #archosrom="$pwd/rombox.ucl"
779 flash
="$pwd/rockbox.ucl"
782 # toolset is the tools within the tools directory that we build for
783 # this particular target.
784 toolset
=$archosbitmaptools
786 t_manufacturer
="archos"
792 modelname
="fmrecorder"
793 target
="-DARCHOS_FMRECORDER"
795 tool
="$rootdir/tools/scramble -fm"
796 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
797 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
799 appextra
="recorder:gui"
800 #archosrom="$pwd/rombox.ucl"
801 flash
="$pwd/rockbox.ucl"
804 # toolset is the tools within the tools directory that we build for
805 # this particular target.
806 toolset
=$archosbitmaptools
808 t_manufacturer
="archos"
814 modelname
="recorderv2"
815 target
="-DARCHOS_RECORDERV2"
817 tool
="$rootdir/tools/scramble -v2"
818 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
819 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
821 appextra
="recorder:gui"
822 #archosrom="$pwd/rombox.ucl"
823 flash
="$pwd/rockbox.ucl"
826 # toolset is the tools within the tools directory that we build for
827 # this particular target.
828 toolset
=$archosbitmaptools
830 t_manufacturer
="archos"
837 target
="-DARCHOS_ONDIOSP"
839 tool
="$rootdir/tools/scramble -osp"
840 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
841 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
843 appextra
="recorder:gui"
844 archosrom
="$pwd/rombox.ucl"
845 flash
="$pwd/rockbox.ucl"
848 # toolset is the tools within the tools directory that we build for
849 # this particular target.
850 toolset
=$archosbitmaptools
852 t_manufacturer
="archos"
859 target
="-DARCHOS_ONDIOFM"
861 tool
="$rootdir/tools/scramble -ofm"
862 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
863 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
865 appextra
="recorder:gui"
866 #archosrom="$pwd/rombox.ucl"
867 flash
="$pwd/rockbox.ucl"
870 toolset
=$archosbitmaptools
872 t_manufacturer
="archos"
879 target
="-DARCHOS_AV300"
882 tool
="$rootdir/tools/scramble -mm=C"
883 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
884 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
886 appextra
="recorder:gui"
889 # toolset is the tools within the tools directory that we build for
890 # this particular target.
891 toolset
="$toolset scramble descramble bmp2rb"
892 # architecture, manufacturer and model for the target-tree build
894 t_manufacturer
="archos"
901 target
="-DIRIVER_H120"
904 tool
="$rootdir/tools/scramble -add=h120"
905 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
906 bmp2rb_native
="$rootdir/tools/bmp2rb -f 2"
907 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
908 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
909 output
="rockbox.iriver"
910 appextra
="recorder:gui"
911 flash
="$pwd/rombox.iriver"
914 # toolset is the tools within the tools directory that we build for
915 # this particular target.
916 toolset
=$iriverbitmaptools
918 t_manufacturer
="iriver"
925 target
="-DIRIVER_H300"
928 tool
="$rootdir/tools/scramble -add=h300"
929 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
930 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
931 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
932 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
933 output
="rockbox.iriver"
934 appextra
="recorder:gui"
937 # toolset is the tools within the tools directory that we build for
938 # this particular target.
939 toolset
=$iriverbitmaptools
941 t_manufacturer
="iriver"
948 target
="-DIRIVER_H100"
951 tool
="$rootdir/tools/scramble -add=h100"
952 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
953 bmp2rb_native
="$rootdir/tools/bmp2rb -f 2"
954 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
955 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
956 output
="rockbox.iriver"
957 appextra
="recorder:gui"
958 flash
="$pwd/rombox.iriver"
961 # toolset is the tools within the tools directory that we build for
962 # this particular target.
963 toolset
=$iriverbitmaptools
965 t_manufacturer
="iriver"
972 target
="-DIRIVER_IFP7XX"
976 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
977 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
979 appextra
="recorder:gui"
982 # toolset is the tools within the tools directory that we build for
983 # this particular target.
984 toolset
=$genericbitmaptools
986 t_manufacturer
="pnx0101"
987 t_model
="iriver-ifp7xx"
993 target
="-DIRIVER_H10"
996 tool
="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
997 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
998 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
1000 appextra
="recorder:gui"
1003 boottool
="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
1004 bootoutput
="H10_20GC.mi4"
1005 # toolset is the tools within the tools directory that we build for
1006 # this particular target.
1007 toolset
="$genericbitmaptools scramble"
1008 # architecture, manufacturer and model for the target-tree build
1010 t_manufacturer
="iriver"
1017 target
="-DIRIVER_H10_5GB"
1020 tool
="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
1021 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1022 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
1023 output
="rockbox.mi4"
1024 appextra
="recorder:gui"
1027 boottool
="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
1028 bootoutput
="H10.mi4"
1029 # toolset is the tools within the tools directory that we build for
1030 # this particular target.
1031 toolset
="$genericbitmaptools scramble"
1032 # architecture, manufacturer and model for the target-tree build
1034 t_manufacturer
="iriver"
1040 modelname
="ipodcolor"
1041 target
="-DIPOD_COLOR"
1044 tool
="$rootdir/tools/scramble -add=ipco"
1045 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1046 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
1047 output
="rockbox.ipod"
1048 appextra
="recorder:gui"
1051 bootoutput
="bootloader-$modelname.ipod"
1052 # toolset is the tools within the tools directory that we build for
1053 # this particular target.
1054 toolset
=$ipodbitmaptools
1055 # architecture, manufacturer and model for the target-tree build
1057 t_manufacturer
="ipod"
1063 modelname
="ipodnano"
1064 target
="-DIPOD_NANO"
1067 tool
="$rootdir/tools/scramble -add=nano"
1068 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1069 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
1070 output
="rockbox.ipod"
1071 appextra
="recorder:gui"
1074 bootoutput
="bootloader-$modelname.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
1080 t_manufacturer
="ipod"
1086 modelname
="ipodvideo"
1087 target
="-DIPOD_VIDEO"
1089 tool
="$rootdir/tools/scramble -add=ipvd"
1090 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1091 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1092 output
="rockbox.ipod"
1093 appextra
="recorder:gui"
1096 bootoutput
="bootloader-$modelname.ipod"
1097 # toolset is the tools within the tools directory that we build for
1098 # this particular target.
1099 toolset
=$ipodbitmaptools
1100 # architecture, manufacturer and model for the target-tree build
1102 t_manufacturer
="ipod"
1112 tool
="$rootdir/tools/scramble -add=ip3g"
1113 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1114 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
1115 output
="rockbox.ipod"
1116 appextra
="recorder:gui"
1119 bootoutput
="bootloader-$modelname.ipod"
1120 # toolset is the tools within the tools directory that we build for
1121 # this particular target.
1122 toolset
=$ipodbitmaptools
1123 # architecture, manufacturer and model for the target-tree build
1125 t_manufacturer
="ipod"
1135 tool
="$rootdir/tools/scramble -add=ip4g"
1136 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1137 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
1138 output
="rockbox.ipod"
1139 appextra
="recorder:gui"
1142 bootoutput
="bootloader-$modelname.ipod"
1143 # toolset is the tools within the tools directory that we build for
1144 # this particular target.
1145 toolset
=$ipodbitmaptools
1146 # architecture, manufacturer and model for the target-tree build
1148 t_manufacturer
="ipod"
1154 modelname
="ipodmini"
1155 target
="-DIPOD_MINI"
1158 tool
="$rootdir/tools/scramble -add=mini"
1159 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1160 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
1161 output
="rockbox.ipod"
1162 appextra
="recorder:gui"
1165 bootoutput
="bootloader-$modelname.ipod"
1166 # toolset is the tools within the tools directory that we build for
1167 # this particular target.
1168 toolset
=$ipodbitmaptools
1169 # architecture, manufacturer and model for the target-tree build
1171 t_manufacturer
="ipod"
1177 modelname
="ipodmini2g"
1178 target
="-DIPOD_MINI2G"
1181 tool
="$rootdir/tools/scramble -add=mn2g"
1182 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1183 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
1184 output
="rockbox.ipod"
1185 appextra
="recorder:gui"
1188 bootoutput
="bootloader-$modelname.ipod"
1189 # toolset is the tools within the tools directory that we build for
1190 # this particular target.
1191 toolset
=$ipodbitmaptools
1192 # architecture, manufacturer and model for the target-tree build
1194 t_manufacturer
="ipod"
1200 modelname
="ipod1g2g"
1201 target
="-DIPOD_1G2G"
1204 tool
="$rootdir/tools/scramble -add=1g2g"
1205 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1206 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
1207 output
="rockbox.ipod"
1208 appextra
="recorder:gui"
1211 bootoutput
="bootloader-$modelname.ipod"
1212 # toolset is the tools within the tools directory that we build for
1213 # this particular target.
1214 toolset
=$ipodbitmaptools
1215 # architecture, manufacturer and model for the target-tree build
1217 t_manufacturer
="ipod"
1224 target
="-DIAUDIO_X5"
1227 tool
="$rootdir/tools/scramble -add=iax5"
1228 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1229 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1230 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
1231 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 7"
1232 output
="rockbox.iaudio"
1233 appextra
="recorder:gui"
1236 # toolset is the tools within the tools directory that we build for
1237 # this particular target.
1238 toolset
="$iaudiobitmaptools"
1239 # architecture, manufacturer and model for the target-tree build
1241 t_manufacturer
="iaudio"
1248 target
="-DIAUDIO_M5"
1251 tool
="$rootdir/tools/scramble -add=iam5"
1252 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1253 bmp2rb_native
="$rootdir/tools/bmp2rb -f 2"
1254 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
1255 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 7"
1256 output
="rockbox.iaudio"
1257 appextra
="recorder:gui"
1260 # toolset is the tools within the tools directory that we build for
1261 # this particular target.
1262 toolset
="$iaudiobitmaptools"
1263 # architecture, manufacturer and model for the target-tree build
1265 t_manufacturer
="iaudio"
1275 tool
="$rootdir/tools/scramble -add i7"
1276 boottool
="$rootdir/tools/scramble -tcc=crc"
1277 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1278 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
1279 output
="rockbox.iaudio"
1280 appextra
="recorder:gui"
1283 bootoutput
="I7_FW.BIN"
1284 # toolset is the tools within the tools directory that we build for
1285 # this particular target.
1286 toolset
="$tccbitmaptools"
1287 # architecture, manufacturer and model for the target-tree build
1289 t_manufacturer
="tcc77x"
1299 tool
="$rootdir/tools/scramble -add=d2"
1300 boottool
="$rootdir/tools/scramble -tcc=crc"
1301 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1302 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1303 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
1304 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
1305 output
="rockbox.iaudio"
1306 appextra
="recorder:gui"
1309 toolset
="$tccbitmaptools"
1310 # architecture, manufacturer and model for the target-tree build
1312 t_manufacturer
="tcc780x"
1319 target
="-DIAUDIO_M3"
1322 tool
="$rootdir/tools/scramble -add=iam3"
1323 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1324 bmp2rb_native
="$rootdir/tools/bmp2rb -f 7"
1325 output
="rockbox.iaudio"
1326 appextra
="recorder:gui"
1329 # toolset is the tools within the tools directory that we build for
1330 # this particular target.
1331 toolset
="$iaudiobitmaptools"
1332 # architecture, manufacturer and model for the target-tree build
1334 t_manufacturer
="iaudio"
1340 modelname
="gigabeatf"
1341 target
="-DGIGABEAT_F"
1344 tool
="$rootdir/tools/scramble -add=giga"
1345 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1346 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1347 output
="rockbox.gigabeat"
1348 appextra
="recorder:gui"
1351 toolset
=$gigabeatbitmaptools
1352 boottool
="$rootdir/tools/scramble -gigabeat"
1353 bootoutput
="FWIMG01.DAT"
1354 # architecture, manufacturer and model for the target-tree build
1356 t_manufacturer
="s3c2440"
1357 t_model
="gigabeat-fx"
1362 modelname
="gigabeats"
1363 target
="-DGIGABEAT_S"
1366 tool
="$rootdir/tools/scramble -add=gigs"
1367 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1368 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1369 output
="rockbox.gigabeat"
1370 appextra
="recorder:gui"
1373 toolset
="$gigabeatbitmaptools mknkboot"
1374 boottool
="$rootdir/tools/scramble -gigabeats"
1376 # architecture, manufacturer and model for the target-tree build
1378 t_manufacturer
="imx31"
1379 t_model
="gigabeat-s"
1384 modelname
="mrobe500"
1385 target
="-DMROBE_500"
1388 # tool="$rootdir/tools/scramble -add=m500"
1390 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1391 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1392 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
1393 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
1394 output
="rockbox.mrobe500"
1395 appextra
="recorder:gui"
1398 toolset
=$gigabeatbitmaptools
1400 bootoutput
="rockbox.mrboot"
1401 # architecture, manufacturer and model for the target-tree build
1403 t_manufacturer
="tms320dm320"
1409 modelname
="mrobe100"
1410 target
="-DMROBE_100"
1413 tool
="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS"
1414 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1415 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
1416 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
1417 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
1418 output
="rockbox.mi4"
1419 appextra
="recorder:gui"
1422 boottool
="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL"
1423 bootoutput
="pp5020.mi4"
1424 # toolset is the tools within the tools directory that we build for
1425 # this particular target.
1426 toolset
="$genericbitmaptools scramble"
1427 # architecture, manufacturer and model for the target-tree build
1429 t_manufacturer
="olympus"
1435 modelname
="logikdax"
1436 target
="-DLOGIK_DAX"
1439 tool
="$rootdir/tools/scramble -add=ldax"
1440 boottool
="$rootdir/tools/scramble -tcc=crc"
1441 bootoutput
="player.rom"
1442 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1443 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
1444 output
="rockbox.logik"
1445 appextra
="recorder:gui"
1448 # toolset is the tools within the tools directory that we build for
1449 # this particular target.
1450 toolset
=$tccbitmaptools
1451 # architecture, manufacturer and model for the target-tree build
1453 t_manufacturer
="tcc77x"
1459 modelname
="creativezvm30"
1460 target
="-DCREATIVE_ZVM"
1463 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1464 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1465 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
1466 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
1467 tool
="$rootdir/tools/scramble -creative=zvm"
1469 output
="rockbox.zvm"
1470 appextra
="recorder:gui"
1473 toolset
=$ipodbitmaptools
1474 boottool
="$rootdir/tools/scramble -creative=zvm"
1475 bootoutput
="rockbox.zvmboot"
1476 # architecture, manufacturer and model for the target-tree build
1478 t_manufacturer
="tms320dm320"
1479 t_model
="creative-zvm"
1484 modelname
="creativezvm60"
1485 target
="-DCREATIVE_ZVM60GB"
1488 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1489 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1490 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
1491 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
1492 tool
="$rootdir/tools/scramble -creative=zvm60"
1494 output
="rockbox.zvm60"
1495 appextra
="recorder:gui"
1498 toolset
=$ipodbitmaptools
1499 boottool
="$rootdir/tools/scramble -creative=zvm60"
1500 bootoutput
="rockbox.zvm60boot"
1501 # architecture, manufacturer and model for the target-tree build
1503 t_manufacturer
="tms320dm320"
1504 t_model
="creative-zvm"
1507 92|creativezenvision
)
1509 modelname
="creativezv"
1510 target
="-DCREATIVE_ZV"
1513 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1514 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1515 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
1516 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
1517 tool
="$rootdir/tools/scramble -creative=zenvision"
1520 appextra
="recorder:gui"
1523 toolset
=$ipodbitmaptools
1524 boottool
="$rootdir/tools/scramble -creative=zenvision"
1525 bootoutput
="rockbox.zvboot"
1526 # architecture, manufacturer and model for the target-tree build
1528 t_manufacturer
="tms320dm320"
1529 t_model
="creative-zvm"
1535 target
="-DSANSA_E200"
1536 memory
=32 # supposedly
1538 tool
="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1539 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1540 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1541 output
="rockbox.mi4"
1542 appextra
="recorder:gui"
1545 boottool
="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1546 bootoutput
="PP5022.mi4"
1547 # toolset is the tools within the tools directory that we build for
1548 # this particular target.
1549 toolset
="$genericbitmaptools scramble"
1550 # architecture, manufacturer and model for the target-tree build
1552 t_manufacturer
="sandisk"
1553 t_model
="sansa-e200"
1557 # the e200R model is pretty much identical to the e200, it only has a
1558 # different option to the scramble tool when building a bootloader and
1559 # makes the bootloader output file name in all lower case.
1562 target
="-DSANSA_E200"
1563 memory
=32 # supposedly
1565 tool
="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1566 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1567 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1568 output
="rockbox.mi4"
1569 appextra
="recorder:gui"
1572 boottool
="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1573 bootoutput
="pp5022.mi4"
1574 # toolset is the tools within the tools directory that we build for
1575 # this particular target.
1576 toolset
="$genericbitmaptools scramble"
1577 # architecture, manufacturer and model for the target-tree build
1579 t_manufacturer
="sandisk"
1580 t_model
="sansa-e200"
1586 target
="-DSANSA_C200"
1587 memory
=32 # supposedly
1589 tool
="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBOS"
1590 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1591 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1592 output
="rockbox.mi4"
1593 appextra
="recorder:gui"
1596 boottool
="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
1597 bootoutput
="firmware.mi4"
1598 # toolset is the tools within the tools directory that we build for
1599 # this particular target.
1600 toolset
="$genericbitmaptools scramble"
1601 # architecture, manufacturer and model for the target-tree build
1603 t_manufacturer
="sandisk"
1604 t_model
="sansa-c200"
1610 target
="-DSANSA_M200"
1613 tool
="$rootdir/tools/scramble -add=m200"
1614 boottool
="$rootdir/tools/scramble -tcc=crc"
1615 bootoutput
="player.rom"
1616 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1617 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
1618 output
="rockbox.m200"
1619 appextra
="recorder:gui"
1622 # toolset is the tools within the tools directory that we build for
1623 # this particular target.
1624 toolset
=$tccbitmaptools
1625 # architecture, manufacturer and model for the target-tree build
1627 t_manufacturer
="tcc77x"
1634 target
="-DELIO_TPJ1022"
1637 tool
="$rootdir/tools/scramble -add tpj2"
1638 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1639 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
1640 output
="rockbox.elio"
1641 appextra
="recorder:gui"
1644 boottool
="$rootdir/tools/scramble -mi4v2"
1645 bootoutput
="pp5020.mi4"
1646 # toolset is the tools within the tools directory that we build for
1647 # this particular target.
1648 toolset
="$genericbitmaptools scramble"
1649 # architecture, manufacturer and model for the target-tree build
1651 t_manufacturer
="tatung"
1658 target
="-DPHILIPS_SA9200"
1659 memory
=32 # supposedly
1661 tool
="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBOS"
1662 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1663 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1664 output
="rockbox.mi4"
1665 appextra
="recorder:gui"
1668 boottool
="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBBL"
1669 bootoutput
="FWImage.ebn"
1670 # toolset is the tools within the tools directory that we build for
1671 # this particular target.
1672 toolset
="$genericbitmaptools scramble"
1673 # architecture, manufacturer and model for the target-tree build
1675 t_manufacturer
="philips"
1680 echo "Please select a supported target platform!"
1686 echo "Platform set to $modelname"
1690 ############################################################################
1691 # Amount of memory, for those that can differ. They have $memory unset at
1695 if [ -z "$memory" ]; then
1698 echo "Enter size of your RAM (in MB): (Defaults to 32)"
1699 if [ "1" != `parse_args --ram` ]; then
1700 size
=`parse_args --ram`;
1714 echo "Enter size of your RAM (in MB): (Defaults to 2)"
1715 if [ "1" != `parse_args --ram` ]; then
1716 size
=`parse_args --ram`;
1730 echo "Memory size selected: $memory MB"
1735 ##################################################################
1736 # Figure out build "type"
1739 # the ifp7x0 is the only platform that supports building a gdb stub like
1743 gdbstub
="(G)DB stub, "
1746 gdbstub
="(I)installer, "
1751 if [ "1" != `parse_args --type` ]; then
1752 option
=`parse_args --type`;
1754 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, $gdbstub(M)anual: (Defaults to N)"
1760 appsdir
='\$(ROOTDIR)/bootloader'
1762 extradefines
="-DBOOTLOADER -DE200R_INSTALLER -ffunction-sections -fdata-sections"
1764 echo "e200R-installer build selected"
1767 if test $t_manufacturer = "archos"; then
1768 # Archos SH-based players do this somewhat differently for
1770 appsdir
='\$(ROOTDIR)/flash/bootbox'
1773 appsdir
='\$(ROOTDIR)/bootloader'
1776 if test -n "$boottool"; then
1779 if test -n "$bootoutput"; then
1783 extradefines
="-DBOOTLOADER -ffunction-sections -fdata-sections"
1785 echo "Bootloader build selected"
1790 extradefines
="-DSIMULATOR"
1791 echo "Simulator build selected"
1794 echo "Advanced build selected"
1798 extradefines
="-DSTUB" # for target makefile symbol EXTRA_DEFINES
1799 appsdir
='\$(ROOTDIR)/gdb'
1808 echo "GDB stub build selected"
1813 echo "Manual build selected"
1816 if [ "$modelname" = "e200r" ]; then
1817 echo "Do not use the e200R target for regular builds. Use e200 instead."
1821 echo "Normal build selected"
1825 # to be able running "make manual" from non-manual configuration
1828 manualdev
="recorderv2fm"
1831 manualdev
="recorderv2fm"
1837 manualdev
="ipodmini"
1840 manualdev
=$modelname
1844 if [ -z "$debug" ]; then
1845 GCCOPTS
="$GCCOPTS $GCCOPTIMIZE"
1848 echo "Using source code root directory: $rootdir"
1850 # this was once possible to change at build-time, but no more:
1855 if [ "yes" = "$simulator" ]; then
1856 # setup compiler and things for simulator
1859 if [ -d "archos" ]; then
1860 echo "sub directory archos already present"
1863 echo "created an archos subdirectory for simulating the hard disk"
1867 # Now, figure out version number of the (gcc) compiler we are about to use
1868 gccver
=`$CC -dumpversion`;
1870 # figure out the binutil version too and display it, mostly for the build
1871 # system etc to be able to see it easier
1872 ldver
=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
1874 if [ -z "$gccver" ]; then
1875 echo "WARNING: The compiler you must use ($CC) is not in your path!"
1876 echo "WARNING: this may cause your build to fail since we cannot do the"
1877 echo "WARNING: checks we want now."
1880 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
1883 num1
=`echo $gccver | cut -d . -f1`
1884 num2
=`echo $gccver | cut -d . -f2`
1885 gccnum
=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
1892 echo "Using $CC $gccver ($gccnum)"
1894 if test "$gccnum" -ge "400"; then
1895 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
1896 # so we ignore that warnings for now
1898 GCCOPTS
="$GCCOPTS -Wno-pointer-sign"
1901 if test "$gccnum" -ge "401"; then
1902 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
1903 # will break strict-aliasing rules"
1905 GCCOPTS
="$GCCOPTS -fno-strict-aliasing"
1908 if test "$gccnum" -ge "402"; then
1909 # disable warning about "warning: initialized field overwritten" as gcc 4.2
1910 # and later would throw it for several valid cases
1911 GCCOPTS
="$GCCOPTS -Wno-override-init"
1919 # cross-compile for win32
1922 # Verify that the cross-compiler is of a recommended version!
1923 if test "$gccver" != "$gccchoice"; then
1924 echo "WARNING: Your cross-compiler $CC $gccver is not of the recommended"
1925 echo "WARNING: version $gccchoice!"
1926 echo "WARNING: This may cause your build to fail since it may be a version"
1927 echo "WARNING: that isn't functional or known to not be the best choice."
1928 echo "WARNING: If you suffer from build problems, you know that this is"
1929 echo "WARNING: a likely source for them..."
1937 echo "Using $LD $ldver"
1939 # check the compiler for SH platforms
1940 if test "$CC" = "sh-elf-gcc"; then
1941 if test "$gccnum" -lt "400"; then
1942 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
1943 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
1945 # figure out patch status
1946 gccpatch
=`$CC --version`;
1948 if { echo $gccpatch |
grep "rockbox" >/dev
/null
2>&1; } then
1949 echo "gcc $gccver is rockbox patched"
1950 # then convert -O to -Os to get smaller binaries!
1951 GCCOPTS
=`echo $GCCOPTS | sed 's/ -O / -Os /'`
1953 echo "WARNING: You use an unpatched gcc compiler: $gccver"
1954 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
1959 if test "$CC" = "m68k-elf-gcc"; then
1960 # convert -O to -Os to get smaller binaries!
1961 GCCOPTS
=`echo $GCCOPTS | sed 's/ -O / -Os /'`
1965 # echo "checks for $file in $path" >&2
1966 if test -f "$path/$file"; then
1972 if [ "1" != `parse_args --ccache` ]; then
1973 echo "Enable ccache for building"
1976 if [ "1" = `parse_args --no-ccache` ]; then
1977 ccache
=`findtool ccache`
1978 if test -n "$ccache"; then
1979 echo "Found and uses ccache ($ccache)"
1984 if test -n "$ccache"; then
1988 if test "X$endian" = "Xbig"; then
1989 defendian
="ROCKBOX_BIG_ENDIAN"
1991 defendian
="ROCKBOX_LITTLE_ENDIAN"
1995 -e "s,@ENDIAN@,${defendian},g" \
1996 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
1997 -e "s,@config_rtc@,$config_rtc,g" \
1998 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
2000 /* This header was made by configure */
2001 #ifndef __BUILD_AUTOCONF_H
2002 #define __BUILD_AUTOCONF_H
2004 /* Define endianess for the target or simulator platform */
2007 /* Define this if you build rockbox to support the logf logging and display */
2008 #undef ROCKBOX_HAS_LOGF
2010 /* optional defines for RTC mod for h1x0 */
2014 #endif /* __BUILD_AUTOCONF_H */
2017 if test -n "$t_cpu"; then
2018 TARGET_INC
="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
2019 TARGET_INC
="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
2020 TARGET_INC
="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
2024 if test "$simulator" = "yes"; then
2025 # add simul make stuff on the #SIMUL# line
2026 simmagic1
="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
2027 simmagic2
="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
2029 # delete the lines that match
2030 simmagic1
='/@SIMUL1@/D'
2031 simmagic2
='/@SIMUL2@/D'
2034 if test "$swcodec" = "yes"; then
2035 voicetoolset
="rbspeexenc voicefont wavtrim"
2037 voicetoolset
="voicefont wavtrim"
2040 if test "$apps" = "apps"; then
2041 # only when we build "real" apps we build the .lng files
2046 -e "s,@ROOTDIR@,${rootdir},g" \
2047 -e "s,@DEBUG@,${debug},g" \
2048 -e "s,@MEMORY@,${memory},g" \
2049 -e "s,@TARGET_ID@,${target_id},g" \
2050 -e "s,@TARGET@,${target},g" \
2051 -e "s,@CPU@,${t_cpu},g" \
2052 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
2053 -e "s,@MODELNAME@,${modelname},g" \
2054 -e "s,@LANGUAGE@,${language},g" \
2055 -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
2056 -e "s,@PWD@,${pwd},g" \
2057 -e "s,@CC@,${CC},g" \
2058 -e "s,@LD@,${LD},g" \
2059 -e "s,@AR@,${AR},g" \
2060 -e "s,@AS@,${AS},g" \
2061 -e "s,@OC@,${OC},g" \
2062 -e "s,@WINDRES@,${WINDRES},g" \
2063 -e "s,@DLLTOOL@,${DLLTOOL},g" \
2064 -e "s,@DLLWRAP@,${DLLWRAP},g" \
2065 -e "s,@RANLIB@,${RANLIB},g" \
2066 -e "s,@TOOL@,${tool},g" \
2067 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
2068 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
2069 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
2070 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
2071 -e "s,@OUTPUT@,${output},g" \
2072 -e "s,@APPEXTRA@,${appextra},g" \
2073 -e "s,@ARCHOSROM@,${archosrom},g" \
2074 -e "s,@FLASHFILE@,${flash},g" \
2075 -e "s,@PLUGINS@,${plugins},g" \
2076 -e "s,@CODECS@,${swcodec},g" \
2077 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
2078 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
2079 -e "s,@GCCOPTS@,${GCCOPTS},g" \
2080 -e "s,@TARGET_INC@,${TARGET_INC},g" \
2081 -e "s!@LDOPTS@!${LDOPTS}!g" \
2082 -e "s,@LOADADDRESS@,${loadaddress},g" \
2083 -e "s,@EXTRADEF@,${extradefines},g" \
2084 -e "s,@APPSDIR@,${appsdir},g" \
2085 -e "s,@FIRMDIR@,${firmdir},g" \
2086 -e "s,@TOOLSDIR@,${toolsdir},g" \
2087 -e "s,@APPS@,${apps},g" \
2088 -e "s,@SIMVER@,${simver},g" \
2089 -e "s,@GCCVER@,${gccver},g" \
2090 -e "s,@GCCNUM@,${gccnum},g" \
2091 -e "s,@UNAME@,${uname},g" \
2092 -e "s,@ENDIAN@,${defendian},g" \
2093 -e "s,@TOOLSET@,${toolset},g" \
2096 -e "s,@MANUALDEV@,${manualdev},g" \
2097 -e "s,@ENCODER@,${ENC_CMD},g" \
2098 -e "s,@ENC_OPTS@,${ENC_OPTS},g" \
2099 -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
2100 -e "s,@TTS_OPTS@,${TTS_OPTS},g" \
2101 -e "s,@VOICETOOLSET@,${voicetoolset},g" \
2102 -e "s,@LANGS@,${buildlangs},g" \
2103 -e "s,@USE_ELF@,${USE_ELF},g" \
2105 ## Automatically generated. http://www.rockbox.org/
2113 # old 'make' versions don't have the built-in 'info' function
2114 info=old\$(shell echo >&2 "Consider upgrading to GNU make 3.81+ for optimum build performance.")
2115 ifeq (\$(call info),old)
2116 export info=echo "\$\$(1)";
2119 export ROOTDIR=@ROOTDIR@
2120 export FIRMDIR=@FIRMDIR@
2121 export APPSDIR=@APPSDIR@
2122 export TOOLSDIR=@TOOLSDIR@
2123 export DOCSDIR=\$(ROOTDIR)/docs
2124 export MANUALDIR=\${ROOTDIR}/manual
2125 export DEBUG=@DEBUG@
2126 export MODELNAME=@MODELNAME@
2127 export ARCHOSROM=@ARCHOSROM@
2128 export FLASHFILE=@FLASHFILE@
2129 export TARGET_ID=@TARGET_ID@
2130 export TARGET=@TARGET@
2132 export MANUFACTURER=@MANUFACTURER@
2134 export BUILDDIR=@PWD@
2135 export LANGUAGE=@LANGUAGE@
2136 export VOICELANGUAGE=@VOICELANGUAGE@
2137 export MEMORYSIZE=@MEMORY@
2138 export VERSION=\$(shell \$(ROOTDIR)/tools/svnversion.sh \$(ROOTDIR))
2139 export BUILDDATE=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
2140 export MKFIRMWARE=@TOOL@
2141 export BMP2RB_MONO=@BMP2RB_MONO@
2142 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
2143 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
2144 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
2145 export BINARY=@OUTPUT@
2146 export APPEXTRA=@APPEXTRA@
2147 export ENABLEDPLUGINS=@PLUGINS@
2148 export SOFTWARECODECS=@CODECS@
2149 export EXTRA_DEFINES=@EXTRADEF@
2157 export WINDRES=@WINDRES@
2158 export DLLTOOL=@DLLTOOL@
2159 export DLLWRAP=@DLLWRAP@
2160 export RANLIB=@RANLIB@
2161 export PROFILE_OPTS=@PROFILE_OPTS@
2162 export SIMVER=@SIMVER@
2163 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
2164 export GCCOPTS=@GCCOPTS@
2165 export TARGET_INC=@TARGET_INC@
2166 export LOADADDRESS=@LOADADDRESS@
2167 export SHARED_FLAG=@SHARED_FLAG@
2168 export LDOPTS=@LDOPTS@
2169 export GCCVER=@GCCVER@
2170 export GCCNUM=@GCCNUM@
2171 export UNAME=@UNAME@
2172 export MANUALDEV=@MANUALDEV@
2173 export TTS_OPTS=@TTS_OPTS@
2174 export TTS_ENGINE=@TTS_ENGINE@
2175 export ENC_OPTS=@ENC_OPTS@
2176 export ENCODER=@ENCODER@
2177 export USE_ELF=@USE_ELF@
2179 # Do not print "Entering directory ..."
2180 MAKEFLAGS += --no-print-directory
2182 .PHONY: all clean tags zip tools manual bin build info langs
2187 \$(SILENT)\$(TOOLSDIR)/mkinfo.pl \$(BUILDDIR)/rockbox-info.txt
2189 build: tools @LANGS@
2192 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
2193 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@
2198 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
2199 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ \$(BUILDDIR)/\$(BINARY)
2202 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ rocks
2204 veryclean: clean toolsclean
2207 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) clean
2210 \$(SILENT)echo Cleaning build directory
2211 \$(SILENT)rm -rf rockbox.zip TAGS @APPS@ firmware comsim sim lang.[ch]\
2212 manual *.pdf *.a credits.raw @OUTPUT@ bitmaps pluginbitmaps \
2213 @ARCHOSROM@ @FLASHFILE@ UI256.bmp rockbox-full.zip \
2214 html txt rockbox-manual*.zip sysfont.h rockbox-info.txt \
2215 voicefontids *.wav *.mp3 *.voice max_language_size.h
2218 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) AR=\$(HOSTAR) @TOOLSET@
2221 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) AR=\$(HOSTAR) @VOICETOOLSET@
2224 \$(SILENT)rm -f TAGS
2225 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) tags
2226 \$(SILENT)\$(MAKE) -C \$(APPSDIR) tags
2227 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins tags
2228 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins/lib tags
2231 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\" -r "\$(ROOTDIR)" -f 1 -o rockbox-fonts.zip \$(TARGET) \$(BINARY)
2234 \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done ; \\
2235 \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\$\$feat\" -i \"\$(TARGET_ID)\" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
2238 \$(SILENT)find . -name "*.map" | xargs zip rockbox-maps.zip
2241 \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\
2242 \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\$\$feat\" -i \"\$(TARGET_ID)\" -r "\$(ROOTDIR)" -f 2 -o rockbox-full.zip \$(TARGET) \$(BINARY)
2245 \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\
2246 \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\$\$feat\" -i \"\$(TARGET_ID)\" -o "rockbox.7z" -z "7za a" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
2249 \$(SILENT)rm -f rockbox.tar
2250 \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\
2251 \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\$\$feat\" -i \"\$(TARGET_ID)\" -o "rockbox.tar" -z "tar --no-recursion -uf" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
2254 \$(SILENT)bzip2 -f9 rockbox.tar
2257 \$(SILENT)gzip -f9 rockbox.tar
2260 \$(SILENT)mkdir -p \$(BUILDDIR)/apps/lang
2261 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/lang OBJDIR=\$(BUILDDIR)/apps/lang
2265 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-pdf
2267 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-html
2268 manual-zhtml: manual-zip
2270 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-txt
2272 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-txt-zip
2274 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-zip
2277 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ features
2280 @echo "A few helpful make targets"
2282 @echo "all - builds a full Rockbox (default), including tools"
2283 @echo "bin - builds only the Rockbox.<target name> file"
2284 @echo "rocks - builds only plugins and codecs"
2285 @echo "clean - cleans a build directory (not tools)"
2286 @echo "veryclean - cleans the build and tools directories"
2287 @echo "manual - builds a manual"
2288 @echo "manual-html - HTML manual"
2289 @echo "manual-zip - HTML manual (zipped)"
2290 @echo "manual-txt - txt manual"
2291 @echo "fullzip - creates a rockbox.zip of your build with fonts"
2292 @echo "zip - creates a rockbox.zip of your build (no fonts)"
2293 @echo "gzip - creates a rockbox.tar.gz of your build (no fonts)"
2294 @echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)"
2295 @echo "7zip - creates a rockbox.7z of your build (no fonts)"
2296 @echo "fontzip - creates rockbox-fonts.zip"
2297 @echo "mapzip - creates rockbox-maps.zip with all .map files"
2298 @echo "tools - builds the tools only"
2299 @echo "voicetools - builds the voice tools only"
2300 @echo "install - installs your build (for simulator builds only)"
2304 if [ "yes" = "$simulator" ]; then
2306 cat >> Makefile
<<EOF
2309 @echo "installing a full setup in your archos dir"
2310 @(\$(MAKE) fullzip && cd archos && unzip -oq ../rockbox-full.zip)
2315 if [ "yes" = "$voice" ]; then
2317 cat >> Makefile
<<EOF
2319 voice: voicetools features
2320 \$(SILENT)for f in \`cat \$(BUILDDIR)/${apps}/features\`; do feat="\$\$feat:\$\$f" ; done ; \\
2321 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 \\
2326 echo "Created Makefile"