Chessbox plugin: Reset computer thinking time on forced play (FS #5135)
[Rockbox.git] / tools / configure
blob14cf6978913738121ad662a37cede257a3e682f8
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 -Wundef -O -nostdlib -ffreestanding -Wstrict-prototypes"
14 use_logf="#undef ROCKBOX_HAS_LOGF"
16 scriptver=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'`
19 # Begin Function Definitions
21 input() {
22 read response
23 echo $response
26 prefixtools () {
27 prefix="$1"
28 CC=${prefix}gcc
29 WINDRES=${prefix}windres
30 DLLTOOL=${prefix}dlltool
31 DLLWRAP=${prefix}dllwrap
32 RANLIB=${prefix}ranlib
33 LD=${prefix}ld
34 AR=${prefix}ar
35 AS=${prefix}as
36 OC=${prefix}objcopy
39 crosswincc () {
40 # naive approach to selecting a mingw cross-compiler on linux/*nix
41 echo "Enabling win32 crosscompiling"
43 prefixtools i586-mingw32msvc-
45 LDOPTS="-lgdi32 -luser32 -mwindows"
46 # add cross-compiler option(s)
47 GCCOPTS="$GCCOPTS -mno-cygwin"
49 output="rockboxui.exe" # use this as output binary name
50 crosscompile="yes"
51 endian="little" # windows is little endian
54 # scan the $PATH for the given command
55 findtool(){
56 file="$1"
58 IFS=":"
59 for path in $PATH
61 # echo "checks for $file in $path" >&2
62 if test -f "$path/$file"; then
63 echo "$path/$file"
64 return
66 done
70 simcc () {
72 # default tool setup for native building
73 prefixtools ""
75 simver=sdl
76 GCCOPTS='-W -Wall -g -fno-builtin'
78 output="rockboxui" # use this as default output binary name
80 # generic sdl-config checker
81 sdl=`findtool sdl-config`
83 if [ -z "$sdl" ]; then
84 echo "configure didn't find sdl-config, which indicates that you"
85 echo "don't have SDL (properly) installed. Please correct and"
86 echo "re-run configure!"
87 exit
90 # default share option, override below if needed
91 SHARED_FLAG="-shared"
93 case $uname in
94 CYGWIN*)
95 echo "Cygwin host detected"
97 # sdl version
98 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
99 LDOPTS="`sdl-config --libs` -mconsole"
101 output="rockboxui.exe" # use this as output binary name
104 Linux)
105 echo "Linux host detected"
106 GCCOPTS="$GCCOPTS"
107 if [ "0" != `sdl-config --libs |grep -c mwindows` ]; then
108 # Enable crosscompiling if sdl-config is from Windows SDL
109 crosswincc
111 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
112 LDOPTS="`sdl-config --libs`"
115 FreeBSD)
116 echo "FreeBSD host detected"
117 # sdl version
118 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
119 LDOPTS="`sdl-config --libs`"
122 Darwin)
123 echo "Darwin host detected"
124 # sdl version
125 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
126 LDOPTS="`sdl-config --libs`"
127 SHARED_FLAG="-dynamiclib -Wl\,-single_module"
131 echo "Unsupported system: $uname, fix configure and retry"
132 exit
134 esac
136 if [ "`uname -m`" = "x86_64" ]; then
137 GCCOPTS="$GCCOPTS -fPIC" # needed to make shared objects link
140 GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
142 if test "X$crosscompile" != "Xyes"; then
143 id=$$
144 cat >/tmp/conftest-$id.c <<EOF
145 #include <stdio.h>
146 int main(int argc, char **argv)
148 int var=0;
149 char *varp = (char *)&var;
150 *varp=1;
152 printf("%d\n", var);
153 return 0;
157 $CC -o /tmp/conftest-$id /tmp/conftest-$id.c 2>/dev/null
159 if test `/tmp/conftest-$id 2>/dev/null` -gt "1"; then
160 # big endian
161 endian="big"
162 else
163 # little endian
164 endian="little"
166 echo "Simulator environment deemed $endian endian"
168 # use wildcard here to make it work even if it was named *.exe like
169 # on cygwin
170 rm -f /tmp/conftest-$id*
174 shcc () {
175 prefixtools sh-elf-
176 GCCOPTS="$CCOPTS -m1"
177 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
178 endian="big"
181 calmrisccc () {
182 prefixtools calmrisc16-unknown-elf-
183 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
184 GCCOPTIMIZE="-fomit-frame-pointer"
185 endian="big"
188 coldfirecc () {
189 prefixtools m68k-elf-
190 GCCOPTS="$CCOPTS -m5206e -Wa\,-m5249 -malign-int -mstrict-align"
191 GCCOPTIMIZE="-fomit-frame-pointer"
192 endian="big"
195 arm7tdmicc () {
196 prefixtools arm-elf-
197 GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
198 if test "X$1" != "Xshort"; then
199 GCCOPTS="$GCCOPTS -mlong-calls"
201 GCCOPTIMIZE="-fomit-frame-pointer"
202 endian="little"
205 arm9tdmicc () {
206 prefixtools arm-elf-
207 GCCOPTS="$CCOPTS -mcpu=arm9tdmi -mlong-calls"
208 GCCOPTIMIZE="-fomit-frame-pointer"
209 endian="little"
212 whichadvanced () {
213 ##################################################################
214 # Prompt for specific developer options
216 echo ""
217 echo "Enter your developer options (press enter when done)"
218 echo -n "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling"
219 if [ "$memory" = "2" ]; then
220 echo -n ", (8)MB MOD"
222 if [ "$archos" = "h120" ]; then
223 echo -n ", (R)TC MOD"
225 echo ""
227 cont=1
229 while [ $cont = "1" ]; do
231 option=`input`;
233 case $option in
234 [Dd])
235 if [ "yes" = "$profile" ]; then
236 echo "Debug is incompatible with profiling"
237 else
238 echo "define DEBUG"
239 use_debug="yes"
242 [Ll])
243 echo "logf() support enabled"
244 logf="yes"
246 [Ss])
247 echo "Simulator build enabled"
248 simulator="yes"
250 [Pp])
251 if [ "yes" = "$use_debug" ]; then
252 echo "Profiling is incompatible with debug"
253 else
254 echo "Profiling support is enabled"
255 profile="yes"
259 if [ "$memory" = "2" ]; then
260 memory="8"
261 echo "Memory size selected: 8MB"
262 else
263 cont=0
266 [Rr])
267 if [ "$archos" = "h120" ]; then
268 config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231"
269 have_rtc_alarm="#define HAVE_RTC_ALARM"
270 echo "RTC functions enabled (DS1339/DS3231)"
271 else
272 cont=0
276 cont=0
278 esac
279 done
280 echo "done"
282 if [ "yes" = "$use_debug" ]; then
283 debug="-DDEBUG"
284 GCCOPTS="$GCCOPTS -g -DDEBUG"
286 if [ "yes" = "$logf" ]; then
287 use_logf="#define ROCKBOX_HAS_LOGF 1"
289 if [ "yes" = "$simulator" ]; then
290 debug="-DDEBUG"
291 extradefines="$extradefines -DSIMULATOR"
293 if [ "yes" = "$profile" ]; then
294 extradefines="$extradefines -DRB_PROFILE"
295 PROFILE_OPTS="-finstrument-functions"
299 voiceconfig () {
300 echo "Building voice for $archos"
301 echo ""
303 if [ `which flite` ]; then
304 FLITE="F(l)ite "
305 FLITE_OPTS="FLITE_OPTS=\"\""
306 DEFAULT_TTS="flite"
307 DEFAULT_TTS_OPTS=$FLITE_OPTS
308 DEFAULT_NOISEFLOOR="500"
309 DEFAULT_CHOICE="L"
311 if [ `which speak` ]; then
312 ESPEAK="(e)Speak "
313 ESPEAK_OPTS="ESPEAK_OPTS=\"\""
314 DEFAULT_TTS="espeak"
315 DEFAULT_TTS_OPTS=$ESPEAK_OPTS
316 DEFAULT_NOISEFLOOR="500"
317 DEFAULT_CHOICE="e"
319 if [ `which festival` ]; then
320 FESTIVAL="(F)estival "
321 FESTIVAL_OPTS="FLITE_OPTS=\"\""
322 DEFAULT_TTS="festival"
323 DEFAULT_TTS_OPTS=$FESTIVAL_OPTS
324 DEFAULT_NOISEFLOOR="500"
325 DEFAULT_CHOICE="F"
328 if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ]; then
329 echo "You need Festival, eSpeak or Flite in your path to build voice files"
330 exit
333 echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}(${DEFAULT_CHOICE})?"
334 option=`input`
335 case "$option" in
336 [Ll])
337 TTS_ENGINE="flite"
338 NOISEFLOOR="500" # TODO: check this value
339 TTS_OPTS=$FLITE_OPTS
341 [Ee])
342 TTS_ENGINE="espeak"
343 NOISEFLOOR="500"
344 TTS_OPTS=$ESPEAK_OPTS
346 [Ff])
347 TTS_ENGINE="festival"
348 NOISEFLOOR="500"
349 TTS_OPTS=$FESTIVAL_OPTS
352 TTS_ENGINE=$DEFAULT_TTS
353 TTS_OPTS=$DEFAULT_TTS_OPTS
354 NOISEFLOOR=$DEFAULT_NOISEFLOOR
355 esac
356 echo "Using $TTS_ENGINE for TTS"
358 echo ""
360 if [ `which oggenc` ]; then
361 OGGENC="(O)ggenc "
362 DEFAULT_ENC="oggenc"
363 VORBIS_OPTS="VORBIS_OPTS=\"-q0 --downmix\""
364 DEFAULT_ENC_OPTS=$VORBIS_OPTS
365 DEFAULT_CHOICE="O"
367 if [ `which speexenc` ]; then
368 SPEEXENC="(S)peexenc "
369 DEFAULT_ENC="speexenc"
370 SPEEX_OPTS="" # TODO: find appropriate options for speex
371 DEFAULT_ENC_OPTS=$SPEEX_OPTS
372 DEFAULT_CHOICE="S"
374 if [ `which lame` ]; then
375 LAME="(L)ame "
376 DEFAULT_ENC="lame"
377 LAME_OPTS="LAME_OPTS=\"--resample 12 -t -m m -h -V 9 -S\""
378 DEFAULT_ENC_OPTS=$LAME_OPTS
379 DEFAULT_CHOICE="L"
382 if [ "$LAME" = "" ]; then
383 echo "You need to have Lame installed to build voice files"
386 echo "Encoder to use: ${LAME}${OGGENC}${SPEEXENC}(${DEFAULT_CHOICE})?"
387 echo ""
388 echo "Note: Use Lame - the other options won't work"
389 option=`input`
390 case "$option" in
391 [Oo])
392 ENCODER="oggenc"
393 ENC_OPTS=$VORBIS_OPTS
395 [Ss])
396 ENCODER="speexenc"
397 ENC_OPTS=$SPEEX_OPTS
399 [Ll])
400 ENCODER="lame"
401 ENC_OPTS=$LAME_OPTS
404 ENCODER=$DEFAULT_ENC
405 ENC_OPTS=$DEFAULT_ENC_OPTS
406 esac
407 echo "Using $ENCODER for encoding voice clips"
409 cat > voicesettings.sh <<EOF
410 TTS_ENGINE="${TTS_ENGINE}"
411 ENCODER="${ENCODER}"
412 TEMPDIR="${pwd}"
413 NOISEFLOOR="${NOISEFLOOR}"
414 ${TTS_OPTS}
415 ${ENC_OPTS}
419 picklang() {
420 # figure out which languages that are around
421 for file in $rootdir/apps/lang/*.lang; do
422 clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
423 langs="$langs $clean"
424 done
426 num=1
427 for one in $langs; do
428 echo "$num. $one"
429 num=`expr $num + 1`
430 done
432 read pick
433 return $pick;
436 whichlang() {
437 num=1
438 for one in $langs; do
439 if [ "$num" = "$pick" ]; then
440 echo $one
441 return
443 num=`expr $num + 1`
444 done
447 opt=$1
449 if test "$opt" = "--help"; then
450 echo "Rockbox configure script."
451 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
452 echo "Do *NOT* run this within the tools directory!"
453 echo ""
454 echo "Usage: configure [--ccache][--no-ccache]"
455 exit
458 if test -r "configure"; then
459 # this is a check for a configure script in the current directory, it there
460 # is one, try to figure out if it is this one!
462 if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
463 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
464 echo "It will only cause you pain and grief. Instead do this:"
465 echo ""
466 echo " cd .."
467 echo " mkdir build-dir"
468 echo " cd build-dir"
469 echo " ../tools/configure"
470 echo ""
471 echo "Much happiness will arise from this. Enjoy"
472 exit
476 # get our current directory
477 pwd=`pwd`;
479 if { echo $pwd | grep " "; } then
480 echo "You're running this script in a path that contains space. The build"
481 echo "system is unfortunately not clever enough to deal with this. Please"
482 echo "run the script from a different path, rename the path or fix the build"
483 echo "system!"
484 exit
487 if [ -z "$rootdir" ]; then
488 ##################################################################
489 # Figure out where the source code root is!
491 rootdir=`dirname $0`/../
493 #####################################################################
494 # Convert the possibly relative directory name to an absolute version
496 now=`pwd`
497 cd $rootdir
498 rootdir=`pwd`
500 # cd back to the build dir
501 cd $now
504 apps="apps"
505 appsdir='\$(ROOTDIR)/apps'
506 firmdir='\$(ROOTDIR)/firmware'
507 toolsdir='\$(ROOTDIR)/tools'
510 ##################################################################
511 # Figure out target platform
514 echo "Enter target platform:"
515 cat <<EOF
516 ==Archos== ==iriver== ==Apple iPod==
517 0) Player/Studio 10) H120/H140 20) Color/Photo
518 1) Recorder 11) H320/H340 21) Nano
519 2) FM Recorder 12) iHP-100/110/115 22) Video
520 3) Recorder v2 13) iFP-790 23) 3G
521 4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
522 5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
523 6) AV300 26) Mini 2G
524 27) 1G, 2G
526 ==iAudio== ==Toshiba== ==SanDisk==
527 30) X5/X5V/X5L 40) Gigabeat F 50) Sansa e200
528 31) M5/M5L 51) Sansa e200R
530 ==Tatung==
531 60) Elio TPJ-1022
534 buildfor=`input`;
536 # Set of tools built for all target platforms:
537 toolset="rdf2binary convbdf codepages"
539 # Toolsets for some target families:
540 archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
541 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
542 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
543 ipodbitmaptools="$toolset scramble ipod_fw bmp2rb codepages"
544 gigabeatbitmaptools="$toolset scramble descramble bmp2rb"
545 # generic is used by IFP, H10, Sansa-e200
546 genericbitmaptools="$toolset bmp2rb"
549 # ---- For each target ----
551 # *Variables*
552 # target_id: a unique number identifying this target, DOES NOT necessarily
553 # have to be the menu number. Just use the currently highest
554 # number+1 when you add a new target.
555 # archos: short model name used all over to identify this target
556 # memory: number of megabytes of RAM this target has. If the amount can
557 # be selected by the size prompt, let memory be unset here
558 # target: -Ddefine passed to the build commands to make the correct
559 # config-*.h file get included etc
560 # tool: the tool that takes a plain binary and converts that into a
561 # working "firmware" file for your target
562 # output: the final output file name
563 # boottool: the tool that takes a plain binary and generates a bootloader
564 # file for your target (or blank to use $tool)
565 # bootoutput:the final output file name for the bootloader (or blank to use
566 # $output)
567 # appextra: passed to the APPEXTRA variable in the Makefiles.
568 # TODO: add proper explanation
569 # archosrom: used only for Archos targets that build a special flashable .ucl
570 # image. Set to blank for other builds.
571 # flash: the same as archosrom. These two should be merged
572 # plugins: set to 'yes' to build the plugins. Early development builds can
573 # set this to no in the early stages to have an easier life for a
574 # while
575 # swcodec: set 'yes' on swcodec targets
576 # toolset: lists what particular tools in the tools/ directory that this
577 # target needs to have built prior to building Rockbox
579 # *Functions*
580 # *cc: sets up gcc and compiler options for your target builds. Note
581 # that if you select a simulator build, the compiler selection is
582 # overridden later in the script.
584 case $buildfor in
586 0|player)
587 target_id=1
588 archos="player"
589 target="-DARCHOS_PLAYER"
590 shcc
591 tool="$rootdir/tools/scramble"
592 output="archos.mod"
593 appextra="player:gui"
594 archosrom="$pwd/rombox.ucl"
595 flash="$pwd/rockbox.ucl"
596 plugins="yes"
597 swcodec=""
599 # toolset is the tools within the tools directory that we build for
600 # this particular target.
601 toolset="$toolset scramble descramble sh2d player_unifont uclpack"
603 # Note: the convbdf is present in the toolset just because: 1) the
604 # firmware/Makefile assumes it is present always, and 2) we will need it when we
605 # build the player simulator
607 t_cpu="sh"
608 t_manufacturer="archos"
609 t_model="player"
612 1|recorder)
613 target_id=2
614 archos="recorder"
615 target="-DARCHOS_RECORDER"
616 shcc
617 tool="$rootdir/tools/scramble"
618 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
619 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
620 output="ajbrec.ajz"
621 appextra="recorder:gui"
622 archosrom=""#"$pwd/rombox.ucl"
623 flash="$pwd/rockbox.ucl"
624 plugins="yes"
625 swcodec=""
626 # toolset is the tools within the tools directory that we build for
627 # this particular target.
628 toolset=$archosbitmaptools
629 t_cpu="sh"
630 t_manufacturer="archos"
631 t_model="recorder"
634 2|fmrecorder)
635 target_id=3
636 archos="fmrecorder"
637 target="-DARCHOS_FMRECORDER"
638 shcc
639 tool="$rootdir/tools/scramble -fm"
640 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
641 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
642 output="ajbrec.ajz"
643 appextra="recorder:gui"
644 archosrom=""#"$pwd/rombox.ucl"
645 flash="$pwd/rockbox.ucl"
646 plugins="yes"
647 swcodec=""
648 # toolset is the tools within the tools directory that we build for
649 # this particular target.
650 toolset=$archosbitmaptools
651 t_cpu="sh"
652 t_manufacturer="archos"
653 t_model="fm_v2"
656 3|recorderv2)
657 target_id=4
658 archos="recorderv2"
659 target="-DARCHOS_RECORDERV2"
660 shcc
661 tool="$rootdir/tools/scramble -v2"
662 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
663 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
664 output="ajbrec.ajz"
665 appextra="recorder:gui"
666 archosrom=""#"$pwd/rombox.ucl"
667 flash="$pwd/rockbox.ucl"
668 plugins="yes"
669 swcodec=""
670 # toolset is the tools within the tools directory that we build for
671 # this particular target.
672 toolset=$archosbitmaptools
673 t_cpu="sh"
674 t_manufacturer="archos"
675 t_model="fm_v2"
678 4|ondiosp)
679 target_id=7
680 archos="ondiosp"
681 target="-DARCHOS_ONDIOSP"
682 shcc
683 tool="$rootdir/tools/scramble -osp"
684 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
685 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
686 output="ajbrec.ajz"
687 appextra="recorder:gui"
688 archosrom="$pwd/rombox.ucl"
689 flash="$pwd/rockbox.ucl"
690 plugins="yes"
691 swcodec=""
692 # toolset is the tools within the tools directory that we build for
693 # this particular target.
694 toolset=$archosbitmaptools
695 t_cpu="sh"
696 t_manufacturer="archos"
697 t_model="ondio"
700 5|ondiofm)
701 target_id=8
702 archos="ondiofm"
703 target="-DARCHOS_ONDIOFM"
704 shcc
705 tool="$rootdir/tools/scramble -ofm"
706 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
707 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
708 output="ajbrec.ajz"
709 appextra="recorder:gui"
710 archosrom=""#"$pwd/rombox.ucl"
711 flash="$pwd/rockbox.ucl"
712 plugins="yes"
713 swcodec=""
714 toolset=$archosbitmaptools
715 t_cpu="sh"
716 t_manufacturer="archos"
717 t_model="ondio"
720 6|av300)
721 target_id=26
722 archos="av300"
723 target="-DARCHOS_AV300"
724 memory=16 # always
725 arm7tdmicc
726 tool="$rootdir/tools/scramble -mm=C"
727 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
728 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
729 output="cjbm.ajz"
730 appextra="recorder:gui"
731 archosrom=""
732 flash=""
733 plugins="yes"
734 swcodec=""
735 # toolset is the tools within the tools directory that we build for
736 # this particular target.
737 toolset="$toolset scramble descramble bmp2rb codepages"
738 # architecture, manufacturer and model for the target-tree build
739 t_cpu="arm"
740 t_manufacturer="archos"
741 t_model="av300"
744 10|h120)
745 target_id=9
746 archos="h120"
747 target="-DIRIVER_H120"
748 memory=32 # always
749 coldfirecc
750 tool="$rootdir/tools/scramble -add=h120"
751 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
752 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
753 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
754 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
755 output="rockbox.iriver"
756 appextra="recorder:gui"
757 archosrom=""
758 flash="$pwd/rombox.iriver"
759 plugins="yes"
760 swcodec="yes"
761 # toolset is the tools within the tools directory that we build for
762 # this particular target.
763 toolset=$iriverbitmaptools
764 t_cpu="coldfire"
765 t_manufacturer="iriver"
766 t_model="h100"
769 11|h300)
770 target_id=10
771 archos="h300"
772 target="-DIRIVER_H300"
773 memory=32 # always
774 coldfirecc
775 tool="$rootdir/tools/scramble -add=h300"
776 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
777 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
778 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
779 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
780 output="rockbox.iriver"
781 appextra="recorder:gui"
782 archosrom=""
783 flash=""
784 plugins="yes"
785 swcodec="yes"
786 # toolset is the tools within the tools directory that we build for
787 # this particular target.
788 toolset=$iriverbitmaptools
789 t_cpu="coldfire"
790 t_manufacturer="iriver"
791 t_model="h300"
794 12|h100)
795 target_id=11
796 archos="h100"
797 target="-DIRIVER_H100"
798 memory=16 # always
799 coldfirecc
800 tool="$rootdir/tools/scramble -add=h100"
801 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
802 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
803 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
804 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
805 output="rockbox.iriver"
806 appextra="recorder:gui"
807 archosrom=""
808 flash=""
809 plugins="yes"
810 swcodec="yes"
811 # toolset is the tools within the tools directory that we build for
812 # this particular target.
813 toolset=$iriverbitmaptools
814 t_cpu="coldfire"
815 t_manufacturer="iriver"
816 t_model="h100"
819 13|ifp7xx)
820 target_id=19
821 archos="ifp7xx"
822 target="-DIRIVER_IFP7XX"
823 memory=1
824 arm7tdmicc short
825 tool="cp"
826 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
827 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
828 output="rockbox.wma"
829 appextra="recorder:gui"
830 archosrom=""
831 flash=""
832 plugins="yes"
833 swcodec="yes"
834 # toolset is the tools within the tools directory that we build for
835 # this particular target.
836 toolset=$genericbitmaptools
837 t_cpu="arm"
838 t_manufacturer="pnx0101"
839 t_model="iriver-ifp7xx"
842 14|h10)
843 target_id=22
844 archos="h10"
845 target="-DIRIVER_H10"
846 memory=32 # always
847 arm7tdmicc
848 tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
849 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
850 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
851 output="rockbox.mi4"
852 appextra="recorder:gui"
853 archosrom=""
854 flash=""
855 plugins="yes"
856 swcodec="yes"
857 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
858 bootoutput="H10_20GC.mi4"
859 # toolset is the tools within the tools directory that we build for
860 # this particular target.
861 toolset="$genericbitmaptools scramble"
862 # architecture, manufacturer and model for the target-tree build
863 t_cpu="arm"
864 t_manufacturer="iriver"
865 t_model="h10"
868 15|h10_5gb)
869 target_id=24
870 archos="h10_5gb"
871 target="-DIRIVER_H10_5GB"
872 memory=32 # always
873 arm7tdmicc
874 tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
875 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
876 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
877 output="rockbox.mi4"
878 appextra="recorder:gui"
879 archosrom=""
880 flash=""
881 plugins="yes"
882 swcodec="yes"
883 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
884 bootoutput="H10.mi4"
885 # toolset is the tools within the tools directory that we build for
886 # this particular target.
887 toolset="$genericbitmaptools scramble"
888 # architecture, manufacturer and model for the target-tree build
889 t_cpu="arm"
890 t_manufacturer="iriver"
891 t_model="h10"
894 20|ipodcolor)
895 target_id=13
896 archos="ipodcolor"
897 target="-DIPOD_COLOR"
898 memory=32 # always
899 arm7tdmicc
900 tool="$rootdir/tools/scramble -add=ipco"
901 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
902 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
903 output="rockbox.ipod"
904 appextra="recorder:gui"
905 archosrom=""
906 flash=""
907 plugins="yes"
908 swcodec="yes"
909 bootoutput="bootloader-$archos.ipod"
910 # toolset is the tools within the tools directory that we build for
911 # this particular target.
912 toolset=$ipodbitmaptools
913 # architecture, manufacturer and model for the target-tree build
914 t_cpu="arm"
915 t_manufacturer="ipod"
916 t_model="color"
919 21|ipodnano)
920 target_id=14
921 archos="ipodnano"
922 target="-DIPOD_NANO"
923 memory=32 # always
924 arm7tdmicc
925 tool="$rootdir/tools/scramble -add=nano"
926 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
927 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
928 output="rockbox.ipod"
929 appextra="recorder:gui"
930 archosrom=""
931 flash=""
932 plugins="yes"
933 swcodec="yes"
934 bootoutput="bootloader-$archos.ipod"
935 # toolset is the tools within the tools directory that we build for
936 # this particular target.
937 toolset=$ipodbitmaptools
938 # architecture, manufacturer and model for the target-tree build
939 t_cpu="arm"
940 t_manufacturer="ipod"
941 t_model="nano"
944 22|ipodvideo)
945 target_id=15
946 archos="ipodvideo"
947 target="-DIPOD_VIDEO"
948 arm7tdmicc
949 tool="$rootdir/tools/scramble -add=ipvd"
950 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
951 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
952 output="rockbox.ipod"
953 appextra="recorder:gui"
954 archosrom=""
955 flash=""
956 plugins="yes"
957 swcodec="yes"
958 bootoutput="bootloader-$archos.ipod"
959 # toolset is the tools within the tools directory that we build for
960 # this particular target.
961 toolset=$ipodbitmaptools
962 # architecture, manufacturer and model for the target-tree build
963 t_cpu="arm"
964 t_manufacturer="ipod"
965 t_model="video"
968 23|ipod3g)
969 target_id=16
970 archos="ipod3g"
971 target="-DIPOD_3G"
972 memory=32 # always
973 arm7tdmicc
974 tool="$rootdir/tools/scramble -add=ip3g"
975 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
976 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
977 output="rockbox.ipod"
978 appextra="recorder:gui"
979 archosrom=""
980 flash=""
981 plugins="yes"
982 swcodec="yes"
983 bootoutput="bootloader-$archos.ipod"
984 # toolset is the tools within the tools directory that we build for
985 # this particular target.
986 toolset=$ipodbitmaptools
987 # architecture, manufacturer and model for the target-tree build
988 t_cpu="arm"
989 t_manufacturer="ipod"
990 t_model="3g"
993 24|ipod4g)
994 target_id=17
995 archos="ipod4g"
996 target="-DIPOD_4G"
997 memory=32 # always
998 arm7tdmicc
999 tool="$rootdir/tools/scramble -add=ip4g"
1000 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1001 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1002 output="rockbox.ipod"
1003 appextra="recorder:gui"
1004 archosrom=""
1005 flash=""
1006 plugins="yes"
1007 swcodec="yes"
1008 bootoutput="bootloader-$archos.ipod"
1009 # toolset is the tools within the tools directory that we build for
1010 # this particular target.
1011 toolset=$ipodbitmaptools
1012 # architecture, manufacturer and model for the target-tree build
1013 t_cpu="arm"
1014 t_manufacturer="ipod"
1015 t_model="4g"
1018 25|ipodmini)
1019 target_id=18
1020 archos="ipodmini"
1021 target="-DIPOD_MINI"
1022 memory=32 # always
1023 arm7tdmicc
1024 tool="$rootdir/tools/scramble -add=mini"
1025 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1026 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1027 output="rockbox.ipod"
1028 appextra="recorder:gui"
1029 archosrom=""
1030 flash=""
1031 plugins="yes"
1032 swcodec="yes"
1033 bootoutput="bootloader-$archos.ipod"
1034 # toolset is the tools within the tools directory that we build for
1035 # this particular target.
1036 toolset=$ipodbitmaptools
1037 # architecture, manufacturer and model for the target-tree build
1038 t_cpu="arm"
1039 t_manufacturer="ipod"
1040 t_model="mini"
1043 26|ipodmini2g)
1044 target_id=21
1045 archos="ipodmini2g"
1046 target="-DIPOD_MINI2G"
1047 memory=32 # always
1048 arm7tdmicc
1049 tool="$rootdir/tools/scramble -add=mn2g"
1050 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1051 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1052 output="rockbox.ipod"
1053 appextra="recorder:gui"
1054 archosrom=""
1055 flash=""
1056 plugins="yes"
1057 swcodec="yes"
1058 bootoutput="bootloader-$archos.ipod"
1059 # toolset is the tools within the tools directory that we build for
1060 # this particular target.
1061 toolset=$ipodbitmaptools
1062 # architecture, manufacturer and model for the target-tree build
1063 t_cpu="arm"
1064 t_manufacturer="ipod"
1065 t_model="mini2g"
1068 27|ipod1g2g)
1069 target_id=29
1070 archos="ipod1g2g"
1071 target="-DIPOD_1G2G"
1072 memory=32 # always
1073 arm7tdmicc
1074 tool="$rootdir/tools/scramble -add=1g2g"
1075 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1076 bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
1077 output="rockbox.ipod"
1078 appextra="recorder:gui"
1079 archosrom=""
1080 flash=""
1081 plugins="yes"
1082 swcodec="yes"
1083 bootoutput="bootloader-$archos.ipod"
1084 # toolset is the tools within the tools directory that we build for
1085 # this particular target.
1086 toolset=$ipodbitmaptools
1087 # architecture, manufacturer and model for the target-tree build
1088 t_cpu="arm"
1089 t_manufacturer="ipod"
1090 t_model="1g2g"
1093 30|x5)
1094 target_id=12
1095 archos="x5"
1096 target="-DIAUDIO_X5"
1097 memory=16 # always
1098 coldfirecc
1099 tool="$rootdir/tools/scramble -add=iax5"
1100 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1101 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1102 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1103 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1104 output="rockbox.iaudio"
1105 appextra="recorder:gui"
1106 archosrom=""
1107 flash=""
1108 plugins="yes"
1109 swcodec="yes"
1110 # toolset is the tools within the tools directory that we build for
1111 # this particular target.
1112 toolset="$iaudiobitmaptools"
1113 # architecture, manufacturer and model for the target-tree build
1114 t_cpu="coldfire"
1115 t_manufacturer="iaudio"
1116 t_model="x5"
1119 31|m5)
1120 target_id=28
1121 archos="m5"
1122 target="-DIAUDIO_M5"
1123 memory=16 # always
1124 coldfirecc
1125 tool="$rootdir/tools/scramble -add=iam5"
1126 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1127 bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
1128 bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
1129 bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
1130 output="rockbox.iaudio"
1131 appextra="recorder:gui"
1132 archosrom=""
1133 flash=""
1134 plugins="yes"
1135 swcodec="yes"
1136 # toolset is the tools within the tools directory that we build for
1137 # this particular target.
1138 toolset="$iaudiobitmaptools"
1139 # architecture, manufacturer and model for the target-tree build
1140 t_cpu="coldfire"
1141 t_manufacturer="iaudio"
1142 t_model="m5"
1145 40|gigabeatf)
1146 target_id=20
1147 archos="gigabeatf"
1148 target="-DGIGABEAT_F"
1149 memory=32 # always
1150 arm9tdmicc
1151 tool="$rootdir/tools/scramble -add=giga"
1152 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1153 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1154 output="rockbox.gigabeat"
1155 appextra="recorder:gui"
1156 archosrom=""
1157 flash=""
1158 plugins="yes"
1159 swcodec="yes"
1160 toolset=$gigabeatbitmaptools
1161 boottool="$rootdir/tools/scramble -gigabeat"
1162 bootoutput="FWIMG01.DAT"
1163 # architecture, manufacturer and model for the target-tree build
1164 t_cpu="arm"
1165 t_manufacturer="s3c2440"
1166 t_model="gigabeat-fx"
1169 50|e200)
1170 target_id=23
1171 archos="e200"
1172 target="-DSANSA_E200"
1173 memory=32 # supposedly
1174 arm7tdmicc
1175 tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
1176 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1177 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1178 output="rockbox.mi4"
1179 appextra="recorder:gui"
1180 archosrom=""
1181 flash=""
1182 plugins="yes"
1183 swcodec="yes"
1184 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
1185 bootoutput="PP5022.mi4"
1186 # toolset is the tools within the tools directory that we build for
1187 # this particular target.
1188 toolset="$genericbitmaptools scramble"
1189 # architecture, manufacturer and model for the target-tree build
1190 t_cpu="arm"
1191 t_manufacturer="sandisk"
1192 t_model="sansa-e200"
1195 51|e200r)
1196 # the e200R model is pretty much identical to the e200, it only has a
1197 # different option to the scramble tool when building a bootloader and
1198 # makes the bootloader output file name in all lower case.
1199 target_id=27
1200 archos="e200r"
1201 target="-DSANSA_E200"
1202 memory=32 # supposedly
1203 arm7tdmicc
1204 tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
1205 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1206 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1207 output="rockbox.mi4"
1208 appextra="recorder:gui"
1209 archosrom=""
1210 flash=""
1211 plugins="yes"
1212 swcodec="yes"
1213 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
1214 bootoutput="pp5022.mi4"
1215 # toolset is the tools within the tools directory that we build for
1216 # this particular target.
1217 toolset="$genericbitmaptools scramble"
1218 # architecture, manufacturer and model for the target-tree build
1219 t_cpu="arm"
1220 t_manufacturer="sandisk"
1221 t_model="sansa-e200"
1224 60|tpj1022)
1225 target_id=25
1226 archos="tpj1022"
1227 target="-DELIO_TPJ1022"
1228 memory=32 # always
1229 arm7tdmicc
1230 tool="$rootdir/tools/scramble -add tpj2"
1231 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1232 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
1233 output="rockbox.elio"
1234 appextra="recorder:gui"
1235 archosrom=""
1236 flash=""
1237 plugins="yes"
1238 swcodec="yes"
1239 boottool="$rootdir/tools/scramble -mi4v2"
1240 bootoutput="pp5020.mi4"
1241 # toolset is the tools within the tools directory that we build for
1242 # this particular target.
1243 toolset="$genericbitmaptools scramble"
1244 # architecture, manufacturer and model for the target-tree build
1245 t_cpu="arm"
1246 t_manufacturer="tatung"
1247 t_model="tpj1022"
1251 echo "Please select a supported target platform!"
1252 exit
1255 esac
1257 echo "Platform set to $archos"
1260 #remove start
1261 ############################################################################
1262 # Amount of memory, for those that can differ. They have $memory unset at
1263 # this point.
1266 if [ -z "$memory" ]; then
1268 case $target_id in
1270 echo "Enter size of your RAM (in MB): (Defaults to 32)"
1271 size=`input`;
1272 case $size in
1273 60|64)
1274 memory="64"
1277 memory="32"
1279 esac
1283 echo "Enter size of your RAM (in MB): (defaults to 2)"
1284 size=`input`;
1285 case $size in
1287 memory="8"
1290 memory="2"
1292 esac
1294 esac
1296 echo "Memory size selected: $memory MB"
1298 #remove end
1300 ##################################################################
1301 # Figure out build "type"
1304 # the ifp7x0 is the only platform that supports building a gdb stub like
1305 # this
1306 case $archos in
1307 ifp7xx)
1308 gdbstub="(G)DB stub, "
1312 esac
1314 echo ""
1315 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, $gdbstub(M)anual, (V)oice? (N)"
1317 option=`input`;
1319 case $option in
1320 [Bb])
1321 if test -n "$archosrom"; then
1322 # Archos SH-based players do this somewhat differently for
1323 # some reason
1324 appsdir='\$(ROOTDIR)/flash/bootbox'
1325 apps="bootbox"
1326 else
1327 appsdir='\$(ROOTDIR)/bootloader'
1328 apps="bootloader"
1329 flash=""
1330 if test -n "$boottool"; then
1331 tool="$boottool"
1333 if test -n "$bootoutput"; then
1334 output=$bootoutput
1337 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
1338 bootloader="1"
1339 echo "Bootloader build selected"
1341 [Ss])
1342 debug="-DDEBUG"
1343 simulator="yes"
1344 extradefines="-DSIMULATOR"
1345 echo "Simulator build selected"
1347 [Aa])
1348 echo "Advanced build selected"
1349 whichadvanced
1351 [Gg])
1352 extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
1353 appsdir='\$(ROOTDIR)/gdb'
1354 apps="stub"
1355 case $archos in
1356 ifp7xx)
1357 output="stub.wma"
1361 esac
1362 echo "GDB stub build selected"
1364 [Mm])
1365 appsdir='\$(ROOTDIR)/manual'
1366 firmdir='\$(ROOTDIR)/manual/platform' # No Makefile here. Effectively ignores target
1367 toolsdir=$firmdir;
1368 toolset='';
1369 apps="manual"
1370 echo "Manual build selected"
1372 [Vv])
1373 echo "Voice build selected"
1374 voiceconfig
1375 toolset="${toolset} voicefont wavtrim"
1376 voice="yes"
1379 debug=""
1380 echo "Normal build selected"
1383 esac
1384 # to be able running "make manual" from non-manual configuration
1385 case $archos in
1386 fmrecorder)
1387 manualdev="recorderv2fm"
1389 recorderv2)
1390 manualdev="recorderv2fm"
1392 h1??)
1393 manualdev="h1xx"
1395 ipodmini2g)
1396 manualdev="ipodmini"
1399 manualdev=$archos
1401 esac
1403 if [ -z "$debug" ]; then
1404 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
1407 echo "Using source code root directory: $rootdir"
1409 # this was once possible to change at build-time, but no more:
1410 language="english"
1412 # Ask about language if building voice
1413 if [ "yes" = "$voice" ]; then
1414 echo "Select a number for the language to use (default is english)"
1416 picklang
1417 language=`whichlang`
1419 if [ -z "$language" ]; then
1420 # pick a default
1421 language="english"
1423 echo "Language set to $language"
1426 uname=`uname`
1428 if [ "yes" = "$simulator" ]; then
1429 # setup compiler and things for simulator
1430 simcc
1432 if [ -d "archos" ]; then
1433 echo "sub directory archos already present"
1434 else
1435 mkdir archos
1436 echo "created an archos subdirectory for simulating the hard disk"
1440 # Now, figure out version number of the (gcc) compiler we are about to use
1441 gccver=`$CC -dumpversion`;
1443 if [ -z "$gccver" ]; then
1444 echo "WARNING: The compiler you must use ($CC) is not in your path!"
1445 echo "WARNING: this may cause your build to fail since we cannot do the"
1446 echo "WARNING: checks we want now."
1447 else
1449 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
1450 # DEPEND on it
1452 num1=`echo $gccver | cut -d . -f1`
1453 num2=`echo $gccver | cut -d . -f2`
1454 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
1456 # This makes:
1457 # 3.3.X => 303
1458 # 3.4.X => 304
1459 # 2.95.3 => 295
1461 echo "Using $CC $gccver ($gccnum)"
1463 if test "$gccnum" -ge "400"; then
1464 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
1465 # so we ignore that warnings for now
1466 # -Wno-pointer-sign
1467 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
1470 if test "$gccnum" -ge "401"; then
1471 # this is a lame hack to avoid "warning: dereferencing type-punned pointer
1472 # will break strict-aliasing rules"
1474 GCCOPTS="$GCCOPTS -fno-strict-aliasing"
1479 # check the compiler for SH platforms
1480 if test "$CC" = "sh-elf-gcc"; then
1481 if test "$gccnum" -lt "400"; then
1482 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
1483 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
1484 else
1485 # figure out patch status
1486 gccpatch=`$CC --version`;
1488 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
1489 echo "gcc $gccver is rockbox patched"
1490 # then convert -O to -Os to get smaller binaries!
1491 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
1492 else
1493 echo "WARNING: You use an unpatched gcc compiler: $gccver"
1494 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
1499 if test "$CC" = "m68k-elf-gcc"; then
1500 # convert -O to -Os to get smaller binaries!
1501 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
1504 if test "$1" = "--ccache"; then
1505 echo "Enable ccache for building"
1506 ccache="ccache"
1507 else
1508 if test "$1" != "--no-ccache"; then
1509 ccache=`findtool ccache`
1510 if test -n "$ccache"; then
1511 echo "Found and uses ccache ($ccache)"
1516 if test -n "$ccache"; then
1517 CC="$ccache $CC"
1520 if test "X$endian" = "Xbig"; then
1521 defendian="ROCKBOX_BIG_ENDIAN"
1522 else
1523 defendian="ROCKBOX_LITTLE_ENDIAN"
1526 sed > autoconf.h \
1527 -e "s,@ENDIAN@,${defendian},g" \
1528 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
1529 -e "s,@config_rtc@,$config_rtc,g" \
1530 -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
1531 <<EOF
1532 /* This header was made by configure */
1533 #ifndef __BUILD_AUTOCONF_H
1534 #define __BUILD_AUTOCONF_H
1536 /* Define endianess for the target or simulator platform */
1537 #define @ENDIAN@ 1
1539 /* Define this if you build rockbox to support the logf logging and display */
1540 #undef ROCKBOX_HAS_LOGF
1542 /* optional defines for RTC mod for h1x0 */
1543 @config_rtc@
1544 @have_rtc_alarm@
1546 #endif /* __BUILD_AUTOCONF_H */
1549 if test -n "$t_cpu"; then
1550 TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
1551 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
1552 TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
1553 GCCOPTS="$GCCOPTS"
1556 if test "$simulator" = "yes"; then
1557 # add simul make stuff on the #SIMUL# line
1558 simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
1559 simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
1560 else
1561 # delete the lines that match
1562 simmagic1='/@SIMUL1@/D'
1563 simmagic2='/@SIMUL2@/D'
1566 sed > Makefile \
1567 -e "s,@ROOTDIR@,${rootdir},g" \
1568 -e "s,@DEBUG@,${debug},g" \
1569 -e "s,@MEMORY@,${memory},g" \
1570 -e "s,@TARGET_ID@,${target_id},g" \
1571 -e "s,@TARGET@,${target},g" \
1572 -e "s,@CPU@,${t_cpu},g" \
1573 -e "s,@MANUFACTURER@,${t_manufacturer},g" \
1574 -e "s,@ARCHOS@,${archos},g" \
1575 -e "s,@LANGUAGE@,${language},g" \
1576 -e "s,@PWD@,${pwd},g" \
1577 -e "s,@CC@,${CC},g" \
1578 -e "s,@LD@,${LD},g" \
1579 -e "s,@AR@,${AR},g" \
1580 -e "s,@AS@,${AS},g" \
1581 -e "s,@OC@,${OC},g" \
1582 -e "s,@WINDRES@,${WINDRES},g" \
1583 -e "s,@DLLTOOL@,${DLLTOOL},g" \
1584 -e "s,@DLLWRAP@,${DLLWRAP},g" \
1585 -e "s,@RANLIB@,${RANLIB},g" \
1586 -e "s,@TOOL@,${tool},g" \
1587 -e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
1588 -e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
1589 -e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
1590 -e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
1591 -e "s,@OUTPUT@,${output},g" \
1592 -e "s,@APPEXTRA@,${appextra},g" \
1593 -e "s,@ARCHOSROM@,${archosrom},g" \
1594 -e "s,@FLASHFILE@,${flash},g" \
1595 -e "s,@PLUGINS@,${plugins},g" \
1596 -e "s,@CODECS@,${swcodec},g" \
1597 -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
1598 -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
1599 -e "s,@GCCOPTS@,${GCCOPTS},g" \
1600 -e "s,@TARGET_INC@,${TARGET_INC},g" \
1601 -e "s!@LDOPTS@!${LDOPTS}!g" \
1602 -e "s,@LOADADDRESS@,${loadaddress},g" \
1603 -e "s,@EXTRADEF@,${extradefines},g" \
1604 -e "s,@APPSDIR@,${appsdir},g" \
1605 -e "s,@FIRMDIR@,${firmdir},g" \
1606 -e "s,@TOOLSDIR@,${toolsdir},g" \
1607 -e "s,@APPS@,${apps},g" \
1608 -e "s,@SIMVER@,${simver},g" \
1609 -e "s,@GCCVER@,${gccver},g" \
1610 -e "s,@GCCNUM@,${gccnum},g" \
1611 -e "s,@UNAME@,${uname},g" \
1612 -e "s,@ENDIAN@,${defendian},g" \
1613 -e "s,@TOOLSET@,${toolset},g" \
1614 -e "${simmagic1}" \
1615 -e "${simmagic2}" \
1616 -e "s,@MANUALDEV@,${manualdev},g" \
1617 <<EOF
1618 ## Automaticly generated. http://www.rockbox.org/
1620 ifndef V
1621 SILENT=@
1622 else
1623 VERBOSEOPT=-v
1624 endif
1626 # old 'make' versions don't have the built-in 'info' function
1627 info=old\$(shell echo >&2 "Consider upgrading to GNU make 3.81+ for optimum build performance.")
1628 ifeq (\$(call info),old)
1629 export info=echo "\$\$(1)";
1630 endif
1632 export ROOTDIR=@ROOTDIR@
1633 export FIRMDIR=@FIRMDIR@
1634 export APPSDIR=@APPSDIR@
1635 export TOOLSDIR=@TOOLSDIR@
1636 export DOCSDIR=\$(ROOTDIR)/docs
1637 export MANUALDIR=\${ROOTDIR}/manual
1638 export DEBUG=@DEBUG@
1639 export ARCHOS=@ARCHOS@
1640 export ARCHOSROM=@ARCHOSROM@
1641 export FLASHFILE=@FLASHFILE@
1642 export TARGET_ID=@TARGET_ID@
1643 export TARGET=@TARGET@
1644 export CPU=@CPU@
1645 export MANUFACTURER=@MANUFACTURER@
1646 export OBJDIR=@PWD@
1647 export BUILDDIR=@PWD@
1648 export LANGUAGE=@LANGUAGE@
1649 export MEMORYSIZE=@MEMORY@
1650 export VERSION=\$(shell \$(ROOTDIR)/tools/svnversion.sh \$(ROOTDIR))
1651 export BUILDDATE=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
1652 export MKFIRMWARE=@TOOL@
1653 export BMP2RB_MONO=@BMP2RB_MONO@
1654 export BMP2RB_NATIVE=@BMP2RB_NATIVE@
1655 export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
1656 export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
1657 export BINARY=@OUTPUT@
1658 export APPEXTRA=@APPEXTRA@
1659 export ENABLEDPLUGINS=@PLUGINS@
1660 export SOFTWARECODECS=@CODECS@
1661 export EXTRA_DEFINES=@EXTRADEF@
1662 export HOSTCC=gcc
1663 export CC=@CC@
1664 export LD=@LD@
1665 export AR=@AR@
1666 export AS=@AS@
1667 export OC=@OC@
1668 export WINDRES=@WINDRES@
1669 export DLLTOOL=@DLLTOOL@
1670 export DLLWRAP=@DLLWRAP@
1671 export RANLIB=@RANLIB@
1672 export PROFILE_OPTS=@PROFILE_OPTS@
1673 export SIMVER=@SIMVER@
1674 export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
1675 export GCCOPTS=@GCCOPTS@
1676 export TARGET_INC=@TARGET_INC@
1677 export LOADADDRESS=@LOADADDRESS@
1678 export SHARED_FLAG=@SHARED_FLAG@
1679 export LDOPTS=@LDOPTS@
1680 export GCCVER=@GCCVER@
1681 export GCCNUM=@GCCNUM@
1682 export UNAME=@UNAME@
1683 export MANUALDEV=@MANUALDEV@
1685 # Do not print "Entering directory ..."
1686 MAKEFLAGS += --no-print-directory
1688 .PHONY: all clean tags zip tools manual bin build info
1690 all: info
1692 info: build
1693 \$(SILENT)\$(TOOLSDIR)/mkinfo.pl \$(BUILDDIR)/rockbox-info.txt
1695 build: tools
1696 @SIMUL1@
1697 @SIMUL2@
1698 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
1699 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@
1701 bin: tools
1702 @SIMUL1@
1703 @SIMUL2@
1704 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
1705 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ \$(BUILDDIR)/\$(BINARY)
1707 rocks: tools
1708 \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ rocks
1710 veryclean: clean toolsclean
1712 toolsclean:
1713 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) clean
1715 clean:
1716 \$(SILENT)echo Cleaning build directory
1717 \$(SILENT)rm -rf rockbox.zip TAGS @APPS@ firmware comsim sim lang.[ch]\
1718 manual *.pdf *.a credits.raw @OUTPUT@ bitmaps pluginbitmaps \
1719 @ARCHOSROM@ @FLASHFILE@ UI256.bmp rockbox-full.zip \
1720 html txt rockbox-manual*.zip sysfont.h rockbox-info.txt
1722 voice: tools
1723 \$(TOOLSDIR)/genvoice.sh \$(ROOTDIR) \$(LANGUAGE) \$(ARCHOS) voicesettings.sh
1725 tools:
1726 \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) @TOOLSET@
1728 tags:
1729 \$(SILENT)rm -f TAGS
1730 \$(SILENT)\$(MAKE) -C \$(FIRMDIR) tags
1731 \$(SILENT)\$(MAKE) -C \$(APPSDIR) tags
1732 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins tags
1733 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins/lib tags
1735 fontzip:
1736 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" -f 1 -o rockbox-fonts.zip \$(TARGET) \$(BINARY)
1738 zip:
1739 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1741 mapzip:
1742 \$(SILENT)find . -name "*.map" | xargs zip rockbox-maps.zip
1744 fullzip:
1745 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" -f 2 -o rockbox-full.zip \$(TARGET) \$(BINARY)
1747 7zip:
1748 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -o "rockbox.7z" -z "7za a" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1750 tar:
1751 \$(SILENT)rm -f rockbox.tar
1752 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -o "rockbox.tar" -z "tar --no-recursion -uf" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1754 bzip2: tar
1755 \$(SILENT)bzip2 -f9 rockbox.tar
1757 gzip: tar
1758 \$(SILENT)gzip -f9 rockbox.tar
1760 manual: manual-pdf
1761 manual-pdf:
1762 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-pdf
1763 manual-html:
1764 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-html
1765 manual-zhtml: manual-zip
1766 manual-txt:
1767 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-txt
1768 manual-ztxt:
1769 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-txt-zip
1770 manual-zip:
1771 \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-zip
1773 help:
1774 @echo "A few helpful make targets"
1775 @echo ""
1776 @echo "all - builds a full Rockbox (default), including tools"
1777 @echo "bin - builds only the Rockbox.<target name> file"
1778 @echo "clean - cleans a build directory (not tools)"
1779 @echo "veryclean - cleans the build and tools directories"
1780 @echo "manual - builds a manual"
1781 @echo "manual-html - HTML manual"
1782 @echo "manual-zip - HTML manual (zipped)"
1783 @echo "manual-txt - txt manual"
1784 @echo "fullzip - creates a rockbox.zip of your build with fonts"
1785 @echo "zip - creates a rockbox.zip of your build (no fonts)"
1786 @echo "gzip - creates a rockbox.tar.gz of your build (no fonts)"
1787 @echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)"
1788 @echo "7zip - creates a rockbox.7z of your build (no fonts)"
1789 @echo "fontzip - creates rockbox-fonts.zip"
1790 @echo "mapzip - creates rockbox-maps.zip with all .map files"
1791 @echo "tools - builds the tools only"
1792 @echo "install - installs your build (for simulator builds only)"
1796 if [ "yes" = "$simulator" ]; then
1798 cat >> Makefile <<EOF
1800 install:
1801 @echo "installing a full setup in your archos dir"
1802 @(\$(MAKE) fullzip && cd archos && unzip -oq ../rockbox-full.zip)
1807 echo "Created Makefile"