Sudoku adapted to H10-5GB by Marianne Arnold.
[Rockbox.git] / tools / configure
blob837a107aac68697e3566d94de21dfb8697ec1e07
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 if [ "$simver" = "win32" ]; then
107 # win32 version
108 GCCOPTS="$GCCOPTS -mno-cygwin -DNOCYGWIN"
109 LDOPTS="-lgdi32 -luser32 -mno-cygwin"
110 elif [ "$simver" = "sdl" ]; then
111 # sdl version
112 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
113 LDOPTS="`sdl-config --libs`"
114 checksoundcard
115 else
116 # x11 version
117 GCCOPTS="$GCCOPTS"
118 LDOPTS='-L/usr/X11R6/lib -lSM -lICE -lXt -lX11 -lXmu -lSM -lICE -lX11 -lpthread'
119 checksoundcard
121 output="rockboxui.exe" # use this as output binary name
124 Linux)
125 echo "Linux host detected"
126 GCCOPTS="$GCCOPTS"
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
133 crosswincc
135 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
136 LDOPTS="`sdl-config --libs`"
137 checksoundcard
138 else
139 LDOPTS='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -lnsl -ldl -lpthread'
140 checksoundcard
141 fi # not a cross-compiler
144 FreeBSD)
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"
154 exit
156 esac
158 if [ `uname -m` = "x86_64" ]; then
159 GCCOPTS="$GCCOPTS -fPIC" # needed to make shared objects link
162 if test "X$crosscompile" != "Xyes"; then
163 id=$$
164 cat >/tmp/conftest-$id.c <<EOF
165 #include <stdio.h>
166 int main(int argc, char **argv)
168 int var=0;
169 char *varp = (char *)&var;
170 *varp=1;
172 printf("%d\n", var);
173 return 0;
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
180 # big endian
181 endian="big"
182 else
183 # little endian
184 endian="little"
186 echo "Simulator environment deemed $endian endian"
188 # use wildcard here to make it work even if it was named *.exe like
189 # on cygwin
190 rm -f /tmp/conftest-$id*
194 shcc () {
195 prefixtools sh-elf-
196 GCCOPTS="$CCOPTS -m1"
197 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
198 endian="big"
201 calmrisccc () {
202 prefixtools calmrisc16-unknown-elf-
203 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
204 GCCOPTIMIZE="-fomit-frame-pointer"
205 endian="big"
208 coldfirecc () {
209 prefixtools m68k-elf-
210 GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
211 GCCOPTIMIZE="-fomit-frame-pointer"
212 endian="big"
215 arm7tdmicc () {
216 prefixtools arm-elf-
217 GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
218 if test "X$1" != "Xshort"; then
219 GCCOPTS="$GCCOPTS -ffunction-sections -mlong-calls"
221 GCCOPTIMIZE="-fomit-frame-pointer"
222 endian="little"
225 arm9tdmicc () {
226 prefixtools arm-elf-
227 GCCOPTS="$CCOPTS -mcpu=arm9tdmi -ffunction-sections -mlong-calls"
228 GCCOPTIMIZE="-fomit-frame-pointer"
229 endian="little"
232 whichaddr () {
233 case $archos in
234 gmini120|gminisp)
235 echo ""
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."
241 loadaddress=`input`
243 if [ "0$loadaddress" = "0" ]; then
244 #default
245 loadaddress="0x10000";
247 echo "You selected $loadaddress"
251 esac
254 whichdevel () {
255 ##################################################################
256 # Prompt for specific developer options
258 echo ""
259 echo "Enter your developer options (press enter when done)"
260 echo "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling"
261 cont=1
263 while [ $cont = "1" ]; do
265 option=`input`;
267 case $option in
268 [Dd])
269 if [ "yes" = "$profile" ]; then
270 echo "Debug is incompatible with profiling"
271 else
272 echo "define DEBUG"
273 use_debug="yes"
276 [Ll])
277 echo "logf() support enabled"
278 logf="yes"
280 [Ss])
281 echo "Simulator build enabled"
282 simulator="yes"
284 [Pp])
285 if [ "yes" = "$use_debug" ]; then
286 echo "Profiling is incompatible with debug"
287 else
288 echo "Profiling support is enabled"
289 profile="yes"
293 echo "done"
294 cont=0
296 esac
297 done
299 if [ "yes" = "$use_debug" ]; then
300 debug="-DDEBUG"
301 GCCOPTS="$GCCOPTS -g -DDEBUG"
303 if [ "yes" = "$logf" ]; then
304 use_logf="#define ROCKBOX_HAS_LOGF 1"
306 if [ "yes" = "$simulator" ]; then
307 debug="-DDEBUG"
308 extradefines="$extradefines -DSIMULATOR"
309 whichsim
311 if [ "yes" = "$profile" ]; then
312 extradefines="$extradefines -DRB_PROFILE"
313 PROFILE_OPTS="-finstrument-functions"
317 whichsim () {
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
327 echo ""
328 echo "Build (S)DL version? (S)"
330 option=`input`;
332 case $option in
333 [Ww])
334 simver="win32"
336 WINDRES=windres
337 DLLTOOL=dlltool
338 DLLWRAP=dllwrap
340 # make sure the code knows this is for win32
341 extradefines="$extradefines -DWIN32"
343 [Xx])
344 simver="x11"
345 extradefines="$extradefines -DX11"
347 [Ss]|*)
348 simver="sdl"
349 extradefines="$extradefines -DSDL"
351 esac
352 echo "Selected $simver simulator"
356 target=$1
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!"
362 echo ""
363 echo "Usage: configure [--ccache][--no-ccache]"
364 exit
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:"
374 echo ""
375 echo " cd .."
376 echo " mkdir build-dir"
377 echo " cd build-dir"
378 echo " ../tools/configure"
379 echo ""
380 echo "Much happiness will arise from this. Enjoy"
381 exit
385 # get our current directory
386 pwd=`pwd`;
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
397 rootdir=$dir
398 break
400 done
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:"
406 firmdir=`input`
409 #####################################################################
410 # Convert the possibly relative directory name to an absolute version
412 now=`pwd`
413 cd $rootdir
414 rootdir=`pwd`
416 # cd back to the build dir
417 cd $now
420 apps="apps"
421 appsdir='\$(ROOTDIR)/apps'
422 firmdir='\$(ROOTDIR)/firmware'
423 toolsdir='\$(ROOTDIR)/tools'
426 ##################################################################
427 # Figure out target platform
430 echo "Enter target platform:"
431 cat <<EOF
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
440 7) Ondio FM
442 ==iAudio== ==Toshiba== ==SanDisk==
443 30) X5/X5V/X5L 40) Gigabeat F 50) Sansa e200
445 ==Tatung==
446 60) Elio TPJ-1022
449 buildfor=`input`;
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 ----
466 # *Variables*
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
479 # $output)
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
487 # while
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
492 # *Functions*
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.
497 case $buildfor in
499 0|player)
500 target_id=1
501 archos="player"
502 target="-DARCHOS_PLAYER"
503 shcc
504 tool="$rootdir/tools/scramble"
505 output="archos.mod"
506 appextra="player:gui"
507 archosrom="$pwd/rombox.ucl"
508 flash="$pwd/rockbox.ucl"
509 plugins="yes"
510 codecs=""
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
522 1|recorder)
523 target_id=2
524 archos="recorder"
525 target="-DARCHOS_RECORDER"
526 shcc
527 tool="$rootdir/tools/scramble"
528 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
529 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
530 output="ajbrec.ajz"
531 appextra="recorder:gui"
532 archosrom="$pwd/rombox.ucl"
533 flash="$pwd/rockbox.ucl"
534 plugins="yes"
535 codecs=""
536 # toolset is the tools within the tools directory that we build for
537 # this particular target.
538 toolset=$archosbitmaptools
541 2|fmrecorder)
542 target_id=3
543 archos="fmrecorder"
544 target="-DARCHOS_FMRECORDER"
545 shcc
546 tool="$rootdir/tools/scramble -fm"
547 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
548 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
549 output="ajbrec.ajz"
550 appextra="recorder:gui"
551 archosrom="$pwd/rombox.ucl"
552 flash="$pwd/rockbox.ucl"
553 plugins="yes"
554 codecs=""
555 # toolset is the tools within the tools directory that we build for
556 # this particular target.
557 toolset=$archosbitmaptools
560 3|recorderv2)
561 target_id=4
562 archos="recorderv2"
563 target="-DARCHOS_RECORDERV2"
564 shcc
565 tool="$rootdir/tools/scramble -v2"
566 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
567 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
568 output="ajbrec.ajz"
569 appextra="recorder:gui"
570 archosrom="$pwd/rombox.ucl"
571 flash="$pwd/rockbox.ucl"
572 plugins="yes"
573 codecs=""
574 # toolset is the tools within the tools directory that we build for
575 # this particular target.
576 toolset=$archosbitmaptools
579 4|gmini120)
580 target_id=5
581 archos="gmini120"
582 target="-DARCHOS_GMINI120"
583 memory=16 # fixed size (16 is a guess, remove comment when checked)
584 calmrisccc
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"
590 archosrom=""
591 flash=""
592 plugins="" # disabled for now, enable later on
593 codecs="libmad"
594 # toolset is the tools within the tools directory that we build for
595 # this particular target.
596 toolset="$toolset bmp2rb codepages"
599 5|gminisp)
600 target_id=6
601 archos="gminisp"
602 target="-DARCHOS_GMINISP"
603 memory=16 # fixed size (16 is a guess, remove comment when checked)
604 calmrisccc
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"
610 archosrom=""
611 flash=""
612 plugins="" # disabled for now, enable later on
613 codecs="libmad"
614 # toolset is the tools within the tools directory that we build for
615 # this particular target.
616 toolset="$toolset bmp2rb codepages"
619 6|ondiosp)
620 target_id=7
621 archos="ondiosp"
622 target="-DARCHOS_ONDIOSP"
623 shcc
624 tool="$rootdir/tools/scramble -osp"
625 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
626 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
627 output="ajbrec.ajz"
628 appextra="recorder:gui"
629 archosrom="$pwd/rombox.ucl"
630 flash="$pwd/rockbox.ucl"
631 plugins="yes"
632 codecs=""
633 # toolset is the tools within the tools directory that we build for
634 # this particular target.
635 toolset=$archosbitmaptools
638 7|ondiofm)
639 target_id=8
640 archos="ondiofm"
641 target="-DARCHOS_ONDIOFM"
642 shcc
643 tool="$rootdir/tools/scramble -ofm"
644 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
645 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
646 output="ajbrec.ajz"
647 appextra="recorder:gui"
648 archosrom="$pwd/rombox.ucl"
649 flash="$pwd/rockbox.ucl"
650 plugins="yes"
651 codecs=""
652 toolset=$archosbitmaptools
655 10|h120)
656 target_id=9
657 archos="h120"
658 target="-DIRIVER_H120"
659 memory=32 # always
660 coldfirecc
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"
668 archosrom=""
669 flash=""
670 plugins="yes"
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
677 11|h300)
678 target_id=10
679 archos="h300"
680 target="-DIRIVER_H300"
681 memory=32 # always
682 coldfirecc
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"
690 archosrom=""
691 flash=""
692 plugins="yes"
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
699 12|h100)
700 target_id=11
701 archos="h100"
702 target="-DIRIVER_H100"
703 memory=16 # always
704 coldfirecc
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"
712 archosrom=""
713 flash=""
714 plugins="yes"
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
721 30|x5)
722 target_id=12
723 archos="x5"
724 target="-DIAUDIO_X5"
725 memory=16 # always
726 coldfirecc
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"
734 archosrom=""
735 flash=""
736 plugins="yes"
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
742 t_cpu="coldfire"
743 t_manufacturer="iaudio"
744 t_model="x5"
747 20|ipodcolor)
748 target_id=13
749 archos="ipodcolor"
750 target="-DIPOD_COLOR"
751 memory=32 # always
752 arm7tdmicc
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"
758 archosrom=""
759 flash=""
760 plugins="yes"
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
769 21|ipodnano)
770 target_id=14
771 archos="ipodnano"
772 target="-DIPOD_NANO"
773 memory=32 # always
774 arm7tdmicc
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"
780 archosrom=""
781 flash=""
782 plugins="yes"
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
791 22|ipodvideo)
792 target_id=15
793 archos="ipodvideo"
794 target="-DIPOD_VIDEO"
795 memory=32 # 30GB models have 32MB, 60GB have 64MB
796 arm7tdmicc
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"
802 archosrom=""
803 flash=""
804 plugins="yes"
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
813 23|ipod3g)
814 target_id=16
815 archos="ipod3g"
816 target="-DIPOD_3G"
817 memory=32 # always
818 arm7tdmicc
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"
824 archosrom=""
825 flash=""
826 plugins="yes"
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
835 24|ipod4g)
836 target_id=17
837 archos="ipod4g"
838 target="-DIPOD_4G"
839 memory=32 # always
840 arm7tdmicc
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"
846 archosrom=""
847 flash=""
848 plugins="yes"
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
857 25|ipodmini)
858 target_id=18
859 archos="ipodmini"
860 target="-DIPOD_MINI"
861 memory=32 # always
862 arm7tdmicc
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"
868 archosrom=""
869 flash=""
870 plugins="yes"
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
879 13|ifp7xx)
880 target_id=19
881 archos="ifp7xx"
882 target="-DIRIVER_IFP7XX"
883 memory=1
884 arm7tdmicc short
885 tool="cp"
886 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
887 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
888 output="rockbox.wma"
889 appextra="recorder:gui"
890 archosrom=""
891 flash=""
892 plugins="yes"
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
899 40|gigabeatf)
900 target_id=20
901 archos="gigabeatf"
902 target="-DGIGABEAT_F"
903 memory=32 # always
904 arm9tdmicc
905 tool="cp"
906 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
907 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
908 output="rockbox.gigabeat"
909 appextra="recorder:gui"
910 archosrom=""
911 flash=""
912 plugins="yes"
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
918 t_cpu="arm"
919 t_manufacturer="gigabeat"
920 t_model="meg-fx"
923 26|ipodmini2g)
924 target_id=21
925 archos="ipodmini2g"
926 target="-DIPOD_MINI2G"
927 memory=32 # always
928 arm7tdmicc
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"
934 archosrom=""
935 flash=""
936 plugins="yes"
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
945 14|h10)
946 target_id=22
947 archos="h10"
948 target="-DIRIVER_H10"
949 memory=32 # always
950 arm7tdmicc
951 tool="$rootdir/tools/scramble -add=h10"
952 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
953 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
954 output="rockbox.h10"
955 appextra="recorder:gui"
956 archosrom=""
957 flash=""
958 plugins="yes"
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
966 t_cpu="arm"
967 t_manufacturer="iriver"
968 t_model="h10"
971 50|e200)
972 target_id=23
973 archos="e200"
974 target="-DSANSA_E200"
975 memory=32 # supposedly
976 arm7tdmicc
977 tool="$rootdir/tools/mkmi4.sh e200"
978 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
979 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
980 output="PP5022.mi4"
981 appextra="recorder:gui"
982 archosrom=""
983 flash=""
984 plugins="yes"
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
992 t_cpu="arm"
993 t_manufacturer="sandisk"
994 t_model="sansa-e200"
997 15|h10_5gb)
998 target_id=24
999 archos="h10_5gb"
1000 target="-DIRIVER_H10_5GB"
1001 memory=32 # always
1002 arm7tdmicc
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"
1008 archosrom=""
1009 flash=""
1010 plugins="yes"
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
1018 t_cpu="arm"
1019 t_manufacturer="iriver"
1020 t_model="h10"
1023 60|tpj1022)
1024 target_id=25
1025 archos="tpj1022"
1026 target="-DELIO_TPJ1022"
1027 memory=32 # always
1028 arm7tdmicc
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"
1034 archosrom=""
1035 flash=""
1036 plugins="yes"
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
1044 t_cpu="arm"
1045 t_manufacturer="tatung"
1046 t_model="tpj1022"
1050 echo "Please select a supported target platform!"
1051 exit
1054 esac
1056 echo "Platform set to $archos"
1059 ############################################################################
1060 # Amount of memory, for those that can differ.
1063 if [ -z "$memory" ]; then
1064 size="2"
1065 if [ -z "$update" ]; then
1066 echo "Enter size of your RAM (in MB): (defaults to 2)"
1067 size=`input`;
1070 case $size in
1072 memory="8"
1075 memory="2"
1078 esac
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
1087 # this
1088 case $archos in
1089 ifp7xx)
1090 gdbstub="(G)DB stub, "
1094 esac
1096 echo ""
1097 echo "Build (N)ormal, (D)evel, (S)imulator, (B)ootloader, $gdbstub(M)anual? (N)"
1099 option=`input`;
1101 case $option in
1102 [Bb])
1103 if test -n "$archosrom"; then
1104 # Archos SH-based players do this somewhat differently for
1105 # some reason
1106 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
1107 appsdir='\$(ROOTDIR)/flash/bootbox'
1108 apps="bootbox"
1109 else
1110 extradefines="-DBOOTLOADER" # for target makefile symbol EXTRA_DEFINES
1111 appsdir='\$(ROOTDIR)/bootloader'
1112 apps="bootloader"
1113 if test -n "$boottool"; then
1114 tool="$boottool"
1116 if test -n "$bootoutput"; then
1117 output=$bootoutput
1120 bootloader="1"
1121 echo "Bootloader build selected"
1123 [Ss])
1124 debug="-DDEBUG"
1125 simulator="yes"
1126 extradefines="-DSIMULATOR"
1127 echo "Simulator build selected"
1128 whichsim
1130 [Dd])
1131 echo "Devel build selected"
1132 whichdevel
1134 [Gg])
1135 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
1136 appsdir='\$(ROOTDIR)/gdb'
1137 apps="stub"
1138 case $archos in
1139 ifp7xx)
1140 output="stub.wma"
1144 esac
1145 echo "GDB stub build selected"
1147 [Mm])
1148 appsdir='\$(ROOTDIR)/manual'
1149 firmdir='\$(ROOTDIR)/manual/platform' # No Makefile here. Effectively ignores target
1150 toolsdir=$firmdir;
1151 toolset='';
1152 apps="manual"
1153 case $archos in
1154 fmrecorder)
1155 archos="recorderv2fm"
1157 recorderv2)
1158 archos="recorderv2fm"
1160 h1??)
1161 archos="h1xx"
1163 ipodmini2g)
1164 archos="ipodmini"
1168 esac
1169 echo "Manual build selected"
1172 debug=""
1173 echo "Normal build selected"
1176 esac
1178 if [ -z "$debug" ]; then
1179 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
1182 whichaddr
1184 echo "Using source code root directory: $rootdir"
1186 # this was once possible to change at build-time, but no more:
1187 language="english"
1189 uname=`uname`
1191 if [ "yes" = "$simulator" ]; then
1192 # setup compiler and things for simulator
1193 simcc
1195 if [ -d "archos" ]; then
1196 echo "sub directory archos already present"
1197 else
1198 mkdir archos
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."
1210 else
1212 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
1213 # DEPEND on it
1215 num1=`echo $gccver | cut -d . -f1`
1216 num2=`echo $gccver | cut -d . -f2`
1217 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
1219 # This makes:
1220 # 3.3.X => 303
1221 # 3.4.X => 304
1222 # 2.95.3 => 295
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
1229 # -Wno-pointer-sign
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"
1247 else
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 /'`
1255 else
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"
1264 ccache="ccache"
1265 else
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
1275 CC="$ccache $CC"
1278 if test "X$endian" = "Xbig"; then
1279 defendian="ROCKBOX_BIG_ENDIAN"
1280 else
1281 defendian="ROCKBOX_LITTLE_ENDIAN"
1284 sed > autoconf.h \
1285 -e "s,@ENDIAN@,${defendian},g" \
1286 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
1287 -e "s,@SIMSOUND@,$use_simsound,g" \
1288 <<EOF
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 */
1294 #define @ENDIAN@ 1
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 */
1301 @SIMSOUND@
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"
1310 GCCOPTS="$GCCOPTS"
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,"
1317 else
1318 # delete the lines that match
1319 simmagic1='/@SIMUL1@/D'
1320 simmagic2='/@SIMUL2@/D'
1323 sed > Makefile \
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" \
1368 -e "${simmagic1}" \
1369 -e "${simmagic2}" \
1370 <<EOF
1371 ## Automaticly generated. http://www.rockbox.org/
1373 ifndef V
1374 SILENT=@
1375 else
1376 VERBOSEOPT=-v
1377 endif
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@
1391 export OBJDIR=@PWD@
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@
1407 export HOSTCC=gcc
1408 export CC=@CC@
1409 export LD=@LD@
1410 export AR=@AR@
1411 export AS=@AS@
1412 export OC=@OC@
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
1433 all: tools
1434 @SIMUL1@
1435 @SIMUL2@
1436 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
1437 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@
1439 bin: tools
1440 @SIMUL1@
1441 @SIMUL2@
1442 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
1443 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ \$(BUILDDIR)/\$(BINARY)
1445 veryclean: clean toolsclean
1447 toolsclean:
1448 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) clean
1450 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
1456 tools:
1457 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) @TOOLSET@
1459 tags:
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
1466 fontzip:
1467 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" -f 1 -o rockbox-fonts.zip \$(TARGET) \$(BINARY)
1469 zip:
1470 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1472 fullzip:
1473 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" -f 2 -o rockbox-full.zip \$(TARGET) \$(BINARY)
1475 7zip:
1476 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -o "rockbox.7z" -z "7za a" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1478 tar:
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)
1482 bzip2: tar
1483 \$(SILENT)bzip2 -f9 rockbox.tar
1485 gzip: tar
1486 \$(SILENT)gzip -f9 rockbox.tar
1488 manual: manual-pdf
1489 manual-pdf:
1490 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-pdf
1492 manual-html:
1493 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-html
1495 manual-zip:
1496 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-zip
1498 help:
1499 @echo "A few helpful make targets"
1500 @echo ""
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
1522 install:
1523 @echo "installing a full setup in your archos dir"
1524 @(\$(MAKE) fullzip && cd archos && unzip -oq ../rockbox-full.zip)
1529 echo "Created Makefile"