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 SHARED_FLAG
="-shared"
107 if [ "$simver" = "win32" ]; then
109 GCCOPTS
="$GCCOPTS -mno-cygwin -DNOCYGWIN"
110 LDOPTS
="-lgdi32 -luser32 -mno-cygwin"
111 elif [ "$simver" = "sdl" ]; then
113 GCCOPTS
="$GCCOPTS `sdl-config --cflags`"
114 LDOPTS
="`sdl-config --libs`"
119 LDOPTS
='-L/usr/X11R6/lib -lSM -lICE -lXt -lX11 -lXmu -lSM -lICE -lX11 -lpthread'
122 output
="rockboxui.exe" # use this as output binary name
126 echo "Linux host detected"
128 SHARED_FLAG
="-shared"
129 if [ "$simver" = "win32" ]; then
130 LDOPTS
='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -lnsl -ldl -lpthread'
131 crosswincc
# setup cross-compiler
132 elif [ "$simver" = "sdl" ]; then
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`"
141 LDOPTS
='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -lnsl -ldl -lpthread'
143 fi # not a cross-compiler
147 echo "FreeBSD host detected"
148 LDOPTS
='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -dl -lpthread'
149 SHARED_FLAG
="-shared"
150 if [ "$simver" = "win32" ]; then
151 crosswincc
# setup cross-compiler
156 echo "Darwin host detected"
158 GCCOPTS
="$GCCOPTS `sdl-config --cflags`"
159 LDOPTS
="`sdl-config --libs`"
160 SHARED_FLAG
="-dynamiclib -Wl\,-single_module"
161 use_simsound
="#define ROCKBOX_HAS_SIMSOUND 1"
162 echo "Enabled PCM sound playback in simulator"
166 echo "Unsupported system: $uname, fix configure and retry"
171 if [ "`uname -m`" = "x86_64" ]; then
172 GCCOPTS
="$GCCOPTS -fPIC" # needed to make shared objects link
175 if test "X$crosscompile" != "Xyes"; then
177 cat >/tmp
/conftest-
$id.c
<<EOF
179 int main(int argc, char **argv)
182 char *varp = (char *)&var;
190 $CC -o /tmp
/conftest-
$id /tmp
/conftest-
$id.c
2>/dev
/null
192 if test `/tmp/conftest-$id 2>/dev/null` -gt "1"; then
199 echo "Simulator environment deemed $endian endian"
201 # use wildcard here to make it work even if it was named *.exe like
203 rm -f /tmp
/conftest-
$id*
209 GCCOPTS
="$CCOPTS -m1"
210 GCCOPTIMIZE
="-fomit-frame-pointer -fschedule-insns"
215 prefixtools calmrisc16-unknown-elf-
216 GCCOPTS
="-Wl\,--no-check-sections $CCOPTS"
217 GCCOPTIMIZE
="-fomit-frame-pointer"
222 prefixtools m68k-elf-
223 GCCOPTS
="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
224 GCCOPTIMIZE
="-fomit-frame-pointer"
230 GCCOPTS
="$CCOPTS -mcpu=arm7tdmi"
231 if test "X$1" != "Xshort"; then
232 GCCOPTS
="$GCCOPTS -ffunction-sections -mlong-calls"
234 GCCOPTIMIZE
="-fomit-frame-pointer"
240 GCCOPTS
="$CCOPTS -mcpu=arm9tdmi -ffunction-sections -mlong-calls"
241 GCCOPTIMIZE
="-fomit-frame-pointer"
249 echo "Where do you want the firmware to be flashed?"
250 echo "WARNING: Do not answer this question lightly,"
251 echo "unless you don't plan to flash your gmini."
252 echo "In this case, reply '0x10000' (no quotes) and "
253 echo "re-configure when you know better."
256 if [ "0$loadaddress" = "0" ]; then
258 loadaddress
="0x10000";
260 echo "You selected $loadaddress"
268 ##################################################################
269 # Prompt for specific developer options
272 echo "Enter your developer options (press enter when done)"
273 echo "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling"
276 while [ $cont = "1" ]; do
282 if [ "yes" = "$profile" ]; then
283 echo "Debug is incompatible with profiling"
290 echo "logf() support enabled"
294 echo "Simulator build enabled"
298 if [ "yes" = "$use_debug" ]; then
299 echo "Profiling is incompatible with debug"
301 echo "Profiling support is enabled"
312 if [ "yes" = "$use_debug" ]; then
314 GCCOPTS
="$GCCOPTS -g -DDEBUG"
316 if [ "yes" = "$logf" ]; then
317 use_logf
="#define ROCKBOX_HAS_LOGF 1"
319 if [ "yes" = "$simulator" ]; then
321 extradefines
="$extradefines -DSIMULATOR"
324 if [ "yes" = "$profile" ]; then
325 extradefines
="$extradefines -DRB_PROFILE"
326 PROFILE_OPTS
="-finstrument-functions"
332 if [ -z "$simver" ]; then
334 ##################################################################
335 # Figure out what simulator version
337 # x11 is deprecated so hide it from the question
338 # win32 is also deprecated
341 echo "Build (S)DL version? (S)"
353 # make sure the code knows this is for win32
354 extradefines
="$extradefines -DWIN32"
358 extradefines
="$extradefines -DX11"
362 extradefines
="$extradefines -DSDL"
365 echo "Selected $simver simulator"
371 if test "$target" = "--help"; then
372 echo "Rockbox configure script."
373 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
374 echo "Do *NOT* run this within the tools directory!"
376 echo "Usage: configure [--ccache][--no-ccache]"
380 if test -r "configure"; then
381 # this is a check for a configure script in the current directory, it there
382 # is one, try to figure out if it is this one!
384 if { grep "^# Jukebox" configure
>/dev
/null
2>&1 ; } then
385 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
386 echo "It will only cause you pain and grief. Instead do this:"
389 echo " mkdir build-dir"
391 echo " ../tools/configure"
393 echo "Much happiness will arise from this. Enjoy"
398 # get our current directory
401 if [ -z "$rootdir" ]; then
402 ##################################################################
403 # Figure out where the source code root is!
406 firmfile
="crt0.S" # a file to check for in the firmware root dir
408 for dir
in . .. ..
/.. ..
/rockbox
*; do
409 if [ -f $dir/firmware
/$firmfile ]; then
415 if [ -z "$rootdir" ]; then
416 echo "This script couldn't find your source code root directory. Please enter the"
417 echo "full path to the source code directory here:"
422 #####################################################################
423 # Convert the possibly relative directory name to an absolute version
429 # cd back to the build dir
434 appsdir
='\$(ROOTDIR)/apps'
435 firmdir
='\$(ROOTDIR)/firmware'
436 toolsdir
='\$(ROOTDIR)/tools'
439 ##################################################################
440 # Figure out target platform
443 echo "Enter target platform:"
445 ==Archos== ==iriver== ==Apple iPod==
446 0) Player/Studio 10) H120/H140 20) Color/Photo
447 1) Recorder 11) H320/H340 21) Nano
448 2) FM Recorder 12) iHP-100/110/115 22) Video
449 3) Recorder v2 13) iFP-790 23) 3G
450 4) Gmini 120 14) H10 20Gb 24) 4G Grayscale
451 5) Gmini SP 15) H10 5/6Gb 25) Mini 1G
452 6) Ondio SP 26) Mini 2G
455 ==iAudio== ==Toshiba== ==SanDisk==
456 30) X5/X5V/X5L 40) Gigabeat F 50) Sansa e200
464 # Set of tools built for all target platforms:
465 toolset
="rdf2binary convbdf"
467 # Toolsets for some target families:
468 archosbitmaptools
="$toolset scramble descramble sh2d uclpack bmp2rb codepages"
469 iriverbitmaptools
="$toolset scramble descramble mkboot bmp2rb codepages"
470 iaudiobitmaptools
="$toolset scramble descramble mkboot bmp2rb codepages"
471 ipodbitmaptools
="$toolset scramble ipod_fw bmp2rb codepages"
472 gigabeatbitmaptools
="$toolset scramble descramble bmp2rb codepages"
473 # generic is used by IFP, H10, Sansa-e200
474 genericbitmaptools
="$toolset bmp2rb codepages"
477 # ---- For each target ----
480 # target_id: a unique number identifying this target, DOES NOT necessarily
481 # have to be the menu number. Just use the currently highest
482 # number+1 when you add a new target.
483 # archos: short model name used all over to identify this target
484 # target: -Ddefine passed to the build commands to make the correct
485 # config-*.h file get included etc
486 # tool: the tool that takes a plain binary and converts that into a
487 # working "firmware" file for your target
488 # output: the final output file name
489 # boottool: the tool that takes a plain binary and generates a bootloader
490 # file for your target (or blank to use $tool)
491 # bootoutput:the final output file name for the bootloader (or blank to use
493 # appextra: passed to the APPEXTRA variable in the Makefiles.
494 # TODO: add proper explanation
495 # archosrom: used only for Archos targets that build a special flashable .ucl
496 # image. Set to blank for other builds.
497 # flash: the same as archosrom. These two should be merged
498 # plugins: set to 'yes' to build the plugins. Early development builds can
499 # set this to no in the early stages to have an easier life for a
501 # codecs: lists codecs to build for this target
502 # toolset: lists what particular tools in the tools/ directory that this
503 # target needs to have built prior to building Rockbox
506 # *cc: sets up gcc and compiler options for your target builds. Note
507 # that if you select a simulator build, the compiler selection is
508 # overridden later in the script.
515 target
="-DARCHOS_PLAYER"
517 tool
="$rootdir/tools/scramble"
519 appextra
="player:gui"
520 archosrom
="$pwd/rombox.ucl"
521 flash
="$pwd/rockbox.ucl"
525 # toolset is the tools within the tools directory that we build for
526 # this particular target.
527 toolset
="$toolset scramble descramble sh2d generate_rocklatin uclpack"
529 # Note: the convbdf is present in the toolset just because: 1) the
530 # firmware/Makefile assumes it is present always, and 2) we will need it when we
531 # build the player simulator
538 target
="-DARCHOS_RECORDER"
540 tool
="$rootdir/tools/scramble"
541 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
542 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
544 appextra
="recorder:gui"
545 archosrom
="$pwd/rombox.ucl"
546 flash
="$pwd/rockbox.ucl"
549 # toolset is the tools within the tools directory that we build for
550 # this particular target.
551 toolset
=$archosbitmaptools
557 target
="-DARCHOS_FMRECORDER"
559 tool
="$rootdir/tools/scramble -fm"
560 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
561 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
563 appextra
="recorder:gui"
564 archosrom
="$pwd/rombox.ucl"
565 flash
="$pwd/rockbox.ucl"
568 # toolset is the tools within the tools directory that we build for
569 # this particular target.
570 toolset
=$archosbitmaptools
576 target
="-DARCHOS_RECORDERV2"
578 tool
="$rootdir/tools/scramble -v2"
579 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
580 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
582 appextra
="recorder:gui"
583 archosrom
="$pwd/rombox.ucl"
584 flash
="$pwd/rockbox.ucl"
587 # toolset is the tools within the tools directory that we build for
588 # this particular target.
589 toolset
=$archosbitmaptools
595 target
="-DARCHOS_GMINI120"
596 memory
=16 # fixed size (16 is a guess, remove comment when checked)
598 tool
="cp" # might work for now!
599 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
600 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
601 output
="rockbox.gmini"
602 appextra
="recorder:gui"
605 plugins
="" # disabled for now, enable later on
607 # toolset is the tools within the tools directory that we build for
608 # this particular target.
609 toolset
="$toolset bmp2rb codepages"
615 target
="-DARCHOS_GMINISP"
616 memory
=16 # fixed size (16 is a guess, remove comment when checked)
618 tool
="cp" # might work for now!
619 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
620 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
621 output
="rockbox.gmini"
622 appextra
="recorder:gui"
625 plugins
="" # disabled for now, enable later on
627 # toolset is the tools within the tools directory that we build for
628 # this particular target.
629 toolset
="$toolset bmp2rb codepages"
635 target
="-DARCHOS_ONDIOSP"
637 tool
="$rootdir/tools/scramble -osp"
638 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
639 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
641 appextra
="recorder:gui"
642 archosrom
="$pwd/rombox.ucl"
643 flash
="$pwd/rockbox.ucl"
646 # toolset is the tools within the tools directory that we build for
647 # this particular target.
648 toolset
=$archosbitmaptools
654 target
="-DARCHOS_ONDIOFM"
656 tool
="$rootdir/tools/scramble -ofm"
657 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
658 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
660 appextra
="recorder:gui"
661 archosrom
="$pwd/rombox.ucl"
662 flash
="$pwd/rockbox.ucl"
665 toolset
=$archosbitmaptools
671 target
="-DIRIVER_H120"
674 tool
="$rootdir/tools/scramble -add=h120"
675 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
676 bmp2rb_native
="$rootdir/tools/bmp2rb -f 2"
677 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
678 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
679 output
="rockbox.iriver"
680 appextra
="recorder:gui"
684 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
685 # toolset is the tools within the tools directory that we build for
686 # this particular target.
687 toolset
=$iriverbitmaptools
693 target
="-DIRIVER_H300"
696 tool
="$rootdir/tools/scramble -add=h300"
697 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
698 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
699 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
700 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
701 output
="rockbox.iriver"
702 appextra
="recorder:gui"
706 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
707 # toolset is the tools within the tools directory that we build for
708 # this particular target.
709 toolset
=$iriverbitmaptools
715 target
="-DIRIVER_H100"
718 tool
="$rootdir/tools/scramble -add=h100"
719 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
720 bmp2rb_native
="$rootdir/tools/bmp2rb -f 2"
721 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
722 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 0"
723 output
="rockbox.iriver"
724 appextra
="recorder:gui"
728 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
729 # toolset is the tools within the tools directory that we build for
730 # this particular target.
731 toolset
=$iriverbitmaptools
740 tool
="$rootdir/tools/scramble -add=iax5"
741 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
742 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
743 bmp2rb_remotemono
="$rootdir/tools/bmp2rb -f 0"
744 bmp2rb_remotenative
="$rootdir/tools/bmp2rb -f 7"
745 output
="rockbox.iaudio"
746 appextra
="recorder:gui"
750 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
751 # toolset is the tools within the tools directory that we build for
752 # this particular target.
753 toolset
="$iaudiobitmaptools"
754 # architecture, manufacturer and model for the target-tree build
756 t_manufacturer
="iaudio"
763 target
="-DIPOD_COLOR"
766 tool
="$rootdir/tools/scramble -add=ipco"
767 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
768 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
769 output
="rockbox.ipod"
770 appextra
="recorder:gui"
774 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
775 boottool
="$rootdir/tools/scramble -ipod4g"
776 bootoutput
="bootloader.img"
777 # toolset is the tools within the tools directory that we build for
778 # this particular target.
779 toolset
=$ipodbitmaptools
780 # architecture, manufacturer and model for the target-tree build
782 t_manufacturer
="ipod"
792 tool
="$rootdir/tools/scramble -add=nano"
793 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
794 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
795 output
="rockbox.ipod"
796 appextra
="recorder:gui"
800 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
801 boottool
="$rootdir/tools/scramble -ipod4g"
802 bootoutput
="bootloader.img"
803 # toolset is the tools within the tools directory that we build for
804 # this particular target.
805 toolset
=$ipodbitmaptools
806 # architecture, manufacturer and model for the target-tree build
808 t_manufacturer
="ipod"
815 target
="-DIPOD_VIDEO"
816 memory
=32 # 30GB models have 32MB, 60GB have 64MB
818 tool
="$rootdir/tools/scramble -add=ipvd"
819 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
820 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
821 output
="rockbox.ipod"
822 appextra
="recorder:gui"
826 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
827 boottool
="$rootdir/tools/scramble -ipod5g"
828 bootoutput
="bootloader.img"
829 # toolset is the tools within the tools directory that we build for
830 # this particular target.
831 toolset
=$ipodbitmaptools
832 # architecture, manufacturer and model for the target-tree build
834 t_manufacturer
="ipod"
844 tool
="$rootdir/tools/scramble -add=ip3g"
845 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
846 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
847 output
="rockbox.ipod"
848 appextra
="recorder:gui"
852 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
853 boottool
="$rootdir/tools/scramble -ipod3g"
854 bootoutput
="bootloader.img"
855 # toolset is the tools within the tools directory that we build for
856 # this particular target.
857 toolset
=$ipodbitmaptools
858 # architecture, manufacturer and model for the target-tree build
860 t_manufacturer
="ipod"
870 tool
="$rootdir/tools/scramble -add=ip4g"
871 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
872 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
873 output
="rockbox.ipod"
874 appextra
="recorder:gui"
878 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
879 boottool
="$rootdir/tools/scramble -ipod4g"
880 bootoutput
="bootloader.img"
881 # toolset is the tools within the tools directory that we build for
882 # this particular target.
883 toolset
=$ipodbitmaptools
884 # architecture, manufacturer and model for the target-tree build
886 t_manufacturer
="ipod"
896 tool
="$rootdir/tools/scramble -add=mini"
897 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
898 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
899 output
="rockbox.ipod"
900 appextra
="recorder:gui"
904 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
905 boottool
="$rootdir/tools/scramble -ipod4g"
906 bootoutput
="bootloader.img"
907 # toolset is the tools within the tools directory that we build for
908 # this particular target.
909 toolset
=$ipodbitmaptools
910 # architecture, manufacturer and model for the target-tree build
912 t_manufacturer
="ipod"
919 target
="-DIRIVER_IFP7XX"
923 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
924 bmp2rb_native
="$rootdir/tools/bmp2rb -f 0"
926 appextra
="recorder:gui"
930 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
931 # toolset is the tools within the tools directory that we build for
932 # this particular target.
933 toolset
=$genericbitmaptools
939 target
="-DGIGABEAT_F"
943 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
944 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
945 output
="rockbox.gigabeat"
946 appextra
="recorder:gui"
950 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
951 toolset
=$gigabeatbitmaptools
952 boottool
="$rootdir/tools/scramble -gigabeat"
953 bootoutput
="FWIMG01.DAT"
954 # architecture, manufacturer and model for the target-tree build
956 t_manufacturer
="gigabeat"
963 target
="-DIPOD_MINI2G"
966 tool
="$rootdir/tools/scramble -add=mn2g"
967 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
968 bmp2rb_native
="$rootdir/tools/bmp2rb -f 6"
969 output
="rockbox.ipod"
970 appextra
="recorder:gui"
974 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
975 boottool
="$rootdir/tools/scramble -ipod4g"
976 bootoutput
="bootloader.img"
977 # toolset is the tools within the tools directory that we build for
978 # this particular target.
979 toolset
=$ipodbitmaptools
980 # architecture, manufacturer and model for the target-tree build
982 t_manufacturer
="ipod"
989 target
="-DIRIVER_H10"
992 tool
="$rootdir/tools/scramble -add=h10"
993 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
994 bmp2rb_native
="$rootdir/tools/bmp2rb -f 4"
996 appextra
="recorder:gui"
1000 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
1001 boottool
="$rootdir/tools/scramble -mi4v3"
1002 bootoutput
="H10_20GC.mi4"
1003 # toolset is the tools within the tools directory that we build for
1004 # this particular target.
1005 toolset
="$genericbitmaptools scramble"
1006 # architecture, manufacturer and model for the target-tree build
1008 t_manufacturer
="iriver"
1015 target
="-DSANSA_E200"
1016 memory
=32 # supposedly
1018 tool
="$rootdir/tools/mkmi4.sh e200"
1019 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1020 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
1022 appextra
="recorder:gui"
1026 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
1027 boottool
="$rootdir/tools/scramble -mi4v3"
1028 bootoutput
="PP5022.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
="sandisk"
1035 t_model
="sansa-e200"
1041 target
="-DIRIVER_H10_5GB"
1044 tool
="$rootdir/tools/scramble -add=h10_5gb"
1045 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1046 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
1047 output
="rockbox.h10"
1048 appextra
="recorder:gui"
1052 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
1053 boottool
="$rootdir/tools/scramble -mi4v2"
1054 bootoutput
="H10.mi4"
1055 # toolset is the tools within the tools directory that we build for
1056 # this particular target.
1057 toolset
="$genericbitmaptools scramble"
1058 # architecture, manufacturer and model for the target-tree build
1060 t_manufacturer
="iriver"
1067 target
="-DELIO_TPJ1022"
1070 tool
="$rootdir/tools/scramble -add tpj2"
1071 bmp2rb_mono
="$rootdir/tools/bmp2rb -f 0"
1072 bmp2rb_native
="$rootdir/tools/bmp2rb -f 5"
1073 output
="rockbox.elio"
1074 appextra
="recorder:gui"
1078 codecs
="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
1079 boottool
="$rootdir/tools/scramble -mi4v2"
1080 bootoutput
="pp5020.mi4"
1081 # toolset is the tools within the tools directory that we build for
1082 # this particular target.
1083 toolset
="$genericbitmaptools scramble"
1084 # architecture, manufacturer and model for the target-tree build
1086 t_manufacturer
="tatung"
1091 echo "Please select a supported target platform!"
1097 echo "Platform set to $archos"
1100 ############################################################################
1101 # Amount of memory, for those that can differ.
1104 if [ -z "$memory" ]; then
1106 if [ -z "$update" ]; then
1107 echo "Enter size of your RAM (in MB): (defaults to 2)"
1120 echo "Memory size selected: $memory MB"
1123 ##################################################################
1124 # Figure out build "type"
1127 # the ifp7x0 is the only platform that supports building a gdb stub like
1131 gdbstub
="(G)DB stub, "
1138 echo "Build (N)ormal, (D)evel, (S)imulator, (B)ootloader, $gdbstub(M)anual? (N)"
1144 if test -n "$archosrom"; then
1145 # Archos SH-based players do this somewhat differently for
1147 extradefines
="-DBOOTLOADER -ffunction-sections -fdata-sections"
1148 appsdir
='\$(ROOTDIR)/flash/bootbox'
1151 extradefines
="-DBOOTLOADER" # for target makefile symbol EXTRA_DEFINES
1152 appsdir
='\$(ROOTDIR)/bootloader'
1154 if test -n "$boottool"; then
1157 if test -n "$bootoutput"; then
1162 echo "Bootloader build selected"
1167 extradefines
="-DSIMULATOR"
1168 echo "Simulator build selected"
1172 echo "Devel build selected"
1176 extradefines
="-DSTUB" # for target makefile symbol EXTRA_DEFINES
1177 appsdir
='\$(ROOTDIR)/gdb'
1186 echo "GDB stub build selected"
1189 appsdir
='\$(ROOTDIR)/manual'
1190 firmdir
='\$(ROOTDIR)/manual/platform' # No Makefile here. Effectively ignores target
1196 archos
="recorderv2fm"
1199 archos
="recorderv2fm"
1210 echo "Manual build selected"
1214 echo "Normal build selected"
1219 if [ -z "$debug" ]; then
1220 GCCOPTS
="$GCCOPTS $GCCOPTIMIZE"
1225 echo "Using source code root directory: $rootdir"
1227 # this was once possible to change at build-time, but no more:
1232 if [ "yes" = "$simulator" ]; then
1233 # setup compiler and things for simulator
1236 if [ -d "archos" ]; then
1237 echo "sub directory archos already present"
1240 echo "created an archos subdirectory for simulating the hard disk"
1244 # Now, figure out version number of the (gcc) compiler we are about to use
1245 gccver
=`$CC -dumpversion`;
1247 if [ -z "$gccver" ]; then
1248 echo "WARNING: The compiler you must use ($CC) is not in your path!"
1249 echo "WARNING: this may cause your build to fail since we cannot do the"
1250 echo "WARNING: checks we want now."
1253 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
1256 num1
=`echo $gccver | cut -d . -f1`
1257 num2
=`echo $gccver | cut -d . -f2`
1258 gccnum
=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
1265 echo "Using $CC $gccver ($gccnum)"
1267 if test "$gccnum" -ge "400"; then
1268 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
1269 # so we ignore that warnings for now
1271 GCCOPTS
="$GCCOPTS -Wno-pointer-sign"
1274 if test "$gccnum" -ge "401"; then
1275 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
1276 # will break strict-aliasing rules"
1278 GCCOPTS
="$GCCOPTS -fno-strict-aliasing"
1283 # check the compiler for SH platforms
1284 if test "$CC" = "sh-elf-gcc"; then
1285 if test "$gccnum" -lt "400"; then
1286 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
1287 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
1289 # figure out patch status
1290 gccpatch
=`$CC --version`;
1292 if { echo $gccpatch |
grep "rockbox" >/dev
/null
2>&1; } then
1293 echo "gcc $gccver is rockbox patched"
1294 # then convert -O to -Os to get smaller binaries!
1295 GCCOPTS
=`echo $GCCOPTS | sed 's/ -O / -Os /'`
1297 echo "WARNING: You use an unpatched gcc compiler: $gccver"
1298 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
1303 if test "$1" = "--ccache"; then
1304 echo "Enable ccache for building"
1307 if test "$1" != "--no-ccache"; then
1308 ccache
=`findtool ccache`
1309 if test -n "$ccache"; then
1310 echo "Found and uses ccache ($ccache)"
1315 if test -n "$ccache"; then
1319 if test "X$endian" = "Xbig"; then
1320 defendian
="ROCKBOX_BIG_ENDIAN"
1322 defendian
="ROCKBOX_LITTLE_ENDIAN"
1326 -e "s,@ENDIAN@,${defendian},g" \
1327 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
1328 -e "s,@SIMSOUND@,$use_simsound,g" \
1330 /* This header was made by configure */
1331 #ifndef __BUILD_AUTOCONF_H
1332 #define __BUILD_AUTOCONF_H
1334 /* Define endianess for the target or simulator platform */
1337 /* Define this if you build rockbox to support the logf logging and display */
1338 #undef ROCKBOX_HAS_LOGF
1340 /* Define this if you have the linux/soundcard.h header and thus can compile
1341 the sound-playing code in the X11 sim */
1344 #endif /* __BUILD_AUTOCONF_H */
1347 if test -n "$t_cpu"; then
1348 TARGET_INC
="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
1349 TARGET_INC
="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
1350 TARGET_INC
="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
1354 if test "$simulator" = "yes"; then
1355 # add simul make stuff on the #SIMUL# line
1356 simmagic1
="s,@SIMUL1@,@\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
1357 simmagic2
="s,@SIMUL2@,@\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
1359 # delete the lines that match
1360 simmagic1
='/@SIMUL1@/D'
1361 simmagic2
='/@SIMUL2@/D'
1365 -e "s,@ROOTDIR@,${rootdir},g" \
1366 -e "s,@DEBUG@,${debug},g" \
1367 -e "s,@MEMORY@,${memory},g" \
1368 -e "s,@TARGET_ID@,${target_id},g" \
1369 -e "s,@TARGET@,${target},g" \
1370 -e "s,@ARCHOS@,${archos},g" \
1371 -e "s,@LANGUAGE@,${language},g" \
1372 -e "s,@PWD@,${pwd},g" \
1373 -e "s,@CC@,${CC},g" \
1374 -e "s,@LD@,${LD},g" \
1375 -e "s,@AR@,${AR},g" \
1376 -e "s,@AS@,${AS},g" \
1377 -e "s,@OC@,${OC},g" \
1378 -e "s,@WINDRES@,${WINDRES},g" \
1379 -e "s,@DLLTOOL@,${DLLTOOL},g" \
1380 -e "s,@DLLWRAP@,${DLLWRAP},g" \
1381 -e "s,@RANLIB@,${RANLIB},g" \
1382 -e "s,@TOOL@,${tool},g" \
1383 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
1384 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
1385 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
1386 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
1387 -e "s,@OUTPUT@,${output},g" \
1388 -e "s,@APPEXTRA@,${appextra},g" \
1389 -e "s,@ARCHOSROM@,${archosrom},g" \
1390 -e "s,@FLASHFILE@,${flash},g" \
1391 -e "s,@PLUGINS@,${plugins},g" \
1392 -e "s,@CODECS@,${codecs},g" \
1393 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
1394 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
1395 -e "s,@GCCOPTS@,${GCCOPTS},g" \
1396 -e "s,@TARGET_INC@,${TARGET_INC},g" \
1397 -e "s!@LDOPTS@!${LDOPTS}!g" \
1398 -e "s,@LOADADDRESS@,${loadaddress},g" \
1399 -e "s,@EXTRADEF@,${extradefines},g" \
1400 -e "s,@APPSDIR@,${appsdir},g" \
1401 -e "s,@FIRMDIR@,${firmdir},g" \
1402 -e "s,@TOOLSDIR@,${toolsdir},g" \
1403 -e "s,@APPS@,${apps},g" \
1404 -e "s,@SIMVER@,${simver},g" \
1405 -e "s,@GCCVER@,${gccver},g" \
1406 -e "s,@GCCNUM@,${gccnum},g" \
1407 -e "s,@UNAME@,${uname},g" \
1408 -e "s,@ENDIAN@,${defendian},g" \
1409 -e "s,@TOOLSET@,${toolset},g" \
1413 ## Automaticly generated. http://www.rockbox.org/
1421 export ROOTDIR=@ROOTDIR@
1422 export FIRMDIR=@FIRMDIR@
1423 export APPSDIR=@APPSDIR@
1424 export TOOLSDIR=@TOOLSDIR@
1425 export DOCSDIR=\$(ROOTDIR)/docs
1426 export MANUALDIR=\${ROOTDIR}/manual
1427 export DEBUG=@DEBUG@
1428 export ARCHOS=@ARCHOS@
1429 export ARCHOSROM=@ARCHOSROM@
1430 export FLASHFILE=@FLASHFILE@
1431 export TARGET_ID=@TARGET_ID@
1432 export TARGET=@TARGET@
1434 export BUILDDIR=@PWD@
1435 export LANGUAGE=@LANGUAGE@
1436 export MEMORYSIZE=@MEMORY@
1437 export VERSION=\$(shell date +%y%m%d-%H%M)
1438 export BUILDDATE=\$(shell date +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
1439 export MKFIRMWARE=@TOOL@
1440 export BMP2RB_MONO=@BMP2RB_MONO@
1441 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
1442 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
1443 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
1444 export BINARY=@OUTPUT@
1445 export APPEXTRA=@APPEXTRA@
1446 export ENABLEDPLUGINS=@PLUGINS@
1447 export SOFTWARECODECS=@CODECS@
1448 export EXTRA_DEFINES=@EXTRADEF@
1455 export WINDRES=@WINDRES@
1456 export DLLTOOL=@DLLTOOL@
1457 export DLLWRAP=@DLLWRAP@
1458 export RANLIB=@RANLIB@
1459 export PROFILE_OPTS=@PROFILE_OPTS@
1460 export GCCOPTS=@GCCOPTS@
1461 export TARGET_INC=@TARGET_INC@
1462 export LOADADDRESS=@LOADADDRESS@
1463 export SIMVER=@SIMVER@
1464 export SIMDIR=\$(ROOTDIR)/uisimulator/\$(SIMVER)
1465 export SHARED_FLAG=@SHARED_FLAG@
1466 export LDOPTS=@LDOPTS@
1467 export GCCVER=@GCCVER@
1468 export GCCNUM=@GCCNUM@
1469 export UNAME=@UNAME@
1471 # Do not print "Entering directory ..."
1472 MAKEFLAGS += --no-print-directory
1474 .PHONY: all clean tags zip tools manual
1479 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
1480 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@
1485 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
1486 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ \$(BUILDDIR)/\$(BINARY)
1488 veryclean: clean toolsclean
1491 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) clean
1494 \$(SILENT)echo Cleaning build directory
1495 \$(SILENT)rm -rf rockbox.zip TAGS @APPS@ firmware comsim sim lang.[ch]\
1496 manual *.pdf *.a credits.raw @OUTPUT@ bitmaps pluginbitmaps \
1497 @ARCHOSROM@ @FLASHFILE@ UI256.bmp rockbox-full.zip
1500 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) @TOOLSET@
1503 \$(SILENT)rm -f TAGS
1504 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) tags
1505 \$(SILENT)\$(MAKE) -C \$(APPSDIR) tags
1506 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins tags
1507 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins/lib tags
1510 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" -f 1 -o rockbox-fonts.zip \$(TARGET) \$(BINARY)
1513 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1516 \$(SILENT)find . -name "*.map" | xargs zip rockbox-maps.zip
1519 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" -f 2 -o rockbox-full.zip \$(TARGET) \$(BINARY)
1522 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -o "rockbox.7z" -z "7za a" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1525 \$(SILENT)rm -f rockbox.tar
1526 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -o "rockbox.tar" -z "tar --no-recursion -uf" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1529 \$(SILENT)bzip2 -f9 rockbox.tar
1532 \$(SILENT)gzip -f9 rockbox.tar
1536 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-pdf
1539 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-html
1542 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-zip
1545 @echo "A few helpful make targets"
1547 @echo "all - builds a full Rockbox (default), including tools"
1548 @echo "bin - builds only the Rockbox.<target name> file"
1549 @echo "clean - cleans a build directory (not tools)"
1550 @echo "veryclean - cleans the build and tools directories"
1551 @echo "manual - builds a manual"
1552 @echo "manual-html - HTML manual"
1553 @echo "manual-zip - HTML manual (zipped)"
1554 @echo "fullzip - creates a rockbox.zip of your build with fonts"
1555 @echo "zip - creates a rockbox.zip of your build (no fonts)"
1556 @echo "gzip - creates a rockbox.tar.gz of your build (no fonts)"
1557 @echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)"
1558 @echo "7zip - creates a rockbox.7z of your build (no fonts)"
1559 @echo "fontzip - creates rockbox-fonts.zip"
1560 @echo "mapzip - creates rockbox-maps.zip with all .map files"
1561 @echo "tools - builds the tools only"
1562 @echo "install - installs your build (for simulator builds only)"
1566 if [ "yes" = "$simulator" ]; then
1568 cat >> Makefile
<<EOF
1571 @echo "installing a full setup in your archos dir"
1572 @(\$(MAKE) fullzip && cd archos && unzip -oq ../rockbox-full.zip)
1577 echo "Created Makefile"