Initial check-in of work-in-progress iPod bootloader. Current targets are iPod Color...
[Rockbox.git] / tools / configure
blob38d95a71a06654e014e400123568cf485fee9930
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
66 simcc () {
68 # default tool setup for native building
69 prefixtools ""
71 GCCOPTS='-W -Wall -g -fno-builtin'
73 output="rockboxui" # use this as default output binary name
75 case $uname in
76 CYGWIN*)
77 echo "Cygwin host detected"
79 if [ "$simver" = "win32" ]; then
80 # win32 version
81 GCCOPTS="$GCCOPTS -mno-cygwin -DNOCYGWIN"
82 LDOPTS="-lgdi32 -luser32 -mno-cygwin"
83 else
84 # x11 version
85 GCCOPTS="$GCCOPTS"
86 LDOPTS='-L/usr/X11R6/lib -lSM -lICE -lXt -lX11 -lXmu -lSM -lICE -lX11 -lpthread'
87 checksoundcard
89 output="rockboxui.exe" # use this as output binary name
92 Linux)
93 echo "Linux host detected"
94 GCCOPTS="$GCCOPTS"
95 LDOPTS='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -lnsl -ldl -lpthread'
96 if [ "$simver" = "win32" ]; then
97 crosswincc # setup cross-compiler
98 else
99 checksoundcard
100 fi # not a cross-compiler
103 FreeBSD)
104 echo "FreeBSD host detected"
105 LDOPTS='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -dl -lpthread'
106 if [ "$simver" = "win32" ]; then
107 crosswincc # setup cross-compiler
112 echo "Unsupported system: $uname, fix configure and retry"
113 exit
115 esac
118 if test "X$crosscompile" != "Xyes"; then
119 id=$$
120 cat >/tmp/conftest-$id.c <<EOF
121 #include <stdio.h>
122 int main(int argc, char **argv)
124 int var=0;
125 char *varp = (char *)&var;
126 *varp=1;
128 printf("%d\n", var);
129 return 0;
133 $CC -o /tmp/conftest-$id /tmp/conftest-$id.c 2>/dev/null
135 if test `/tmp/conftest-$id 2>/dev/null` -gt "1"; then
136 # big endian
137 endian="big"
138 else
139 # little endian
140 endian="little"
142 echo "Simulator environment deemed $endian endian"
144 # use wildcard here to make it work even if it was named *.exe like
145 # on cygwin
146 rm -f /tmp/conftest-$id*
150 shcc () {
151 prefixtools sh-elf-
152 GCCOPTS="$CCOPTS -m1"
153 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
154 endian="big"
157 calmrisccc () {
158 prefixtools calmrisc16-unknown-elf-
159 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
160 GCCOPTIMIZE="-fomit-frame-pointer"
161 endian="big"
164 coldfirecc () {
165 prefixtools m68k-elf-
166 GCCOPTS="$CCOPTS -g -m5200 -Wa\,-m5249 -malign-int -mstrict-align"
167 GCCOPTIMIZE="-fomit-frame-pointer"
168 endian="big"
171 arm7tdmicc () {
172 prefixtools arm-elf-
173 GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
174 GCCOPTIMIZE="-fomit-frame-pointer"
175 endian="little"
178 whichaddr () {
179 case $archos in
180 gmini120|gminisp)
181 echo ""
182 echo "Where do you want the firmware to be flashed?"
183 echo "WARNING: Do not answer this question lightly,"
184 echo "unless you don't plan to flash your gmini."
185 echo "In this case, reply '0x10000' (no quotes) and "
186 echo "re-configure when you know better."
187 loadaddress=`input`
189 if [ "0$loadaddress" = "0" ]; then
190 #default
191 loadaddress="0x10000";
193 echo "You selected $loadaddress"
197 esac
200 whichdevel () {
201 ##################################################################
202 # Prompt for specific developer options
204 echo ""
205 echo "Enter your developer options (press enter when done)"
206 echo "(D)EBUG, (L)ogf, (S)imulator"
207 cont=1
209 while [ $cont = "1" ]; do
211 option=`input`;
213 case $option in
214 [Dd])
215 echo "define DEBUG"
216 debug="-DDEBUG"
217 GCCOPTS="$GCCOPTS -g -DDEBUG"
219 [Ll])
220 logf="yes"
221 echo "logf() support enabled"
222 use_logf="#define ROCKBOX_HAS_LOGF 1"
224 [Ss])
225 echo "Simulator build enabled"
226 simulator="yes"
229 echo "done"
230 cont=0
232 esac
233 done
235 if [ "yes" = "$simulator" ]; then
236 debug="-DDEBUG"
237 extradefines="-DSIMULATOR"
238 whichsim
242 whichsim () {
244 if [ -z "$simver" ]; then
246 ##################################################################
247 # Figure out win32/x11 GUI
249 echo ""
250 echo "Build (W)in32 or (X)11 GUI version? (X)"
252 option=`input`;
254 case $option in
255 [Ww])
256 simver="win32"
258 WINDRES=windres
259 DLLTOOL=dlltool
260 DLLWRAP=dllwrap
262 # make sure the code knows this is for win32
263 extradefines="$extradefines -DWIN32"
266 simver="x11"
268 esac
269 echo "Selected $simver simulator"
273 picklang() {
274 # figure out which languages that are around
275 for file in $rootdir/apps/lang/*.lang; do
276 clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
277 langs="$langs $clean"
278 done
280 num=1
281 for one in $langs; do
282 echo "$num. $one"
283 num=`expr $num + 1`
284 done
286 read pick
287 return $pick;
290 whichlang() {
291 num=1
292 for one in $langs; do
293 if [ "$num" = "$pick" ]; then
294 echo $one
295 return
297 num=`expr $num + 1`
298 done
301 if test "$1" = "--help"; then
302 echo "Rockbox configure script."
303 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
304 echo "Do *NOT* run this within the tools directory!"
305 echo ""
306 echo "Usage: configure [--ccache]"
307 exit
310 if test "$1" = "--ccache"; then
311 echo "Enable ccache for building"
312 ccache="yes"
315 if test -r "configure"; then
316 # this is a check for a configure script in the current directory, it there
317 # is one, try to figure out if it is this one!
319 if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
320 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
321 echo "It will only cause you pain and grief. Instead do this:"
322 echo ""
323 echo " cd .."
324 echo " mkdir build-dir"
325 echo " cd build-dir"
326 echo " ../tools/configure"
327 echo ""
328 echo "Much happiness will arise from this. Enjoy"
329 exit
333 if [ "$target" = "--help" -o \
334 "$target" = "-h" ]; then
335 echo "Just invoke the script and answer the questions."
336 echo "This script will write a Makefile for you"
337 exit
340 # get our current directory
341 pwd=`pwd`;
343 if [ "$target" = "update" ]; then
344 echo "configure update is unfortunately no longer supported"
345 exit
346 else
348 echo "This script will setup your Rockbox build environment."
349 echo "Further docs here: http://www.rockbox.org/"
350 echo ""
354 if [ -z "$rootdir" ]; then
355 ##################################################################
356 # Figure out where the source code root is!
359 firmfile="crt0.S" # a file to check for in the firmware root dir
361 for dir in . .. ../.. ../rockbox*; do
362 if [ -f $dir/firmware/$firmfile ]; then
363 rootdir=$dir
364 break
366 done
368 if [ -z "$rootdir" ]; then
369 echo "This script couldn't find your source code root directory. Please enter the"
370 echo "full path to the source code directory here:"
372 firmdir=`input`
375 #####################################################################
376 # Convert the possibly relative directory name to an absolute version
378 now=`pwd`
379 cd $rootdir
380 rootdir=`pwd`
382 echo "Using this source code root directory:"
383 echo $rootdir
384 echo ""
386 # cd back to the build dir
387 cd $now
390 apps="apps"
391 appsdir='\$(ROOTDIR)/apps'
393 ##################################################################
394 # Figure out target platform
397 echo "Enter target platform:"
399 echo "1 - Archos Player/Studio"
400 echo "2 - Archos Recorder"
401 echo "3 - Archos FM Recorder"
402 echo "4 - Archos Recorder v2"
403 echo "5 - Archos Gmini 120"
404 echo "6 - Archos Gmini SP"
405 echo "7 - Archos Ondio SP"
406 echo "8 - Archos Ondio FM"
407 echo "9 - iriver H120/H140"
408 echo "10 - iriver H320/H340"
409 echo "11 - iriver iHP-100/iHP-110/iHP-115"
410 echo "12 - iAudio X5"
411 echo "13 - iPod Color/Photo"
412 echo "14 - iPod Nano"
414 getit=`input`;
416 case $getit in
419 archos="player"
420 target="-DARCHOS_PLAYER"
421 shcc
422 tool="$rootdir/tools/scramble"
423 output="archos.mod"
424 appextra="player:gui"
425 archosrom="$pwd/rombox.ucl"
426 flash="$pwd/rockbox.ucl"
427 plugins="yes"
428 codecs=""
432 archos="recorder"
433 target="-DARCHOS_RECORDER"
434 shcc
435 tool="$rootdir/tools/scramble"
436 output="ajbrec.ajz"
437 appextra="recorder:gui"
438 archosrom="$pwd/rombox.ucl"
439 flash="$pwd/rockbox.ucl"
440 plugins="yes"
441 codecs=""
445 archos="fmrecorder"
446 target="-DARCHOS_FMRECORDER"
447 shcc
448 tool="$rootdir/tools/scramble -fm"
449 output="ajbrec.ajz"
450 appextra="recorder:gui"
451 archosrom="$pwd/rombox.ucl"
452 flash="$pwd/rockbox.ucl"
453 plugins="yes"
454 codecs=""
458 archos="recorderv2"
459 target="-DARCHOS_RECORDERV2"
460 shcc
461 tool="$rootdir/tools/scramble -v2"
462 output="ajbrec.ajz"
463 appextra="recorder:gui"
464 archosrom="$pwd/rombox.ucl"
465 flash="$pwd/rockbox.ucl"
466 plugins="yes"
467 codecs=""
471 archos="gmini120"
472 target="-DARCHOS_GMINI120"
473 memory=16 # fixed size (16 is a guess, remove comment when checked)
474 calmrisccc
475 tool="cp" # might work for now!
476 output="rockbox.gmini"
477 appextra="recorder:gui"
478 archosrom=""
479 flash=""
480 plugins="" # disabled for now, enable later on
481 codecs="libmad"
485 archos="gminisp"
486 target="-DARCHOS_GMINISP"
487 memory=16 # fixed size (16 is a guess, remove comment when checked)
488 calmrisccc
489 tool="cp" # might work for now!
490 output="rockbox.gmini"
491 appextra="recorder:gui"
492 archosrom=""
493 flash=""
494 plugins="" # disabled for now, enable later on
495 codecs="libmad"
499 archos="ondiosp"
500 target="-DARCHOS_ONDIOSP"
501 shcc
502 tool="$rootdir/tools/scramble -osp"
503 output="ajbrec.ajz"
504 appextra="recorder:gui"
505 archosrom="$pwd/rombox.ucl"
506 flash="$pwd/rockbox.ucl"
507 plugins="yes"
508 codecs=""
512 archos="ondiofm"
513 target="-DARCHOS_ONDIOFM"
514 shcc
515 tool="$rootdir/tools/scramble -ofm"
516 output="ajbrec.ajz"
517 appextra="recorder:gui"
518 archosrom="$pwd/rombox.ucl"
519 flash="$pwd/rockbox.ucl"
520 plugins="yes"
521 codecs=""
525 archos="h120"
526 target="-DIRIVER_H120"
527 memory=32 # always
528 coldfirecc
529 tool="$rootdir/tools/scramble -add=h120"
530 output="rockbox.iriver"
531 appextra="recorder:gui"
532 archosrom=""
533 flash=""
534 plugins="yes"
535 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
539 archos="h300"
540 target="-DIRIVER_H300"
541 memory=32 # always
542 coldfirecc
543 tool="$rootdir/tools/scramble -add=h300"
544 output="rockbox.iriver"
545 appextra="recorder:gui"
546 archosrom=""
547 flash=""
548 plugins="yes"
549 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
553 archos="h100"
554 target="-DIRIVER_H100"
555 memory=16 # always
556 coldfirecc
557 tool="$rootdir/tools/scramble -add=h100"
558 output="rockbox.iriver"
559 appextra="recorder:gui"
560 archosrom=""
561 flash=""
562 plugins="yes"
563 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
567 archos="x5"
568 target="-DIAUDIO_X5"
569 memory=32 # always
570 coldfirecc
571 tool="$rootdir/tools/scramble -add=x5" # wrong, must be fixed
572 output="rockbox.iaudio"
573 appextra="recorder:gui"
574 archosrom=""
575 flash=""
576 plugins="yes"
577 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
581 archos="ipodcolor"
582 target="-DIPOD_COLOR"
583 memory=32 # always
584 arm7tdmicc
585 tool="$rootdir/tools/scramble -add=ipco"
586 output="rockbox.ipod"
587 appextra="recorder:gui"
588 archosrom=""
589 flash=""
590 plugins="yes"
591 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
595 archos="ipodnano"
596 target="-DIPOD_NANO"
597 memory=32 # always
598 arm7tdmicc
599 tool="$rootdir/tools/scramble -add=nano"
600 output="rockbox.ipod"
601 appextra="recorder:gui"
602 archosrom=""
603 flash=""
604 plugins="yes"
605 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
609 echo "Please select an actual target platform!"
610 exit
613 esac
615 echo "Platform set to $archos"
618 ############################################################################
619 # Amount of memory, for those that can differ.
622 if [ -z "$memory" ]; then
623 size="2"
624 if [ -z "$update" ]; then
625 echo "Enter size of your RAM (in MB): (defaults to 2)"
626 size=`input`;
629 case $size in
631 memory="8"
634 memory="2"
637 esac
638 echo "Memory size selected: $memory MB"
641 ##################################################################
642 # Figure out build "type"
644 echo ""
645 echo "Build (N)ormal, (D)evel, (S)imulator, (B)ootloader? (N)"
647 option=`input`;
649 case $option in
650 [Bb])
651 case $archos in
652 h100|h120|ipodcolor|ipodnano)
653 extradefines="-DBOOTLOADER" # for target makefile symbol EXTRA_DEFINES
654 appsdir='\$(ROOTDIR)/bootloader'
655 apps="bootloader"
658 extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
659 appsdir='\$(ROOTDIR)/flash/bootbox'
660 apps="bootbox"
662 esac
663 bootloader="1"
664 echo "Bootloader build selected"
666 [Ss])
667 debug="-DDEBUG"
668 simulator="yes"
669 extradefines="-DSIMULATOR"
670 echo "Simulator build selected"
671 whichsim
673 [Dd])
674 echo "Devel build selected"
675 whichdevel
678 debug=""
679 echo "Normal build selected"
680 GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
683 esac
686 whichaddr
688 ############################################################################
689 # language
691 echo "Select a number for the language to use (default is english)"
693 picklang
694 language=`whichlang`
696 if [ -z "$language" ]; then
697 # pick a default
698 language="english"
700 echo "Language set to $language"
702 uname=`uname`
704 if [ "yes" = "$simulator" ]; then
705 # setup compiler and things for simulator
706 simcc
708 if [ -d "archos" ]; then
709 echo "sub directory archos already present"
710 else
711 mkdir archos
712 echo "created an archos subdirectory for simulating the hard disk"
716 # Now, figure out version number of the (gcc) compiler we are about to use
717 gccver=`$CC -dumpversion`;
719 if [ -z "$gccver" ]; then
720 echo "WARNING: The compiler you must use ($CC) is not in your path!"
721 echo "WARNING: this may cause your build to fail since we cannot do the"
722 echo "WARNING: checks we want now."
723 else
725 # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
726 # DEPEND on it
728 num1=`echo $gccver | cut -d . -f1`
729 num2=`echo $gccver | cut -d . -f2`
730 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
732 # This makes:
733 # 3.3.X => 303
734 # 3.4.X => 304
735 # 2.95.3 => 295
737 echo "Using $CC $gccver ($gccnum)"
739 if test "$gccnum" -ge "400"; then
740 # gcc 4.0 is just *so* much pickier on arguments that differ in signedness
741 # so we ignore that warnings for now
742 # -Wno-pointer-sign
743 GCCOPTS="$GCCOPTS -Wno-pointer-sign"
748 if test "X$ccache" = "Xyes"; then
749 CC="ccache $CC"
752 if test "X$endian" = "Xbig"; then
753 defendian="ROCKBOX_BIG_ENDIAN"
754 else
755 defendian="ROCKBOX_LITTLE_ENDIAN"
758 sed > autoconf.h \
759 -e "s,@ENDIAN@,${defendian},g" \
760 -e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
761 -e "s,@SIMSOUND@,$use_simsound,g" \
762 <<EOF
763 /* This header was made by configure */
764 #ifndef __BUILD_AUTOCONF_H
765 #define __BUILD_AUTOCONF_H
767 /* Define endianess for the target or simulator platform */
768 #define @ENDIAN@ 1
770 /* Define this if you build rockbox to support the logf logging and display */
771 #undef ROCKBOX_HAS_LOGF
773 /* Define this if you have the linux/soundcard.h header and thus can compile
774 the sound-playing code in the X11 sim */
775 @SIMSOUND@
777 #endif /* __BUILD_AUTOCONF_H */
780 if test "$simulator" = "yes"; then
781 # verify that we have a sed version we can use!
782 lines=`echo "moo" | sed -e '/moo/cline1\nline2\nline3' | wc -l`
783 if test "$lines" -eq "1"; then
784 echo "You have a broken sed version. You must upgrade to be able to "
785 echo "generate a fine Makefile. See details at:"
786 echo "http://www.rockbox.org/twiki/bin/view/Main/BrokenSed"
787 exit
788 else
789 version=`sed --version | head -n 1`
790 echo "$version is a fine sed"
793 # add simul make stuff on the #SIMUL# line
794 simmagic='/#SIMUL#/c\ @$(MAKE) -C $(SIMDIR) OBJDIR=$(BUILDDIR)/sim\n @$(MAKE) -C $(ROOTDIR)/uisimulator/common OBJDIR=$(BUILDDIR)/comsim'
795 else
796 # delete the line that matches
797 simmagic='/#SIMUL#/D'
800 sed > Makefile \
801 -e "s,@ROOTDIR@,${rootdir},g" \
802 -e "s,@DEBUG@,${debug},g" \
803 -e "s,@MEMORY@,${memory},g" \
804 -e "s,@TARGET@,${target},g" \
805 -e "s,@ARCHOS@,${archos},g" \
806 -e "s,@LANGUAGE@,${language},g" \
807 -e "s,@PWD@,${pwd},g" \
808 -e "s,@CC@,${CC},g" \
809 -e "s,@LD@,${LD},g" \
810 -e "s,@AR@,${AR},g" \
811 -e "s,@AS@,${AS},g" \
812 -e "s,@OC@,${OC},g" \
813 -e "s,@WINDRES@,${WINDRES},g" \
814 -e "s,@DLLTOOL@,${DLLTOOL},g" \
815 -e "s,@DLLWRAP@,${DLLWRAP},g" \
816 -e "s,@RANLIB@,${RANLIB},g" \
817 -e "s,@TOOL@,${tool},g" \
818 -e "s,@OUTPUT@,${output},g" \
819 -e "s,@APPEXTRA@,${appextra},g" \
820 -e "s,@ARCHOSROM@,${archosrom},g" \
821 -e "s,@FLASHFILE@,${flash},g" \
822 -e "s,@PLUGINS@,${plugins},g" \
823 -e "s,@CODECS@,${codecs},g" \
824 -e "s,@GCCOPTS@,${GCCOPTS},g" \
825 -e "s,@LDOPTS@,${LDOPTS},g" \
826 -e "s,@LOADADDRESS@,${loadaddress},g" \
827 -e "s,@EXTRADEF@,${extradefines},g" \
828 -e "s,@APPSDIR@,${appsdir},g" \
829 -e "s,@APPS@,${apps},g" \
830 -e "s,@SIMVER@,${simver},g" \
831 -e "s,@GCCVER@,${gccver},g" \
832 -e "s,@GCCNUM@,${gccnum},g" \
833 -e "s,@UNAME@,${uname},g" \
834 -e "s,@ENDIAN@,${defendian},g" \
835 -e "${simmagic}" \
836 <<EOF
837 ## Automaticly generated. http://www.rockbox.org/
839 export ROOTDIR=@ROOTDIR@
840 export FIRMDIR=\$(ROOTDIR)/firmware
841 export APPSDIR=@APPSDIR@
842 export TOOLSDIR=\$(ROOTDIR)/tools
843 export DOCSDIR=\$(ROOTDIR)/docs
844 export DEBUG=@DEBUG@
845 export ARCHOS=@ARCHOS@
846 export ARCHOSROM=@ARCHOSROM@
847 export FLASHFILE=@FLASHFILE@
848 export TARGET=@TARGET@
849 export OBJDIR=@PWD@
850 export BUILDDIR=@PWD@
851 export LANGUAGE=@LANGUAGE@
852 export MEMORYSIZE=@MEMORY@
853 export VERSION=\$(shell date +%y%m%d-%H%M)
854 export BUILDDATE=\$(shell date +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
855 export MKFIRMWARE=@TOOL@
856 export BINARY=@OUTPUT@
857 export APPEXTRA=@APPEXTRA@
858 export ENABLEDPLUGINS=@PLUGINS@
859 export SOFTWARECODECS=@CODECS@
860 export EXTRA_DEFINES=@EXTRADEF@
861 export CC=@CC@
862 export LD=@LD@
863 export AR=@AR@
864 export AS=@AS@
865 export OC=@OC@
866 export WINDRES=@WINDRES@
867 export DLLTOOL=@DLLTOOL@
868 export DLLWRAP=@DLLWRAP@
869 export RANLIB=@RANLIB@
870 export GCCOPTS=@GCCOPTS@
871 export LOADADDRESS=@LOADADDRESS@
872 export SIMVER=@SIMVER@
873 export SIMDIR=\$(ROOTDIR)/uisimulator/\$(SIMVER)
874 export LDOPTS=@LDOPTS@
875 export GCCVER=@GCCVER@
876 export GCCNUM=@GCCNUM@
877 export UNAME=@UNAME@
879 # Do not print "Entering directory ..."
880 MAKEFLAGS += --no-print-directory
882 .PHONY: all clean tags zip
884 all:
885 #SIMUL#
886 @\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
887 @\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@
889 clean:
890 @\$(MAKE) -C \$(FIRMDIR) clean OBJDIR=\$(BUILDDIR)/firmware
891 @\$(MAKE) -C \$(APPSDIR) clean OBJDIR=\$(BUILDDIR)/@APPS@
892 @rm -rf rockbox.zip TAGS @APPS@ firmware comsim sim lang.h
894 tags:
895 @rm -f TAGS
896 \$(MAKE) -C \$(FIRMDIR) tags
897 \$(MAKE) -C \$(APPSDIR) tags
898 \$(MAKE) -C \$(APPSDIR)/plugins tags
899 \$(MAKE) -C \$(APPSDIR)/plugins/lib tags
901 zip:
902 \$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
905 if [ "yes" = "$simulator" ]; then
907 cat >> Makefile <<EOF
909 install:
910 @echo "installing a full setup in your archos dir"
911 @(make zip && cd archos && unzip -oq ../rockbox.zip)
916 echo "Created Makefile"