Splash function: Fixed several bugs and problems: (1) Off-by-one bug caused a buffer...
[Rockbox.git] / tools / configure
blob16fb39cb32a5d4820cf89f396cffe27e03edec85
1 #!/bin/sh
2 # __________ __ ___.
3 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 # \/ \/ \/ \/ \/
8 # $Id$
11 # global CC options for all platforms
12 CCOPTS="-W -Wall -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
22 input() {
23 read response
24 echo $response
27 prefixtools () {
28 prefix="$1"
29 CC=${prefix}gcc
30 WINDRES=${prefix}windres
31 DLLTOOL=${prefix}dlltool
32 DLLWRAP=${prefix}dllwrap
33 RANLIB=${prefix}ranlib
34 LD=${prefix}ld
35 AR=${prefix}ar
36 AS=${prefix}as
37 OC=${prefix}objcopy
40 crosswincc () {
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
51 crosscompile="yes"
52 endian="little" # windows is little endian
55 checksoundcard () {
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
62 fi # has codecs
65 # scan the $PATH for the given command
66 findtool(){
67 file="$1"
69 IFS=":"
70 for path in $PATH
72 # echo "checks for $file in $path" >&2
73 if test -f "$path/$file"; then
74 echo "$path/$file"
75 return
77 done
81 simcc () {
83 # default tool setup for native building
84 prefixtools ""
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!"
98 exit
102 case $uname in
103 CYGWIN*)
104 echo "Cygwin host detected"
106 SHARED_FLAG="-shared"
107 if [ "$simver" = "win32" ]; then
108 # win32 version
109 GCCOPTS="$GCCOPTS -mno-cygwin -DNOCYGWIN"
110 LDOPTS="-lgdi32 -luser32 -mno-cygwin"
111 elif [ "$simver" = "sdl" ]; then
112 # sdl version
113 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
114 LDOPTS="`sdl-config --libs`"
115 checksoundcard
116 else
117 # x11 version
118 GCCOPTS="$GCCOPTS"
119 LDOPTS='-L/usr/X11R6/lib -lSM -lICE -lXt -lX11 -lXmu -lSM -lICE -lX11 -lpthread'
120 checksoundcard
122 output="rockboxui.exe" # use this as output binary name
125 Linux)
126 echo "Linux host detected"
127 GCCOPTS="$GCCOPTS"
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
135 crosswincc
137 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
138 LDOPTS="`sdl-config --libs`"
139 checksoundcard
140 else
141 LDOPTS='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -lnsl -ldl -lpthread'
142 checksoundcard
143 fi # not a cross-compiler
146 FreeBSD)
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
155 Darwin)
156 echo "Darwin host detected"
157 # sdl version
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"
167 exit
169 esac
171 if [ "`uname -m`" = "x86_64" ]; then
172 GCCOPTS="$GCCOPTS -fPIC" # needed to make shared objects link
175 if test "X$crosscompile" != "Xyes"; then
176 id=$$
177 cat >/tmp/conftest-$id.c <<EOF
178 #include <stdio.h>
179 int main(int argc, char **argv)
181 int var=0;
182 char *varp = (char *)&var;
183 *varp=1;
185 printf("%d\n", var);
186 return 0;
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
193 # big endian
194 endian="big"
195 else
196 # little endian
197 endian="little"
199 echo "Simulator environment deemed $endian endian"
201 # use wildcard here to make it work even if it was named *.exe like
202 # on cygwin
203 rm -f /tmp/conftest-$id*
207 shcc () {
208 prefixtools sh-elf-
209 GCCOPTS="$CCOPTS -m1"
210 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
211 endian="big"
214 calmrisccc () {
215 prefixtools calmrisc16-unknown-elf-
216 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
217 GCCOPTIMIZE="-fomit-frame-pointer"
218 endian="big"
221 coldfirecc () {
222 prefixtools m68k-elf-
223 GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
224 GCCOPTIMIZE="-fomit-frame-pointer"
225 endian="big"
228 arm7tdmicc () {
229 prefixtools arm-elf-
230 GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
231 if test "X$1" != "Xshort"; then
232 GCCOPTS="$GCCOPTS -ffunction-sections -mlong-calls"
234 GCCOPTIMIZE="-fomit-frame-pointer"
235 endian="little"
238 arm9tdmicc () {
239 prefixtools arm-elf-
240 GCCOPTS="$CCOPTS -mcpu=arm9tdmi -ffunction-sections -mlong-calls"
241 GCCOPTIMIZE="-fomit-frame-pointer"
242 endian="little"
245 whichaddr () {
246 case $archos in
247 gmini120|gminisp)
248 echo ""
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."
254 loadaddress=`input`
256 if [ "0$loadaddress" = "0" ]; then
257 #default
258 loadaddress="0x10000";
260 echo "You selected $loadaddress"
264 esac
267 whichdevel () {
268 ##################################################################
269 # Prompt for specific developer options
271 echo ""
272 echo "Enter your developer options (press enter when done)"
273 echo "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling"
274 cont=1
276 while [ $cont = "1" ]; do
278 option=`input`;
280 case $option in
281 [Dd])
282 if [ "yes" = "$profile" ]; then
283 echo "Debug is incompatible with profiling"
284 else
285 echo "define DEBUG"
286 use_debug="yes"
289 [Ll])
290 echo "logf() support enabled"
291 logf="yes"
293 [Ss])
294 echo "Simulator build enabled"
295 simulator="yes"
297 [Pp])
298 if [ "yes" = "$use_debug" ]; then
299 echo "Profiling is incompatible with debug"
300 else
301 echo "Profiling support is enabled"
302 profile="yes"
306 echo "done"
307 cont=0
309 esac
310 done
312 if [ "yes" = "$use_debug" ]; then
313 debug="-DDEBUG"
314 GCCOPTS="$GCCOPTS -g -DDEBUG"
316 if [ "yes" = "$logf" ]; then
317 use_logf="#define ROCKBOX_HAS_LOGF 1"
319 if [ "yes" = "$simulator" ]; then
320 debug="-DDEBUG"
321 extradefines="$extradefines -DSIMULATOR"
322 whichsim
324 if [ "yes" = "$profile" ]; then
325 extradefines="$extradefines -DRB_PROFILE"
326 PROFILE_OPTS="-finstrument-functions"
330 whichsim () {
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
340 echo ""
341 echo "Build (S)DL version? (S)"
343 option=`input`;
345 case $option in
346 [Ww])
347 simver="win32"
349 WINDRES=windres
350 DLLTOOL=dlltool
351 DLLWRAP=dllwrap
353 # make sure the code knows this is for win32
354 extradefines="$extradefines -DWIN32"
356 [Xx])
357 simver="x11"
358 extradefines="$extradefines -DX11"
360 [Ss]|*)
361 simver="sdl"
362 extradefines="$extradefines -DSDL"
364 esac
365 echo "Selected $simver simulator"
369 target=$1
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!"
375 echo ""
376 echo "Usage: configure [--ccache][--no-ccache]"
377 exit
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:"
387 echo ""
388 echo " cd .."
389 echo " mkdir build-dir"
390 echo " cd build-dir"
391 echo " ../tools/configure"
392 echo ""
393 echo "Much happiness will arise from this. Enjoy"
394 exit
398 # get our current directory
399 pwd=`pwd`;
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
410 rootdir=$dir
411 break
413 done
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:"
419 firmdir=`input`
422 #####################################################################
423 # Convert the possibly relative directory name to an absolute version
425 now=`pwd`
426 cd $rootdir
427 rootdir=`pwd`
429 # cd back to the build dir
430 cd $now
433 apps="apps"
434 appsdir='\$(ROOTDIR)/apps'
435 firmdir='\$(ROOTDIR)/firmware'
436 toolsdir='\$(ROOTDIR)/tools'
439 ##################################################################
440 # Figure out target platform
443 echo "Enter target platform:"
444 cat <<EOF
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
453 7) Ondio FM
455 ==iAudio== ==Toshiba== ==SanDisk==
456 30) X5/X5V/X5L 40) Gigabeat F 50) Sansa e200
458 ==Tatung==
459 60) Elio TPJ-1022
462 buildfor=`input`;
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 ----
479 # *Variables*
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
492 # $output)
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
500 # while
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
505 # *Functions*
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.
510 case $buildfor in
512 0|player)
513 target_id=1
514 archos="player"
515 target="-DARCHOS_PLAYER"
516 shcc
517 tool="$rootdir/tools/scramble"
518 output="archos.mod"
519 appextra="player:gui"
520 archosrom="$pwd/rombox.ucl"
521 flash="$pwd/rockbox.ucl"
522 plugins="yes"
523 codecs=""
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
535 1|recorder)
536 target_id=2
537 archos="recorder"
538 target="-DARCHOS_RECORDER"
539 shcc
540 tool="$rootdir/tools/scramble"
541 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
542 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
543 output="ajbrec.ajz"
544 appextra="recorder:gui"
545 archosrom="$pwd/rombox.ucl"
546 flash="$pwd/rockbox.ucl"
547 plugins="yes"
548 codecs=""
549 # toolset is the tools within the tools directory that we build for
550 # this particular target.
551 toolset=$archosbitmaptools
554 2|fmrecorder)
555 target_id=3
556 archos="fmrecorder"
557 target="-DARCHOS_FMRECORDER"
558 shcc
559 tool="$rootdir/tools/scramble -fm"
560 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
561 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
562 output="ajbrec.ajz"
563 appextra="recorder:gui"
564 archosrom="$pwd/rombox.ucl"
565 flash="$pwd/rockbox.ucl"
566 plugins="yes"
567 codecs=""
568 # toolset is the tools within the tools directory that we build for
569 # this particular target.
570 toolset=$archosbitmaptools
573 3|recorderv2)
574 target_id=4
575 archos="recorderv2"
576 target="-DARCHOS_RECORDERV2"
577 shcc
578 tool="$rootdir/tools/scramble -v2"
579 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
580 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
581 output="ajbrec.ajz"
582 appextra="recorder:gui"
583 archosrom="$pwd/rombox.ucl"
584 flash="$pwd/rockbox.ucl"
585 plugins="yes"
586 codecs=""
587 # toolset is the tools within the tools directory that we build for
588 # this particular target.
589 toolset=$archosbitmaptools
592 4|gmini120)
593 target_id=5
594 archos="gmini120"
595 target="-DARCHOS_GMINI120"
596 memory=16 # fixed size (16 is a guess, remove comment when checked)
597 calmrisccc
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"
603 archosrom=""
604 flash=""
605 plugins="" # disabled for now, enable later on
606 codecs="libmad"
607 # toolset is the tools within the tools directory that we build for
608 # this particular target.
609 toolset="$toolset bmp2rb codepages"
612 5|gminisp)
613 target_id=6
614 archos="gminisp"
615 target="-DARCHOS_GMINISP"
616 memory=16 # fixed size (16 is a guess, remove comment when checked)
617 calmrisccc
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"
623 archosrom=""
624 flash=""
625 plugins="" # disabled for now, enable later on
626 codecs="libmad"
627 # toolset is the tools within the tools directory that we build for
628 # this particular target.
629 toolset="$toolset bmp2rb codepages"
632 6|ondiosp)
633 target_id=7
634 archos="ondiosp"
635 target="-DARCHOS_ONDIOSP"
636 shcc
637 tool="$rootdir/tools/scramble -osp"
638 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
639 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
640 output="ajbrec.ajz"
641 appextra="recorder:gui"
642 archosrom="$pwd/rombox.ucl"
643 flash="$pwd/rockbox.ucl"
644 plugins="yes"
645 codecs=""
646 # toolset is the tools within the tools directory that we build for
647 # this particular target.
648 toolset=$archosbitmaptools
651 7|ondiofm)
652 target_id=8
653 archos="ondiofm"
654 target="-DARCHOS_ONDIOFM"
655 shcc
656 tool="$rootdir/tools/scramble -ofm"
657 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
658 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
659 output="ajbrec.ajz"
660 appextra="recorder:gui"
661 archosrom="$pwd/rombox.ucl"
662 flash="$pwd/rockbox.ucl"
663 plugins="yes"
664 codecs=""
665 toolset=$archosbitmaptools
668 10|h120)
669 target_id=9
670 archos="h120"
671 target="-DIRIVER_H120"
672 memory=32 # always
673 coldfirecc
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"
681 archosrom=""
682 flash=""
683 plugins="yes"
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
690 11|h300)
691 target_id=10
692 archos="h300"
693 target="-DIRIVER_H300"
694 memory=32 # always
695 coldfirecc
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"
703 archosrom=""
704 flash=""
705 plugins="yes"
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
712 12|h100)
713 target_id=11
714 archos="h100"
715 target="-DIRIVER_H100"
716 memory=16 # always
717 coldfirecc
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"
725 archosrom=""
726 flash=""
727 plugins="yes"
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
734 30|x5)
735 target_id=12
736 archos="x5"
737 target="-DIAUDIO_X5"
738 memory=16 # always
739 coldfirecc
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"
747 archosrom=""
748 flash=""
749 plugins="yes"
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
755 t_cpu="coldfire"
756 t_manufacturer="iaudio"
757 t_model="x5"
760 20|ipodcolor)
761 target_id=13
762 archos="ipodcolor"
763 target="-DIPOD_COLOR"
764 memory=32 # always
765 arm7tdmicc
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"
771 archosrom=""
772 flash=""
773 plugins="yes"
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
781 t_cpu="arm"
782 t_manufacturer="ipod"
783 t_model="color"
786 21|ipodnano)
787 target_id=14
788 archos="ipodnano"
789 target="-DIPOD_NANO"
790 memory=32 # always
791 arm7tdmicc
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"
797 archosrom=""
798 flash=""
799 plugins="yes"
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
807 t_cpu="arm"
808 t_manufacturer="ipod"
809 t_model="nano"
812 22|ipodvideo)
813 target_id=15
814 archos="ipodvideo"
815 target="-DIPOD_VIDEO"
816 memory=32 # 30GB models have 32MB, 60GB have 64MB
817 arm7tdmicc
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"
823 archosrom=""
824 flash=""
825 plugins="yes"
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
833 t_cpu="arm"
834 t_manufacturer="ipod"
835 t_model="video"
838 23|ipod3g)
839 target_id=16
840 archos="ipod3g"
841 target="-DIPOD_3G"
842 memory=32 # always
843 arm7tdmicc
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"
849 archosrom=""
850 flash=""
851 plugins="yes"
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
859 t_cpu="arm"
860 t_manufacturer="ipod"
861 t_model="3g"
864 24|ipod4g)
865 target_id=17
866 archos="ipod4g"
867 target="-DIPOD_4G"
868 memory=32 # always
869 arm7tdmicc
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"
875 archosrom=""
876 flash=""
877 plugins="yes"
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
885 t_cpu="arm"
886 t_manufacturer="ipod"
887 t_model="4g"
890 25|ipodmini)
891 target_id=18
892 archos="ipodmini"
893 target="-DIPOD_MINI"
894 memory=32 # always
895 arm7tdmicc
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"
901 archosrom=""
902 flash=""
903 plugins="yes"
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
911 t_cpu="arm"
912 t_manufacturer="ipod"
913 t_model="mini"
916 13|ifp7xx)
917 target_id=19
918 archos="ifp7xx"
919 target="-DIRIVER_IFP7XX"
920 memory=1
921 arm7tdmicc short
922 tool="cp"
923 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
924 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
925 output="rockbox.wma"
926 appextra="recorder:gui"
927 archosrom=""
928 flash=""
929 plugins="yes"
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
936 40|gigabeatf)
937 target_id=20
938 archos="gigabeatf"
939 target="-DGIGABEAT_F"
940 memory=32 # always
941 arm9tdmicc
942 tool="cp"
943 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
944 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
945 output="rockbox.gigabeat"
946 appextra="recorder:gui"
947 archosrom=""
948 flash=""
949 plugins="yes"
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
955 t_cpu="arm"
956 t_manufacturer="gigabeat"
957 t_model="meg-fx"
960 26|ipodmini2g)
961 target_id=21
962 archos="ipodmini2g"
963 target="-DIPOD_MINI2G"
964 memory=32 # always
965 arm7tdmicc
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"
971 archosrom=""
972 flash=""
973 plugins="yes"
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
981 t_cpu="arm"
982 t_manufacturer="ipod"
983 t_model="mini2g"
986 14|h10)
987 target_id=22
988 archos="h10"
989 target="-DIRIVER_H10"
990 memory=32 # always
991 arm7tdmicc
992 tool="$rootdir/tools/scramble -add=h10"
993 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
994 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
995 output="rockbox.h10"
996 appextra="recorder:gui"
997 archosrom=""
998 flash=""
999 plugins="yes"
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
1007 t_cpu="arm"
1008 t_manufacturer="iriver"
1009 t_model="h10"
1012 50|e200)
1013 target_id=23
1014 archos="e200"
1015 target="-DSANSA_E200"
1016 memory=32 # supposedly
1017 arm7tdmicc
1018 tool="$rootdir/tools/mkmi4.sh e200"
1019 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1020 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1021 output="PP5022.mi4"
1022 appextra="recorder:gui"
1023 archosrom=""
1024 flash=""
1025 plugins="yes"
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
1033 t_cpu="arm"
1034 t_manufacturer="sandisk"
1035 t_model="sansa-e200"
1038 15|h10_5gb)
1039 target_id=24
1040 archos="h10_5gb"
1041 target="-DIRIVER_H10_5GB"
1042 memory=32 # always
1043 arm7tdmicc
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"
1049 archosrom=""
1050 flash=""
1051 plugins="yes"
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
1059 t_cpu="arm"
1060 t_manufacturer="iriver"
1061 t_model="h10"
1064 60|tpj1022)
1065 target_id=25
1066 archos="tpj1022"
1067 target="-DELIO_TPJ1022"
1068 memory=32 # always
1069 arm7tdmicc
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"
1075 archosrom=""
1076 flash=""
1077 plugins="yes"
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
1085 t_cpu="arm"
1086 t_manufacturer="tatung"
1087 t_model="tpj1022"
1091 echo "Please select a supported target platform!"
1092 exit
1095 esac
1097 echo "Platform set to $archos"
1100 ############################################################################
1101 # Amount of memory, for those that can differ.
1104 if [ -z "$memory" ]; then
1105 size="2"
1106 if [ -z "$update" ]; then
1107 echo "Enter size of your RAM (in MB): (defaults to 2)"
1108 size=`input`;
1111 case $size in
1113 memory="8"
1116 memory="2"
1119 esac
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
1128 # this
1129 case $archos in
1130 ifp7xx)
1131 gdbstub="(G)DB stub, "
1135 esac
1137 echo ""
1138 echo "Build (N)ormal, (D)evel, (S)imulator, (B)ootloader, $gdbstub(M)anual? (N)"
1140 option=`input`;
1142 case $option in
1143 [Bb])
1144 if test -n "$archosrom"; then
1145 # Archos SH-based players do this somewhat differently for
1146 # some reason
1147 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
1148 appsdir='\$(ROOTDIR)/flash/bootbox'
1149 apps="bootbox"
1150 else
1151 extradefines="-DBOOTLOADER" # for target makefile symbol EXTRA_DEFINES
1152 appsdir='\$(ROOTDIR)/bootloader'
1153 apps="bootloader"
1154 if test -n "$boottool"; then
1155 tool="$boottool"
1157 if test -n "$bootoutput"; then
1158 output=$bootoutput
1161 bootloader="1"
1162 echo "Bootloader build selected"
1164 [Ss])
1165 debug="-DDEBUG"
1166 simulator="yes"
1167 extradefines="-DSIMULATOR"
1168 echo "Simulator build selected"
1169 whichsim
1171 [Dd])
1172 echo "Devel build selected"
1173 whichdevel
1175 [Gg])
1176 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
1177 appsdir='\$(ROOTDIR)/gdb'
1178 apps="stub"
1179 case $archos in
1180 ifp7xx)
1181 output="stub.wma"
1185 esac
1186 echo "GDB stub build selected"
1188 [Mm])
1189 appsdir='\$(ROOTDIR)/manual'
1190 firmdir='\$(ROOTDIR)/manual/platform' # No Makefile here. Effectively ignores target
1191 toolsdir=$firmdir;
1192 toolset='';
1193 apps="manual"
1194 case $archos in
1195 fmrecorder)
1196 archos="recorderv2fm"
1198 recorderv2)
1199 archos="recorderv2fm"
1201 h1??)
1202 archos="h1xx"
1204 ipodmini2g)
1205 archos="ipodmini"
1209 esac
1210 echo "Manual build selected"
1213 debug=""
1214 echo "Normal build selected"
1217 esac
1219 if [ -z "$debug" ]; then
1220 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
1223 whichaddr
1225 echo "Using source code root directory: $rootdir"
1227 # this was once possible to change at build-time, but no more:
1228 language="english"
1230 uname=`uname`
1232 if [ "yes" = "$simulator" ]; then
1233 # setup compiler and things for simulator
1234 simcc
1236 if [ -d "archos" ]; then
1237 echo "sub directory archos already present"
1238 else
1239 mkdir archos
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."
1251 else
1253 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
1254 # DEPEND on it
1256 num1=`echo $gccver | cut -d . -f1`
1257 num2=`echo $gccver | cut -d . -f2`
1258 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
1260 # This makes:
1261 # 3.3.X => 303
1262 # 3.4.X => 304
1263 # 2.95.3 => 295
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
1270 # -Wno-pointer-sign
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"
1288 else
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 /'`
1296 else
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"
1305 ccache="ccache"
1306 else
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
1316 CC="$ccache $CC"
1319 if test "X$endian" = "Xbig"; then
1320 defendian="ROCKBOX_BIG_ENDIAN"
1321 else
1322 defendian="ROCKBOX_LITTLE_ENDIAN"
1325 sed > autoconf.h \
1326 -e "s,@ENDIAN@,${defendian},g" \
1327 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
1328 -e "s,@SIMSOUND@,$use_simsound,g" \
1329 <<EOF
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 */
1335 #define @ENDIAN@ 1
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 */
1342 @SIMSOUND@
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"
1351 GCCOPTS="$GCCOPTS"
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,"
1358 else
1359 # delete the lines that match
1360 simmagic1='/@SIMUL1@/D'
1361 simmagic2='/@SIMUL2@/D'
1364 sed > Makefile \
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" \
1410 -e "${simmagic1}" \
1411 -e "${simmagic2}" \
1412 <<EOF
1413 ## Automaticly generated. http://www.rockbox.org/
1415 ifndef V
1416 SILENT=@
1417 else
1418 VERBOSEOPT=-v
1419 endif
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@
1433 export OBJDIR=@PWD@
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@
1449 export HOSTCC=gcc
1450 export CC=@CC@
1451 export LD=@LD@
1452 export AR=@AR@
1453 export AS=@AS@
1454 export OC=@OC@
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
1476 all: tools
1477 @SIMUL1@
1478 @SIMUL2@
1479 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
1480 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@
1482 bin: tools
1483 @SIMUL1@
1484 @SIMUL2@
1485 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
1486 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ \$(BUILDDIR)/\$(BINARY)
1488 veryclean: clean toolsclean
1490 toolsclean:
1491 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) clean
1493 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
1499 tools:
1500 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) @TOOLSET@
1502 tags:
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
1509 fontzip:
1510 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" -f 1 -o rockbox-fonts.zip \$(TARGET) \$(BINARY)
1512 zip:
1513 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1515 fullzip:
1516 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" -f 2 -o rockbox-full.zip \$(TARGET) \$(BINARY)
1518 7zip:
1519 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -o "rockbox.7z" -z "7za a" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1521 tar:
1522 \$(SILENT)rm -f rockbox.tar
1523 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -o "rockbox.tar" -z "tar --no-recursion -uf" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1525 bzip2: tar
1526 \$(SILENT)bzip2 -f9 rockbox.tar
1528 gzip: tar
1529 \$(SILENT)gzip -f9 rockbox.tar
1531 manual: manual-pdf
1532 manual-pdf:
1533 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-pdf
1535 manual-html:
1536 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-html
1538 manual-zip:
1539 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-zip
1541 help:
1542 @echo "A few helpful make targets"
1543 @echo ""
1544 @echo "all - builds a full Rockbox (default), including tools"
1545 @echo "bin - builds only the Rockbox.<target name> file"
1546 @echo "clean - cleans a build directory (not tools)"
1547 @echo "veryclean - cleans the build and tools directories"
1548 @echo "manual - builds a manual"
1549 @echo "manual-html - HTML manual"
1550 @echo "manual-zip - HTML manual (zipped)"
1551 @echo "fullzip - creates a rockbox.zip of your build with fonts"
1552 @echo "zip - creates a rockbox.zip of your build (no fonts)"
1553 @echo "gzip - creates a rockbox.tar.gz of your build (no fonts)"
1554 @echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)"
1555 @echo "7zip - creates a rockbox.7z of your build (no fonts)"
1556 @echo "fontzip - creates rockbox-fonts.zip"
1557 @echo "tools - builds the tools only"
1558 @echo "install - installs your build (for simulator builds only)"
1562 if [ "yes" = "$simulator" ]; then
1564 cat >> Makefile <<EOF
1566 install:
1567 @echo "installing a full setup in your archos dir"
1568 @(\$(MAKE) fullzip && cd archos && unzip -oq ../rockbox-full.zip)
1573 echo "Created Makefile"