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
687 # Set of tools built for all target platforms:
688 toolset
="rdf2binary convbdf codepages"
690 # Toolsets for some target families:
691 archosbitmaptools
="$toolset scramble descramble sh2d uclpack bmp2rb"
692 iriverbitmaptools
="$toolset scramble descramble mkboot bmp2rb"
693 iaudiobitmaptools
="$toolset scramble descramble mkboot bmp2rb"
694 ipodbitmaptools
="$toolset scramble bmp2rb"
695 gigabeatbitmaptools
="$toolset scramble descramble bmp2rb"
696 tccbitmaptools
="$toolset scramble mktccboot bmp2rb"
697 # generic is used by IFP, H10, Sansa-e200
698 genericbitmaptools
="$toolset bmp2rb"
701 # ---- For each target ----
704 # target_id: a unique number identifying this target, IS NOT the menu number.
705 # Just use the currently highest number+1 when you add a new
707 # modelname: short model name used all over to identify this target
708 # memory: number of megabytes of RAM this target has. If the amount can
709 # be selected by the size prompt, let memory be unset here
710 # target: -Ddefine passed to the build commands to make the correct
711 # config-*.h file get included etc
712 # tool: the tool that takes a plain binary and converts that into a
713 # working "firmware" file for your target
714 # output: the final output file name
715 # boottool: the tool that takes a plain binary and generates a bootloader
716 # file for your target (or blank to use $tool)
717 # bootoutput:the final output file name for the bootloader (or blank to use
719 # appextra: passed to the APPEXTRA variable in the Makefiles.
720 # TODO: add proper explanation
721 # archosrom: used only for Archos targets that build a special flashable .ucl
723 # flash: name of output for flashing, for targets where there's a special
724 # file output for this.
725 # plugins: set to 'yes' to build the plugins. Early development builds can
726 # set this to no in the early stages to have an easier life for a
728 # swcodec: set 'yes' on swcodec targets
729 # toolset: lists what particular tools in the tools/ directory that this
730 # target needs to have built prior to building Rockbox
733 # *cc: sets up gcc and compiler options for your target builds. Note
734 # that if you select a simulator build, the compiler selection is
735 # overridden later in the script.
742 target
="-DARCHOS_PLAYER"
744 tool
="$rootdir/tools/scramble"
746 appextra
="player:gui"
747 archosrom
="$pwd/rombox.ucl"
748 flash
="$pwd/rockbox.ucl"
752 # toolset is the tools within the tools directory that we build for
753 # this particular target.
754 toolset
="$toolset scramble descramble sh2d player_unifont uclpack"
756 # Note: the convbdf is present in the toolset just because: 1) the
757 # firmware/Makefile assumes it is present always, and 2) we will need it when we
758 # build the player simulator
761 t_manufacturer
="archos"
768 target
="-DARCHOS_RECORDER"
770 tool
="$rootdir/tools/scramble"
771 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
772 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
774 appextra
="recorder:gui"
775 #archosrom="$pwd/rombox.ucl"
776 flash
="$pwd/rockbox.ucl"
779 # toolset is the tools within the tools directory that we build for
780 # this particular target.
781 toolset
=$archosbitmaptools
783 t_manufacturer
="archos"
789 modelname
="fmrecorder"
790 target
="-DARCHOS_FMRECORDER"
792 tool
="$rootdir/tools/scramble -fm"
793 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
794 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
796 appextra
="recorder:gui"
797 #archosrom="$pwd/rombox.ucl"
798 flash
="$pwd/rockbox.ucl"
801 # toolset is the tools within the tools directory that we build for
802 # this particular target.
803 toolset
=$archosbitmaptools
805 t_manufacturer
="archos"
811 modelname
="recorderv2"
812 target
="-DARCHOS_RECORDERV2"
814 tool
="$rootdir/tools/scramble -v2"
815 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
816 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
818 appextra
="recorder:gui"
819 #archosrom="$pwd/rombox.ucl"
820 flash
="$pwd/rockbox.ucl"
823 # toolset is the tools within the tools directory that we build for
824 # this particular target.
825 toolset
=$archosbitmaptools
827 t_manufacturer
="archos"
834 target
="-DARCHOS_ONDIOSP"
836 tool
="$rootdir/tools/scramble -osp"
837 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
838 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
840 appextra
="recorder:gui"
841 archosrom
="$pwd/rombox.ucl"
842 flash
="$pwd/rockbox.ucl"
845 # toolset is the tools within the tools directory that we build for
846 # this particular target.
847 toolset
=$archosbitmaptools
849 t_manufacturer
="archos"
856 target
="-DARCHOS_ONDIOFM"
858 tool
="$rootdir/tools/scramble -ofm"
859 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
860 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
862 appextra
="recorder:gui"
863 #archosrom="$pwd/rombox.ucl"
864 flash
="$pwd/rockbox.ucl"
867 toolset
=$archosbitmaptools
869 t_manufacturer
="archos"
876 target
="-DARCHOS_AV300"
879 tool
="$rootdir/tools/scramble -mm=C"
880 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
881 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
883 appextra
="recorder:gui"
886 # toolset is the tools within the tools directory that we build for
887 # this particular target.
888 toolset
="$toolset scramble descramble bmp2rb"
889 # architecture, manufacturer and model for the target-tree build
891 t_manufacturer
="archos"
898 target
="-DIRIVER_H120"
901 tool
="$rootdir/tools/scramble -add=h120"
902 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
903 bmp2rb_native
="$rootdir/tools/bmp2rb -f 2"
904 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
905 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
906 output
="rockbox.iriver"
907 appextra
="recorder:gui"
908 flash
="$pwd/rombox.iriver"
911 # toolset is the tools within the tools directory that we build for
912 # this particular target.
913 toolset
=$iriverbitmaptools
915 t_manufacturer
="iriver"
922 target
="-DIRIVER_H300"
925 tool
="$rootdir/tools/scramble -add=h300"
926 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
927 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
928 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
929 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
930 output
="rockbox.iriver"
931 appextra
="recorder:gui"
934 # toolset is the tools within the tools directory that we build for
935 # this particular target.
936 toolset
=$iriverbitmaptools
938 t_manufacturer
="iriver"
945 target
="-DIRIVER_H100"
948 tool
="$rootdir/tools/scramble -add=h100"
949 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
950 bmp2rb_native
="$rootdir/tools/bmp2rb -f 2"
951 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
952 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
953 output
="rockbox.iriver"
954 appextra
="recorder:gui"
955 flash
="$pwd/rombox.iriver"
958 # toolset is the tools within the tools directory that we build for
959 # this particular target.
960 toolset
=$iriverbitmaptools
962 t_manufacturer
="iriver"
969 target
="-DIRIVER_IFP7XX"
973 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
974 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
976 appextra
="recorder:gui"
979 # toolset is the tools within the tools directory that we build for
980 # this particular target.
981 toolset
=$genericbitmaptools
983 t_manufacturer
="pnx0101"
984 t_model
="iriver-ifp7xx"
990 target
="-DIRIVER_H10"
993 tool
="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
994 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
995 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
997 appextra
="recorder:gui"
1000 boottool
="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
1001 bootoutput
="H10_20GC.mi4"
1002 # toolset is the tools within the tools directory that we build for
1003 # this particular target.
1004 toolset
="$genericbitmaptools scramble"
1005 # architecture, manufacturer and model for the target-tree build
1007 t_manufacturer
="iriver"
1014 target
="-DIRIVER_H10_5GB"
1017 tool
="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
1018 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1019 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
1020 output
="rockbox.mi4"
1021 appextra
="recorder:gui"
1024 boottool
="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
1025 bootoutput
="H10.mi4"
1026 # toolset is the tools within the tools directory that we build for
1027 # this particular target.
1028 toolset
="$genericbitmaptools scramble"
1029 # architecture, manufacturer and model for the target-tree build
1031 t_manufacturer
="iriver"
1037 modelname
="ipodcolor"
1038 target
="-DIPOD_COLOR"
1041 tool
="$rootdir/tools/scramble -add=ipco"
1042 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1043 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
1044 output
="rockbox.ipod"
1045 appextra
="recorder:gui"
1048 bootoutput
="bootloader-$modelname.ipod"
1049 # toolset is the tools within the tools directory that we build for
1050 # this particular target.
1051 toolset
=$ipodbitmaptools
1052 # architecture, manufacturer and model for the target-tree build
1054 t_manufacturer
="ipod"
1060 modelname
="ipodnano"
1061 target
="-DIPOD_NANO"
1064 tool
="$rootdir/tools/scramble -add=nano"
1065 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1066 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
1067 output
="rockbox.ipod"
1068 appextra
="recorder:gui"
1071 bootoutput
="bootloader-$modelname.ipod"
1072 # toolset is the tools within the tools directory that we build for
1073 # this particular target.
1074 toolset
=$ipodbitmaptools
1075 # architecture, manufacturer and model for the target-tree build
1077 t_manufacturer
="ipod"
1083 modelname
="ipodvideo"
1084 target
="-DIPOD_VIDEO"
1086 tool
="$rootdir/tools/scramble -add=ipvd"
1087 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1088 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1089 output
="rockbox.ipod"
1090 appextra
="recorder:gui"
1093 bootoutput
="bootloader-$modelname.ipod"
1094 # toolset is the tools within the tools directory that we build for
1095 # this particular target.
1096 toolset
=$ipodbitmaptools
1097 # architecture, manufacturer and model for the target-tree build
1099 t_manufacturer
="ipod"
1109 tool
="$rootdir/tools/scramble -add=ip3g"
1110 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1111 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
1112 output
="rockbox.ipod"
1113 appextra
="recorder:gui"
1116 bootoutput
="bootloader-$modelname.ipod"
1117 # toolset is the tools within the tools directory that we build for
1118 # this particular target.
1119 toolset
=$ipodbitmaptools
1120 # architecture, manufacturer and model for the target-tree build
1122 t_manufacturer
="ipod"
1132 tool
="$rootdir/tools/scramble -add=ip4g"
1133 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1134 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
1135 output
="rockbox.ipod"
1136 appextra
="recorder:gui"
1139 bootoutput
="bootloader-$modelname.ipod"
1140 # toolset is the tools within the tools directory that we build for
1141 # this particular target.
1142 toolset
=$ipodbitmaptools
1143 # architecture, manufacturer and model for the target-tree build
1145 t_manufacturer
="ipod"
1151 modelname
="ipodmini"
1152 target
="-DIPOD_MINI"
1155 tool
="$rootdir/tools/scramble -add=mini"
1156 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1157 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
1158 output
="rockbox.ipod"
1159 appextra
="recorder:gui"
1162 bootoutput
="bootloader-$modelname.ipod"
1163 # toolset is the tools within the tools directory that we build for
1164 # this particular target.
1165 toolset
=$ipodbitmaptools
1166 # architecture, manufacturer and model for the target-tree build
1168 t_manufacturer
="ipod"
1174 modelname
="ipodmini2g"
1175 target
="-DIPOD_MINI2G"
1178 tool
="$rootdir/tools/scramble -add=mn2g"
1179 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1180 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
1181 output
="rockbox.ipod"
1182 appextra
="recorder:gui"
1185 bootoutput
="bootloader-$modelname.ipod"
1186 # toolset is the tools within the tools directory that we build for
1187 # this particular target.
1188 toolset
=$ipodbitmaptools
1189 # architecture, manufacturer and model for the target-tree build
1191 t_manufacturer
="ipod"
1197 modelname
="ipod1g2g"
1198 target
="-DIPOD_1G2G"
1201 tool
="$rootdir/tools/scramble -add=1g2g"
1202 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1203 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
1204 output
="rockbox.ipod"
1205 appextra
="recorder:gui"
1208 bootoutput
="bootloader-$modelname.ipod"
1209 # toolset is the tools within the tools directory that we build for
1210 # this particular target.
1211 toolset
=$ipodbitmaptools
1212 # architecture, manufacturer and model for the target-tree build
1214 t_manufacturer
="ipod"
1221 target
="-DIAUDIO_X5"
1224 tool
="$rootdir/tools/scramble -add=iax5"
1225 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1226 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1227 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
1228 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 7"
1229 output
="rockbox.iaudio"
1230 appextra
="recorder:gui"
1233 # toolset is the tools within the tools directory that we build for
1234 # this particular target.
1235 toolset
="$iaudiobitmaptools"
1236 # architecture, manufacturer and model for the target-tree build
1238 t_manufacturer
="iaudio"
1245 target
="-DIAUDIO_M5"
1248 tool
="$rootdir/tools/scramble -add=iam5"
1249 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1250 bmp2rb_native
="$rootdir/tools/bmp2rb -f 2"
1251 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
1252 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 7"
1253 output
="rockbox.iaudio"
1254 appextra
="recorder:gui"
1257 # toolset is the tools within the tools directory that we build for
1258 # this particular target.
1259 toolset
="$iaudiobitmaptools"
1260 # architecture, manufacturer and model for the target-tree build
1262 t_manufacturer
="iaudio"
1272 tool
="$rootdir/tools/scramble -add i7"
1273 boottool
="$rootdir/tools/scramble -tcc=crc"
1274 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1275 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
1276 output
="rockbox.iaudio"
1277 appextra
="recorder:gui"
1280 bootoutput
="I7_FW.BIN"
1281 # toolset is the tools within the tools directory that we build for
1282 # this particular target.
1283 toolset
="$tccbitmaptools"
1284 # architecture, manufacturer and model for the target-tree build
1286 t_manufacturer
="tcc77x"
1296 tool
="$rootdir/tools/scramble -add=d2"
1297 boottool
="$rootdir/tools/scramble -tcc=crc"
1298 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1299 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1300 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
1301 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
1302 output
="rockbox.iaudio"
1303 appextra
="recorder:gui"
1306 toolset
="$tccbitmaptools"
1307 # architecture, manufacturer and model for the target-tree build
1309 t_manufacturer
="tcc780x"
1316 target
="-DIAUDIO_M3"
1319 tool
="$rootdir/tools/scramble -add=iam3"
1320 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1321 bmp2rb_native
="$rootdir/tools/bmp2rb -f 7"
1322 output
="rockbox.iaudio"
1323 appextra
="recorder:gui"
1326 # toolset is the tools within the tools directory that we build for
1327 # this particular target.
1328 toolset
="$iaudiobitmaptools"
1329 # architecture, manufacturer and model for the target-tree build
1331 t_manufacturer
="iaudio"
1337 modelname
="gigabeatf"
1338 target
="-DGIGABEAT_F"
1341 tool
="$rootdir/tools/scramble -add=giga"
1342 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1343 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1344 output
="rockbox.gigabeat"
1345 appextra
="recorder:gui"
1348 toolset
=$gigabeatbitmaptools
1349 boottool
="$rootdir/tools/scramble -gigabeat"
1350 bootoutput
="FWIMG01.DAT"
1351 # architecture, manufacturer and model for the target-tree build
1353 t_manufacturer
="s3c2440"
1354 t_model
="gigabeat-fx"
1359 modelname
="gigabeats"
1360 target
="-DGIGABEAT_S"
1363 tool
="$rootdir/tools/scramble -add=gigs"
1364 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1365 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1366 output
="rockbox.gigabeat"
1367 appextra
="recorder:gui"
1370 toolset
="$gigabeatbitmaptools mknkboot"
1371 boottool
="$rootdir/tools/scramble -gigabeats"
1373 # architecture, manufacturer and model for the target-tree build
1375 t_manufacturer
="imx31"
1376 t_model
="gigabeat-s"
1381 modelname
="mrobe500"
1382 target
="-DMROBE_500"
1385 # tool="$rootdir/tools/scramble -add=m500"
1387 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1388 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1389 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
1390 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
1391 output
="rockbox.mrobe500"
1392 appextra
="recorder:gui"
1395 toolset
=$gigabeatbitmaptools
1397 bootoutput
="rockbox.mrboot"
1398 # architecture, manufacturer and model for the target-tree build
1400 t_manufacturer
="tms320dm320"
1406 modelname
="mrobe100"
1407 target
="-DMROBE_100"
1410 tool
="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS"
1411 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1412 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
1413 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
1414 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
1415 output
="rockbox.mi4"
1416 appextra
="recorder:gui"
1419 boottool
="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL"
1420 bootoutput
="pp5020.mi4"
1421 # toolset is the tools within the tools directory that we build for
1422 # this particular target.
1423 toolset
="$genericbitmaptools scramble"
1424 # architecture, manufacturer and model for the target-tree build
1426 t_manufacturer
="olympus"
1432 modelname
="logikdax"
1433 target
="-DLOGIK_DAX"
1436 tool
="$rootdir/tools/scramble -add=ldax"
1437 boottool
="$rootdir/tools/scramble -tcc=crc"
1438 bootoutput
="player.rom"
1439 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1440 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
1441 output
="rockbox.logik"
1442 appextra
="recorder:gui"
1445 # toolset is the tools within the tools directory that we build for
1446 # this particular target.
1447 toolset
=$tccbitmaptools
1448 # architecture, manufacturer and model for the target-tree build
1450 t_manufacturer
="tcc77x"
1456 modelname
="creativezvm"
1457 target
="-DCREATIVE_ZVM"
1460 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1461 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1462 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
1463 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
1464 tool
="$rootdir/tools/scramble -creative=zvm"
1465 output
="rockbox.zvm"
1466 appextra
="recorder:gui"
1469 toolset
=$ipodbitmaptools
1470 boottool
="$rootdir/tools/scramble -creative=zvm"
1471 bootoutput
="rockbox.zvmboot"
1472 # architecture, manufacturer and model for the target-tree build
1474 t_manufacturer
="tms320dm320"
1475 t_model
="creative-zvm"
1481 target
="-DSANSA_E200"
1482 memory
=32 # supposedly
1484 tool
="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1485 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1486 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1487 output
="rockbox.mi4"
1488 appextra
="recorder:gui"
1491 boottool
="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1492 bootoutput
="PP5022.mi4"
1493 # toolset is the tools within the tools directory that we build for
1494 # this particular target.
1495 toolset
="$genericbitmaptools scramble"
1496 # architecture, manufacturer and model for the target-tree build
1498 t_manufacturer
="sandisk"
1499 t_model
="sansa-e200"
1503 # the e200R model is pretty much identical to the e200, it only has a
1504 # different option to the scramble tool when building a bootloader and
1505 # makes the bootloader output file name in all lower case.
1508 target
="-DSANSA_E200"
1509 memory
=32 # supposedly
1511 tool
="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1512 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1513 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1514 output
="rockbox.mi4"
1515 appextra
="recorder:gui"
1518 boottool
="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1519 bootoutput
="pp5022.mi4"
1520 # toolset is the tools within the tools directory that we build for
1521 # this particular target.
1522 toolset
="$genericbitmaptools scramble"
1523 # architecture, manufacturer and model for the target-tree build
1525 t_manufacturer
="sandisk"
1526 t_model
="sansa-e200"
1532 target
="-DSANSA_C200"
1533 memory
=32 # supposedly
1535 tool
="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBOS"
1536 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1537 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
1538 output
="rockbox.mi4"
1539 appextra
="recorder:gui"
1542 boottool
="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
1543 bootoutput
="firmware.mi4"
1544 # toolset is the tools within the tools directory that we build for
1545 # this particular target.
1546 toolset
="$genericbitmaptools scramble"
1547 # architecture, manufacturer and model for the target-tree build
1549 t_manufacturer
="sandisk"
1550 t_model
="sansa-c200"
1556 target
="-DSANSA_M200"
1559 tool
="$rootdir/tools/scramble -add=m200"
1560 boottool
="$rootdir/tools/scramble -tcc=crc"
1561 bootoutput
="player.rom"
1562 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1563 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
1564 output
="rockbox.m200"
1565 appextra
="recorder:gui"
1568 # toolset is the tools within the tools directory that we build for
1569 # this particular target.
1570 toolset
=$tccbitmaptools
1571 # architecture, manufacturer and model for the target-tree build
1573 t_manufacturer
="tcc77x"
1580 target
="-DELIO_TPJ1022"
1583 tool
="$rootdir/tools/scramble -add tpj2"
1584 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1585 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
1586 output
="rockbox.elio"
1587 appextra
="recorder:gui"
1590 boottool
="$rootdir/tools/scramble -mi4v2"
1591 bootoutput
="pp5020.mi4"
1592 # toolset is the tools within the tools directory that we build for
1593 # this particular target.
1594 toolset
="$genericbitmaptools scramble"
1595 # architecture, manufacturer and model for the target-tree build
1597 t_manufacturer
="tatung"
1602 echo "Please select a supported target platform!"
1608 echo "Platform set to $modelname"
1612 ############################################################################
1613 # Amount of memory, for those that can differ. They have $memory unset at
1617 if [ -z "$memory" ]; then
1620 echo "Enter size of your RAM (in MB): (Defaults to 32)"
1621 if [ "1" != `parse_args --ram` ]; then
1622 size
=`parse_args --ram`;
1636 echo "Enter size of your RAM (in MB): (Defaults to 2)"
1637 if [ "1" != `parse_args --ram` ]; then
1638 size
=`parse_args --ram`;
1652 echo "Memory size selected: $memory MB"
1657 ##################################################################
1658 # Figure out build "type"
1661 # the ifp7x0 is the only platform that supports building a gdb stub like
1665 gdbstub
="(G)DB stub, "
1668 gdbstub
="(I)installer, "
1673 if [ "1" != `parse_args --type` ]; then
1674 option
=`parse_args --type`;
1676 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, $gdbstub(M)anual: (Defaults to N)"
1682 appsdir
='\$(ROOTDIR)/bootloader'
1684 extradefines
="-DBOOTLOADER -DE200R_INSTALLER -ffunction-sections -fdata-sections"
1686 echo "e200R-installer build selected"
1689 if test $t_manufacturer = "archos"; then
1690 # Archos SH-based players do this somewhat differently for
1692 appsdir
='\$(ROOTDIR)/flash/bootbox'
1695 appsdir
='\$(ROOTDIR)/bootloader'
1698 if test -n "$boottool"; then
1701 if test -n "$bootoutput"; then
1705 extradefines
="-DBOOTLOADER -ffunction-sections -fdata-sections"
1707 echo "Bootloader build selected"
1712 extradefines
="-DSIMULATOR"
1713 echo "Simulator build selected"
1716 echo "Advanced build selected"
1720 extradefines
="-DSTUB" # for target makefile symbol EXTRA_DEFINES
1721 appsdir
='\$(ROOTDIR)/gdb'
1730 echo "GDB stub build selected"
1735 echo "Manual build selected"
1738 if [ "$modelname" = "e200r" ]; then
1739 echo "Do not use the e200R target for regular builds. Use e200 instead."
1743 echo "Normal build selected"
1747 # to be able running "make manual" from non-manual configuration
1750 manualdev
="recorderv2fm"
1753 manualdev
="recorderv2fm"
1759 manualdev
="ipodmini"
1762 manualdev
=$modelname
1766 if [ -z "$debug" ]; then
1767 GCCOPTS
="$GCCOPTS $GCCOPTIMIZE"
1770 echo "Using source code root directory: $rootdir"
1772 # this was once possible to change at build-time, but no more:
1777 if [ "yes" = "$simulator" ]; then
1778 # setup compiler and things for simulator
1781 if [ -d "archos" ]; then
1782 echo "sub directory archos already present"
1785 echo "created an archos subdirectory for simulating the hard disk"
1789 # Now, figure out version number of the (gcc) compiler we are about to use
1790 gccver
=`$CC -dumpversion`;
1792 # figure out the binutil version too and display it, mostly for the build
1793 # system etc to be able to see it easier
1794 ldver
=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
1796 if [ -z "$gccver" ]; then
1797 echo "WARNING: The compiler you must use ($CC) is not in your path!"
1798 echo "WARNING: this may cause your build to fail since we cannot do the"
1799 echo "WARNING: checks we want now."
1802 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
1805 num1
=`echo $gccver | cut -d . -f1`
1806 num2
=`echo $gccver | cut -d . -f2`
1807 gccnum
=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
1814 echo "Using $CC $gccver ($gccnum)"
1816 if test "$gccnum" -ge "400"; then
1817 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
1818 # so we ignore that warnings for now
1820 GCCOPTS
="$GCCOPTS -Wno-pointer-sign"
1823 if test "$gccnum" -ge "401"; then
1824 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
1825 # will break strict-aliasing rules"
1827 GCCOPTS
="$GCCOPTS -fno-strict-aliasing"
1830 if test "$gccnum" -ge "402"; then
1831 # disable warning about "warning: initialized field overwritten" as gcc 4.2
1832 # and later would throw it for several valid cases
1833 GCCOPTS
="$GCCOPTS -Wno-override-init"
1841 # cross-compile for win32
1844 # Verify that the cross-compiler is of a recommended version!
1845 if test "$gccver" != "$gccchoice"; then
1846 echo "WARNING: Your cross-compiler $CC $gccver is not of the recommended"
1847 echo "WARNING: version $gccchoice!"
1848 echo "WARNING: This may cause your build to fail since it may be a version"
1849 echo "WARNING: that isn't functional or known to not be the best choice."
1850 echo "WARNING: If you suffer from build problems, you know that this is"
1851 echo "WARNING: a likely source for them..."
1859 echo "Using $LD $ldver"
1861 # check the compiler for SH platforms
1862 if test "$CC" = "sh-elf-gcc"; then
1863 if test "$gccnum" -lt "400"; then
1864 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
1865 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
1867 # figure out patch status
1868 gccpatch
=`$CC --version`;
1870 if { echo $gccpatch |
grep "rockbox" >/dev
/null
2>&1; } then
1871 echo "gcc $gccver is rockbox patched"
1872 # then convert -O to -Os to get smaller binaries!
1873 GCCOPTS
=`echo $GCCOPTS | sed 's/ -O / -Os /'`
1875 echo "WARNING: You use an unpatched gcc compiler: $gccver"
1876 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
1881 if test "$CC" = "m68k-elf-gcc"; then
1882 # convert -O to -Os to get smaller binaries!
1883 GCCOPTS
=`echo $GCCOPTS | sed 's/ -O / -Os /'`
1887 # echo "checks for $file in $path" >&2
1888 if test -f "$path/$file"; then
1894 if [ "1" != `parse_args --ccache` ]; then
1895 echo "Enable ccache for building"
1898 if [ "1" = `parse_args --no-ccache` ]; then
1899 ccache
=`findtool ccache`
1900 if test -n "$ccache"; then
1901 echo "Found and uses ccache ($ccache)"
1906 if test -n "$ccache"; then
1910 if test "X$endian" = "Xbig"; then
1911 defendian
="ROCKBOX_BIG_ENDIAN"
1913 defendian
="ROCKBOX_LITTLE_ENDIAN"
1917 -e "s,@ENDIAN@,${defendian},g" \
1918 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
1919 -e "s,@config_rtc@,$config_rtc,g" \
1920 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
1922 /* This header was made by configure */
1923 #ifndef __BUILD_AUTOCONF_H
1924 #define __BUILD_AUTOCONF_H
1926 /* Define endianess for the target or simulator platform */
1929 /* Define this if you build rockbox to support the logf logging and display */
1930 #undef ROCKBOX_HAS_LOGF
1932 /* optional defines for RTC mod for h1x0 */
1936 #endif /* __BUILD_AUTOCONF_H */
1939 if test -n "$t_cpu"; then
1940 TARGET_INC
="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
1941 TARGET_INC
="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
1942 TARGET_INC
="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
1946 if test "$simulator" = "yes"; then
1947 # add simul make stuff on the #SIMUL# line
1948 simmagic1
="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
1949 simmagic2
="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
1951 # delete the lines that match
1952 simmagic1
='/@SIMUL1@/D'
1953 simmagic2
='/@SIMUL2@/D'
1956 if test "$swcodec" = "yes"; then
1957 voicetoolset
="rbspeexenc voicefont wavtrim"
1959 voicetoolset
="voicefont wavtrim"
1962 if test "$apps" = "apps"; then
1963 # only when we build "real" apps we build the .lng files
1968 -e "s,@ROOTDIR@,${rootdir},g" \
1969 -e "s,@DEBUG@,${debug},g" \
1970 -e "s,@MEMORY@,${memory},g" \
1971 -e "s,@TARGET_ID@,${target_id},g" \
1972 -e "s,@TARGET@,${target},g" \
1973 -e "s,@CPU@,${t_cpu},g" \
1974 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
1975 -e "s,@MODELNAME@,${modelname},g" \
1976 -e "s,@LANGUAGE@,${language},g" \
1977 -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
1978 -e "s,@PWD@,${pwd},g" \
1979 -e "s,@CC@,${CC},g" \
1980 -e "s,@LD@,${LD},g" \
1981 -e "s,@AR@,${AR},g" \
1982 -e "s,@AS@,${AS},g" \
1983 -e "s,@OC@,${OC},g" \
1984 -e "s,@WINDRES@,${WINDRES},g" \
1985 -e "s,@DLLTOOL@,${DLLTOOL},g" \
1986 -e "s,@DLLWRAP@,${DLLWRAP},g" \
1987 -e "s,@RANLIB@,${RANLIB},g" \
1988 -e "s,@TOOL@,${tool},g" \
1989 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
1990 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
1991 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
1992 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
1993 -e "s,@OUTPUT@,${output},g" \
1994 -e "s,@APPEXTRA@,${appextra},g" \
1995 -e "s,@ARCHOSROM@,${archosrom},g" \
1996 -e "s,@FLASHFILE@,${flash},g" \
1997 -e "s,@PLUGINS@,${plugins},g" \
1998 -e "s,@CODECS@,${swcodec},g" \
1999 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
2000 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
2001 -e "s,@GCCOPTS@,${GCCOPTS},g" \
2002 -e "s,@TARGET_INC@,${TARGET_INC},g" \
2003 -e "s!@LDOPTS@!${LDOPTS}!g" \
2004 -e "s,@LOADADDRESS@,${loadaddress},g" \
2005 -e "s,@EXTRADEF@,${extradefines},g" \
2006 -e "s,@APPSDIR@,${appsdir},g" \
2007 -e "s,@FIRMDIR@,${firmdir},g" \
2008 -e "s,@TOOLSDIR@,${toolsdir},g" \
2009 -e "s,@APPS@,${apps},g" \
2010 -e "s,@SIMVER@,${simver},g" \
2011 -e "s,@GCCVER@,${gccver},g" \
2012 -e "s,@GCCNUM@,${gccnum},g" \
2013 -e "s,@UNAME@,${uname},g" \
2014 -e "s,@ENDIAN@,${defendian},g" \
2015 -e "s,@TOOLSET@,${toolset},g" \
2018 -e "s,@MANUALDEV@,${manualdev},g" \
2019 -e "s,@ENCODER@,${ENC_CMD},g" \
2020 -e "s,@ENC_OPTS@,${ENC_OPTS},g" \
2021 -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
2022 -e "s,@TTS_OPTS@,${TTS_OPTS},g" \
2023 -e "s,@VOICETOOLSET@,${voicetoolset},g" \
2024 -e "s,@LANGS@,${buildlangs},g" \
2026 ## Automatically generated. http://www.rockbox.org/
2034 # old 'make' versions don't have the built-in 'info' function
2035 info=old\$(shell echo >&2 "Consider upgrading to GNU make 3.81+ for optimum build performance.")
2036 ifeq (\$(call info),old)
2037 export info=echo "\$\$(1)";
2040 export ROOTDIR=@ROOTDIR@
2041 export FIRMDIR=@FIRMDIR@
2042 export APPSDIR=@APPSDIR@
2043 export TOOLSDIR=@TOOLSDIR@
2044 export DOCSDIR=\$(ROOTDIR)/docs
2045 export MANUALDIR=\${ROOTDIR}/manual
2046 export DEBUG=@DEBUG@
2047 export MODELNAME=@MODELNAME@
2048 export ARCHOSROM=@ARCHOSROM@
2049 export FLASHFILE=@FLASHFILE@
2050 export TARGET_ID=@TARGET_ID@
2051 export TARGET=@TARGET@
2053 export MANUFACTURER=@MANUFACTURER@
2055 export BUILDDIR=@PWD@
2056 export LANGUAGE=@LANGUAGE@
2057 export VOICELANGUAGE=@VOICELANGUAGE@
2058 export MEMORYSIZE=@MEMORY@
2059 export VERSION=\$(shell \$(ROOTDIR)/tools/svnversion.sh \$(ROOTDIR))
2060 export BUILDDATE=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
2061 export MKFIRMWARE=@TOOL@
2062 export BMP2RB_MONO=@BMP2RB_MONO@
2063 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
2064 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
2065 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
2066 export BINARY=@OUTPUT@
2067 export APPEXTRA=@APPEXTRA@
2068 export ENABLEDPLUGINS=@PLUGINS@
2069 export SOFTWARECODECS=@CODECS@
2070 export EXTRA_DEFINES=@EXTRADEF@
2078 export WINDRES=@WINDRES@
2079 export DLLTOOL=@DLLTOOL@
2080 export DLLWRAP=@DLLWRAP@
2081 export RANLIB=@RANLIB@
2082 export PROFILE_OPTS=@PROFILE_OPTS@
2083 export SIMVER=@SIMVER@
2084 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
2085 export GCCOPTS=@GCCOPTS@
2086 export TARGET_INC=@TARGET_INC@
2087 export LOADADDRESS=@LOADADDRESS@
2088 export SHARED_FLAG=@SHARED_FLAG@
2089 export LDOPTS=@LDOPTS@
2090 export GCCVER=@GCCVER@
2091 export GCCNUM=@GCCNUM@
2092 export UNAME=@UNAME@
2093 export MANUALDEV=@MANUALDEV@
2094 export TTS_OPTS=@TTS_OPTS@
2095 export TTS_ENGINE=@TTS_ENGINE@
2096 export ENC_OPTS=@ENC_OPTS@
2097 export ENCODER=@ENCODER@
2099 # Do not print "Entering directory ..."
2100 MAKEFLAGS += --no-print-directory
2102 .PHONY: all clean tags zip tools manual bin build info langs
2107 \$(SILENT)\$(TOOLSDIR)/mkinfo.pl \$(BUILDDIR)/rockbox-info.txt
2109 build: tools @LANGS@
2112 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
2113 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@
2118 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
2119 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ \$(BUILDDIR)/\$(BINARY)
2122 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ rocks
2124 veryclean: clean toolsclean
2127 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) clean
2130 \$(SILENT)echo Cleaning build directory
2131 \$(SILENT)rm -rf rockbox.zip TAGS @APPS@ firmware comsim sim lang.[ch]\
2132 manual *.pdf *.a credits.raw @OUTPUT@ bitmaps pluginbitmaps \
2133 @ARCHOSROM@ @FLASHFILE@ UI256.bmp rockbox-full.zip \
2134 html txt rockbox-manual*.zip sysfont.h rockbox-info.txt \
2135 voicefontids *.wav *.mp3 *.voice max_language_size.h
2138 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) AR=\$(HOSTAR) @TOOLSET@
2141 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) AR=\$(HOSTAR) @VOICETOOLSET@
2144 \$(SILENT)rm -f TAGS
2145 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) tags
2146 \$(SILENT)\$(MAKE) -C \$(APPSDIR) tags
2147 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins tags
2148 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins/lib tags
2151 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\" -r "\$(ROOTDIR)" -f 1 -o rockbox-fonts.zip \$(TARGET) \$(BINARY)
2154 \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done ; \\
2155 \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\$\$feat\" -i \"\$(TARGET_ID)\" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
2158 \$(SILENT)find . -name "*.map" | xargs zip rockbox-maps.zip
2161 \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\
2162 \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\$\$feat\" -i \"\$(TARGET_ID)\" -r "\$(ROOTDIR)" -f 2 -o rockbox-full.zip \$(TARGET) \$(BINARY)
2165 \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\
2166 \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\$\$feat\" -i \"\$(TARGET_ID)\" -o "rockbox.7z" -z "7za a" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
2169 \$(SILENT)rm -f rockbox.tar
2170 \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\
2171 \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\$\$feat\" -i \"\$(TARGET_ID)\" -o "rockbox.tar" -z "tar --no-recursion -uf" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
2174 \$(SILENT)bzip2 -f9 rockbox.tar
2177 \$(SILENT)gzip -f9 rockbox.tar
2180 \$(SILENT)mkdir -p \$(BUILDDIR)/apps/lang
2181 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/lang OBJDIR=\$(BUILDDIR)/apps/lang
2185 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-pdf
2187 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-html
2188 manual-zhtml: manual-zip
2190 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-txt
2192 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-txt-zip
2194 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-zip
2197 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ features
2200 @echo "A few helpful make targets"
2202 @echo "all - builds a full Rockbox (default), including tools"
2203 @echo "bin - builds only the Rockbox.<target name> file"
2204 @echo "rocks - builds only plugins and codecs"
2205 @echo "clean - cleans a build directory (not tools)"
2206 @echo "veryclean - cleans the build and tools directories"
2207 @echo "manual - builds a manual"
2208 @echo "manual-html - HTML manual"
2209 @echo "manual-zip - HTML manual (zipped)"
2210 @echo "manual-txt - txt manual"
2211 @echo "fullzip - creates a rockbox.zip of your build with fonts"
2212 @echo "zip - creates a rockbox.zip of your build (no fonts)"
2213 @echo "gzip - creates a rockbox.tar.gz of your build (no fonts)"
2214 @echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)"
2215 @echo "7zip - creates a rockbox.7z of your build (no fonts)"
2216 @echo "fontzip - creates rockbox-fonts.zip"
2217 @echo "mapzip - creates rockbox-maps.zip with all .map files"
2218 @echo "tools - builds the tools only"
2219 @echo "voicetools - builds the voice tools only"
2220 @echo "install - installs your build (for simulator builds only)"
2224 if [ "yes" = "$simulator" ]; then
2226 cat >> Makefile
<<EOF
2229 @echo "installing a full setup in your archos dir"
2230 @(\$(MAKE) fullzip && cd archos && unzip -oq ../rockbox-full.zip)
2235 if [ "yes" = "$voice" ]; then
2237 cat >> Makefile
<<EOF
2239 voice: voicetools features
2240 \$(SILENT)for f in \`cat \$(BUILDDIR)/${apps}/features\`; do feat="\$\$feat:\$\$f" ; done ; \\
2241 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 \\
2246 echo "Created Makefile"