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
|
|
|
|
|
|
|
input() {
|
|
|
|
read response
|
|
|
|
echo $response
|
|
|
|
}
|
|
|
|
|
2002-05-31 07:22:38 +00:00
|
|
|
simulator() {
|
|
|
|
##################################################################
|
|
|
|
# Figure out where the firmware code is!
|
|
|
|
#
|
|
|
|
|
|
|
|
simfile="x11/lcd-x11.c" # a file to check for in the uisimulator root dir
|
|
|
|
|
|
|
|
for dir in uisimulator . .. ../uisimulator ../../uisimulator; do
|
|
|
|
if [ -f "$dir/$simfile" ]; then
|
|
|
|
simdir="$dir/x11"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -z "$simdir" ]; then
|
|
|
|
echo "This script couldn't find your uisimulator/x11 directory. Please enter the"
|
|
|
|
echo "full path to your uisimulator/x11 directory here:"
|
|
|
|
|
|
|
|
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" \
|
|
|
|
<<EOF
|
|
|
|
## Automaticly generated. http://bjorn.haxx.se/rockbox/
|
|
|
|
|
|
|
|
SIMDIR=@SIMDIR@
|
|
|
|
DEBUG=@DEBUG@
|
|
|
|
TARGET=@TARGET@
|
|
|
|
DISPLAY=@DISPLAY@
|
|
|
|
KEYPAD=@KEYPAD@
|
|
|
|
THISDIR="@PWD@"
|
|
|
|
|
|
|
|
.PHONE:
|
|
|
|
|
|
|
|
all: sim
|
|
|
|
|
|
|
|
sim:
|
|
|
|
make -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR)
|
|
|
|
|
|
|
|
clean-sim:
|
|
|
|
make -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) clean
|
|
|
|
|
|
|
|
clean:
|
|
|
|
make clean-sim
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
echo "Created Makefile"
|
|
|
|
}
|
|
|
|
|
|
|
|
# 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-`
|
|
|
|
fi
|
|
|
|
fi
|
2002-05-31 07:22:38 +00:00
|
|
|
else
|
|
|
|
|
|
|
|
echo "Setup your Rockbox build environment."
|
|
|
|
echo "http://bjorn.haxx.se/rockbox/"
|
|
|
|
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)"
|
|
|
|
|
|
|
|
echo "1 - Archos Player old LCD"
|
|
|
|
echo "2 - Archos Player/Studio new LCD"
|
|
|
|
echo "3 - Archos Recorder"
|
|
|
|
|
|
|
|
getit=`input`;
|
|
|
|
|
|
|
|
case $getit in
|
|
|
|
|
|
|
|
1)
|
|
|
|
target="-DARCHOS_PLAYER_OLD"
|
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-05-31 07:22:38 +00:00
|
|
|
|
2002-05-23 09:11:35 +00:00
|
|
|
2)
|
|
|
|
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-05-31 07:22:38 +00:00
|
|
|
*|3)
|
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-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
|
|
|
|
2002-05-31 07:22:38 +00:00
|
|
|
if [ -n "$simulator" ]; then
|
|
|
|
# we deal with the simulator Makefile separately
|
|
|
|
simulator
|
|
|
|
exit
|
|
|
|
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-05-23 09:11:35 +00:00
|
|
|
if [ -f $dir/$appsfile ]; then
|
|
|
|
appsdir=$dir
|
2002-05-23 09:18:14 +00:00
|
|
|
break
|
2002-05-23 09:11:35 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -z "$appsdir" ]; then
|
|
|
|
echo "This script couldn't find your apps directory. Please enter the"
|
|
|
|
echo "full path to the apps directory here:"
|
|
|
|
|
|
|
|
appsdir=`input`
|
|
|
|
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" \
|
|
|
|
-e "s,@PWD@,${pwd},g" \
|
|
|
|
<<EOF
|
2002-05-23 10:10:44 +00:00
|
|
|
## Automaticly generated. http://bjorn.haxx.se/rockbox/
|
|
|
|
|
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-05-23 09:11:35 +00:00
|
|
|
|
2002-05-23 13:55:26 +00:00
|
|
|
.PHONE: firmware apps
|
|
|
|
|
2002-05-24 10:10:20 +00:00
|
|
|
all: apps
|
2002-05-23 13:55:26 +00:00
|
|
|
|
|
|
|
firmware:
|
2002-05-23 10:10:44 +00:00
|
|
|
make -C \$(FIRMDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR)
|
2002-05-23 13:55:26 +00:00
|
|
|
|
|
|
|
apps:
|
2002-05-23 10:10:44 +00:00
|
|
|
make -C \$(APPSDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR)
|
2002-05-23 09:11:35 +00:00
|
|
|
|
2002-05-24 09:33:37 +00:00
|
|
|
clean-firmware:
|
|
|
|
make -C \$(FIRMDIR) TARGET=\$(TARGET) OBJDIR=\$(THISDIR) clean
|
|
|
|
|
|
|
|
clean-apps:
|
|
|
|
make -C \$(APPSDIR) TARGET=\$(TARGET) OBJDIR=\$(THISDIR) clean
|
|
|
|
|
2002-05-23 13:55:26 +00:00
|
|
|
clean:
|
2002-05-24 09:33:37 +00:00
|
|
|
make clean-firmware clean-apps
|
2002-05-23 13:55:26 +00:00
|
|
|
|
2002-05-23 09:11:35 +00:00
|
|
|
EOF
|
2002-05-23 09:39:31 +00:00
|
|
|
|
|
|
|
echo "Created Makefile"
|