3 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
11 # global CC options for all platforms
12 CCOPTS
="-W -Wall -O -nostdlib -ffreestanding -Wstrict-prototypes"
15 # Begin Function Definitions
37 GCCOPTS
="$CCOPTS -m5200"
42 if [ -z "$simver" ]; then
44 ##################################################################
45 # Figure out win32/x11 GUI
48 echo "Build (W)in32 or (X)11 GUI version? (X)"
60 echo "Selected $simver simulator"
68 -e "s,@ROOTDIR@,${rootdir},g" \
69 -e "s,@ARCHOS@,${archos},g" \
70 -e "s,@DEBUG@,${debug},g" \
71 -e "s,@KEYPAD@,${keypad},g" \
72 -e "s,@PWD@,${pwd},g" \
73 -e "s,@LANGUAGE@,${language},g" \
74 -e "s,@TARGET@,${target},g" \
75 -e "s,@SIMVER@,${simver},g" \
77 ## Automaticly generated. http://rockbox.haxx.se
79 export ARCHOS=@ARCHOS@
80 export ROOTDIR=@ROOTDIR@
81 export FIRMDIR=\$(ROOTDIR)/firmware
82 export APPSDIR=\$(ROOTDIR)/apps
83 export TOOLSDIR=\$(ROOTDIR)/tools
84 export DOCSDIR=\$(ROOTDIR)/docs
85 export APPSDIR=@ROOTDIR@/apps
86 export SIMDIR=\$(ROOTDIR)/uisimulator/@SIMVER@
88 export KEYPAD=@KEYPAD@
90 export SIMVER=@SIMVER@
91 export TARGET=@TARGET@
92 export LANGUAGE=@LANGUAGE@
93 export VERSION=\$(shell date +%y%m%d-%H%M)
100 \$(MAKE) -C \$(SIMDIR)
103 \$(MAKE) -C \$(SIMDIR) clean
108 make -C \$(SIMDIR) tags
111 \$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" sim\$(TARGET)
114 @echo "installing a full setup in your archos dir"
115 @(make zip && cd archos && unzip -oq ../rockbox.zip)
118 echo "Created Makefile"
120 if [ -d "archos" ]; then
121 echo "sub directory archos already present"
124 echo "created an archos subdirectory for simulating the hard disk"
130 # figure out which languages that are around
131 for file in $rootdir/apps
/lang
/*.lang
; do
132 clean
=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
133 langs
="$langs $clean"
137 for one
in $langs; do
148 for one
in $langs; do
149 if [ "$num" = "$pick" ]; then
160 if test "$1" = "--help"; then
161 echo "Rockbox configure script."
162 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
163 echo "Do *NOT* run this within the tools directory!"
167 if test -r "configure"; then
168 # this is a check for a configure script in the current directory, it there
169 # is one, try to figure out if it is this one!
171 if { grep "^# Jukebox" configure
>/dev
/null
2>&1 ; } then
172 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
173 echo "It will only cause you pain and grief. Instead do this:"
176 echo " mkdir build-dir"
178 echo " ../tools/configure"
180 echo "Much happiness will arise from this. Enjoy"
185 if [ "$target" = "--help" -o \
186 "$target" = "-h" ]; then
187 echo "Just invoke the script and answer the questions."
188 echo "This script will write a Makefile for you"
192 # get our current directory
195 if [ "$target" = "update" ]; then
196 echo "configure update is unfortunately no longer supported"
200 echo "This script will setup your Rockbox build environment."
201 echo "Further docs here: http://rockbox.haxx.se/docs/"
206 if [ -z "$rootdir" ]; then
207 ##################################################################
208 # Figure out where the source code root is!
211 firmfile
="crt0.S" # a file to check for in the firmware root dir
213 for dir
in . .. ..
/.. ..
/rockbox
*; do
214 if [ -f $dir/firmware
/$firmfile ]; then
220 if [ -z "$rootdir" ]; then
221 echo "This script couldn't find your source code root directory. Please enter the"
222 echo "full path to the source code directory here:"
227 #####################################################################
228 # Convert the possibly relative directory name to an absolute version
234 echo "Using this source code root directory:"
238 # cd back to the build dir
242 if [ -z "$archos" ]; then
244 ##################################################################
245 # Figure out target platform
248 echo "Enter target platform: (default is Archos Recorder)"
250 echo "1 - Archos Player/Studio"
251 echo "2 - Archos Recorder"
252 echo "3 - Archos FM Recorder"
253 echo "4 - Archos Recorder v2"
254 echo "7 - Archos Ondio SP"
255 echo "8 - Archos Ondio FM"
256 echo "9 - Iriver H100"
264 target
="-DARCHOS_PLAYER"
275 target
="-DARCHOS_FMRECORDER"
280 archosrom
="$pwd/rombox.ucl"
286 target
="-DARCHOS_RECORDERV2"
291 archosrom
="$pwd/rombox.ucl"
297 target
="-DARCHOS_ONDIOSP"
308 target
="-DARCHOS_ONDIOFM"
319 target
="-DIRIVER_H100"
322 tool
="not-written-yet"
323 output
="rockbox.iriver"
331 target
="-DARCHOS_RECORDER"
336 archosrom
="$pwd/rombox.ucl"
342 echo "Platform set to $archos"
346 if [ -z "$memory" ]; then
348 if [ -z "$update" ]; then
349 echo "Enter size of your RAM (in MB): (defaults to 2)"
362 echo "Memory size selected: $memory MB"
365 if [ -z "$debug" ]; then
366 ##################################################################
367 # Figure out debug on/off
369 echo "Build (N)ormal, (D)ebug or (S)imulated version? (N)"
377 echo "Simulator build selected"
382 echo "Debug build selected"
383 GCCOPTS
="$GCCOPTS -g -DDEBUG"
387 echo "Normal build selected"
388 GCCOPTS
="$GCCOPTS -fomit-frame-pointer -fschedule-insns"
395 if [ -z "$language" ]; then
397 echo "Select a number for the language to use (default is english)"
402 if [ -z "$language" ]; then
406 echo "Language set to $language"
409 if [ "yes" = "$simulator" ]; then
410 # we have already dealt with the simulator Makefile separately
416 -e "s,@ROOTDIR@,${rootdir},g" \
417 -e "s,@DEBUG@,${debug},g" \
418 -e "s,@MEMORY@,${memory},g" \
419 -e "s,@TARGET@,${target},g" \
420 -e "s,@ARCHOS@,${archos},g" \
421 -e "s,@LANGUAGE@,${language},g" \
422 -e "s,@PWD@,${pwd},g" \
423 -e "s,@CC@,${CC},g" \
424 -e "s,@LD@,${LD},g" \
425 -e "s,@AR@,${AR},g" \
426 -e "s,@AS@,${AS},g" \
427 -e "s,@OC@,${OC},g" \
428 -e "s,@TOOL@,${tool},g" \
429 -e "s,@OUTPUT@,${output},g" \
430 -e "s,@APPEXTRA@,${appextra},g" \
431 -e "s,@ARCHOSROM@,${archosrom},g" \
432 -e "s,@PLUGINS@,${plugins},g" \
433 -e "s,@GCCOPTS@,${GCCOPTS},g" \
435 ## Automaticly generated. http://rockbox.haxx.se
437 export ROOTDIR=@ROOTDIR@
438 export FIRMDIR=\$(ROOTDIR)/firmware
439 export APPSDIR=\$(ROOTDIR)/apps
440 export TOOLSDIR=\$(ROOTDIR)/tools
441 export DOCSDIR=\$(ROOTDIR)/docs
443 export ARCHOS=@ARCHOS@
444 export ARCHOSROM=@ARCHOSROM@
445 export TARGET=@TARGET@
447 export LANGUAGE=@LANGUAGE@
448 export MEMORYSIZE=@MEMORY@
449 export VERSION=\$(shell date +%y%m%d-%H%M)
450 export MKFIRMWARE=\$(TOOLSDIR)/@TOOL@
451 export BINARY=@OUTPUT@
452 export APPEXTRA=@APPEXTRA@
453 export ENABLEDPLUGINS=@PLUGINS@
459 export GCCOPTS=@GCCOPTS@
461 .PHONY: all clean tags zip
464 @\$(MAKE) -C \$(FIRMDIR)
465 @\$(MAKE) -C \$(APPSDIR)
468 @\$(MAKE) -C \$(FIRMDIR) clean
469 @\$(MAKE) -C \$(APPSDIR) clean
470 @rm -f rockbox.zip TAGS
474 \$(MAKE) -C \$(FIRMDIR) tags
475 \$(MAKE) -C \$(APPSDIR) tags
476 \$(MAKE) -C \$(APPSDIR)/plugins tags
477 \$(MAKE) -C \$(APPSDIR)/plugins/lib tags
480 \$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" \$(TARGET)
483 echo "Created Makefile"