3 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
13 # Begin Function Definitions
22 if [ -z "$simver" ]; then
24 ##################################################################
25 # Figure out win32/x11 GUI
28 echo "Build (W)in32 or (X)11 GUI version? (X)"
40 echo "Selected $simver simulator"
47 ##################################################################
48 # Figure out where the firmware code is!
51 # a file to check for in the uisimulator root dir
52 simfile
="$simver/lcd-$simver.c"
54 for dir
in uisimulator . .. ..
/uisimulator ..
/..
/uisimulator
; do
55 if [ -f "$dir/$simfile" ]; then
61 if [ -z "$simdir" ]; then
62 echo "This script couldn't find your uisimulator/$simver directory. Please enter the"
63 echo "full path to your uisimulator/$simver directory here:"
69 -e "s,@SIMDIR@,${simdir},g" \
70 -e "s,@TOOLSDIR@,${toolsdir},g" \
71 -e "s,@TARGET@,${target},g" \
72 -e "s,@ARCHOS@,${archos},g" \
73 -e "s,@DEBUG@,${debug},g" \
74 -e "s,@DISPLAY@,${display},g" \
75 -e "s,@KEYPAD@,${keypad},g" \
76 -e "s,@PWD@,${pwd},g" \
77 -e "s,@LANGUAGE@,${language},g" \
78 -e "s,@SIMVER@,${simver},g" \
80 ## Automaticly generated. http://rockbox.haxx.se
92 VERSION=\$(shell date +%y%m%d-%H%M)
99 \$(MAKE) -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) VERSION=\$(VERSION) LANGUAGE=\$(LANGUAGE)
102 \$(MAKE) -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) clean
106 make -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) tags
110 echo "Created Makefile"
112 if [ -d "archos" ]; then
113 echo "sub directory archos already present"
116 echo "created an archos subdirectory for simulating the hard disk"
122 # figure out which languages that are around
123 for file in $appsdir/lang
/*.lang
; do
124 clean
=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
125 langs
="$langs $clean"
129 for one
in $langs; do
140 for one
in $langs; do
141 if [ "$num" = "$pick" ]; then
151 # Beging Build Script
157 if test "$1" = "--help"; then
158 echo "Rockbox configure script."
159 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
160 echo "Do *NOT* run this within the tools directory!"
164 if test -r "configure"; then
165 # this is a check for a configure script in the current directory, it there
166 # is one, try to figure out if it is this one!
168 if { grep "^# Jukebox" configure
>/dev
/null
2>&1 ; } then
169 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
170 echo "It will only cause you pain and grief. Instead do this:"
173 echo " mkdir build-dir"
175 echo " ../tools/configure"
177 echo "Much happiness will arise from this. Enjoy"
182 if [ "$target" = "--help" -o \
183 "$target" = "-h" ]; then
184 echo "Just invoke the script and answer the questions."
185 echo "This script will write a Makefile for you"
189 # get our current directory
192 if [ "$target" = "update" ]; then
195 if [ -f Makefile
]; then
196 if { grep "^## Auto" Makefile
>/dev
/null
2>&1 ; } then
197 echo "Existing generated Makefile found. Getting defaults from it."
198 archos
=`grep "^ARCHOS=" Makefile | cut -d= -f2-`
199 target
=`grep "^TARGET=" Makefile | cut -d= -f2-`
200 debug
=`grep "^DEBUG=" Makefile | cut -d= -f2-`
201 language
=`grep "^LANGUAGE=" Makefile | cut -d= -f2-`
202 memory
=`grep "^MEMORYSIZE=" Makefile | cut -d= -f2-`
204 if [ "$debug" = "SIMULATOR=1" ]; then
206 display
=`grep "^DISPLAY=" Makefile | cut -d= -f2-`
207 keypad
=`grep "^KEYPAD=" Makefile | cut -d= -f2-`
208 simver
=`grep "^SIMVER=" Makefile | cut -d= -f2-`
214 echo "This script will setup your Rockbox build environment."
215 echo "Further docs here: http://rockbox.haxx.se/docs/"
220 if [ -z "$archos" ]; then
222 ##################################################################
223 # Figure out target platform
226 echo "Enter target platform: (default is Archos Recorder)"
228 echo "1 - Archos Player/Studio"
229 echo "2 - Archos Recorder"
230 echo "3 - Archos FM Recorder"
231 echo "4 - Archos Recorder v2"
232 echo "5 - Neo mStation"
241 target
="-DARCHOS_PLAYER"
242 display
="-DHAVE_LCD_CHARCELLS"
243 keypad
="-DHAVE_PLAYER_KEYPAD"
248 target
="-DARCHOS_FMRECORDER"
249 display
="-DHAVE_LCD_BITMAP"
250 keypad
="-DHAVE_RECORDER_KEYPAD"
255 target
="-DARCHOS_RECORDERV2"
256 display
="-DHAVE_LCD_BITMAP"
257 keypad
="-DHAVE_RECORDER_KEYPAD"
262 target
="-DNEO_MSTATION"
263 display
="-DHAVE_NEOLCD_CHARCELLS"
264 keypad
="-DHAVE_NEO_KEYPAD"
270 display
="-DHAVE_NEOLCD_CHARCELLS"
271 keypad
="-DHAVE_NEO_KEYPAD"
276 target
="-DARCHOS_RECORDER"
277 display
="-DHAVE_LCD_BITMAP"
278 keypad
="-DHAVE_RECORDER_KEYPAD"
283 echo "Platform set to $archos"
287 if [ -z "$memory" ]; then
289 if [ -z "$update" ]; then
290 echo "Enter size of your RAM (in MB): (defaults to 2)"
303 echo "Memory size selected: $memory MB"
306 if [ -z "$debug" ]; then
307 ##################################################################
308 # Figure out debug on/off
310 echo "Build (N)ormal, (D)ebug or (S)imulated version? (N)"
318 echo "Simulator build selected"
323 echo "Debug build selected"
327 echo "Normal build selected"
333 ##################################################################
334 # Figure out where the firmware code is!
337 firmfile
="crt0.S" # a file to check for in the firmware root dir
339 for dir
in firmware . .. ..
/firmware ..
/..
/firmware
; do
340 if [ -f $dir/$firmfile ]; then
346 if [ -z "$firmdir" ]; then
347 echo "This script couldn't find your firmware directory. Please enter the"
348 echo "full path to the firmware directory here:"
353 ##################################################################
354 # Figure out where the apps code is!
357 appsfile
="credits.c" # a file to check for in the apps root dir
359 for dir
in apps . .. ..
/apps ..
/..
/apps
$firmdir/apps
$firmdir/..
/apps
; do
360 if [ -f $dir/$appsfile ]; then
366 if [ -z "$appsdir" ]; then
367 echo "This script couldn't find your apps directory. Please enter the"
368 echo "full path to the apps directory here:"
373 ##################################################################
374 # Figure out where the tools directory is!
377 toolsfile
="descramble.c" # a file to check for in the tools root dir
379 for dir
in tools . .. ..
/tools ..
/..
/tools
$firmdir/tools
$firmdir/..
/tools
; do
380 if [ -f $dir/$toolsfile ]; then
386 if [ -z "$toolsdir" ]; then
387 # no file found, check if (some of) the necessary tools are in the PATH
392 for dir
in `echo $PATH | tr ':' ' '`; do
393 if [ -x "$dir/$toolsexe" ]; then
394 echo "found $toolsexe in $dir"
402 if [ -z "$toolsdir" ]; then
403 echo "This script couldn't find your tools directory. Please enter the"
404 echo "full path to the tools directory here:"
409 if [ -z "$language" ]; then
411 echo "Select a number for the language to use (default is english)"
416 if [ -z "$language" ]; then
420 echo "Language set to $language"
423 if [ "yes" = "$simulator" ]; then
424 # we have already dealt with the simulator Makefile separately
430 -e "s,@FIRMDIR@,${firmdir},g" \
431 -e "s,@APPSDIR@,${appsdir},g" \
432 -e "s,@TOOLSDIR@,${toolsdir},g" \
433 -e "s,@DEBUG@,${debug},g" \
434 -e "s,@MEMORY@,${memory},g" \
435 -e "s,@TARGET@,${target},g" \
436 -e "s,@ARCHOS@,${archos},g" \
437 -e "s,@LANGUAGE@,${language},g" \
438 -e "s,@PWD@,${pwd},g" \
440 ## Automaticly generated. http://rockbox.haxx.se
451 VERSION=\$(shell date +%y%m%d-%H%M)
453 .PHONY: firmware apps
458 \$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR) MEM=\$(MEMORYSIZE) TOOLSDIR=\$(TOOLSDIR)
461 \$(MAKE) -C \$(APPSDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR) VERSION=\$(VERSION) LANGUAGE=\$(LANGUAGE) MEM=\$(MEMORYSIZE) TOOLSDIR=\$(TOOLSDIR)
464 \$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) OBJDIR=\$(THISDIR) clean
467 \$(MAKE) -C \$(APPSDIR) TARGET=\$(TARGET) OBJDIR=\$(THISDIR) clean
470 \$(MAKE) clean-firmware clean-apps
473 \$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) OBJDIR=\$(THISDIR) tags
476 \$(MAKE) -C \$(APPSDIR) TARGET=\$(TARGET) OBJDIR=\$(THISDIR) tags
480 \$(MAKE) tags-firmware tags-apps
483 echo "Created Makefile"