2002-05-23 09:11:35 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
|
|
|
|
target=$1
|
2002-05-23 10:10:44 +00:00
|
|
|
debug=$2
|
2002-05-23 09:11:35 +00:00
|
|
|
|
2002-09-02 11:50:52 +00:00
|
|
|
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!
|
|
|
|
|
2002-09-02 12:33:18 +00:00
|
|
|
if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then
|
2002-09-02 11:50:52 +00:00
|
|
|
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-23 09:11:35 +00:00
|
|
|
input() {
|
|
|
|
read response
|
|
|
|
echo $response
|
|
|
|
}
|
|
|
|
|
2002-06-06 13:33:38 +00:00
|
|
|
simul () {
|
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"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
simver="x11"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2002-05-31 07:22:38 +00:00
|
|
|
##################################################################
|
|
|
|
# Figure out where the firmware code is!
|
|
|
|
#
|
|
|
|
|
2002-08-02 12:06:07 +00:00
|
|
|
simfile="$simver/lcd-$simver.c" # a file to check for in the uisimulator root dir
|
2002-05-31 07:22:38 +00:00
|
|
|
|
|
|
|
for dir in uisimulator . .. ../uisimulator ../../uisimulator; do
|
|
|
|
if [ -f "$dir/$simfile" ]; then
|
2002-08-02 12:06:07 +00:00
|
|
|
simdir="$dir/$simver"
|
2002-05-31 07:22:38 +00:00
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -z "$simdir" ]; then
|
2002-08-02 12:06:07 +00:00
|
|
|
echo "This script couldn't find your uisimulator/$simver directory. Please enter the"
|
|
|
|
echo "full path to your uisimulator/$simver directory here:"
|
2002-05-31 07:22:38 +00:00
|
|
|
|
|
|
|
simdir=`input`
|
|
|
|
fi
|
|
|
|
|
|
|
|
sed > Makefile \
|
|
|
|
-e "s,@SIMDIR@,${simdir},g" \
|
|
|
|
-e "s,@TARGET@,${target},g" \
|
|
|
|
-e "s,@DEBUG@,${debug},g" \
|
|
|
|
-e "s,@DISPLAY@,${display},g" \
|
|
|
|
-e "s,@KEYPAD@,${keypad},g" \
|
|
|
|
-e "s,@PWD@,${pwd},g" \
|
2002-09-20 06:38:38 +00:00
|
|
|
-e "s,@LANGUAGE@,${language},g" \
|
2002-08-02 12:06:07 +00:00
|
|
|
-e "s,@SIMVER@,${simver},g" \
|
2002-09-20 06:38:38 +00:00
|
|
|
-e "s,@EXTRA_DEFINES@,${extra_defines},g" \
|
2002-05-31 07:22:38 +00:00
|
|
|
<<EOF
|
2002-08-11 09:17:47 +00:00
|
|
|
## Automaticly generated. http://rockbox.haxx.se
|
2002-05-31 07:22:38 +00:00
|
|
|
|
|
|
|
SIMDIR=@SIMDIR@
|
|
|
|
DEBUG=@DEBUG@
|
|
|
|
TARGET=@TARGET@
|
|
|
|
DISPLAY=@DISPLAY@
|
|
|
|
KEYPAD=@KEYPAD@
|
|
|
|
THISDIR="@PWD@"
|
2002-08-02 12:06:07 +00:00
|
|
|
SIMVER=@SIMVER@
|
2002-09-20 06:38:38 +00:00
|
|
|
LANGUAGE=@LANGUAGE@
|
2002-07-15 13:19:00 +00:00
|
|
|
VERSION=\$(shell date +%y%m%d-%H%M)
|
2002-08-11 09:17:47 +00:00
|
|
|
EXTRA_DEFINES=@EXTRA_DEFINES@
|
2002-05-31 07:22:38 +00:00
|
|
|
|
2002-07-26 14:13:03 +00:00
|
|
|
.PHONY:
|
2002-05-31 07:22:38 +00:00
|
|
|
|
|
|
|
all: sim
|
|
|
|
|
|
|
|
sim:
|
2002-09-20 06:38:38 +00:00
|
|
|
\$(MAKE) -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) VERSION=\$(VERSION) LANGUAGE=\$(LANGUAGE) EXTRA_DEFINES="\$(EXTRA_DEFINES)"
|
2002-05-31 07:22:38 +00:00
|
|
|
|
2002-08-15 10:07:27 +00:00
|
|
|
clean:
|
2002-08-07 14:37:53 +00:00
|
|
|
\$(MAKE) -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) clean
|
2002-05-31 07:22:38 +00:00
|
|
|
|
2002-08-15 10:07:27 +00:00
|
|
|
tags:
|
|
|
|
@rm -f TAGS
|
|
|
|
make -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) tags
|
2002-05-31 07:22:38 +00:00
|
|
|
|
|
|
|
EOF
|
|
|
|
|
2002-06-06 13:33:38 +00:00
|
|
|
echo "Created Makefile"
|
2002-05-31 08:38:35 +00:00
|
|
|
|
2002-06-06 13:33:38 +00:00
|
|
|
if [ -d "archos" ]; then
|
|
|
|
echo "sub directory archos already present"
|
|
|
|
else
|
|
|
|
mkdir archos
|
|
|
|
echo "created an archos subdirectory for simulating the hard disk"
|
|
|
|
fi
|
2002-05-31 08:38:35 +00:00
|
|
|
|
2002-05-31 07:22:38 +00:00
|
|
|
}
|
|
|
|
|
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
|
|
|
|
target=""
|
|
|
|
if [ -f Makefile ]; then
|
|
|
|
if { grep "^## Auto" Makefile >/dev/null 2>&1 ; } then
|
|
|
|
echo "Existing generated Makefile found. Getting defaults from it."
|
|
|
|
target=`grep "^TARGET=" Makefile | cut -d= -f2-`
|
|
|
|
debug=`grep "^DEBUG=" Makefile | cut -d= -f2-`
|
2002-09-20 06:38:38 +00:00
|
|
|
language=`grep "^LANGUAGE=" Makefile | cut -d= -f2-`
|
2002-08-11 09:17:47 +00:00
|
|
|
extra_defines=`grep "^EXTRA_DEFINES=" Makefile | cut -d= -f2-`
|
2002-06-03 21:56:48 +00:00
|
|
|
|
|
|
|
if [ "$debug" = "SIMULATOR=1" ]; then
|
|
|
|
simulator="yes"
|
2002-06-03 22:26:56 +00:00
|
|
|
display=`grep "^DISPLAY=" Makefile | cut -d= -f2-`
|
|
|
|
keypad=`grep "^KEYPAD=" Makefile | cut -d= -f2-`
|
2002-08-02 12:06:07 +00:00
|
|
|
simver=`grep "^SIMVER=" Makefile | cut -d= -f2-`
|
2002-06-03 21:56:48 +00:00
|
|
|
fi
|
2002-05-23 10:10:44 +00:00
|
|
|
fi
|
|
|
|
fi
|
2002-05-31 07:22:38 +00:00
|
|
|
else
|
|
|
|
|
|
|
|
echo "Setup your Rockbox build environment."
|
2002-08-11 09:17:47 +00:00
|
|
|
echo "http://rockbox.haxx.se/"
|
2002-05-31 07:22:38 +00:00
|
|
|
echo ""
|
|
|
|
|
2002-05-23 10:10:44 +00:00
|
|
|
fi
|
|
|
|
|
2002-05-23 09:11:35 +00:00
|
|
|
if [ -z "$target" ]; then
|
|
|
|
|
|
|
|
##################################################################
|
|
|
|
# Figure out target platform
|
|
|
|
#
|
|
|
|
|
|
|
|
echo "Enter target platform: (defaults to Recorder)"
|
|
|
|
|
2002-10-15 12:25:57 +00:00
|
|
|
echo "1 - Archos Player/Studio"
|
|
|
|
echo "2 - Archos Recorder"
|
2002-05-23 09:11:35 +00:00
|
|
|
|
|
|
|
getit=`input`;
|
|
|
|
|
|
|
|
case $getit in
|
|
|
|
|
|
|
|
1)
|
|
|
|
target="-DARCHOS_PLAYER"
|
2002-05-31 07:22:38 +00:00
|
|
|
display="-DHAVE_LCD_CHARCELLS"
|
|
|
|
keypad="-DHAVE_PLAYER_KEYPAD"
|
2002-05-23 09:11:35 +00:00
|
|
|
;;
|
|
|
|
|
2002-10-15 12:25:57 +00:00
|
|
|
*|2)
|
2002-05-23 09:11:35 +00:00
|
|
|
target="-DARCHOS_RECORDER"
|
2002-05-31 07:22:38 +00:00
|
|
|
display="-DHAVE_LCD_BITMAP"
|
|
|
|
keypad="-DHAVE_RECORDER_KEYPAD"
|
2002-05-23 09:11:35 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2002-09-20 06:38:38 +00:00
|
|
|
if [ -z "$extra_defines" ]; then
|
|
|
|
if [ "-DARCHOS_RECORDER" = "$target" ] ; then
|
|
|
|
disable_demos="-DDISABLE_NOTHING"
|
|
|
|
disable_games=""
|
2002-08-31 20:59:23 +00:00
|
|
|
|
2002-09-20 06:38:38 +00:00
|
|
|
echo "Do you want to use Demos? (Y)"
|
|
|
|
getit=`input`;
|
|
|
|
if [ "n" = "$getit" -o "N" = "$getit" ] ; then
|
|
|
|
disable_demos="-DDISABLE_DEMOS"
|
|
|
|
fi
|
2002-08-31 20:59:23 +00:00
|
|
|
|
2002-09-20 06:38:38 +00:00
|
|
|
echo "Do you want to play Games? (Y)"
|
|
|
|
getit=`input`;
|
|
|
|
if [ "n" = "$getit" -o "N" = "$getit" ] ; then
|
|
|
|
disable_games=" -DDISABLE_GAMES"
|
|
|
|
fi
|
|
|
|
|
|
|
|
extra_defines="$disable_demos$disable_games"
|
|
|
|
fi
|
2002-08-11 09:17:47 +00:00
|
|
|
fi
|
|
|
|
|
2002-08-31 23:21:59 +00:00
|
|
|
|
2002-05-23 10:10:44 +00:00
|
|
|
if [ -z "$debug" ]; then
|
|
|
|
##################################################################
|
|
|
|
# Figure out debug on/off
|
|
|
|
#
|
|
|
|
echo ""
|
2002-05-31 07:22:38 +00:00
|
|
|
echo "Build (N)ormal, (D)ebug or (S)imulated version? (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
|
2002-05-31 07:22:38 +00:00
|
|
|
[Ss])
|
|
|
|
debug="SIMULATOR=1"
|
|
|
|
simulator="yes"
|
|
|
|
;;
|
|
|
|
[Dd])
|
2002-05-23 10:10:44 +00:00
|
|
|
debug="DEBUG=1"
|
|
|
|
;;
|
|
|
|
*)
|
2002-05-24 10:14:10 +00:00
|
|
|
debug="NODEBUG=1"
|
2002-05-23 10:10:44 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
fi
|
2002-05-23 09:11:35 +00:00
|
|
|
|
|
|
|
##################################################################
|
|
|
|
# Figure out where the firmware code is!
|
|
|
|
#
|
|
|
|
|
2002-05-27 12:33:30 +00:00
|
|
|
firmfile="crt0.S" # a file to check for in the firmware root dir
|
2002-05-23 09:11:35 +00:00
|
|
|
|
2002-05-23 09:18:14 +00:00
|
|
|
for dir in firmware . .. ../firmware ../../firmware; do
|
2002-05-23 09:11:35 +00:00
|
|
|
if [ -f $dir/$firmfile ]; then
|
|
|
|
firmdir=$dir
|
2002-05-23 09:18:14 +00:00
|
|
|
break
|
2002-05-23 09:11:35 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -z "$firmdir" ]; then
|
|
|
|
echo "This script couldn't find your firmware directory. Please enter the"
|
|
|
|
echo "full path to the firmware directory here:"
|
|
|
|
|
|
|
|
firmdir=`input`
|
|
|
|
fi
|
|
|
|
|
|
|
|
##################################################################
|
|
|
|
# Figure out where the apps code is!
|
|
|
|
#
|
|
|
|
|
|
|
|
appsfile="credits.c" # a file to check for in the apps root dir
|
|
|
|
|
2002-05-23 12:48:04 +00:00
|
|
|
for dir in apps . .. ../apps ../../apps $firmdir/apps $firmdir/../apps; do
|
2002-09-20 06:38:38 +00:00
|
|
|
if [ -f $dir/$appsfile ]; then
|
|
|
|
appsdir=$dir
|
|
|
|
break
|
|
|
|
fi
|
2002-05-23 09:11:35 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
if [ -z "$appsdir" ]; then
|
2002-09-20 06:38:38 +00:00
|
|
|
echo "This script couldn't find your apps directory. Please enter the"
|
|
|
|
echo "full path to the apps directory here:"
|
2002-05-23 09:11:35 +00:00
|
|
|
|
2002-09-20 06:38:38 +00:00
|
|
|
appsdir=`input`
|
2002-05-23 09:11:35 +00:00
|
|
|
fi
|
|
|
|
|
2002-09-20 06:38:38 +00:00
|
|
|
picklang() {
|
|
|
|
# figure out which languages that are around
|
|
|
|
for file in $appsdir/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
|
|
|
|
return $pick;
|
|
|
|
}
|
|
|
|
|
|
|
|
whichlang() {
|
|
|
|
num=1
|
|
|
|
for one in $langs; do
|
|
|
|
if [ "$num" = "$pick" ]; then
|
|
|
|
echo $one
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
num=`expr $num + 1`
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2002-09-20 06:50:29 +00:00
|
|
|
if [ "yes" = "$simulator" ]; then
|
|
|
|
# we deal with the simulator Makefile separately
|
|
|
|
simul
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2002-05-23 09:39:31 +00:00
|
|
|
sed > Makefile \
|
|
|
|
-e "s,@FIRMDIR@,${firmdir},g" \
|
|
|
|
-e "s,@APPSDIR@,${appsdir},g" \
|
|
|
|
-e "s,@DEBUG@,${debug},g" \
|
|
|
|
-e "s,@TARGET@,${target},g" \
|
2002-09-20 06:38:38 +00:00
|
|
|
-e "s,@LANGUAGE@,${language},g" \
|
|
|
|
-e "s,@EXTRA_DEFINES@,${extra_defines},g" \
|
2002-05-23 09:39:31 +00:00
|
|
|
-e "s,@PWD@,${pwd},g" \
|
|
|
|
<<EOF
|
2002-08-11 09:17:47 +00:00
|
|
|
## Automaticly generated. http://rockbox.haxx.se
|
2002-05-23 10:10:44 +00:00
|
|
|
|
2002-05-23 09:11:35 +00:00
|
|
|
FIRMDIR=@FIRMDIR@
|
|
|
|
APPSDIR=@APPSDIR@
|
|
|
|
DEBUG=@DEBUG@
|
|
|
|
TARGET=@TARGET@
|
2002-05-23 09:39:31 +00:00
|
|
|
THISDIR="@PWD@"
|
2002-09-20 06:38:38 +00:00
|
|
|
LANGUAGE=@LANGUAGE@
|
2002-07-15 13:19:00 +00:00
|
|
|
VERSION=\$(shell date +%y%m%d-%H%M)
|
2002-05-23 09:11:35 +00:00
|
|
|
|
2002-08-11 09:17:47 +00:00
|
|
|
EXTRA_DEFINES=@EXTRA_DEFINES@
|
2002-07-26 14:13:03 +00:00
|
|
|
.PHONY: firmware apps
|
2002-05-23 13:55:26 +00:00
|
|
|
|
2002-05-31 08:38:35 +00:00
|
|
|
all: firmware apps
|
2002-05-23 13:55:26 +00:00
|
|
|
|
|
|
|
firmware:
|
2002-09-20 06:38:38 +00:00
|
|
|
\$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR) EXTRA_DEFINES="\$(EXTRA_DEFINES)"
|
2002-05-23 13:55:26 +00:00
|
|
|
|
|
|
|
apps:
|
2002-09-20 11:42:57 +00:00
|
|
|
\$(MAKE) -C \$(APPSDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR) VERSION=\$(VERSION) LANGUAGE=\$(LANGUAGE) EXTRA_DEFINES="\$(EXTRA_DEFINES)"
|
2002-05-23 09:11:35 +00:00
|
|
|
|
2002-05-24 09:33:37 +00:00
|
|
|
clean-firmware:
|
2002-08-07 14:37:53 +00:00
|
|
|
\$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) OBJDIR=\$(THISDIR) clean
|
2002-05-24 09:33:37 +00:00
|
|
|
|
|
|
|
clean-apps:
|
2002-08-07 14:37:53 +00:00
|
|
|
\$(MAKE) -C \$(APPSDIR) TARGET=\$(TARGET) OBJDIR=\$(THISDIR) clean
|
2002-05-24 09:33:37 +00:00
|
|
|
|
2002-05-23 13:55:26 +00:00
|
|
|
clean:
|
2002-08-07 14:37:53 +00:00
|
|
|
\$(MAKE) clean-firmware clean-apps
|
2002-05-23 13:55:26 +00:00
|
|
|
|
2002-08-15 09:32:59 +00:00
|
|
|
tags-firmware:
|
|
|
|
\$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) OBJDIR=\$(THISDIR) tags
|
|
|
|
|
|
|
|
tags-apps:
|
|
|
|
\$(MAKE) -C \$(APPSDIR) TARGET=\$(TARGET) OBJDIR=\$(THISDIR) tags
|
|
|
|
|
|
|
|
tags:
|
|
|
|
@rm -f TAGS
|
|
|
|
\$(MAKE) tags-firmware tags-apps
|
2002-05-23 09:11:35 +00:00
|
|
|
EOF
|
2002-05-23 09:39:31 +00:00
|
|
|
|
|
|
|
echo "Created Makefile"
|