2002-05-23 09:11:35 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
|
2004-10-04 13:02:41 +00:00
|
|
|
# global CC options for all platforms
|
|
|
|
CCOPTS="-W -Wall -O -nostdlib -ffreestanding -Wstrict-prototypes"
|
2002-09-02 11:50:52 +00:00
|
|
|
|
2002-10-17 09:08:05 +00:00
|
|
|
#
|
|
|
|
# Begin Function Definitions
|
|
|
|
#
|
2002-05-23 09:11:35 +00:00
|
|
|
input() {
|
|
|
|
read response
|
|
|
|
echo $response
|
|
|
|
}
|
|
|
|
|
2005-02-18 13:47:17 +00:00
|
|
|
prefixtools () {
|
|
|
|
prefix="$1"
|
|
|
|
CC=${prefix}gcc
|
|
|
|
WINDRES=${prefix}windres
|
|
|
|
DLLTOOL=${prefix}dlltool
|
|
|
|
DLLWRAP=${prefix}dllwrap
|
|
|
|
RANLIB=${prefix}ranlib
|
|
|
|
LD=${prefix}ld
|
|
|
|
AR=${prefix}ar
|
|
|
|
AS=${prefix}as
|
|
|
|
OC=${prefix}objcopy
|
|
|
|
}
|
|
|
|
|
|
|
|
crosswincc () {
|
|
|
|
# naive approach to selecting a mingw cross-compiler on linux/*nix
|
|
|
|
echo "Enabling win32 crosscompiling"
|
|
|
|
|
2005-03-09 22:07:29 +00:00
|
|
|
prefixtools i586-mingw32msvc-
|
2005-02-18 13:47:17 +00:00
|
|
|
|
|
|
|
LDOPTS="-lgdi32 -luser32 -mwindows"
|
|
|
|
# add cross-compiler option(s)
|
|
|
|
GCCOPTS="$GCCOPTS -mno-cygwin"
|
2005-03-10 22:02:53 +00:00
|
|
|
|
|
|
|
output="rockboxui.exe" # use this as output binary name
|
2005-04-26 22:41:48 +00:00
|
|
|
crosscompile="yes"
|
|
|
|
endian="little" # windows is little endian
|
2005-02-18 13:47:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
simcc () {
|
|
|
|
|
|
|
|
# default tool setup for native building
|
|
|
|
prefixtools ""
|
|
|
|
|
2005-02-22 12:19:12 +00:00
|
|
|
GCCOPTS='-W -Wall -g -fno-builtin'
|
2005-02-18 13:47:17 +00:00
|
|
|
|
|
|
|
output="rockboxui" # use this as default output binary name
|
|
|
|
|
|
|
|
case $uname in
|
|
|
|
CYGWIN*)
|
|
|
|
echo "Cygwin host detected"
|
2005-02-22 12:19:12 +00:00
|
|
|
|
|
|
|
if [ "$simver" = "win32" ]; then
|
|
|
|
# win32 version
|
|
|
|
GCCOPTS="$GCCOPTS -mno-cygwin -DNOCYGWIN"
|
|
|
|
LDOPTS="-lgdi32 -luser32 -mno-cygwin"
|
|
|
|
else
|
|
|
|
# x11 version
|
2005-02-27 07:58:01 +00:00
|
|
|
GCCOPTS="$GCCOPTS"
|
2005-02-22 12:19:12 +00:00
|
|
|
LDOPTS='-L/usr/X11R6/lib -lSM -lICE -lXt -lX11 -lXmu -lSM -lICE -lX11 -lpthread'
|
|
|
|
fi
|
2005-02-18 13:47:17 +00:00
|
|
|
output="rockboxui.exe" # use this as output binary name
|
|
|
|
;;
|
|
|
|
|
|
|
|
Linux)
|
|
|
|
echo "Linux host detected"
|
2005-02-22 12:19:12 +00:00
|
|
|
GCCOPTS="$GCCOPTS"
|
2005-02-18 13:47:17 +00:00
|
|
|
LDOPTS='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -lnsl -ldl -lpthread'
|
|
|
|
if [ "$simver" = "win32" ]; then
|
|
|
|
crosswincc # setup cross-compiler
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
FreeBSD)
|
|
|
|
echo "FreeBSD host detected"
|
|
|
|
LDOPTS='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -dl -lpthread'
|
|
|
|
if [ "$simver" = "win32" ]; then
|
|
|
|
crosswincc # setup cross-compiler
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "Unsupported system: $uname, fix configure and retry"
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
esac
|
2005-04-26 22:41:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
if test "X$crosscompile" != "Xyes"; then
|
|
|
|
id=$$
|
|
|
|
cat >/tmp/conftest-$id.c <<EOF
|
|
|
|
#include <stdio.h>
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
int var=0;
|
|
|
|
char *varp = (char *)&var;
|
|
|
|
*varp=1;
|
|
|
|
|
|
|
|
printf("%d\n", var);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
$CC -o /tmp/conftest-$id /tmp/conftest-$id.c 2>/dev/null
|
|
|
|
|
|
|
|
if test `/tmp/conftest-$id 2>/dev/null` -gt "1"; then
|
|
|
|
# big endian
|
|
|
|
endian="big"
|
|
|
|
else
|
|
|
|
# little endian
|
|
|
|
endian="little"
|
|
|
|
fi
|
|
|
|
echo "Simulator environment deemed $endian endian"
|
2005-04-26 22:56:53 +00:00
|
|
|
|
|
|
|
# use wildcard here to make it work even if it was named *.exe like
|
|
|
|
# on cygwin
|
|
|
|
rm -f /tmp/conftest-$id*
|
2005-04-26 22:41:48 +00:00
|
|
|
fi
|
2005-02-18 13:47:17 +00:00
|
|
|
}
|
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
shcc () {
|
2005-02-18 13:47:17 +00:00
|
|
|
prefixtools sh-elf-
|
2004-10-04 13:02:41 +00:00
|
|
|
GCCOPTS="$CCOPTS -m1"
|
2004-10-07 07:08:57 +00:00
|
|
|
GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
|
2005-04-26 22:41:48 +00:00
|
|
|
endian="big"
|
2004-09-22 08:58:50 +00:00
|
|
|
}
|
|
|
|
|
2005-01-04 15:00:06 +00:00
|
|
|
calmrisccc () {
|
2005-02-18 13:47:17 +00:00
|
|
|
prefixtools calmrisc16-unknown-elf-
|
2005-02-10 22:37:09 +00:00
|
|
|
GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
|
2005-01-04 15:00:06 +00:00
|
|
|
GCCOPTIMIZE="-fomit-frame-pointer"
|
2005-04-26 22:41:48 +00:00
|
|
|
endian="big"
|
2005-01-04 15:00:06 +00:00
|
|
|
}
|
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
coldfirecc () {
|
2005-02-18 13:47:17 +00:00
|
|
|
prefixtools m68k-elf-
|
2005-02-06 03:11:26 +00:00
|
|
|
GCCOPTS="$CCOPTS -g -m5200 -Wa\,-m5249 -malign-int -mstrict-align"
|
2004-10-07 07:08:57 +00:00
|
|
|
GCCOPTIMIZE="-fomit-frame-pointer"
|
2005-04-26 22:41:48 +00:00
|
|
|
endian="big"
|
2004-09-22 08:58:50 +00:00
|
|
|
}
|
|
|
|
|
2005-02-10 22:37:09 +00:00
|
|
|
whichaddr () {
|
|
|
|
case $archos in
|
2005-02-12 14:12:10 +00:00
|
|
|
gmini120|gminisp)
|
2005-02-10 22:37:09 +00:00
|
|
|
echo ""
|
|
|
|
echo "Where do you want the firmware to be flashed?"
|
|
|
|
echo "WARNING: Do not answer this question lightly,"
|
|
|
|
echo "unless you don't plan to flash your gmini."
|
|
|
|
echo "In this case, reply '0x10000' (no quotes) and "
|
|
|
|
echo "re-configure when you know better."
|
|
|
|
loadaddress=`input`
|
2005-02-11 12:50:00 +00:00
|
|
|
|
|
|
|
if [ "0$loadaddress" = "0" ]; then
|
|
|
|
#default
|
|
|
|
loadaddress="0x10000";
|
|
|
|
fi
|
|
|
|
echo "You selected $loadaddress"
|
2005-02-10 22:37:09 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2002-10-17 09:19:34 +00:00
|
|
|
whichsim () {
|
2002-08-02 12:06:07 +00:00
|
|
|
|
|
|
|
if [ -z "$simver" ]; then
|
|
|
|
|
|
|
|
##################################################################
|
|
|
|
# Figure out win32/x11 GUI
|
|
|
|
#
|
|
|
|
echo ""
|
|
|
|
echo "Build (W)in32 or (X)11 GUI version? (X)"
|
|
|
|
|
|
|
|
option=`input`;
|
|
|
|
|
|
|
|
case $option in
|
|
|
|
[Ww])
|
|
|
|
simver="win32"
|
2005-02-18 13:47:17 +00:00
|
|
|
|
|
|
|
WINDRES=windres
|
|
|
|
DLLTOOL=dlltool
|
|
|
|
DLLWRAP=dllwrap
|
|
|
|
|
|
|
|
# make sure the code knows this is for win32
|
|
|
|
extradefines="$extradefines -DWIN32"
|
2002-08-02 12:06:07 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
simver="x11"
|
|
|
|
;;
|
|
|
|
esac
|
2003-02-26 09:13:47 +00:00
|
|
|
echo "Selected $simver simulator"
|
2002-08-02 12:06:07 +00:00
|
|
|
fi
|
2002-10-17 09:19:34 +00:00
|
|
|
}
|
|
|
|
|
2002-10-17 09:08:05 +00:00
|
|
|
picklang() {
|
|
|
|
# figure out which languages that are around
|
2004-05-26 11:07:16 +00:00
|
|
|
for file in $rootdir/apps/lang/*.lang; do
|
2002-10-17 09:08:05 +00:00
|
|
|
clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
|
|
|
|
langs="$langs $clean"
|
|
|
|
done
|
|
|
|
|
|
|
|
num=1
|
|
|
|
for one in $langs; do
|
|
|
|
echo "$num. $one"
|
|
|
|
num=`expr $num + 1`
|
|
|
|
done
|
|
|
|
|
|
|
|
read pick
|
|
|
|
return $pick;
|
|
|
|
}
|
|
|
|
|
|
|
|
whichlang() {
|
|
|
|
num=1
|
|
|
|
for one in $langs; do
|
|
|
|
if [ "$num" = "$pick" ]; then
|
|
|
|
echo $one
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
num=`expr $num + 1`
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
target=$1
|
|
|
|
debug=$2
|
|
|
|
|
|
|
|
if test "$1" = "--help"; then
|
|
|
|
echo "Rockbox configure script."
|
|
|
|
echo "Invoke this in a directory to generate a Makefile to build Rockbox"
|
|
|
|
echo "Do *NOT* run this within the tools directory!"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -r "configure"; then
|
|
|
|
# this is a check for a configure script in the current directory, it there
|
|
|
|
# is one, try to figure out if it is this one!
|
|
|
|
|
|
|
|
if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
|
|
|
|
echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
|
|
|
|
echo "It will only cause you pain and grief. Instead do this:"
|
|
|
|
echo ""
|
|
|
|
echo " cd .."
|
|
|
|
echo " mkdir build-dir"
|
|
|
|
echo " cd build-dir"
|
|
|
|
echo " ../tools/configure"
|
|
|
|
echo ""
|
|
|
|
echo "Much happiness will arise from this. Enjoy"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2002-05-31 08:21:20 +00:00
|
|
|
if [ "$target" = "--help" -o \
|
|
|
|
"$target" = "-h" ]; then
|
|
|
|
echo "Just invoke the script and answer the questions."
|
|
|
|
echo "This script will write a Makefile for you"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2002-05-31 07:22:38 +00:00
|
|
|
# get our current directory
|
|
|
|
pwd=`pwd`;
|
2002-05-23 09:11:35 +00:00
|
|
|
|
2002-05-23 10:10:44 +00:00
|
|
|
if [ "$target" = "update" ]; then
|
2004-09-22 08:58:50 +00:00
|
|
|
echo "configure update is unfortunately no longer supported"
|
|
|
|
exit
|
2002-05-31 07:22:38 +00:00
|
|
|
else
|
|
|
|
|
2003-02-26 09:13:47 +00:00
|
|
|
echo "This script will setup your Rockbox build environment."
|
2005-02-18 13:47:17 +00:00
|
|
|
echo "Further docs here: http://www.rockbox.org/"
|
2002-05-31 07:22:38 +00:00
|
|
|
echo ""
|
|
|
|
|
2002-05-23 10:10:44 +00:00
|
|
|
fi
|
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
if [ -z "$rootdir" ]; then
|
|
|
|
##################################################################
|
|
|
|
# Figure out where the source code root is!
|
|
|
|
#
|
|
|
|
|
|
|
|
firmfile="crt0.S" # a file to check for in the firmware root dir
|
|
|
|
|
|
|
|
for dir in . .. ../.. ../rockbox*; do
|
|
|
|
if [ -f $dir/firmware/$firmfile ]; then
|
|
|
|
rootdir=$dir
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -z "$rootdir" ]; then
|
|
|
|
echo "This script couldn't find your source code root directory. Please enter the"
|
|
|
|
echo "full path to the source code directory here:"
|
|
|
|
|
|
|
|
firmdir=`input`
|
|
|
|
fi
|
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
# Convert the possibly relative directory name to an absolute version
|
|
|
|
#
|
|
|
|
now=`pwd`
|
|
|
|
cd $rootdir
|
|
|
|
rootdir=`pwd`
|
|
|
|
|
|
|
|
echo "Using this source code root directory:"
|
|
|
|
echo $rootdir
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
# cd back to the build dir
|
|
|
|
cd $now
|
|
|
|
fi
|
|
|
|
|
2005-05-07 23:16:08 +00:00
|
|
|
apps="apps"
|
2005-01-29 00:00:47 +00:00
|
|
|
appsdir='\$(ROOTDIR)/apps'
|
|
|
|
|
2003-01-16 14:37:30 +00:00
|
|
|
if [ -z "$archos" ]; then
|
2002-05-23 09:11:35 +00:00
|
|
|
|
|
|
|
##################################################################
|
|
|
|
# Figure out target platform
|
|
|
|
#
|
|
|
|
|
2003-12-12 10:48:40 +00:00
|
|
|
echo "Enter target platform: (default is Archos Recorder)"
|
2002-05-23 09:11:35 +00:00
|
|
|
|
2002-10-15 12:25:57 +00:00
|
|
|
echo "1 - Archos Player/Studio"
|
|
|
|
echo "2 - Archos Recorder"
|
2003-01-16 14:37:30 +00:00
|
|
|
echo "3 - Archos FM Recorder"
|
2003-11-19 06:40:59 +00:00
|
|
|
echo "4 - Archos Recorder v2"
|
2005-01-04 15:00:06 +00:00
|
|
|
echo "5 - Archos Gmini 120"
|
2005-02-12 14:12:10 +00:00
|
|
|
echo "6 - Archos Gmini SP"
|
2004-09-09 06:01:46 +00:00
|
|
|
echo "7 - Archos Ondio SP"
|
|
|
|
echo "8 - Archos Ondio FM"
|
2004-09-16 14:36:08 +00:00
|
|
|
echo "9 - Iriver H100"
|
2002-05-23 09:11:35 +00:00
|
|
|
|
|
|
|
getit=`input`;
|
|
|
|
|
|
|
|
case $getit in
|
|
|
|
|
|
|
|
1)
|
2003-01-16 14:37:30 +00:00
|
|
|
archos="player"
|
2002-05-23 09:11:35 +00:00
|
|
|
target="-DARCHOS_PLAYER"
|
2004-09-22 08:58:50 +00:00
|
|
|
shcc
|
2004-10-07 08:08:05 +00:00
|
|
|
tool="$rootdir/tools/scramble"
|
2004-09-22 08:58:50 +00:00
|
|
|
output="archos.mod"
|
|
|
|
appextra="player"
|
2004-11-20 00:55:25 +00:00
|
|
|
archosrom="$pwd/rombox.ucl"
|
|
|
|
flash="$pwd/rockbox.ucl"
|
2004-09-22 21:40:45 +00:00
|
|
|
plugins="yes"
|
2005-02-16 00:38:31 +00:00
|
|
|
codecs=""
|
2004-09-22 08:58:50 +00:00
|
|
|
;;
|
|
|
|
|
2003-01-16 14:37:30 +00:00
|
|
|
3)
|
|
|
|
archos="fmrecorder"
|
|
|
|
target="-DARCHOS_FMRECORDER"
|
2004-09-22 08:58:50 +00:00
|
|
|
shcc
|
2004-10-07 08:08:05 +00:00
|
|
|
tool="$rootdir/tools/scramble -fm"
|
2004-09-22 08:58:50 +00:00
|
|
|
output="ajbrec.ajz"
|
|
|
|
appextra="recorder"
|
2004-11-23 07:47:35 +00:00
|
|
|
archosrom=""
|
2004-10-07 08:20:25 +00:00
|
|
|
flash="$pwd/rockbox.ucl"
|
2004-09-22 21:40:45 +00:00
|
|
|
plugins="yes"
|
2005-02-16 00:38:31 +00:00
|
|
|
codecs=""
|
2003-01-16 14:37:30 +00:00
|
|
|
;;
|
|
|
|
|
2003-11-19 06:40:59 +00:00
|
|
|
4)
|
|
|
|
archos="recorderv2"
|
|
|
|
target="-DARCHOS_RECORDERV2"
|
2004-09-22 08:58:50 +00:00
|
|
|
shcc
|
2004-10-07 08:08:05 +00:00
|
|
|
tool="$rootdir/tools/scramble -v2"
|
2004-09-22 08:58:50 +00:00
|
|
|
output="ajbrec.ajz"
|
|
|
|
appextra="recorder"
|
|
|
|
archosrom="$pwd/rombox.ucl"
|
2004-10-07 08:20:25 +00:00
|
|
|
flash="$pwd/rockbox.ucl"
|
2004-09-22 21:40:45 +00:00
|
|
|
plugins="yes"
|
2005-02-16 00:38:31 +00:00
|
|
|
codecs=""
|
2003-11-19 06:40:59 +00:00
|
|
|
;;
|
|
|
|
|
2005-01-04 15:00:06 +00:00
|
|
|
5)
|
|
|
|
archos="gmini120"
|
2005-03-09 14:39:52 +00:00
|
|
|
target="-DARCHOS_GMINI120"
|
2005-01-04 15:00:06 +00:00
|
|
|
memory=16 # fixed size (16 is a guess, remove comment when checked)
|
|
|
|
calmrisccc
|
2005-02-11 11:05:59 +00:00
|
|
|
tool="cp" # might work for now!
|
2005-02-11 11:48:12 +00:00
|
|
|
output="rockbox.gmini"
|
2005-01-04 15:00:06 +00:00
|
|
|
appextra="recorder"
|
|
|
|
archosrom=""
|
|
|
|
flash=""
|
2005-01-23 00:31:30 +00:00
|
|
|
plugins="" # disabled for now, enable later on
|
2005-03-09 14:39:52 +00:00
|
|
|
codecs="libmad"
|
2005-01-04 15:00:06 +00:00
|
|
|
;;
|
|
|
|
|
2005-02-12 14:12:10 +00:00
|
|
|
6)
|
|
|
|
archos="gminisp"
|
2005-03-09 14:39:52 +00:00
|
|
|
target="-DARCHOS_GMINISP"
|
2005-02-12 14:12:10 +00:00
|
|
|
memory=16 # fixed size (16 is a guess, remove comment when checked)
|
|
|
|
calmrisccc
|
|
|
|
tool="cp" # might work for now!
|
|
|
|
output="rockbox.gmini"
|
|
|
|
appextra="recorder"
|
|
|
|
archosrom=""
|
|
|
|
flash=""
|
|
|
|
plugins="" # disabled for now, enable later on
|
2005-03-09 14:39:52 +00:00
|
|
|
codecs="libmad"
|
2005-02-12 14:12:10 +00:00
|
|
|
;;
|
|
|
|
|
2004-09-09 06:01:46 +00:00
|
|
|
7)
|
|
|
|
archos="ondiosp"
|
|
|
|
target="-DARCHOS_ONDIOSP"
|
2004-09-22 08:58:50 +00:00
|
|
|
shcc
|
2004-10-07 08:08:05 +00:00
|
|
|
tool="$rootdir/tools/scramble -osp"
|
2004-09-22 08:58:50 +00:00
|
|
|
output="ajbrec.ajz"
|
|
|
|
appextra="recorder"
|
2004-10-07 06:51:22 +00:00
|
|
|
archosrom="$pwd/rombox.ucl"
|
2004-10-07 08:20:25 +00:00
|
|
|
flash="$pwd/rockbox.ucl"
|
2004-10-07 06:51:22 +00:00
|
|
|
plugins="yes"
|
2005-02-16 00:38:31 +00:00
|
|
|
codecs=""
|
2004-09-09 06:01:46 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
8)
|
|
|
|
archos="ondiofm"
|
|
|
|
target="-DARCHOS_ONDIOFM"
|
2004-09-22 08:58:50 +00:00
|
|
|
shcc
|
2004-10-07 08:08:05 +00:00
|
|
|
tool="$rootdir/tools/scramble -ofm"
|
2004-09-22 08:58:50 +00:00
|
|
|
output="ajbrec.ajz"
|
|
|
|
appextra="recorder"
|
2004-10-07 06:51:22 +00:00
|
|
|
archosrom="$pwd/rombox.ucl"
|
2004-10-07 08:20:25 +00:00
|
|
|
flash="$pwd/rockbox.ucl"
|
2004-10-07 06:51:22 +00:00
|
|
|
plugins="yes"
|
2005-02-16 00:38:31 +00:00
|
|
|
codecs=""
|
2004-09-16 14:36:08 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
9)
|
|
|
|
archos="h100"
|
|
|
|
target="-DIRIVER_H100"
|
2004-09-16 21:19:21 +00:00
|
|
|
memory=32 # always
|
2004-09-22 08:58:50 +00:00
|
|
|
coldfirecc
|
2005-01-28 12:27:39 +00:00
|
|
|
tool="$rootdir/tools/scramble -add=h120"
|
2004-09-22 08:58:50 +00:00
|
|
|
output="rockbox.iriver"
|
2004-11-19 00:44:07 +00:00
|
|
|
appextra="recorder"
|
2004-09-22 08:58:50 +00:00
|
|
|
archosrom=""
|
2004-10-07 08:20:25 +00:00
|
|
|
flash=""
|
2005-02-04 12:52:15 +00:00
|
|
|
plugins="yes"
|
2005-04-12 21:29:48 +00:00
|
|
|
codecs="libmad liba52 libFLAC libTremor libwavpack dumb libmusepack"
|
2002-05-23 09:11:35 +00:00
|
|
|
;;
|
|
|
|
|
2004-09-22 09:29:58 +00:00
|
|
|
*)
|
|
|
|
archos="recorder"
|
|
|
|
target="-DARCHOS_RECORDER"
|
|
|
|
shcc
|
2004-10-07 08:08:05 +00:00
|
|
|
tool="$rootdir/tools/scramble"
|
2004-09-22 09:29:58 +00:00
|
|
|
output="ajbrec.ajz"
|
|
|
|
appextra="recorder"
|
|
|
|
archosrom="$pwd/rombox.ucl"
|
2004-10-07 08:20:25 +00:00
|
|
|
flash="$pwd/rockbox.ucl"
|
2004-09-22 21:40:45 +00:00
|
|
|
plugins="yes"
|
2005-02-16 00:38:31 +00:00
|
|
|
codecs=""
|
2004-09-22 09:29:58 +00:00
|
|
|
;;
|
|
|
|
|
2002-05-23 09:11:35 +00:00
|
|
|
esac
|
2003-02-26 09:13:47 +00:00
|
|
|
|
|
|
|
echo "Platform set to $archos"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$memory" ]; then
|
|
|
|
size="2"
|
|
|
|
if [ -z "$update" ]; then
|
|
|
|
echo "Enter size of your RAM (in MB): (defaults to 2)"
|
|
|
|
size=`input`;
|
|
|
|
fi
|
|
|
|
|
|
|
|
case $size in
|
|
|
|
8)
|
|
|
|
memory="8"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
memory="2"
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
echo "Memory size selected: $memory MB"
|
2002-05-23 09:11:35 +00:00
|
|
|
fi
|
|
|
|
|
2002-05-23 10:10:44 +00:00
|
|
|
if [ -z "$debug" ]; then
|
|
|
|
##################################################################
|
|
|
|
# Figure out debug on/off
|
|
|
|
#
|
2005-01-29 00:00:47 +00:00
|
|
|
echo "Build (N)ormal, (D)ebug, (S)imulator, (B)ootloader? (N)"
|
2002-05-23 09:11:35 +00:00
|
|
|
|
2002-05-23 10:10:44 +00:00
|
|
|
option=`input`;
|
2002-05-23 09:11:35 +00:00
|
|
|
|
2002-05-23 10:10:44 +00:00
|
|
|
case $option in
|
2005-01-29 00:00:47 +00:00
|
|
|
[Bb])
|
|
|
|
if [ "$archos" != "h100" ]; then
|
|
|
|
echo "only the iRiver_h100 platform can build a boot loader";
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
extradefines="-DBOOTLOADER" # for target makefile symbol EXTRA_DEFINES
|
|
|
|
appsdir='\$(ROOTDIR)/bootloader'
|
2005-05-07 23:16:08 +00:00
|
|
|
apps="bootloader"
|
2005-01-29 00:00:47 +00:00
|
|
|
bootloader="1"
|
|
|
|
echo "Bootloader build selected"
|
|
|
|
;;
|
2002-05-31 07:22:38 +00:00
|
|
|
[Ss])
|
2004-09-22 08:58:50 +00:00
|
|
|
debug="1"
|
2002-05-31 07:22:38 +00:00
|
|
|
simulator="yes"
|
2005-02-18 13:47:17 +00:00
|
|
|
extradefines="-DSIMULATOR"
|
2003-02-26 09:13:47 +00:00
|
|
|
echo "Simulator build selected"
|
2002-10-17 09:19:34 +00:00
|
|
|
whichsim
|
2002-05-31 07:22:38 +00:00
|
|
|
;;
|
|
|
|
[Dd])
|
2004-09-22 08:58:50 +00:00
|
|
|
debug="1"
|
2003-02-26 09:13:47 +00:00
|
|
|
echo "Debug build selected"
|
2004-10-04 13:02:41 +00:00
|
|
|
GCCOPTS="$GCCOPTS -g -DDEBUG"
|
2002-05-23 10:10:44 +00:00
|
|
|
;;
|
|
|
|
*)
|
2004-09-22 08:58:50 +00:00
|
|
|
debug=""
|
2003-02-26 09:13:47 +00:00
|
|
|
echo "Normal build selected"
|
2004-10-07 07:08:57 +00:00
|
|
|
GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
|
2002-05-23 10:10:44 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
fi
|
2002-05-23 09:11:35 +00:00
|
|
|
|
2005-02-10 22:37:09 +00:00
|
|
|
whichaddr
|
2003-04-22 22:18:57 +00:00
|
|
|
|
2002-09-20 06:38:38 +00:00
|
|
|
if [ -z "$language" ]; then
|
|
|
|
|
|
|
|
echo "Select a number for the language to use (default is english)"
|
|
|
|
|
|
|
|
picklang
|
|
|
|
language=`whichlang`
|
|
|
|
|
|
|
|
if [ -z "$language" ]; then
|
|
|
|
# pick a default
|
|
|
|
language="english"
|
|
|
|
fi
|
2003-02-26 09:13:47 +00:00
|
|
|
echo "Language set to $language"
|
2002-09-20 06:38:38 +00:00
|
|
|
fi
|
|
|
|
|
2005-02-18 13:47:17 +00:00
|
|
|
uname=`uname`
|
|
|
|
|
2002-10-17 09:14:57 +00:00
|
|
|
if [ "yes" = "$simulator" ]; then
|
2005-02-18 13:47:17 +00:00
|
|
|
# setup compiler and things for simulator
|
|
|
|
simcc
|
|
|
|
|
|
|
|
if [ -d "archos" ]; then
|
|
|
|
echo "sub directory archos already present"
|
|
|
|
else
|
|
|
|
mkdir archos
|
|
|
|
echo "created an archos subdirectory for simulating the hard disk"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Now, figure out version number of the (gcc) compiler we are about to use
|
|
|
|
gccver=`$CC -dumpversion`;
|
|
|
|
|
|
|
|
if [ -z "$gccver" ]; then
|
|
|
|
echo "WARNING: The compiler you must use ($CC) is not in your path!"
|
|
|
|
echo "WARNING: this may cause your build to fail since we cannot do the"
|
|
|
|
echo "WARNING: checks we want now."
|
|
|
|
else
|
|
|
|
|
|
|
|
# gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
|
|
|
|
# DEPEND on it
|
|
|
|
|
|
|
|
num1=`echo $gccver | cut -d . -f1`
|
|
|
|
num2=`echo $gccver | cut -d . -f2`
|
|
|
|
gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
|
|
|
|
|
|
|
|
# This makes:
|
|
|
|
# 3.3.X => 303
|
|
|
|
# 3.4.X => 304
|
|
|
|
# 2.95.3 => 295
|
|
|
|
|
|
|
|
echo "Using $CC $gccver ($gccnum)"
|
|
|
|
|
2002-10-17 09:14:57 +00:00
|
|
|
fi
|
|
|
|
|
2005-04-26 22:41:48 +00:00
|
|
|
if test "X$endian" = "Xbig"; then
|
|
|
|
defendian="ROCKBOX_BIG_ENDIAN"
|
|
|
|
else
|
|
|
|
defendian="ROCKBOX_LITTLE_ENDIAN"
|
|
|
|
fi
|
|
|
|
|
|
|
|
sed > autoconf.h \
|
|
|
|
-e "s,@ENDIAN@,${defendian},g" \
|
|
|
|
<<EOF
|
2005-05-07 22:41:17 +00:00
|
|
|
/* This header was made by configure */
|
|
|
|
#ifndef __BUILD_AUTOCONF_H
|
|
|
|
#define __BUILD_AUTOCONF_H
|
|
|
|
|
2005-04-26 22:41:48 +00:00
|
|
|
/* Define endianess for the target or simulator platform */
|
|
|
|
#define @ENDIAN@ 1
|
2005-05-07 22:41:17 +00:00
|
|
|
|
|
|
|
#endif /* __BUILD_AUTOCONF_H */
|
2005-04-26 22:41:48 +00:00
|
|
|
EOF
|
|
|
|
|
2002-05-23 09:39:31 +00:00
|
|
|
sed > Makefile \
|
2004-05-26 11:07:16 +00:00
|
|
|
-e "s,@ROOTDIR@,${rootdir},g" \
|
2002-05-23 09:39:31 +00:00
|
|
|
-e "s,@DEBUG@,${debug},g" \
|
2003-02-26 09:13:47 +00:00
|
|
|
-e "s,@MEMORY@,${memory},g" \
|
2002-05-23 09:39:31 +00:00
|
|
|
-e "s,@TARGET@,${target},g" \
|
2003-01-16 14:37:30 +00:00
|
|
|
-e "s,@ARCHOS@,${archos},g" \
|
2002-09-20 06:38:38 +00:00
|
|
|
-e "s,@LANGUAGE@,${language},g" \
|
2002-05-23 09:39:31 +00:00
|
|
|
-e "s,@PWD@,${pwd},g" \
|
2004-09-22 08:58:50 +00:00
|
|
|
-e "s,@CC@,${CC},g" \
|
|
|
|
-e "s,@LD@,${LD},g" \
|
|
|
|
-e "s,@AR@,${AR},g" \
|
|
|
|
-e "s,@AS@,${AS},g" \
|
|
|
|
-e "s,@OC@,${OC},g" \
|
2005-02-18 13:47:17 +00:00
|
|
|
-e "s,@WINDRES@,${WINDRES},g" \
|
|
|
|
-e "s,@DLLTOOL@,${DLLTOOL},g" \
|
|
|
|
-e "s,@DLLWRAP@,${DLLWRAP},g" \
|
|
|
|
-e "s,@RANLIB@,${RANLIB},g" \
|
2004-09-22 08:58:50 +00:00
|
|
|
-e "s,@TOOL@,${tool},g" \
|
|
|
|
-e "s,@OUTPUT@,${output},g" \
|
|
|
|
-e "s,@APPEXTRA@,${appextra},g" \
|
|
|
|
-e "s,@ARCHOSROM@,${archosrom},g" \
|
2004-10-07 08:20:25 +00:00
|
|
|
-e "s,@FLASHFILE@,${flash},g" \
|
2004-09-22 21:40:45 +00:00
|
|
|
-e "s,@PLUGINS@,${plugins},g" \
|
2005-02-16 00:38:31 +00:00
|
|
|
-e "s,@CODECS@,${codecs},g" \
|
2004-10-04 13:02:41 +00:00
|
|
|
-e "s,@GCCOPTS@,${GCCOPTS},g" \
|
2005-02-18 13:47:17 +00:00
|
|
|
-e "s,@LDOPTS@,${LDOPTS},g" \
|
2005-02-10 22:37:09 +00:00
|
|
|
-e "s,@LOADADDRESS@,${loadaddress},g" \
|
2005-01-29 00:00:47 +00:00
|
|
|
-e "s,@EXTRADEF@,${extradefines},g" \
|
|
|
|
-e "s,@APPSDIR@,${appsdir},g" \
|
2005-05-07 23:16:08 +00:00
|
|
|
-e "s,@APPS@,${apps},g" \
|
2005-02-18 13:47:17 +00:00
|
|
|
-e "s,@SIMVER@,${simver},g" \
|
|
|
|
-e "s,@GCCVER@,${gccver},g" \
|
|
|
|
-e "s,@GCCNUM@,${gccnum},g" \
|
2005-02-22 20:00:19 +00:00
|
|
|
-e "s,@UNAME@,${uname},g" \
|
2005-04-26 22:41:48 +00:00
|
|
|
-e "s,@ENDIAN@,${defendian},g" \
|
2005-02-22 20:00:19 +00:00
|
|
|
<<EOF
|
2005-02-18 13:47:17 +00:00
|
|
|
## Automaticly generated. http://www.rockbox.org/
|
2002-05-23 10:10:44 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
export ROOTDIR=@ROOTDIR@
|
|
|
|
export FIRMDIR=\$(ROOTDIR)/firmware
|
2005-01-29 00:00:47 +00:00
|
|
|
export APPSDIR=@APPSDIR@
|
2004-09-22 08:58:50 +00:00
|
|
|
export TOOLSDIR=\$(ROOTDIR)/tools
|
|
|
|
export DOCSDIR=\$(ROOTDIR)/docs
|
|
|
|
export DEBUG=@DEBUG@
|
|
|
|
export ARCHOS=@ARCHOS@
|
|
|
|
export ARCHOSROM=@ARCHOSROM@
|
2004-10-07 08:20:25 +00:00
|
|
|
export FLASHFILE=@FLASHFILE@
|
2004-09-22 08:58:50 +00:00
|
|
|
export TARGET=@TARGET@
|
|
|
|
export OBJDIR=@PWD@
|
2005-05-07 22:41:17 +00:00
|
|
|
export BUILDDIR=@PWD@
|
2004-09-22 08:58:50 +00:00
|
|
|
export LANGUAGE=@LANGUAGE@
|
|
|
|
export MEMORYSIZE=@MEMORY@
|
|
|
|
export VERSION=\$(shell date +%y%m%d-%H%M)
|
2004-10-07 08:08:05 +00:00
|
|
|
export MKFIRMWARE=@TOOL@
|
2004-09-22 08:58:50 +00:00
|
|
|
export BINARY=@OUTPUT@
|
|
|
|
export APPEXTRA=@APPEXTRA@
|
2004-09-22 21:40:45 +00:00
|
|
|
export ENABLEDPLUGINS=@PLUGINS@
|
2005-02-16 00:38:31 +00:00
|
|
|
export SOFTWARECODECS=@CODECS@
|
2005-01-29 00:00:47 +00:00
|
|
|
export EXTRA_DEFINES=@EXTRADEF@
|
2004-09-22 08:58:50 +00:00
|
|
|
export CC=@CC@
|
|
|
|
export LD=@LD@
|
|
|
|
export AR=@AR@
|
|
|
|
export AS=@AS@
|
|
|
|
export OC=@OC@
|
2005-02-18 13:47:17 +00:00
|
|
|
export WINDRES=@WINDRES@
|
|
|
|
export DLLTOOL=@DLLTOOL@
|
|
|
|
export DLLWRAP=@DLLWRAP@
|
|
|
|
export RANLIB=@RANLIB@
|
2004-10-04 13:02:41 +00:00
|
|
|
export GCCOPTS=@GCCOPTS@
|
2005-02-10 22:37:09 +00:00
|
|
|
export LOADADDRESS=@LOADADDRESS@
|
2005-02-18 13:47:17 +00:00
|
|
|
export SIMVER=@SIMVER@
|
|
|
|
export SIMDIR=\$(ROOTDIR)/uisimulator/\$(SIMVER)
|
|
|
|
export LDOPTS=@LDOPTS@
|
|
|
|
export GCCVER=@GCCVER@
|
|
|
|
export GCCNUM=@GCCNUM@
|
2005-02-22 20:00:19 +00:00
|
|
|
export UNAME=@UNAME@
|
2004-09-22 08:58:50 +00:00
|
|
|
|
2005-03-10 22:02:53 +00:00
|
|
|
# Do not print "Entering directory ..."
|
|
|
|
MAKEFLAGS += --no-print-directory
|
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
.PHONY: all clean tags zip
|
|
|
|
|
|
|
|
all:
|
2005-05-07 22:41:17 +00:00
|
|
|
@\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
|
2005-05-07 23:16:08 +00:00
|
|
|
@\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@
|
2002-05-24 09:33:37 +00:00
|
|
|
|
2002-05-23 13:55:26 +00:00
|
|
|
clean:
|
2005-05-07 22:41:17 +00:00
|
|
|
@\$(MAKE) -C \$(FIRMDIR) clean OBJDIR=\$(BUILDDIR)/firmware
|
2005-05-07 23:16:08 +00:00
|
|
|
@\$(MAKE) -C \$(APPSDIR) clean OBJDIR=\$(BUILDDIR)/@APPS@
|
|
|
|
@rm -rf rockbox.zip TAGS @APPS@ firmware comsim sim
|
2002-08-15 09:32:59 +00:00
|
|
|
|
|
|
|
tags:
|
|
|
|
@rm -f TAGS
|
2004-09-22 08:58:50 +00:00
|
|
|
\$(MAKE) -C \$(FIRMDIR) tags
|
|
|
|
\$(MAKE) -C \$(APPSDIR) tags
|
|
|
|
\$(MAKE) -C \$(APPSDIR)/plugins tags
|
|
|
|
\$(MAKE) -C \$(APPSDIR)/plugins/lib tags
|
2004-05-21 19:05:47 +00:00
|
|
|
|
2005-03-03 07:31:39 +00:00
|
|
|
zip:
|
2005-02-18 13:47:17 +00:00
|
|
|
\$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
|
|
|
|
EOF
|
|
|
|
|
|
|
|
if [ "yes" = "$simulator" ]; then
|
|
|
|
|
|
|
|
cat >> Makefile <<EOF
|
|
|
|
|
|
|
|
install:
|
|
|
|
@echo "installing a full setup in your archos dir"
|
|
|
|
@(make zip && cd archos && unzip -oq ../rockbox.zip)
|
2002-05-23 09:11:35 +00:00
|
|
|
EOF
|
2002-05-23 09:39:31 +00:00
|
|
|
|
2005-02-18 13:47:17 +00:00
|
|
|
fi
|
|
|
|
|
2002-05-23 09:39:31 +00:00
|
|
|
echo "Created Makefile"
|