2006-11-06 11:48:00 +00:00
#!/bin/sh
2002-05-23 09:11:35 +00:00
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
2004-10-04 13:02:41 +00:00
# global CC options for all platforms
2007-02-17 21:54:17 +00:00
CCOPTS="-W -Wall -Wundef -O -nostdlib -ffreestanding -Wstrict-prototypes"
2002-09-02 11:50:52 +00:00
2005-05-30 13:00:43 +00:00
use_logf="#undef ROCKBOX_HAS_LOGF"
2005-07-08 10:19:02 +00:00
scriptver=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'`
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
}
2006-01-09 12:41:07 +00:00
# scan the $PATH for the given command
findtool(){
file="$1"
IFS=":"
for path in $PATH
do
# echo "checks for $file in $path" >&2
if test -f "$path/$file"; then
echo "$path/$file"
return
fi
done
}
2005-07-15 21:12:18 +00:00
2005-02-18 13:47:17 +00:00
simcc () {
# default tool setup for native building
prefixtools ""
2007-04-20 11:58:39 +00:00
simver=sdl
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
2007-04-20 11:27:03 +00:00
# generic sdl-config checker
sdl=`findtool sdl-config`
2006-01-09 12:41:07 +00:00
2007-04-20 11:27:03 +00:00
if [ -z "$sdl" ]; then
echo "configure didn't find sdl-config, which indicates that you"
echo "don't have SDL (properly) installed. Please correct and"
echo "re-run configure!"
exit
2006-01-09 12:41:07 +00:00
fi
2007-04-20 11:27:03 +00:00
# default share option, override below if needed
SHARED_FLAG="-shared"
2005-02-18 13:47:17 +00:00
case $uname in
CYGWIN*)
echo "Cygwin host detected"
2005-02-22 12:19:12 +00:00
2007-04-20 11:27:03 +00:00
# sdl version
GCCOPTS="$GCCOPTS `sdl-config --cflags`"
LDOPTS="`sdl-config --libs` -mconsole"
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"
2007-04-20 11:27:03 +00:00
if [ "0" != `sdl-config --libs |grep -c mwindows` ]; then
# Enable crosscompiling if sdl-config is from Windows SDL
crosswincc
fi
GCCOPTS="$GCCOPTS `sdl-config --cflags`"
LDOPTS="`sdl-config --libs`"
2005-02-18 13:47:17 +00:00
;;
FreeBSD)
echo "FreeBSD host detected"
2007-05-31 10:23:16 +00:00
# sdl version
GCCOPTS="$GCCOPTS `sdl-config --cflags`"
LDOPTS="`sdl-config --libs`"
2005-02-18 13:47:17 +00:00
;;
2006-09-29 16:15:11 +00:00
Darwin)
echo "Darwin host detected"
# sdl version
GCCOPTS="$GCCOPTS `sdl-config --cflags`"
LDOPTS="`sdl-config --libs`"
2006-09-29 20:04:36 +00:00
SHARED_FLAG="-dynamiclib -Wl\,-single_module"
2006-09-29 16:15:11 +00:00
;;
2005-02-18 13:47:17 +00:00
*)
echo "Unsupported system: $uname, fix configure and retry"
exit
;;
esac
2007-01-13 02:24:15 +00:00
2006-09-29 16:15:11 +00:00
if [ "`uname -m`" = "x86_64" ]; then
2006-03-01 00:31:38 +00:00
GCCOPTS="$GCCOPTS -fPIC" # needed to make shared objects link
fi
2005-04-26 22:41:48 +00:00
2007-04-20 11:58:39 +00:00
GCCOPTS="$GCCOPTS -I\$(SIMDIR)"
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-
2006-09-18 18:13:33 +00:00
GCCOPTS="$CCOPTS -m5206e -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-11-08 00:52:39 +00:00
arm7tdmicc () {
prefixtools arm-elf-
2006-08-12 22:46:34 +00:00
GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
if test "X$1" != "Xshort"; then
2007-02-17 11:19:14 +00:00
GCCOPTS="$GCCOPTS -mlong-calls"
2006-08-12 22:46:34 +00:00
fi
2005-11-08 00:52:39 +00:00
GCCOPTIMIZE="-fomit-frame-pointer"
endian="little"
}
2006-02-24 15:42:52 +00:00
arm9tdmicc () {
prefixtools arm-elf-
2007-02-17 11:19:14 +00:00
GCCOPTS="$CCOPTS -mcpu=arm9tdmi -mlong-calls"
2006-02-24 15:42:52 +00:00
GCCOPTIMIZE="-fomit-frame-pointer"
endian="little"
}
2007-03-03 00:36:54 +00:00
whichadvanced () {
2005-05-30 13:00:43 +00:00
##################################################################
# Prompt for specific developer options
#
echo ""
echo "Enter your developer options (press enter when done)"
2007-08-08 22:01:06 +00:00
echo -n "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling, (V)oice"
2007-03-03 00:36:54 +00:00
if [ "$memory" = "2" ]; then
echo -n ", (8)MB MOD"
fi
if [ "$archos" = "h120" ]; then
echo -n ", (R)TC MOD"
fi
echo ""
2005-05-30 13:00:43 +00:00
cont=1
while [ $cont = "1" ]; do
option=`input`;
case $option in
[Dd])
2006-01-18 20:54:13 +00:00
if [ "yes" = "$profile" ]; then
echo "Debug is incompatible with profiling"
else
echo "define DEBUG"
use_debug="yes"
fi
2005-05-30 13:00:43 +00:00
;;
[Ll])
echo "logf() support enabled"
2006-01-18 20:54:13 +00:00
logf="yes"
2005-05-30 13:00:43 +00:00
;;
[Ss])
echo "Simulator build enabled"
simulator="yes"
;;
2006-01-18 20:54:13 +00:00
[Pp])
if [ "yes" = "$use_debug" ]; then
echo "Profiling is incompatible with debug"
else
echo "Profiling support is enabled"
profile="yes"
fi
;;
2007-08-08 22:01:06 +00:00
[Vv])
echo "Voice build selected"
voice="yes"
;;
2007-03-03 00:36:54 +00:00
8)
if [ "$memory" = "2" ]; then
memory="8"
echo "Memory size selected: 8MB"
else
cont=0
fi
;;
[Rr])
if [ "$archos" = "h120" ]; then
config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231"
have_rtc_alarm="#define HAVE_RTC_ALARM"
echo "RTC functions enabled (DS1339/DS3231)"
else
cont=0
fi
;;
2005-05-30 13:00:43 +00:00
*)
cont=0
;;
2007-01-13 02:24:15 +00:00
esac
2005-05-30 13:00:43 +00:00
done
2007-03-03 00:36:54 +00:00
echo "done"
2005-05-30 13:00:43 +00:00
2007-08-08 22:01:06 +00:00
if [ "yes" = "$voice" ]; then
2007-08-13 12:21:16 +00:00
toolset="${toolset} voicefont wavtrim"
# Ask about languages to build
echo "Select a number for the language to use (default is english)"
2007-08-25 22:00:13 +00:00
# The multiple-language feature is currently broken
# echo "You may enter a comma-separated list of languages to build"
2007-08-13 12:21:16 +00:00
picklang
voicelanguage=`whichlang`
if [ -z "$voicelanguage" ]; then
# pick a default
voicelanguage="english"
fi
echo "Voice language set to $voicelanguage"
# Configure encoder and TTS engine for each language
for thislang in `echo $voicelanguage | sed 's/,/ /g'`; do
voiceconfig "$thislang"
done
2007-08-08 22:01:06 +00:00
fi
2006-01-18 20:54:13 +00:00
if [ "yes" = "$use_debug" ]; then
debug="-DDEBUG"
GCCOPTS="$GCCOPTS -g -DDEBUG"
fi
if [ "yes" = "$logf" ]; then
use_logf="#define ROCKBOX_HAS_LOGF 1"
fi
2005-05-30 13:00:43 +00:00
if [ "yes" = "$simulator" ]; then
2005-08-30 21:21:06 +00:00
debug="-DDEBUG"
2006-01-18 20:54:13 +00:00
extradefines="$extradefines -DSIMULATOR"
2005-05-30 13:00:43 +00:00
fi
2006-01-18 20:54:13 +00:00
if [ "yes" = "$profile" ]; then
extradefines="$extradefines -DRB_PROFILE"
PROFILE_OPTS="-finstrument-functions"
fi
2005-05-30 13:00:43 +00:00
}
2007-08-13 12:21:16 +00:00
# Configure voice settings
2006-11-03 21:47:52 +00:00
voiceconfig () {
2007-08-13 12:21:16 +00:00
thislang=$1
echo "Building $thislang voice for $archos. Select options"
2006-11-03 21:47:52 +00:00
echo ""
2007-08-13 12:31:18 +00:00
if [ -f "`which flite`" ]; then
2006-11-03 21:47:52 +00:00
FLITE="F(l)ite "
2007-08-25 22:00:13 +00:00
FLITE_OPTS=""
2006-11-03 21:47:52 +00:00
DEFAULT_TTS="flite"
DEFAULT_TTS_OPTS=$FLITE_OPTS
DEFAULT_NOISEFLOOR="500"
DEFAULT_CHOICE="L"
fi
2007-08-13 12:31:18 +00:00
if [ -f "`which espeak`" ]; then
2006-11-03 21:47:52 +00:00
ESPEAK="(e)Speak "
2007-08-25 22:00:13 +00:00
ESPEAK_OPTS=""
2006-11-03 21:47:52 +00:00
DEFAULT_TTS="espeak"
DEFAULT_TTS_OPTS=$ESPEAK_OPTS
DEFAULT_NOISEFLOOR="500"
DEFAULT_CHOICE="e"
fi
2007-08-13 12:31:18 +00:00
if [ -f "`which festival`" ]; then
2006-11-03 21:47:52 +00:00
FESTIVAL="(F)estival "
2007-08-25 22:00:13 +00:00
case "$thislang" in
"italiano")
FESTIVAL_OPTS="--language italian"
;;
"espanol")
FESTIVAL_OPTS="--language spanish"
;;
"finnish")
FESTIVAL_OPTS="--language finnish"
;;
"czech")
FESTIVAL_OPTS="--language czech"
;;
*)
FESTIVAL_OPTS=""
;;
esac
2006-11-03 21:47:52 +00:00
DEFAULT_TTS="festival"
DEFAULT_TTS_OPTS=$FESTIVAL_OPTS
DEFAULT_NOISEFLOOR="500"
DEFAULT_CHOICE="F"
fi
2007-09-01 20:03:20 +00:00
if [ -f "`which swift`" ]; then
SWIFT="S(w)ift "
SWIFT_OPTS=""
DEFAULT_TTS="swift"
DEFAULT_TTS_OPTS=$SWIFT_OPTS
DEFAULT_NOISEFLOOR="500"
DEFAULT_CHOICE="w"
fi
2007-08-09 12:07:42 +00:00
# Allow SAPI if Windows is in use
2007-08-13 12:31:18 +00:00
if [ -f "`which winver`" ]; then
2007-09-02 22:32:34 +00:00
SAPI="(S)API "
SAPI_OPTS=""
DEFAULT_TTS="sapi"
DEFAULT_TTS_OPTS=$SAPI_OPTS
2007-08-09 12:07:42 +00:00
DEFAULT_NOISEFLOOR="500"
DEFAULT_CHOICE="S"
fi
2006-11-03 21:47:52 +00:00
2007-09-02 22:32:34 +00:00
if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ] && [ "$ESPEAK" = "$SAPI" ] && [ "$SAPI" = "$SWIFT" ]; then
echo "You need Festival, eSpeak or Flite in your path, or SAPI available to build voice files"
2006-11-03 21:47:52 +00:00
exit
fi
2007-09-02 22:32:34 +00:00
echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?"
2006-11-03 21:47:52 +00:00
option=`input`
case "$option" in
[Ll])
TTS_ENGINE="flite"
NOISEFLOOR="500" # TODO: check this value
TTS_OPTS=$FLITE_OPTS
;;
[Ee])
TTS_ENGINE="espeak"
NOISEFLOOR="500"
TTS_OPTS=$ESPEAK_OPTS
;;
[Ff])
TTS_ENGINE="festival"
NOISEFLOOR="500"
TTS_OPTS=$FESTIVAL_OPTS
;;
2007-08-09 12:07:42 +00:00
[Ss])
2007-09-02 22:32:34 +00:00
TTS_ENGINE="sapi"
2007-08-09 12:07:42 +00:00
NOISEFLOOR="500"
2007-09-02 22:32:34 +00:00
TTS_OPTS=$SAPI_OPTS
2007-08-09 12:07:42 +00:00
;;
2007-09-01 20:03:20 +00:00
[Ww])
TTS_ENGINE="swift"
NOISEFLOOR="500"
TTS_OPTS=$SWIFT_OPTS
;;
2006-11-03 21:47:52 +00:00
*)
TTS_ENGINE=$DEFAULT_TTS
TTS_OPTS=$DEFAULT_TTS_OPTS
NOISEFLOOR=$DEFAULT_NOISEFLOOR
esac
echo "Using $TTS_ENGINE for TTS"
2007-01-13 02:24:15 +00:00
2007-08-13 12:21:16 +00:00
# Allow the user to input manual commandline options
2007-08-25 22:00:13 +00:00
printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): "
2007-08-13 12:21:16 +00:00
USER_TTS_OPTS=`input`
if [ -n "$USER_TTS_OPTS" ]; then
2007-08-25 22:00:13 +00:00
TTS_OPTS="$USER_TTS_OPTS"
2007-08-13 12:21:16 +00:00
fi
2006-11-03 21:47:52 +00:00
echo ""
2007-08-13 12:31:18 +00:00
if [ -f "`which oggenc`" ]; then
2006-11-03 21:47:52 +00:00
OGGENC="(O)ggenc "
DEFAULT_ENC="oggenc"
2007-08-25 22:00:13 +00:00
VORBIS_OPTS="-q0 --downmix"
2006-11-03 21:47:52 +00:00
DEFAULT_ENC_OPTS=$VORBIS_OPTS
DEFAULT_CHOICE="O"
fi
2007-08-13 12:31:18 +00:00
if [ -f "`which speexenc`" ]; then
2006-11-03 21:47:52 +00:00
SPEEXENC="(S)peexenc "
DEFAULT_ENC="speexenc"
SPEEX_OPTS="" # TODO: find appropriate options for speex
2007-01-13 02:24:15 +00:00
DEFAULT_ENC_OPTS=$SPEEX_OPTS
2006-11-03 21:47:52 +00:00
DEFAULT_CHOICE="S"
fi
2007-08-13 12:31:18 +00:00
if [ -f "`which lame`" ]; then
2006-11-03 21:47:52 +00:00
LAME="(L)ame "
DEFAULT_ENC="lame"
2007-08-25 22:00:13 +00:00
LAME_OPTS="--resample 12 -t -m m -h -V 9 -S -B 64 --vbr-new"
2006-11-03 21:47:52 +00:00
DEFAULT_ENC_OPTS=$LAME_OPTS
DEFAULT_CHOICE="L"
fi
2006-11-06 11:21:11 +00:00
if [ "$LAME" = "" ]; then
2007-08-13 12:21:16 +00:00
echo "You currently need to have Lame installed to build voice files"
2006-11-03 21:47:52 +00:00
fi
2007-08-08 22:01:06 +00:00
# echo "Encoder to use: ${LAME}${OGGENC}${SPEEXENC}(${DEFAULT_CHOICE})?"
# echo ""
# echo "Note: Use Lame - the other options won't work"
# option=`input`
2007-08-13 12:21:16 +00:00
option="l"
case "$option" in
[Oo])
ENCODER="oggenc"
ENC_OPTS=$VORBIS_OPTS
;;
[Ss])
ENCODER="speexenc"
ENC_OPTS=$SPEEX_OPTS
;;
[Ll])
2006-11-03 21:47:52 +00:00
ENCODER="lame"
ENC_OPTS=$LAME_OPTS
2007-08-13 12:21:16 +00:00
;;
*)
ENCODER=$DEFAULT_ENC
ENC_OPTS=$DEFAULT_ENC_OPTS
esac
2006-11-03 21:47:52 +00:00
echo "Using $ENCODER for encoding voice clips"
2007-08-13 12:21:16 +00:00
# Allow the user to input manual commandline options
2007-08-25 22:00:13 +00:00
printf "Enter $ENCODER options (enter for defaults \"$ENC_OPTS\"): "
2007-08-13 12:21:16 +00:00
USER_ENC_OPTS=`input`
if [ -n "$USER_ENC_OPTS" ]; then
2007-08-25 22:00:13 +00:00
ENC_OPTS=$USER_ENC_OPTS
2007-08-13 12:21:16 +00:00
fi
2007-08-09 12:07:42 +00:00
TEMPDIR="${pwd}"
2007-08-13 12:31:18 +00:00
if [ -f "`which cygpath`" ]; then
2007-08-09 12:07:42 +00:00
TEMPDIR=`cygpath . -a -w`
fi
2006-11-03 21:47:52 +00:00
}
2007-01-13 02:24:15 +00:00
picklang() {
# figure out which languages that are around
for file in $rootdir/apps/lang/*.lang; do
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
}
whichlang() {
2007-08-13 12:21:16 +00:00
output=""
# Allow the user to pass a comma-separated list of langauges
for thispick in `echo $pick | sed 's/,/ /g'`; do
num=1
for one in $langs; do
# Accept both the language number and name
if [ "$num" = "$thispick" ] || [ "$thispick" = "$one" ]; then
if [ "$output" = "" ]; then
output=$one
else
output=$output,$one
fi
fi
num=`expr $num + 1`
done
2007-01-13 02:24:15 +00:00
done
2007-08-13 12:21:16 +00:00
echo $output
2006-11-03 21:47:52 +00:00
}
2007-02-23 22:57:01 +00:00
opt=$1
2006-08-28 08:46:16 +00:00
2007-02-23 22:57:01 +00:00
if test "$opt" = "--help"; then
2002-10-17 09:08:05 +00:00
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!"
2005-06-01 11:42:51 +00:00
echo ""
2006-08-16 13:02:29 +00:00
echo "Usage: configure [--ccache][--no-ccache]"
2002-10-17 09:08:05 +00:00
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 07:22:38 +00:00
# get our current directory
pwd=`pwd`;
2002-05-23 09:11:35 +00:00
2007-04-20 11:02:16 +00:00
if { echo $pwd | grep " "; } then
echo "You're running this script in a path that contains space. The build"
echo "system is unfortunately not clever enough to deal with this. Please"
echo "run the script from a different path, rename the path or fix the build"
echo "system!"
exit
fi
2004-09-22 08:58:50 +00:00
if [ -z "$rootdir" ]; then
##################################################################
# Figure out where the source code root is!
#
2006-11-18 22:43:55 +00:00
rootdir=`dirname $0`/../
2004-09-22 08:58:50 +00:00
#####################################################################
# Convert the possibly relative directory name to an absolute version
#
now=`pwd`
cd $rootdir
rootdir=`pwd`
# 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'
2006-02-06 07:25:25 +00:00
firmdir='\$(ROOTDIR)/firmware'
2006-02-06 07:54:50 +00:00
toolsdir='\$(ROOTDIR)/tools'
2006-02-06 07:25:25 +00:00
2005-01-29 00:00:47 +00:00
2002-05-23 09:11:35 +00:00
##################################################################
# Figure out target platform
#
2005-05-24 09:19:44 +00:00
echo "Enter target platform:"
2006-08-30 21:53:26 +00:00
cat <<EOF
2007-01-13 02:24:15 +00:00
==Archos== ==iriver== ==Apple iPod==
0) Player/Studio 10) H120/H140 20) Color/Photo
1) Recorder 11) H320/H340 21) Nano
2) FM Recorder 12) iHP-100/110/115 22) Video
3) Recorder v2 13) iFP-790 23) 3G
4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
2007-01-14 13:48:09 +00:00
6) AV300 26) Mini 2G
2007-07-26 22:42:31 +00:00
27) 1G, 2G
2007-01-13 02:24:15 +00:00
==iAudio== ==Toshiba== ==SanDisk==
30) X5/X5V/X5L 40) Gigabeat F 50) Sansa e200
2007-03-04 14:09:21 +00:00
31) M5/M5L 51) Sansa e200R
2007-09-06 03:28:58 +00:00
52) Sansa c200
2007-03-04 14:09:21 +00:00
2006-08-31 19:19:35 +00:00
==Tatung==
60) Elio TPJ-1022
2006-08-30 21:53:26 +00:00
EOF
2006-08-28 08:46:16 +00:00
buildfor=`input`;
2002-05-23 09:11:35 +00:00
2005-12-02 08:56:20 +00:00
# Set of tools built for all target platforms:
2007-04-01 13:09:22 +00:00
toolset="rdf2binary convbdf codepages"
2005-12-02 08:56:20 +00:00
# Toolsets for some target families:
2007-04-01 13:09:22 +00:00
archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
2007-09-07 15:34:54 +00:00
ipodbitmaptools="$toolset scramble ipod_fw bmp2rb"
2007-04-01 13:09:22 +00:00
gigabeatbitmaptools="$toolset scramble descramble bmp2rb"
2006-08-30 23:47:09 +00:00
# generic is used by IFP, H10, Sansa-e200
2007-04-01 13:09:22 +00:00
genericbitmaptools="$toolset bmp2rb"
2005-12-02 08:56:20 +00:00
2002-05-23 09:11:35 +00:00
2006-08-28 08:46:16 +00:00
# ---- For each target ----
#
# *Variables*
# target_id: a unique number identifying this target, DOES NOT necessarily
# have to be the menu number. Just use the currently highest
# number+1 when you add a new target.
# archos: short model name used all over to identify this target
2007-05-19 14:35:11 +00:00
# memory: number of megabytes of RAM this target has. If the amount can
# be selected by the size prompt, let memory be unset here
2006-08-28 08:46:16 +00:00
# target: -Ddefine passed to the build commands to make the correct
# config-*.h file get included etc
# tool: the tool that takes a plain binary and converts that into a
# working "firmware" file for your target
# output: the final output file name
2006-08-31 12:31:16 +00:00
# boottool: the tool that takes a plain binary and generates a bootloader
# file for your target (or blank to use $tool)
2007-01-13 02:24:15 +00:00
# bootoutput:the final output file name for the bootloader (or blank to use
2006-08-31 12:31:16 +00:00
# $output)
2006-08-28 08:46:16 +00:00
# appextra: passed to the APPEXTRA variable in the Makefiles.
# TODO: add proper explanation
# archosrom: used only for Archos targets that build a special flashable .ucl
# image. Set to blank for other builds.
# flash: the same as archosrom. These two should be merged
# plugins: set to 'yes' to build the plugins. Early development builds can
# set this to no in the early stages to have an easier life for a
# while
2007-07-16 22:25:41 +00:00
# swcodec: set 'yes' on swcodec targets
2006-08-28 08:46:16 +00:00
# toolset: lists what particular tools in the tools/ directory that this
# target needs to have built prior to building Rockbox
#
# *Functions*
# *cc: sets up gcc and compiler options for your target builds. Note
# that if you select a simulator build, the compiler selection is
# overridden later in the script.
case $buildfor in
2006-08-30 21:53:26 +00:00
0|player)
2006-08-28 08:46:16 +00:00
target_id=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"
2005-10-28 00:00:00 +00:00
appextra="player:gui"
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"
2007-07-16 22:25:41 +00:00
swcodec=""
2005-12-02 08:56:20 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
2007-04-04 00:16:11 +00:00
toolset="$toolset scramble descramble sh2d player_unifont uclpack"
2005-12-04 23:25:24 +00:00
# Note: the convbdf is present in the toolset just because: 1) the
# firmware/Makefile assumes it is present always, and 2) we will need it when we
# build the player simulator
2006-11-27 02:16:32 +00:00
t_cpu="sh"
t_manufacturer="archos"
t_model="player"
2004-09-22 08:58:50 +00:00
;;
2006-08-30 21:53:26 +00:00
1|recorder)
2006-08-28 08:46:16 +00:00
target_id=2
2005-06-15 11:27:37 +00:00
archos="recorder"
target="-DARCHOS_RECORDER"
shcc
tool="$rootdir/tools/scramble"
2006-01-22 21:30:32 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
2005-06-15 11:27:37 +00:00
output="ajbrec.ajz"
2005-10-28 00:00:00 +00:00
appextra="recorder:gui"
2007-08-06 13:05:03 +00:00
archosrom="" #"$pwd/rombox.ucl"
2005-06-15 11:27:37 +00:00
flash="$pwd/rockbox.ucl"
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec=""
2005-12-02 08:56:20 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset=$archosbitmaptools
2006-11-27 02:16:32 +00:00
t_cpu="sh"
t_manufacturer="archos"
t_model="recorder"
2005-06-15 11:27:37 +00:00
;;
2006-08-30 21:53:26 +00:00
2|fmrecorder)
2006-08-28 08:46:16 +00:00
target_id=3
2003-01-16 14:37:30 +00:00
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"
2006-01-22 21:30:32 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
2004-09-22 08:58:50 +00:00
output="ajbrec.ajz"
2005-10-28 00:00:00 +00:00
appextra="recorder:gui"
2007-08-06 13:05:03 +00:00
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"
2007-07-16 22:25:41 +00:00
swcodec=""
2005-12-02 08:56:20 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset=$archosbitmaptools
2006-11-27 02:16:32 +00:00
t_cpu="sh"
t_manufacturer="archos"
t_model="fm_v2"
2003-01-16 14:37:30 +00:00
;;
2006-08-30 21:53:26 +00:00
3|recorderv2)
2006-08-28 08:46:16 +00:00
target_id=4
2003-11-19 06:40:59 +00:00
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"
2006-01-22 21:30:32 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
2004-09-22 08:58:50 +00:00
output="ajbrec.ajz"
2005-10-28 00:00:00 +00:00
appextra="recorder:gui"
2007-08-06 13:05:03 +00:00
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"
2007-07-16 22:25:41 +00:00
swcodec=""
2005-12-02 08:56:20 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset=$archosbitmaptools
2006-11-27 02:16:32 +00:00
t_cpu="sh"
t_manufacturer="archos"
t_model="fm_v2"
2003-11-19 06:40:59 +00:00
;;
2006-11-10 20:26:01 +00:00
4|ondiosp)
2006-08-28 08:46:16 +00:00
target_id=7
2004-09-09 06:01:46 +00:00
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"
2006-01-22 21:30:32 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
2004-09-22 08:58:50 +00:00
output="ajbrec.ajz"
2005-10-28 00:00:00 +00:00
appextra="recorder:gui"
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"
2007-07-16 22:25:41 +00:00
swcodec=""
2005-12-02 08:56:20 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset=$archosbitmaptools
2006-11-27 02:16:32 +00:00
t_cpu="sh"
t_manufacturer="archos"
t_model="ondio"
2004-09-09 06:01:46 +00:00
;;
2006-11-10 20:26:01 +00:00
5|ondiofm)
2006-08-28 08:46:16 +00:00
target_id=8
2004-09-09 06:01:46 +00:00
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"
2006-01-22 21:30:32 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
2004-09-22 08:58:50 +00:00
output="ajbrec.ajz"
2005-10-28 00:00:00 +00:00
appextra="recorder:gui"
2007-08-06 13:05:03 +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"
2007-07-16 22:25:41 +00:00
swcodec=""
2005-12-02 08:56:20 +00:00
toolset=$archosbitmaptools
2006-11-27 02:16:32 +00:00
t_cpu="sh"
t_manufacturer="archos"
t_model="ondio"
2004-09-16 14:36:08 +00:00
;;
2007-01-14 13:48:09 +00:00
6|av300)
target_id=26
archos="av300"
target="-DARCHOS_AV300"
memory=16 # always
arm7tdmicc
tool="$rootdir/tools/scramble -mm=C"
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
output="cjbm.ajz"
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec=""
2007-01-14 13:48:09 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
2007-09-07 15:34:54 +00:00
toolset="$toolset scramble descramble bmp2rb"
2007-01-14 13:48:09 +00:00
# architecture, manufacturer and model for the target-tree build
t_cpu="arm"
t_manufacturer="archos"
t_model="av300"
;;
2006-08-30 21:53:26 +00:00
10|h120)
2006-08-28 08:46:16 +00:00
target_id=9
2005-07-08 06:31:13 +00:00
archos="h120"
target="-DIRIVER_H120"
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"
2006-01-22 21:30:32 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
2004-09-22 08:58:50 +00:00
output="rockbox.iriver"
2005-10-28 00:00:00 +00:00
appextra="recorder:gui"
2004-09-22 08:58:50 +00:00
archosrom=""
2007-01-08 18:21:12 +00:00
flash="$pwd/rombox.iriver"
2005-02-04 12:52:15 +00:00
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2005-12-02 08:56:20 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset=$iriverbitmaptools
2006-10-29 10:26:41 +00:00
t_cpu="coldfire"
t_manufacturer="iriver"
t_model="h100"
2002-05-23 09:11:35 +00:00
;;
2006-08-30 21:53:26 +00:00
11|h300)
2006-08-28 08:46:16 +00:00
target_id=10
2005-06-15 11:27:37 +00:00
archos="h300"
target="-DIRIVER_H300"
memory=32 # always
coldfirecc
2005-07-01 09:46:23 +00:00
tool="$rootdir/tools/scramble -add=h300"
2006-01-22 21:30:32 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
2005-06-15 11:27:37 +00:00
output="rockbox.iriver"
2005-10-28 00:00:00 +00:00
appextra="recorder:gui"
2005-06-15 11:27:37 +00:00
archosrom=""
flash=""
2004-09-22 21:40:45 +00:00
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2005-12-02 08:56:20 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset=$iriverbitmaptools
2006-10-29 10:26:41 +00:00
t_cpu="coldfire"
t_manufacturer="iriver"
t_model="h300"
2004-09-22 09:29:58 +00:00
;;
2006-08-30 21:53:26 +00:00
12|h100)
2006-08-28 08:46:16 +00:00
target_id=11
2005-07-08 06:31:13 +00:00
archos="h100"
target="-DIRIVER_H100"
memory=16 # always
coldfirecc
tool="$rootdir/tools/scramble -add=h100"
2006-01-22 21:30:32 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
2005-07-08 06:31:13 +00:00
output="rockbox.iriver"
2005-10-28 00:00:00 +00:00
appextra="recorder:gui"
2005-07-08 06:31:13 +00:00
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2005-12-02 08:56:20 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset=$iriverbitmaptools
2006-10-29 10:26:41 +00:00
t_cpu="coldfire"
t_manufacturer="iriver"
t_model="h100"
2005-07-08 06:31:13 +00:00
;;
2007-07-26 22:42:31 +00:00
13|ifp7xx)
target_id=19
archos="ifp7xx"
target="-DIRIVER_IFP7XX"
memory=1
arm7tdmicc short
tool="cp"
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
output="rockbox.wma"
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
swcodec="yes"
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset=$genericbitmaptools
t_cpu="arm"
t_manufacturer="pnx0101"
t_model="iriver-ifp7xx"
;;
14|h10)
target_id=22
archos="h10"
target="-DIRIVER_H10"
memory=32 # always
arm7tdmicc
tool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBOS"
2006-01-22 21:30:32 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2007-07-26 22:42:31 +00:00
output="rockbox.mi4"
2005-10-28 00:00:00 +00:00
appextra="recorder:gui"
2005-07-15 21:24:10 +00:00
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2007-07-26 22:42:31 +00:00
boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
bootoutput="H10_20GC.mi4"
2005-12-02 08:56:20 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
2007-07-26 22:42:31 +00:00
toolset="$genericbitmaptools scramble"
2006-03-07 12:45:45 +00:00
# architecture, manufacturer and model for the target-tree build
2007-07-26 22:42:31 +00:00
t_cpu="arm"
t_manufacturer="iriver"
t_model="h10"
2005-07-15 21:24:10 +00:00
;;
2007-07-26 22:42:31 +00:00
15|h10_5gb)
target_id=24
archos="h10_5gb"
target="-DIRIVER_H10_5GB"
memory=32 # always
arm7tdmicc
tool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBOS"
2007-03-04 14:09:21 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2007-07-26 22:42:31 +00:00
bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
output="rockbox.mi4"
2007-03-04 14:09:21 +00:00
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2007-07-26 22:42:31 +00:00
boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
bootoutput="H10.mi4"
2007-03-04 14:09:21 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
2007-07-26 22:42:31 +00:00
toolset="$genericbitmaptools scramble"
2007-03-04 14:09:21 +00:00
# architecture, manufacturer and model for the target-tree build
2007-07-26 22:42:31 +00:00
t_cpu="arm"
t_manufacturer="iriver"
t_model="h10"
2007-03-04 14:09:21 +00:00
;;
2006-08-30 21:53:26 +00:00
20|ipodcolor)
2006-08-28 08:46:16 +00:00
target_id=13
2005-11-08 00:52:39 +00:00
archos="ipodcolor"
target="-DIPOD_COLOR"
memory=32 # always
arm7tdmicc
tool="$rootdir/tools/scramble -add=ipco"
2006-01-22 21:30:32 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
2005-11-08 00:52:39 +00:00
output="rockbox.ipod"
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2006-12-14 01:10:44 +00:00
bootoutput="bootloader-$archos.ipod"
2005-12-02 08:56:20 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset=$ipodbitmaptools
2006-10-05 10:58:51 +00:00
# architecture, manufacturer and model for the target-tree build
t_cpu="arm"
t_manufacturer="ipod"
t_model="color"
2005-11-08 00:52:39 +00:00
;;
2006-08-30 21:53:26 +00:00
21|ipodnano)
2006-08-28 08:46:16 +00:00
target_id=14
2005-11-08 00:52:39 +00:00
archos="ipodnano"
target="-DIPOD_NANO"
memory=32 # always
arm7tdmicc
tool="$rootdir/tools/scramble -add=nano"
2006-01-22 21:30:32 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
2005-11-08 00:52:39 +00:00
output="rockbox.ipod"
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2006-12-14 01:10:44 +00:00
bootoutput="bootloader-$archos.ipod"
2005-12-02 08:56:20 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset=$ipodbitmaptools
2006-10-05 10:58:51 +00:00
# architecture, manufacturer and model for the target-tree build
t_cpu="arm"
t_manufacturer="ipod"
t_model="nano"
2005-11-08 00:52:39 +00:00
;;
2006-08-30 21:53:26 +00:00
22|ipodvideo)
2006-08-28 08:46:16 +00:00
target_id=15
2005-12-18 13:04:00 +00:00
archos="ipodvideo"
target="-DIPOD_VIDEO"
arm7tdmicc
tool="$rootdir/tools/scramble -add=ipvd"
2006-01-22 21:30:32 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2005-12-18 13:04:00 +00:00
output="rockbox.ipod"
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2006-12-14 01:10:44 +00:00
bootoutput="bootloader-$archos.ipod"
2005-12-18 13:04:00 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset=$ipodbitmaptools
2006-10-05 10:58:51 +00:00
# architecture, manufacturer and model for the target-tree build
t_cpu="arm"
t_manufacturer="ipod"
t_model="video"
2005-12-18 13:04:00 +00:00
;;
2006-08-30 21:53:26 +00:00
23|ipod3g)
2006-08-28 08:46:16 +00:00
target_id=16
2006-02-05 18:30:50 +00:00
archos="ipod3g"
target="-DIPOD_3G"
memory=32 # always
arm7tdmicc
tool="$rootdir/tools/scramble -add=ip3g"
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2006-02-16 20:03:07 +00:00
bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
2006-02-05 18:30:50 +00:00
output="rockbox.ipod"
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2006-12-14 01:10:44 +00:00
bootoutput="bootloader-$archos.ipod"
2006-02-05 18:30:50 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset=$ipodbitmaptools
2006-10-05 10:58:51 +00:00
# architecture, manufacturer and model for the target-tree build
t_cpu="arm"
t_manufacturer="ipod"
t_model="3g"
2006-02-05 18:30:50 +00:00
;;
2007-01-13 02:24:15 +00:00
2006-08-30 21:53:26 +00:00
24|ipod4g)
2006-08-28 08:46:16 +00:00
target_id=17
2006-02-05 18:30:50 +00:00
archos="ipod4g"
target="-DIPOD_4G"
memory=32 # always
arm7tdmicc
tool="$rootdir/tools/scramble -add=ip4g"
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2006-02-16 20:03:07 +00:00
bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
2006-02-05 18:30:50 +00:00
output="rockbox.ipod"
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2006-12-14 01:10:44 +00:00
bootoutput="bootloader-$archos.ipod"
2006-02-05 18:30:50 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset=$ipodbitmaptools
2006-10-05 10:58:51 +00:00
# architecture, manufacturer and model for the target-tree build
t_cpu="arm"
t_manufacturer="ipod"
t_model="4g"
2006-02-05 18:30:50 +00:00
;;
2007-01-13 02:24:15 +00:00
2006-08-30 21:53:26 +00:00
25|ipodmini)
2006-08-28 08:46:16 +00:00
target_id=18
2006-02-21 15:01:25 +00:00
archos="ipodmini"
target="-DIPOD_MINI"
memory=32 # always
arm7tdmicc
tool="$rootdir/tools/scramble -add=mini"
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
output="rockbox.ipod"
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2006-12-14 01:10:44 +00:00
bootoutput="bootloader-$archos.ipod"
2006-02-21 15:01:25 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset=$ipodbitmaptools
2006-10-05 10:58:51 +00:00
# architecture, manufacturer and model for the target-tree build
t_cpu="arm"
t_manufacturer="ipod"
t_model="mini"
2006-02-21 15:01:25 +00:00
;;
2007-01-13 02:24:15 +00:00
2007-07-26 22:42:31 +00:00
26|ipodmini2g)
target_id=21
archos="ipodmini2g"
target="-DIPOD_MINI2G"
memory=32 # always
arm7tdmicc
tool="$rootdir/tools/scramble -add=mn2g"
2006-01-22 21:30:32 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2007-07-26 22:42:31 +00:00
bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
output="rockbox.ipod"
2006-01-12 00:35:50 +00:00
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2007-07-26 22:42:31 +00:00
bootoutput="bootloader-$archos.ipod"
2006-01-24 22:33:49 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
2007-07-26 22:42:31 +00:00
toolset=$ipodbitmaptools
2006-08-12 08:01:54 +00:00
# architecture, manufacturer and model for the target-tree build
t_cpu="arm"
2007-07-26 22:42:31 +00:00
t_manufacturer="ipod"
t_model="mini2g"
2006-02-24 15:42:52 +00:00
;;
2007-07-26 22:42:31 +00:00
27|ipod1g2g)
target_id=29
archos="ipod1g2g"
target="-DIPOD_1G2G"
2006-03-30 17:29:21 +00:00
memory=32 # always
arm7tdmicc
2007-07-26 22:42:31 +00:00
tool="$rootdir/tools/scramble -add=1g2g"
2006-03-30 17:29:21 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
output="rockbox.ipod"
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2006-12-14 01:10:44 +00:00
bootoutput="bootloader-$archos.ipod"
2006-03-30 17:29:21 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset=$ipodbitmaptools
2006-10-05 10:58:51 +00:00
# architecture, manufacturer and model for the target-tree build
t_cpu="arm"
t_manufacturer="ipod"
2007-07-26 22:42:31 +00:00
t_model="1g2g"
2006-03-30 17:29:21 +00:00
;;
2007-07-26 22:42:31 +00:00
30|x5)
target_id=12
archos="x5"
target="-DIAUDIO_X5"
memory=16 # always
coldfirecc
tool="$rootdir/tools/scramble -add=iax5"
2006-08-01 22:22:01 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2006-09-09 19:02:18 +00:00
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2007-07-26 22:42:31 +00:00
bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
output="rockbox.iaudio"
2006-08-01 22:22:01 +00:00
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2006-08-01 22:22:01 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
2007-07-26 22:42:31 +00:00
toolset="$iaudiobitmaptools"
2006-08-01 22:22:01 +00:00
# architecture, manufacturer and model for the target-tree build
2007-07-26 22:42:31 +00:00
t_cpu="coldfire"
t_manufacturer="iaudio"
t_model="x5"
2006-08-01 22:22:01 +00:00
;;
2007-07-26 22:42:31 +00:00
31|m5)
target_id=28
archos="m5"
target="-DIAUDIO_M5"
memory=16 # always
coldfirecc
tool="$rootdir/tools/scramble -add=iam5"
2007-03-16 14:28:00 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2007-07-26 22:42:31 +00:00
bmp2rb_native="$rootdir/tools/bmp2rb -f 2"
bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
output="rockbox.iaudio"
2007-03-16 14:28:00 +00:00
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2007-03-16 14:28:00 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
2007-07-26 22:42:31 +00:00
toolset="$iaudiobitmaptools"
# architecture, manufacturer and model for the target-tree build
t_cpu="coldfire"
t_manufacturer="iaudio"
t_model="m5"
;;
40|gigabeatf)
target_id=20
archos="gigabeatf"
target="-DGIGABEAT_F"
memory=32 # always
arm9tdmicc
tool="$rootdir/tools/scramble -add=giga"
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
output="rockbox.gigabeat"
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
swcodec="yes"
toolset=$gigabeatbitmaptools
boottool="$rootdir/tools/scramble -gigabeat"
bootoutput="FWIMG01.DAT"
2007-03-16 14:28:00 +00:00
# architecture, manufacturer and model for the target-tree build
t_cpu="arm"
2007-07-26 22:42:31 +00:00
t_manufacturer="s3c2440"
t_model="gigabeat-fx"
2007-03-16 14:28:00 +00:00
;;
2006-08-30 21:53:26 +00:00
50|e200)
2006-08-28 08:46:16 +00:00
target_id=23
2006-08-01 22:22:01 +00:00
archos="e200"
target="-DSANSA_E200"
memory=32 # supposedly
arm7tdmicc
2007-04-12 21:07:35 +00:00
tool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBOS"
2006-08-01 22:22:01 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
2006-11-21 22:26:10 +00:00
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2007-04-12 21:07:35 +00:00
output="rockbox.mi4"
2006-08-01 22:22:01 +00:00
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2007-03-16 14:28:00 +00:00
boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
2006-08-31 09:39:54 +00:00
bootoutput="PP5022.mi4"
2006-08-01 22:22:01 +00:00
# toolset is the tools within the tools directory that we build for
# this particular target.
2006-08-31 09:39:54 +00:00
toolset="$genericbitmaptools scramble"
2006-08-01 22:22:01 +00:00
# architecture, manufacturer and model for the target-tree build
t_cpu="arm"
t_manufacturer="sandisk"
t_model="sansa-e200"
;;
2007-02-23 22:57:01 +00:00
51|e200r)
# the e200R model is pretty much identical to the e200, it only has a
# different option to the scramble tool when building a bootloader and
# makes the bootloader output file name in all lower case.
target_id=27
archos="e200r"
target="-DSANSA_E200"
memory=32 # supposedly
arm7tdmicc
2007-04-12 21:07:35 +00:00
tool="$rootdir/tools/scramble -mi4v3 -model=e20r -type=RBOS"
2007-02-23 22:57:01 +00:00
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
2007-04-12 21:07:35 +00:00
output="rockbox.mi4"
2007-02-23 22:57:01 +00:00
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2007-03-16 14:28:00 +00:00
boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
2007-02-23 22:57:01 +00:00
bootoutput="pp5022.mi4"
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset="$genericbitmaptools scramble"
# architecture, manufacturer and model for the target-tree build
t_cpu="arm"
t_manufacturer="sandisk"
t_model="sansa-e200"
;;
2007-09-06 03:28:58 +00:00
52|c200)
target_id=30
archos="c200"
target="-DSANSA_C200"
memory=32 # supposedly
arm7tdmicc
tool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBOS"
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
output="rockbox.mi4"
appextra="recorder:gui"
archosrom=""
flash=""
plugins=""
swcodec="yes"
boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
bootoutput="firmware.mi4"
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset="$genericbitmaptools scramble"
# architecture, manufacturer and model for the target-tree build
t_cpu="arm"
t_manufacturer="sandisk"
t_model="sansa-c200"
;;
2006-08-31 19:19:35 +00:00
60|tpj1022)
2006-08-31 20:46:11 +00:00
target_id=25
2006-08-31 19:19:35 +00:00
archos="tpj1022"
target="-DELIO_TPJ1022"
memory=32 # always
arm7tdmicc
tool="$rootdir/tools/scramble -add tpj2"
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
output="rockbox.elio"
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
2007-07-16 22:25:41 +00:00
swcodec="yes"
2006-08-31 19:19:35 +00:00
boottool="$rootdir/tools/scramble -mi4v2"
bootoutput="pp5020.mi4"
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset="$genericbitmaptools scramble"
# architecture, manufacturer and model for the target-tree build
t_cpu="arm"
t_manufacturer="tatung"
t_model="tpj1022"
;;
2005-05-23 16:21:46 +00:00
*)
2006-08-30 21:53:26 +00:00
echo "Please select a supported target platform!"
2005-05-23 16:21:46 +00:00
exit
;;
2002-05-23 09:11:35 +00:00
esac
2003-02-26 09:13:47 +00:00
echo "Platform set to $archos"
2005-05-30 13:00:43 +00:00
2007-03-03 00:36:54 +00:00
#remove start
2005-05-30 13:00:43 +00:00
############################################################################
2007-05-19 14:35:11 +00:00
# Amount of memory, for those that can differ. They have $memory unset at
# this point.
2005-05-30 13:00:43 +00:00
#
2003-02-26 09:13:47 +00:00
2007-05-19 14:35:11 +00:00
if [ -z "$memory" ]; then
case $target_id in
15)
echo "Enter size of your RAM (in MB): (Defaults to 32)"
size=`input`;
case $size in
60|64)
memory="64"
;;
*)
memory="32"
;;
esac
;;
*)
echo "Enter size of your RAM (in MB): (defaults to 2)"
size=`input`;
case $size in
8)
memory="8"
;;
*)
memory="2"
;;
esac
;;
esac
echo "Memory size selected: $memory MB"
2002-05-23 09:11:35 +00:00
fi
2007-03-03 00:36:54 +00:00
#remove end
2002-05-23 09:11:35 +00:00
2005-05-30 13:00:43 +00:00
##################################################################
# Figure out build "type"
#
2006-02-09 21:22:36 +00:00
# the ifp7x0 is the only platform that supports building a gdb stub like
# this
case $archos in
ifp7xx)
gdbstub="(G)DB stub, "
;;
2007-09-09 11:20:20 +00:00
e200r|e200)
gdbstub="(I)installer, "
;;
2006-02-09 21:22:36 +00:00
*)
;;
esac
2005-05-30 13:00:43 +00:00
echo ""
2007-08-08 22:01:06 +00:00
echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, $gdbstub(M)anual (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
2007-09-09 11:20:20 +00:00
[Ii])
appsdir='\$(ROOTDIR)/bootloader'
apps="bootloader"
extradefines="-DBOOTLOADER -DE200R_INSTALLER -ffunction-sections -fdata-sections"
bootloader="1"
2007-09-15 12:30:17 +00:00
output="bootloader.bin"
2007-09-09 11:20:20 +00:00
echo "e200R-installer build selected"
;;
2005-01-29 00:00:47 +00:00
[Bb])
2007-08-06 15:50:39 +00:00
if test $t_manufacturer = "archos"; then
2006-08-25 12:19:08 +00:00
# Archos SH-based players do this somewhat differently for
# some reason
appsdir='\$(ROOTDIR)/flash/bootbox'
apps="bootbox"
else
appsdir='\$(ROOTDIR)/bootloader'
apps="bootloader"
2007-01-08 18:21:12 +00:00
flash=""
2006-08-31 09:39:54 +00:00
if test -n "$boottool"; then
tool="$boottool"
fi
if test -n "$bootoutput"; then
output=$bootoutput
fi
2006-08-25 12:19:08 +00:00
fi
2007-02-22 10:05:39 +00:00
extradefines="-DBOOTLOADER -ffunction-sections -fdata-sections"
2005-01-29 00:00:47 +00:00
bootloader="1"
echo "Bootloader build selected"
;;
2002-05-31 07:22:38 +00:00
[Ss])
2005-08-30 21:21:06 +00:00
debug="-DDEBUG"
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-05-31 07:22:38 +00:00
;;
2007-03-03 00:36:54 +00:00
[Aa])
echo "Advanced build selected"
whichadvanced
2002-05-23 10:10:44 +00:00
;;
2006-01-25 01:41:22 +00:00
[Gg])
extradefines="-DSTUB" # for target makefile symbol EXTRA_DEFINES
appsdir='\$(ROOTDIR)/gdb'
apps="stub"
case $archos in
ifp7xx)
output="stub.wma"
;;
*)
;;
esac
echo "GDB stub build selected"
;;
2006-02-06 07:25:25 +00:00
[Mm])
appsdir='\$(ROOTDIR)/manual'
2007-09-06 03:28:58 +00:00
firmdir='\$(ROOTDIR)/manual/platform' # No Makefile here. Effectively ig:res target
2006-02-06 07:25:25 +00:00
toolsdir=$firmdir;
toolset='';
apps="manual"
echo "Manual build selected"
2007-01-13 02:24:15 +00:00
;;
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"
2002-05-23 10:10:44 +00:00
;;
esac
2006-10-23 18:09:38 +00:00
# to be able running "make manual" from non-manual configuration
case $archos in
fmrecorder)
manualdev="recorderv2fm"
;;
recorderv2)
manualdev="recorderv2fm"
;;
h1??)
manualdev="h1xx"
;;
ipodmini2g)
manualdev="ipodmini"
2007-01-13 02:24:15 +00:00
;;
2006-10-23 18:09:38 +00:00
*)
manualdev=$archos
;;
esac
2005-05-30 13:00:43 +00:00
2006-09-18 18:13:33 +00:00
if [ -z "$debug" ]; then
GCCOPTS="$GCCOPTS $GCCOPTIMIZE"
fi
2002-05-23 09:11:35 +00:00
2006-08-30 21:53:26 +00:00
echo "Using source code root directory: $rootdir"
2006-01-09 10:43:51 +00:00
# this was once possible to change at build-time, but no more:
language="english"
2002-09-20 06:38:38 +00:00
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`;
2007-09-08 21:45:21 +00:00
# figure out the binutil version too and display it, mostly for the build
# system etc to be able to see it easier
2007-09-09 09:35:36 +00:00
ldver=`$LD --version | head -n 1 | sed -e 's/[^0-9.]//g'`
2007-09-08 21:45:21 +00:00
2005-02-18 13:47:17 +00:00
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)"
2007-01-13 02:24:15 +00:00
if test "$gccnum" -ge "400"; then
2005-07-07 08:16:39 +00:00
# gcc 4.0 is just *so* much pickier on arguments that differ in signedness
# so we ignore that warnings for now
# -Wno-pointer-sign
GCCOPTS="$GCCOPTS -Wno-pointer-sign"
fi
2007-01-13 02:24:15 +00:00
if test "$gccnum" -ge "401"; then
2006-08-16 13:02:29 +00:00
# this is a lame hack to avoid "warning: dereferencing type-punned pointer
# will break strict-aliasing rules"
GCCOPTS="$GCCOPTS -fno-strict-aliasing"
fi
2007-09-07 17:55:21 +00:00
if test "$gccnum" -ge "402"; then
# disable warning about "warning: initialized field overwritten" as gcc 4.2
# and later would throw it for several valid cases
GCCOPTS="$GCCOPTS -Wno-override-init"
fi
2002-10-17 09:14:57 +00:00
fi
2007-09-08 21:45:21 +00:00
echo "Using $LD $ldver"
2006-05-01 21:21:15 +00:00
# check the compiler for SH platforms
if test "$CC" = "sh-elf-gcc"; then
2007-01-13 02:24:15 +00:00
if test "$gccnum" -lt "400"; then
2006-05-01 21:21:15 +00:00
echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
else
# figure out patch status
gccpatch=`$CC --version`;
if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
echo "gcc $gccver is rockbox patched"
# then convert -O to -Os to get smaller binaries!
2006-05-01 21:34:24 +00:00
GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2006-05-01 21:21:15 +00:00
else
echo "WARNING: You use an unpatched gcc compiler: $gccver"
echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
fi
fi
fi
2007-06-13 15:35:07 +00:00
if test "$CC" = "m68k-elf-gcc"; then
# convert -O to -Os to get smaller binaries!
GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
fi
2006-08-16 13:02:29 +00:00
if test "$1" = "--ccache"; then
echo "Enable ccache for building"
ccache="ccache"
else
if test "$1" != "--no-ccache"; then
ccache=`findtool ccache`
if test -n "$ccache"; then
echo "Found and uses ccache ($ccache)"
fi
fi
fi
2006-05-01 21:21:15 +00:00
2006-08-16 13:02:29 +00:00
if test -n "$ccache"; then
CC="$ccache $CC"
2005-06-01 11:42:51 +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" \
2005-05-30 13:00:43 +00:00
-e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
2007-03-03 00:36:54 +00:00
-e "s,@config_rtc@,$config_rtc,g" \
-e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \
2005-04-26 22:41:48 +00:00
<<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
2005-05-30 13:00:43 +00:00
/* Define this if you build rockbox to support the logf logging and display */
#undef ROCKBOX_HAS_LOGF
2007-03-03 00:36:54 +00:00
/* optional defines for RTC mod for h1x0 */
@config_rtc@
@have_rtc_alarm@
2005-05-07 22:41:17 +00:00
#endif /* __BUILD_AUTOCONF_H */
2005-04-26 22:41:48 +00:00
EOF
2006-03-07 12:45:45 +00:00
if test -n "$t_cpu"; then
2006-07-26 12:26:57 +00:00
TARGET_INC="-I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer/$t_model"
TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
2006-03-07 12:45:45 +00:00
TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
2006-08-01 22:22:01 +00:00
GCCOPTS="$GCCOPTS"
2006-03-07 12:45:45 +00:00
fi
2005-05-23 16:21:46 +00:00
if test "$simulator" = "yes"; then
# add simul make stuff on the #SIMUL# line
2006-10-27 21:48:06 +00:00
simmagic1="s,@SIMUL1@,\$(SILENT)\$(MAKE) -C \$(SIMDIR) OBJDIR=\$(BUILDDIR)/sim,"
simmagic2="s,@SIMUL2@,\$(SILENT)\$(MAKE) -C \$(ROOTDIR)/uisimulator/common OBJDIR=\$(BUILDDIR)/comsim,"
2005-05-23 16:21:46 +00:00
else
2005-12-05 22:13:55 +00:00
# delete the lines that match
simmagic1='/@SIMUL1@/D'
simmagic2='/@SIMUL2@/D'
2005-05-23 16:21:46 +00:00
fi
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" \
2006-01-15 18:20:18 +00:00
-e "s,@TARGET_ID@,${target_id},g" \
2002-05-23 09:39:31 +00:00
-e "s,@TARGET@,${target},g" \
2007-04-20 13:47:30 +00:00
-e "s,@CPU@,${t_cpu},g" \
-e "s,@MANUFACTURER@,${t_manufacturer},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" \
2007-08-13 12:21:16 +00:00
-e "s:@VOICELANGUAGE@:${voicelanguage}: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" \
2006-01-22 21:30:32 +00:00
-e "s,@BMP2RB_NATIVE@,${bmp2rb_native},g" \
-e "s,@BMP2RB_MONO@,${bmp2rb_mono},g" \
-e "s,@BMP2RB_REMOTENATIVE@,${bmp2rb_remotenative},g" \
-e "s,@BMP2RB_REMOTEMONO@,${bmp2rb_remotemono},g" \
2004-09-22 08:58:50 +00:00
-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" \
2007-07-16 22:25:41 +00:00
-e "s,@CODECS@,${swcodec},g" \
2006-01-18 20:54:13 +00:00
-e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
2006-09-29 20:04:36 +00:00
-e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
2004-10-04 13:02:41 +00:00
-e "s,@GCCOPTS@,${GCCOPTS},g" \
2006-03-07 12:45:45 +00:00
-e "s,@TARGET_INC@,${TARGET_INC},g" \
2006-01-09 21:43: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" \
2006-02-06 07:25:25 +00:00
-e "s,@FIRMDIR@,${firmdir},g" \
-e "s,@TOOLSDIR@,${toolsdir},g" \
2005-05-07 23:16:08 +00:00
-e "s,@APPS@,${apps},g" \
2007-04-20 11:58:39 +00:00
-e "s,@SIMVER@,${simver},g" \
2005-02-18 13:47:17 +00:00
-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-12-02 08:56:20 +00:00
-e "s,@TOOLSET@,${toolset},g" \
2005-12-05 22:13:55 +00:00
-e "${simmagic1}" \
-e "${simmagic2}" \
2006-10-23 18:09:38 +00:00
-e "s,@MANUALDEV@,${manualdev},g" \
2007-08-25 22:00:13 +00:00
-e "s,@ENCODER@,${ENCODER},g" \
-e "s,@ENC_OPTS@,${ENC_OPTS},g" \
-e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
-e "s,@TTS_OPTS@,${TTS_OPTS},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
2006-02-09 04:27:57 +00:00
ifndef V
SILENT=@
2006-04-03 21:11:11 +00:00
else
VERBOSEOPT=-v
2006-02-09 04:27:57 +00:00
endif
2006-10-28 22:42:16 +00:00
# old 'make' versions don't have the built-in 'info' function
2006-10-29 09:42:30 +00:00
info=old\$(shell echo >&2 "Consider upgrading to GNU make 3.81+ for optimum build performance.")
2006-10-28 22:42:16 +00:00
ifeq (\$(call info),old)
export info=echo "\$\$(1)";
endif
2004-09-22 08:58:50 +00:00
export ROOTDIR=@ROOTDIR@
2006-02-06 07:25:25 +00:00
export FIRMDIR=@FIRMDIR@
2005-01-29 00:00:47 +00:00
export APPSDIR=@APPSDIR@
2006-02-06 07:25:25 +00:00
export TOOLSDIR=@TOOLSDIR@
2004-09-22 08:58:50 +00:00
export DOCSDIR=\$(ROOTDIR)/docs
2006-02-06 07:25:25 +00:00
export MANUALDIR=\${ROOTDIR}/manual
2004-09-22 08:58:50 +00:00
export DEBUG=@DEBUG@
export ARCHOS=@ARCHOS@
export ARCHOSROM=@ARCHOSROM@
2004-10-07 08:20:25 +00:00
export FLASHFILE=@FLASHFILE@
2006-01-15 18:20:18 +00:00
export TARGET_ID=@TARGET_ID@
2004-09-22 08:58:50 +00:00
export TARGET=@TARGET@
2007-04-20 13:47:30 +00:00
export CPU=@CPU@
export MANUFACTURER=@MANUFACTURER@
2004-09-22 08:58:50 +00:00
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@
2007-08-08 22:01:06 +00:00
export VOICELANGUAGE=@VOICELANGUAGE@
2004-09-22 08:58:50 +00:00
export MEMORYSIZE=@MEMORY@
2007-01-28 17:06:59 +00:00
export VERSION=\$(shell \$(ROOTDIR)/tools/svnversion.sh \$(ROOTDIR))
2007-01-14 14:15:18 +00:00
export BUILDDATE=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
2004-10-07 08:08:05 +00:00
export MKFIRMWARE=@TOOL@
2006-01-22 21:30:32 +00:00
export BMP2RB_MONO=@BMP2RB_MONO@
export BMP2RB_NATIVE=@BMP2RB_NATIVE@
export BMP2RB_REMOTEMONO=@BMP2RB_REMOTEMONO@
export BMP2RB_REMOTENATIVE=@BMP2RB_REMOTENATIVE@
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@
2005-11-21 15:55:34 +00:00
export HOSTCC=gcc
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@
2006-01-18 20:54:13 +00:00
export PROFILE_OPTS=@PROFILE_OPTS@
2007-04-20 11:58:39 +00:00
export SIMVER=@SIMVER@
export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
2004-10-04 13:02:41 +00:00
export GCCOPTS=@GCCOPTS@
2006-03-07 12:45:45 +00:00
export TARGET_INC=@TARGET_INC@
2005-02-10 22:37:09 +00:00
export LOADADDRESS=@LOADADDRESS@
2006-09-29 20:04:36 +00:00
export SHARED_FLAG=@SHARED_FLAG@
2005-02-18 13:47:17 +00:00
export LDOPTS=@LDOPTS@
export GCCVER=@GCCVER@
export GCCNUM=@GCCNUM@
2005-02-22 20:00:19 +00:00
export UNAME=@UNAME@
2006-10-23 18:09:38 +00:00
export MANUALDEV=@MANUALDEV@
2007-08-25 22:00:13 +00:00
export TTS_OPTS=@TTS_OPTS@
export TTS_ENGINE=@TTS_ENGINE@
export ENC_OPTS=@ENC_OPTS@
export ENCODER=@ENCODER@
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
2007-04-20 13:47:30 +00:00
.PHONY: all clean tags zip tools manual bin build info
2004-09-22 08:58:50 +00:00
2007-04-20 20:51:49 +00:00
all: info
2007-04-20 13:47:30 +00:00
2007-04-20 20:51:49 +00:00
info: build
2007-04-20 13:47:30 +00:00
\$(SILENT)\$(TOOLSDIR)/mkinfo.pl \$(BUILDDIR)/rockbox-info.txt
build: tools
2005-12-05 22:13:55 +00:00
@SIMUL1@
@SIMUL2@
2006-02-09 04:27:57 +00:00
\$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
\$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@
2002-05-24 09:33:37 +00:00
2006-08-16 13:30:13 +00:00
bin: tools
@SIMUL1@
@SIMUL2@
\$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
\$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ \$(BUILDDIR)/\$(BINARY)
2007-03-14 20:05:19 +00:00
rocks: tools
\$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ rocks
2006-02-23 10:16:16 +00:00
veryclean: clean toolsclean
toolsclean:
2006-02-09 04:27:57 +00:00
\$(SILENT)\$(MAKE) -C \$(TOOLSDIR) clean
2006-02-23 10:16:16 +00:00
clean:
2006-02-23 10:02:51 +00:00
\$(SILENT)echo Cleaning build directory
\$(SILENT)rm -rf rockbox.zip TAGS @APPS@ firmware comsim sim lang.[ch]\
manual *.pdf *.a credits.raw @OUTPUT@ bitmaps pluginbitmaps \
2006-10-23 18:09:38 +00:00
@ARCHOSROM@ @FLASHFILE@ UI256.bmp rockbox-full.zip \
2007-08-05 19:19:39 +00:00
html txt rockbox-manual*.zip sysfont.h rockbox-info.txt \
2007-08-06 13:05:03 +00:00
voicefontids *.wav *.mp3 *.voice
2002-08-15 09:32:59 +00:00
2005-11-21 15:55:34 +00:00
tools:
2006-02-09 04:27:57 +00:00
\$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) @TOOLSET@
2005-11-21 15:55:34 +00:00
2002-08-15 09:32:59 +00:00
tags:
2006-02-09 04:27:57 +00:00
\$(SILENT)rm -f TAGS
\$(SILENT)\$(MAKE) -C \$(FIRMDIR) tags
\$(SILENT)\$(MAKE) -C \$(APPSDIR) tags
\$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins tags
\$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins/lib tags
2004-05-21 19:05:47 +00:00
2006-05-10 21:57:08 +00:00
fontzip:
\$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" -f 1 -o rockbox-fonts.zip \$(TARGET) \$(BINARY)
2005-03-03 07:31:39 +00:00
zip:
2007-08-05 19:19:39 +00:00
\$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done ; \\
\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\$\$feat\" -i \"\$(TARGET_ID)\" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
2005-12-13 10:58:07 +00:00
2006-10-16 09:31:17 +00:00
mapzip:
\$(SILENT)find . -name "*.map" | xargs zip rockbox-maps.zip
2006-05-10 21:57:08 +00:00
fullzip:
2007-08-05 19:19:39 +00:00
\$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\
\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\$\$feat\" -i \"\$(TARGET_ID)\" -r "\$(ROOTDIR)" -f 2 -o rockbox-full.zip \$(TARGET) \$(BINARY)
2006-05-10 21:57:08 +00:00
2005-12-13 10:58:07 +00:00
7zip:
2007-08-05 19:19:39 +00:00
\$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\
\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\$\$feat\" -i \"\$(TARGET_ID)\" -o "rockbox.7z" -z "7za a" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
2006-02-06 07:25:25 +00:00
2006-03-19 06:57:59 +00:00
tar:
\$(SILENT)rm -f rockbox.tar
2007-08-05 19:19:39 +00:00
\$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\
\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\$\$feat\" -i \"\$(TARGET_ID)\" -o "rockbox.tar" -z "tar --no-recursion -uf" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
2006-03-19 06:57:59 +00:00
bzip2: tar
\$(SILENT)bzip2 -f9 rockbox.tar
gzip: tar
\$(SILENT)gzip -f9 rockbox.tar
2006-07-20 18:07:46 +00:00
manual: manual-pdf
manual-pdf:
\$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-pdf
manual-html:
\$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-html
2006-10-23 18:09:38 +00:00
manual-zhtml: manual-zip
manual-txt:
\$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-txt
manual-ztxt:
\$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-txt-zip
2006-07-20 18:07:46 +00:00
manual-zip:
\$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-zip
2006-02-06 07:25:25 +00:00
2007-08-13 12:21:16 +00:00
features:
\$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ features
2006-03-19 06:57:59 +00:00
help:
@echo "A few helpful make targets"
@echo ""
2006-07-20 18:07:46 +00:00
@echo "all - builds a full Rockbox (default), including tools"
2006-10-06 19:05:08 +00:00
@echo "bin - builds only the Rockbox.<target name> file"
2006-07-20 18:07:46 +00:00
@echo "clean - cleans a build directory (not tools)"
@echo "veryclean - cleans the build and tools directories"
@echo "manual - builds a manual"
@echo "manual-html - HTML manual"
@echo "manual-zip - HTML manual (zipped)"
2006-10-23 18:09:38 +00:00
@echo "manual-txt - txt manual"
2006-07-20 18:07:46 +00:00
@echo "fullzip - creates a rockbox.zip of your build with fonts"
@echo "zip - creates a rockbox.zip of your build (no fonts)"
@echo "gzip - creates a rockbox.tar.gz of your build (no fonts)"
@echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)"
@echo "7zip - creates a rockbox.7z of your build (no fonts)"
@echo "fontzip - creates rockbox-fonts.zip"
2006-10-16 09:31:17 +00:00
@echo "mapzip - creates rockbox-maps.zip with all .map files"
2006-07-20 18:07:46 +00:00
@echo "tools - builds the tools only"
2007-01-13 02:24:15 +00:00
@echo "install - installs your build (for simulator builds only)"
2006-03-19 06:57:59 +00:00
2005-02-18 13:47:17 +00:00
EOF
if [ "yes" = "$simulator" ]; then
cat >> Makefile <<EOF
install:
@echo "installing a full setup in your archos dir"
2006-05-20 11:26:19 +00:00
@(\$(MAKE) fullzip && cd archos && unzip -oq ../rockbox-full.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
2007-08-11 22:41:15 +00:00
if [ "yes" = "$voice" ]; then
cat >> Makefile <<EOF
2007-08-13 12:21:16 +00:00
voice: tools features
2007-08-13 12:44:45 +00:00
\$(SILENT)for f in \`cat \$(BUILDDIR)/${apps}/features\`; do feat="\$\$feat:\$\$f" ; done ; \\
2007-08-25 22:00:13 +00:00
for lang in \`echo \$(VOICELANGUAGE) |sed "s/,/ /g"\`; do \$(TOOLSDIR)/voice.pl -V -l=\$\$lang -t=\$(ARCHOS)\$\$feat -i=\$(TARGET_ID) -e=\$(ENCODER) -E="\$(ENC_OPTS)" -s=\$(TTS_ENGINE) -S="\$(TTS_OPTS)"; done \\
2007-08-11 22:41:15 +00:00
EOF
fi
2002-05-23 09:39:31 +00:00
echo "Created Makefile"