3 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
11 # global CC options for all platforms
12 CCOPTS
="-W -Wall -O -nostdlib -ffreestanding -Wstrict-prototypes"
14 use_logf
="#undef ROCKBOX_HAS_LOGF"
15 use_simsound
="#undef ROCKBOX_HAS_SIMSOUND"
17 scriptver
=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'`
20 # Begin Function Definitions
30 WINDRES
=${prefix}windres
31 DLLTOOL
=${prefix}dlltool
32 DLLWRAP
=${prefix}dllwrap
33 RANLIB
=${prefix}ranlib
41 # naive approach to selecting a mingw cross-compiler on linux/*nix
42 echo "Enabling win32 crosscompiling"
44 prefixtools i586-mingw32msvc-
46 LDOPTS
="-lgdi32 -luser32 -mwindows"
47 # add cross-compiler option(s)
48 GCCOPTS
="$GCCOPTS -mno-cygwin"
50 output
="rockboxui.exe" # use this as output binary name
52 endian
="little" # windows is little endian
56 if test -n "$codecs"; then
57 if test -f "/usr/include/sys/soundcard.h"; then
58 # We have a header file so we can build the sound code
59 use_simsound
="#define ROCKBOX_HAS_SIMSOUND 1"
60 echo "Enabled PCM sound playback in simulator"
61 fi # header file present
65 # scan the $PATH for the given command
72 # echo "checks for $file in $path" >&2
73 if test -f "$path/$file"; then
83 # default tool setup for native building
86 GCCOPTS
='-W -Wall -g -fno-builtin'
88 output
="rockboxui" # use this as default output binary name
90 if [ "$simver" = "sdl" ]; then
91 # generic sdl-config checker
92 sdl
=`findtool sdl-config`
94 if [ -z "$sdl" ]; then
95 echo "configure didn't find sdl-config, which indicates that you"
96 echo "don't have SDL (properly) installed. Please correct and"
97 echo "re-run configure!"
104 echo "Cygwin host detected"
106 if [ "$simver" = "win32" ]; then
108 GCCOPTS
="$GCCOPTS -mno-cygwin -DNOCYGWIN"
109 LDOPTS
="-lgdi32 -luser32 -mno-cygwin"
110 elif [ "$simver" = "sdl" ]; then
112 GCCOPTS
="$GCCOPTS `sdl-config --cflags`"
113 LDOPTS
="`sdl-config --libs`"
118 LDOPTS
='-L/usr/X11R6/lib -lSM -lICE -lXt -lX11 -lXmu -lSM -lICE -lX11 -lpthread'
121 output
="rockboxui.exe" # use this as output binary name
125 echo "Linux host detected"
127 if [ "$simver" = "win32" ]; then
128 LDOPTS
='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -lnsl -ldl -lpthread'
129 crosswincc
# setup cross-compiler
130 elif [ "$simver" = "sdl" ]; then
131 if [ "0" != `sdl-config --libs |grep -c mwindows` ]; then
132 # Enable crosscompiling if sdl-config is from Windows SDL
135 GCCOPTS
="$GCCOPTS `sdl-config --cflags`"
136 LDOPTS
="`sdl-config --libs`"
139 LDOPTS
='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -lnsl -ldl -lpthread'
141 fi # not a cross-compiler
145 echo "FreeBSD host detected"
146 LDOPTS
='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -dl -lpthread'
147 if [ "$simver" = "win32" ]; then
148 crosswincc
# setup cross-compiler
153 echo "Unsupported system: $uname, fix configure and retry"
158 if [ `uname -m` = "x86_64" ]; then
159 GCCOPTS
="$GCCOPTS -fPIC" # needed to make shared objects link
162 if test "X$crosscompile" != "Xyes"; then
164 cat >/tmp
/conftest-
$id.c
<<EOF
166 int main(int argc, char **argv)
169 char *varp = (char *)&var;
177 $CC -o /tmp
/conftest-
$id /tmp
/conftest-
$id.c
2>/dev
/null
179 if test `/tmp/conftest-$id 2>/dev/null` -gt "1"; then
186 echo "Simulator environment deemed $endian endian"
188 # use wildcard here to make it work even if it was named *.exe like
190 rm -f /tmp
/conftest-
$id*
196 GCCOPTS
="$CCOPTS -m1"
197 GCCOPTIMIZE
="-fomit-frame-pointer -fschedule-insns"
202 prefixtools calmrisc16-unknown-elf-
203 GCCOPTS
="-Wl\,--no-check-sections $CCOPTS"
204 GCCOPTIMIZE
="-fomit-frame-pointer"
209 prefixtools m68k-elf-
210 GCCOPTS
="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
211 GCCOPTIMIZE
="-fomit-frame-pointer"
217 GCCOPTS
="$CCOPTS -mcpu=arm7tdmi"
218 if test "X$1" != "Xshort"; then
219 GCCOPTS
="$GCCOPTS -ffunction-sections -mlong-calls"
221 GCCOPTIMIZE
="-fomit-frame-pointer"
227 GCCOPTS
="$CCOPTS -mcpu=arm9tdmi -ffunction-sections -mlong-calls"
228 GCCOPTIMIZE
="-fomit-frame-pointer"
236 echo "Where do you want the firmware to be flashed?"
237 echo "WARNING: Do not answer this question lightly,"
238 echo "unless you don't plan to flash your gmini."
239 echo "In this case, reply '0x10000' (no quotes) and "
240 echo "re-configure when you know better."
243 if [ "0$loadaddress" = "0" ]; then
245 loadaddress
="0x10000";
247 echo "You selected $loadaddress"
255 ##################################################################
256 # Prompt for specific developer options
259 echo "Enter your developer options (press enter when done)"
260 echo "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling"
263 while [ $cont = "1" ]; do
269 if [ "yes" = "$profile" ]; then
270 echo "Debug is incompatible with profiling"
277 echo "logf() support enabled"
281 echo "Simulator build enabled"
285 if [ "yes" = "$use_debug" ]; then
286 echo "Profiling is incompatible with debug"
288 echo "Profiling support is enabled"
299 if [ "yes" = "$use_debug" ]; then
301 GCCOPTS
="$GCCOPTS -g -DDEBUG"
303 if [ "yes" = "$logf" ]; then
304 use_logf
="#define ROCKBOX_HAS_LOGF 1"
306 if [ "yes" = "$simulator" ]; then
308 extradefines
="$extradefines -DSIMULATOR"
311 if [ "yes" = "$profile" ]; then
312 extradefines
="$extradefines -DRB_PROFILE"
313 PROFILE_OPTS
="-finstrument-functions"
319 if [ -z "$simver" ]; then
321 ##################################################################
322 # Figure out what simulator version
324 # x11 is deprecated so hide it from the question
325 # win32 is also deprecated
328 echo "Build (S)DL version? (S)"
340 # make sure the code knows this is for win32
341 extradefines
="$extradefines -DWIN32"
345 extradefines
="$extradefines -DX11"
349 extradefines
="$extradefines -DSDL"
352 echo "Selected $simver simulator"
358 if test "$target" = "--help"; then
359 echo "Rockbox configure script."
360 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
361 echo "Do *NOT* run this within the tools directory!"
363 echo "Usage: configure [--ccache][--no-ccache]"
367 if test -r "configure"; then
368 # this is a check for a configure script in the current directory, it there
369 # is one, try to figure out if it is this one!
371 if { grep "^# Jukebox" configure
>/dev
/null
2>&1 ; } then
372 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
373 echo "It will only cause you pain and grief. Instead do this:"
376 echo " mkdir build-dir"
378 echo " ../tools/configure"
380 echo "Much happiness will arise from this. Enjoy"
385 # get our current directory
388 if [ -z "$rootdir" ]; then
389 ##################################################################
390 # Figure out where the source code root is!
393 firmfile
="crt0.S" # a file to check for in the firmware root dir
395 for dir
in . .. ..
/.. ..
/rockbox
*; do
396 if [ -f $dir/firmware
/$firmfile ]; then
402 if [ -z "$rootdir" ]; then
403 echo "This script couldn't find your source code root directory. Please enter the"
404 echo "full path to the source code directory here:"
409 #####################################################################
410 # Convert the possibly relative directory name to an absolute version
416 # cd back to the build dir
421 appsdir
='\$(ROOTDIR)/apps'
422 firmdir
='\$(ROOTDIR)/firmware'
423 toolsdir
='\$(ROOTDIR)/tools'
426 ##################################################################
427 # Figure out target platform
430 echo "Enter target platform:"
432 ==Archos== ==iriver== ==Apple iPod==
433 0) Player/Studio 10) H120/H140 20) Color/Photo
434 1) Recorder 11) H320/H340 21) Nano
435 2) FM Recorder 12) iHP-100/110/115 22) Video
436 3) Recorder v2 13) iFP-790 23) 3G
437 4) Gmini 120 14) H10 20Gb 24) 4G Grayscale
438 5) Gmini SP 15) H10 5/6Gb 25) Mini 1G
439 6) Ondio SP 26) Mini 2G
442 ==iAudio== ==Toshiba== ==SanDisk==
443 30) X5/X5V/X5L 40) Gigabeat F 50) Sansa e200
451 # Set of tools built for all target platforms:
452 toolset
="rdf2binary convbdf"
454 # Toolsets for some target families:
455 archosbitmaptools
="$toolset scramble descramble sh2d uclpack bmp2rb codepages"
456 iriverbitmaptools
="$toolset scramble descramble mkboot bmp2rb codepages"
457 iaudiobitmaptools
="$toolset scramble descramble mkboot bmp2rb codepages"
458 ipodbitmaptools
="$toolset scramble ipod_fw bmp2rb codepages"
459 gigabeatbitmaptools
="$toolset scramble descramble bmp2rb codepages"
460 # generic is used by IFP, H10, Sansa-e200
461 genericbitmaptools
="$toolset bmp2rb codepages"
464 # ---- For each target ----
467 # target_id: a unique number identifying this target, DOES NOT necessarily
468 # have to be the menu number. Just use the currently highest
469 # number+1 when you add a new target.
470 # archos: short model name used all over to identify this target
471 # target: -Ddefine passed to the build commands to make the correct
472 # config-*.h file get included etc
473 # tool: the tool that takes a plain binary and converts that into a
474 # working "firmware" file for your target
475 # output: the final output file name
476 # boottool: the tool that takes a plain binary and generates a bootloader
477 # file for your target (or blank to use $tool)
478 # bootoutput:the final output file name for the bootloader (or blank to use
480 # appextra: passed to the APPEXTRA variable in the Makefiles.
481 # TODO: add proper explanation
482 # archosrom: used only for Archos targets that build a special flashable .ucl
483 # image. Set to blank for other builds.
484 # flash: the same as archosrom. These two should be merged
485 # plugins: set to 'yes' to build the plugins. Early development builds can
486 # set this to no in the early stages to have an easier life for a
488 # codecs: lists codecs to build for this target
489 # toolset: lists what particular tools in the tools/ directory that this
490 # target needs to have built prior to building Rockbox
493 # *cc: sets up gcc and compiler options for your target builds. Note
494 # that if you select a simulator build, the compiler selection is
495 # overridden later in the script.
502 target
="-DARCHOS_PLAYER"
504 tool
="$rootdir/tools/scramble"
506 appextra
="player:gui"
507 archosrom
="$pwd/rombox.ucl"
508 flash
="$pwd/rockbox.ucl"
512 # toolset is the tools within the tools directory that we build for
513 # this particular target.
514 toolset
="$toolset scramble descramble sh2d generate_rocklatin uclpack"
516 # Note: the convbdf is present in the toolset just because: 1) the
517 # firmware/Makefile assumes it is present always, and 2) we will need it when we
518 # build the player simulator
525 target
="-DARCHOS_RECORDER"
527 tool
="$rootdir/tools/scramble"
528 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
529 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
531 appextra
="recorder:gui"
532 archosrom
="$pwd/rombox.ucl"
533 flash
="$pwd/rockbox.ucl"
536 # toolset is the tools within the tools directory that we build for
537 # this particular target.
538 toolset
=$archosbitmaptools
544 target
="-DARCHOS_FMRECORDER"
546 tool
="$rootdir/tools/scramble -fm"
547 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
548 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
550 appextra
="recorder:gui"
551 archosrom
="$pwd/rombox.ucl"
552 flash
="$pwd/rockbox.ucl"
555 # toolset is the tools within the tools directory that we build for
556 # this particular target.
557 toolset
=$archosbitmaptools
563 target
="-DARCHOS_RECORDERV2"
565 tool
="$rootdir/tools/scramble -v2"
566 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
567 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
569 appextra
="recorder:gui"
570 archosrom
="$pwd/rombox.ucl"
571 flash
="$pwd/rockbox.ucl"
574 # toolset is the tools within the tools directory that we build for
575 # this particular target.
576 toolset
=$archosbitmaptools
582 target
="-DARCHOS_GMINI120"
583 memory
=16 # fixed size (16 is a guess, remove comment when checked)
585 tool
="cp" # might work for now!
586 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
587 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
588 output
="rockbox.gmini"
589 appextra
="recorder:gui"
592 plugins
="" # disabled for now, enable later on
594 # toolset is the tools within the tools directory that we build for
595 # this particular target.
596 toolset
="$toolset bmp2rb codepages"
602 target
="-DARCHOS_GMINISP"
603 memory
=16 # fixed size (16 is a guess, remove comment when checked)
605 tool
="cp" # might work for now!
606 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
607 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
608 output
="rockbox.gmini"
609 appextra
="recorder:gui"
612 plugins
="" # disabled for now, enable later on
614 # toolset is the tools within the tools directory that we build for
615 # this particular target.
616 toolset
="$toolset bmp2rb codepages"
622 target
="-DARCHOS_ONDIOSP"
624 tool
="$rootdir/tools/scramble -osp"
625 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
626 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
628 appextra
="recorder:gui"
629 archosrom
="$pwd/rombox.ucl"
630 flash
="$pwd/rockbox.ucl"
633 # toolset is the tools within the tools directory that we build for
634 # this particular target.
635 toolset
=$archosbitmaptools
641 target
="-DARCHOS_ONDIOFM"
643 tool
="$rootdir/tools/scramble -ofm"
644 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
645 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
647 appextra
="recorder:gui"
648 archosrom
="$pwd/rombox.ucl"
649 flash
="$pwd/rockbox.ucl"
652 toolset
=$archosbitmaptools
658 target
="-DIRIVER_H120"
661 tool
="$rootdir/tools/scramble -add=h120"
662 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
663 bmp2rb_native
="$rootdir/tools/bmp2rb -f 2"
664 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
665 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
666 output
="rockbox.iriver"
667 appextra
="recorder:gui"
671 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
672 # toolset is the tools within the tools directory that we build for
673 # this particular target.
674 toolset
=$iriverbitmaptools
680 target
="-DIRIVER_H300"
683 tool
="$rootdir/tools/scramble -add=h300"
684 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
685 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
686 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
687 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
688 output
="rockbox.iriver"
689 appextra
="recorder:gui"
693 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
694 # toolset is the tools within the tools directory that we build for
695 # this particular target.
696 toolset
=$iriverbitmaptools
702 target
="-DIRIVER_H100"
705 tool
="$rootdir/tools/scramble -add=h100"
706 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
707 bmp2rb_native
="$rootdir/tools/bmp2rb -f 2"
708 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
709 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
710 output
="rockbox.iriver"
711 appextra
="recorder:gui"
715 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
716 # toolset is the tools within the tools directory that we build for
717 # this particular target.
718 toolset
=$iriverbitmaptools
727 tool
="$rootdir/tools/scramble -add=iax5"
728 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
729 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
730 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
731 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 7"
732 output
="rockbox.iaudio"
733 appextra
="recorder:gui"
737 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
738 # toolset is the tools within the tools directory that we build for
739 # this particular target.
740 toolset
="$iaudiobitmaptools"
741 # architecture, manufacturer and model for the target-tree build
743 t_manufacturer
="iaudio"
750 target
="-DIPOD_COLOR"
753 tool
="$rootdir/tools/scramble -add=ipco"
754 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
755 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
756 output
="rockbox.ipod"
757 appextra
="recorder:gui"
761 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
762 boottool
="$rootdir/tools/scramble -ipod4g"
763 bootoutput
="bootloader.img"
764 # toolset is the tools within the tools directory that we build for
765 # this particular target.
766 toolset
=$ipodbitmaptools
775 tool
="$rootdir/tools/scramble -add=nano"
776 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
777 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
778 output
="rockbox.ipod"
779 appextra
="recorder:gui"
783 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
784 boottool
="$rootdir/tools/scramble -ipod4g"
785 bootoutput
="bootloader.img"
786 # toolset is the tools within the tools directory that we build for
787 # this particular target.
788 toolset
=$ipodbitmaptools
794 target
="-DIPOD_VIDEO"
795 memory
=32 # 30GB models have 32MB, 60GB have 64MB
797 tool
="$rootdir/tools/scramble -add=ipvd"
798 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
799 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
800 output
="rockbox.ipod"
801 appextra
="recorder:gui"
805 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
806 boottool
="$rootdir/tools/scramble -ipod5g"
807 bootoutput
="bootloader.img"
808 # toolset is the tools within the tools directory that we build for
809 # this particular target.
810 toolset
=$ipodbitmaptools
819 tool
="$rootdir/tools/scramble -add=ip3g"
820 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
821 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
822 output
="rockbox.ipod"
823 appextra
="recorder:gui"
827 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
828 boottool
="$rootdir/tools/scramble -ipod3g"
829 bootoutput
="bootloader.img"
830 # toolset is the tools within the tools directory that we build for
831 # this particular target.
832 toolset
=$ipodbitmaptools
841 tool
="$rootdir/tools/scramble -add=ip4g"
842 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
843 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
844 output
="rockbox.ipod"
845 appextra
="recorder:gui"
849 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
850 boottool
="$rootdir/tools/scramble -ipod4g"
851 bootoutput
="bootloader.img"
852 # toolset is the tools within the tools directory that we build for
853 # this particular target.
854 toolset
=$ipodbitmaptools
863 tool
="$rootdir/tools/scramble -add=mini"
864 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
865 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
866 output
="rockbox.ipod"
867 appextra
="recorder:gui"
871 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
872 boottool
="$rootdir/tools/scramble -ipod4g"
873 bootoutput
="bootloader.img"
874 # toolset is the tools within the tools directory that we build for
875 # this particular target.
876 toolset
=$ipodbitmaptools
882 target
="-DIRIVER_IFP7XX"
886 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
887 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
889 appextra
="recorder:gui"
893 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
894 # toolset is the tools within the tools directory that we build for
895 # this particular target.
896 toolset
=$genericbitmaptools
902 target
="-DGIGABEAT_F"
906 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
907 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
908 output
="rockbox.gigabeat"
909 appextra
="recorder:gui"
913 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
914 toolset
=$gigabeatbitmaptools
915 boottool
="$rootdir/tools/scramble -gigabeat"
916 bootoutput
="FWIMG01.DAT"
917 # architecture, manufacturer and model for the target-tree build
919 t_manufacturer
="gigabeat"
926 target
="-DIPOD_MINI2G"
929 tool
="$rootdir/tools/scramble -add=mn2g"
930 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
931 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
932 output
="rockbox.ipod"
933 appextra
="recorder:gui"
937 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
938 boottool
="$rootdir/tools/scramble -ipod4g"
939 bootoutput
="bootloader.img"
940 # toolset is the tools within the tools directory that we build for
941 # this particular target.
942 toolset
=$ipodbitmaptools
948 target
="-DIRIVER_H10"
951 tool
="$rootdir/tools/scramble -add=h10"
952 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
953 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
955 appextra
="recorder:gui"
959 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
960 boottool
="$rootdir/tools/scramble -mi4v3"
961 bootoutput
="H10_20GC.mi4"
962 # toolset is the tools within the tools directory that we build for
963 # this particular target.
964 toolset
="$genericbitmaptools scramble"
965 # architecture, manufacturer and model for the target-tree build
967 t_manufacturer
="iriver"
974 target
="-DSANSA_E200"
975 memory
=32 # supposedly
977 tool
="$rootdir/tools/mkmi4.sh e200"
978 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
979 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
981 appextra
="recorder:gui"
985 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
986 boottool
="$rootdir/tools/scramble -mi4v3"
987 bootoutput
="PP5022.mi4"
988 # toolset is the tools within the tools directory that we build for
989 # this particular target.
990 toolset
="$genericbitmaptools scramble"
991 # architecture, manufacturer and model for the target-tree build
993 t_manufacturer
="sandisk"
1000 target
="-DIRIVER_H10_5GB"
1003 tool
="$rootdir/tools/scramble -add=h10_5gb"
1004 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1005 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
1006 output
="rockbox.h10"
1007 appextra
="recorder:gui"
1011 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
1012 boottool
="$rootdir/tools/scramble -mi4v2"
1013 bootoutput
="H10.mi4"
1014 # toolset is the tools within the tools directory that we build for
1015 # this particular target.
1016 toolset
="$genericbitmaptools scramble"
1017 # architecture, manufacturer and model for the target-tree build
1019 t_manufacturer
="iriver"
1026 target
="-DELIO_TPJ1022"
1029 tool
="$rootdir/tools/scramble -add tpj2"
1030 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1031 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
1032 output
="rockbox.elio"
1033 appextra
="recorder:gui"
1037 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
1038 boottool
="$rootdir/tools/scramble -mi4v2"
1039 bootoutput
="pp5020.mi4"
1040 # toolset is the tools within the tools directory that we build for
1041 # this particular target.
1042 toolset
="$genericbitmaptools scramble"
1043 # architecture, manufacturer and model for the target-tree build
1045 t_manufacturer
="tatung"
1050 echo "Please select a supported target platform!"
1056 echo "Platform set to $archos"
1059 ############################################################################
1060 # Amount of memory, for those that can differ.
1063 if [ -z "$memory" ]; then
1065 if [ -z "$update" ]; then
1066 echo "Enter size of your RAM (in MB): (defaults to 2)"
1079 echo "Memory size selected: $memory MB"
1082 ##################################################################
1083 # Figure out build "type"
1086 # the ifp7x0 is the only platform that supports building a gdb stub like
1090 gdbstub
="(G)DB stub, "
1097 echo "Build (N)ormal, (D)evel, (S)imulator, (B)ootloader, $gdbstub(M)anual? (N)"
1103 if test -n "$archosrom"; then
1104 # Archos SH-based players do this somewhat differently for
1106 extradefines
="-DBOOTLOADER -ffunction-sections -fdata-sections"
1107 appsdir
='\$(ROOTDIR)/flash/bootbox'
1110 extradefines
="-DBOOTLOADER" # for target makefile symbol EXTRA_DEFINES
1111 appsdir
='\$(ROOTDIR)/bootloader'
1113 if test -n "$boottool"; then
1116 if test -n "$bootoutput"; then
1121 echo "Bootloader build selected"
1126 extradefines
="-DSIMULATOR"
1127 echo "Simulator build selected"
1131 echo "Devel build selected"
1135 extradefines
="-DSTUB" # for target makefile symbol EXTRA_DEFINES
1136 appsdir
='\$(ROOTDIR)/gdb'
1145 echo "GDB stub build selected"
1148 appsdir
='\$(ROOTDIR)/manual'
1149 firmdir
='\$(ROOTDIR)/manual/platform' # No Makefile here. Effectively ignores target
1155 archos
="recorderv2fm"
1158 archos
="recorderv2fm"
1169 echo "Manual build selected"
1173 echo "Normal build selected"
1178 if [ -z "$debug" ]; then
1179 GCCOPTS
="$GCCOPTS $GCCOPTIMIZE"
1184 echo "Using source code root directory: $rootdir"
1186 # this was once possible to change at build-time, but no more:
1191 if [ "yes" = "$simulator" ]; then
1192 # setup compiler and things for simulator
1195 if [ -d "archos" ]; then
1196 echo "sub directory archos already present"
1199 echo "created an archos subdirectory for simulating the hard disk"
1203 # Now, figure out version number of the (gcc) compiler we are about to use
1204 gccver
=`$CC -dumpversion`;
1206 if [ -z "$gccver" ]; then
1207 echo "WARNING: The compiler you must use ($CC) is not in your path!"
1208 echo "WARNING: this may cause your build to fail since we cannot do the"
1209 echo "WARNING: checks we want now."
1212 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
1215 num1
=`echo $gccver | cut -d . -f1`
1216 num2
=`echo $gccver | cut -d . -f2`
1217 gccnum
=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
1224 echo "Using $CC $gccver ($gccnum)"
1226 if test "$gccnum" -ge "400"; then
1227 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
1228 # so we ignore that warnings for now
1230 GCCOPTS
="$GCCOPTS -Wno-pointer-sign"
1233 if test "$gccnum" -ge "401"; then
1234 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
1235 # will break strict-aliasing rules"
1237 GCCOPTS
="$GCCOPTS -fno-strict-aliasing"
1242 # check the compiler for SH platforms
1243 if test "$CC" = "sh-elf-gcc"; then
1244 if test "$gccnum" -lt "400"; then
1245 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
1246 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
1248 # figure out patch status
1249 gccpatch
=`$CC --version`;
1251 if { echo $gccpatch |
grep "rockbox" >/dev
/null
2>&1; } then
1252 echo "gcc $gccver is rockbox patched"
1253 # then convert -O to -Os to get smaller binaries!
1254 GCCOPTS
=`echo $GCCOPTS | sed 's/ -O / -Os /'`
1256 echo "WARNING: You use an unpatched gcc compiler: $gccver"
1257 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
1262 if test "$1" = "--ccache"; then
1263 echo "Enable ccache for building"
1266 if test "$1" != "--no-ccache"; then
1267 ccache
=`findtool ccache`
1268 if test -n "$ccache"; then
1269 echo "Found and uses ccache ($ccache)"
1274 if test -n "$ccache"; then
1278 if test "X$endian" = "Xbig"; then
1279 defendian
="ROCKBOX_BIG_ENDIAN"
1281 defendian
="ROCKBOX_LITTLE_ENDIAN"
1285 -e "s,@ENDIAN@,${defendian},g" \
1286 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
1287 -e "s,@SIMSOUND@,$use_simsound,g" \
1289 /* This header was made by configure */
1290 #ifndef __BUILD_AUTOCONF_H
1291 #define __BUILD_AUTOCONF_H
1293 /* Define endianess for the target or simulator platform */
1296 /* Define this if you build rockbox to support the logf logging and display */
1297 #undef ROCKBOX_HAS_LOGF
1299 /* Define this if you have the linux/soundcard.h header and thus can compile
1300 the sound-playing code in the X11 sim */
1303 #endif /* __BUILD_AUTOCONF_H */
1306 if test -n "$t_cpu"; then
1307 TARGET_INC
="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
1308 TARGET_INC
="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
1309 TARGET_INC
="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
1313 if test "$simulator" = "yes"; then
1314 # add simul make stuff on the #SIMUL# line
1315 simmagic1
="s,@SIMUL1@,@\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
1316 simmagic2
="s,@SIMUL2@,@\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
1318 # delete the lines that match
1319 simmagic1
='/@SIMUL1@/D'
1320 simmagic2
='/@SIMUL2@/D'
1324 -e "s,@ROOTDIR@,${rootdir},g" \
1325 -e "s,@DEBUG@,${debug},g" \
1326 -e "s,@MEMORY@,${memory},g" \
1327 -e "s,@TARGET_ID@,${target_id},g" \
1328 -e "s,@TARGET@,${target},g" \
1329 -e "s,@ARCHOS@,${archos},g" \
1330 -e "s,@LANGUAGE@,${language},g" \
1331 -e "s,@PWD@,${pwd},g" \
1332 -e "s,@CC@,${CC},g" \
1333 -e "s,@LD@,${LD},g" \
1334 -e "s,@AR@,${AR},g" \
1335 -e "s,@AS@,${AS},g" \
1336 -e "s,@OC@,${OC},g" \
1337 -e "s,@WINDRES@,${WINDRES},g" \
1338 -e "s,@DLLTOOL@,${DLLTOOL},g" \
1339 -e "s,@DLLWRAP@,${DLLWRAP},g" \
1340 -e "s,@RANLIB@,${RANLIB},g" \
1341 -e "s,@TOOL@,${tool},g" \
1342 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
1343 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
1344 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
1345 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
1346 -e "s,@OUTPUT@,${output},g" \
1347 -e "s,@APPEXTRA@,${appextra},g" \
1348 -e "s,@ARCHOSROM@,${archosrom},g" \
1349 -e "s,@FLASHFILE@,${flash},g" \
1350 -e "s,@PLUGINS@,${plugins},g" \
1351 -e "s,@CODECS@,${codecs},g" \
1352 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
1353 -e "s,@GCCOPTS@,${GCCOPTS},g" \
1354 -e "s,@TARGET_INC@,${TARGET_INC},g" \
1355 -e "s!@LDOPTS@!${LDOPTS}!g" \
1356 -e "s,@LOADADDRESS@,${loadaddress},g" \
1357 -e "s,@EXTRADEF@,${extradefines},g" \
1358 -e "s,@APPSDIR@,${appsdir},g" \
1359 -e "s,@FIRMDIR@,${firmdir},g" \
1360 -e "s,@TOOLSDIR@,${toolsdir},g" \
1361 -e "s,@APPS@,${apps},g" \
1362 -e "s,@SIMVER@,${simver},g" \
1363 -e "s,@GCCVER@,${gccver},g" \
1364 -e "s,@GCCNUM@,${gccnum},g" \
1365 -e "s,@UNAME@,${uname},g" \
1366 -e "s,@ENDIAN@,${defendian},g" \
1367 -e "s,@TOOLSET@,${toolset},g" \
1371 ## Automaticly generated. http://www.rockbox.org/
1379 export ROOTDIR=@ROOTDIR@
1380 export FIRMDIR=@FIRMDIR@
1381 export APPSDIR=@APPSDIR@
1382 export TOOLSDIR=@TOOLSDIR@
1383 export DOCSDIR=\$(ROOTDIR)/docs
1384 export MANUALDIR=\${ROOTDIR}/manual
1385 export DEBUG=@DEBUG@
1386 export ARCHOS=@ARCHOS@
1387 export ARCHOSROM=@ARCHOSROM@
1388 export FLASHFILE=@FLASHFILE@
1389 export TARGET_ID=@TARGET_ID@
1390 export TARGET=@TARGET@
1392 export BUILDDIR=@PWD@
1393 export LANGUAGE=@LANGUAGE@
1394 export MEMORYSIZE=@MEMORY@
1395 export VERSION=\$(shell date +%y%m%d-%H%M)
1396 export BUILDDATE=\$(shell date +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
1397 export MKFIRMWARE=@TOOL@
1398 export BMP2RB_MONO=@BMP2RB_MONO@
1399 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
1400 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
1401 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
1402 export BINARY=@OUTPUT@
1403 export APPEXTRA=@APPEXTRA@
1404 export ENABLEDPLUGINS=@PLUGINS@
1405 export SOFTWARECODECS=@CODECS@
1406 export EXTRA_DEFINES=@EXTRADEF@
1413 export WINDRES=@WINDRES@
1414 export DLLTOOL=@DLLTOOL@
1415 export DLLWRAP=@DLLWRAP@
1416 export RANLIB=@RANLIB@
1417 export PROFILE_OPTS=@PROFILE_OPTS@
1418 export GCCOPTS=@GCCOPTS@
1419 export TARGET_INC=@TARGET_INC@
1420 export LOADADDRESS=@LOADADDRESS@
1421 export SIMVER=@SIMVER@
1422 export SIMDIR=\$(ROOTDIR)/uisimulator/\$(SIMVER)
1423 export LDOPTS=@LDOPTS@
1424 export GCCVER=@GCCVER@
1425 export GCCNUM=@GCCNUM@
1426 export UNAME=@UNAME@
1428 # Do not print "Entering directory ..."
1429 MAKEFLAGS += --no-print-directory
1431 .PHONY: all clean tags zip tools manual
1436 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
1437 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@
1442 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
1443 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ \$(BUILDDIR)/\$(BINARY)
1445 veryclean: clean toolsclean
1448 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) clean
1451 \$(SILENT)echo Cleaning build directory
1452 \$(SILENT)rm -rf rockbox.zip TAGS @APPS@ firmware comsim sim lang.[ch]\
1453 manual *.pdf *.a credits.raw @OUTPUT@ bitmaps pluginbitmaps \
1454 @ARCHOSROM@ @FLASHFILE@ UI256.bmp rockbox-full.zip
1457 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) @TOOLSET@
1460 \$(SILENT)rm -f TAGS
1461 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) tags
1462 \$(SILENT)\$(MAKE) -C \$(APPSDIR) tags
1463 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins tags
1464 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins/lib tags
1467 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" -f 1 -o rockbox-fonts.zip \$(TARGET) \$(BINARY)
1470 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1473 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" -f 2 -o rockbox-full.zip \$(TARGET) \$(BINARY)
1476 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -o "rockbox.7z" -z "7za a" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1479 \$(SILENT)rm -f rockbox.tar
1480 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -o "rockbox.tar" -z "tar --no-recursion -uf" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1483 \$(SILENT)bzip2 -f9 rockbox.tar
1486 \$(SILENT)gzip -f9 rockbox.tar
1490 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-pdf
1493 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-html
1496 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-zip
1499 @echo "A few helpful make targets"
1501 @echo "all - builds a full Rockbox (default), including tools"
1502 @echo "clean - cleans a build directory (not tools)"
1503 @echo "veryclean - cleans the build and tools directories"
1504 @echo "manual - builds a manual"
1505 @echo "manual-html - HTML manual"
1506 @echo "manual-zip - HTML manual (zipped)"
1507 @echo "fullzip - creates a rockbox.zip of your build with fonts"
1508 @echo "zip - creates a rockbox.zip of your build (no fonts)"
1509 @echo "gzip - creates a rockbox.tar.gz of your build (no fonts)"
1510 @echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)"
1511 @echo "7zip - creates a rockbox.7z of your build (no fonts)"
1512 @echo "fontzip - creates rockbox-fonts.zip"
1513 @echo "tools - builds the tools only"
1514 @echo "install - installs your build (for simulator builds only)"
1518 if [ "yes" = "$simulator" ]; then
1520 cat >> Makefile
<<EOF
1523 @echo "installing a full setup in your archos dir"
1524 @(\$(MAKE) fullzip && cd archos && unzip -oq ../rockbox-full.zip)
1529 echo "Created Makefile"