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
29 GCCOPTIMIZE
="-fomit-frame-pointer -fschedule-insns"
33 CC
=calmrisc16-unknown-elf-gcc
34 LD
=calmrisc16-unknown-elf-ld
35 AR
=calmrisc16-unknown-elf-ar
36 AS
=calmrisc16-unknown-elf-as
37 OC
=calmrisc16-unknown-elf-objcopy
39 GCCOPTIMIZE
="-fomit-frame-pointer"
48 GCCOPTS
="$CCOPTS -g -m5200 -Wa\,-m5249"
49 GCCOPTIMIZE
="-fomit-frame-pointer"
54 if [ -z "$simver" ]; then
56 ##################################################################
57 # Figure out win32/x11 GUI
60 echo "Build (W)in32 or (X)11 GUI version? (X)"
72 echo "Selected $simver simulator"
80 -e "s,@ROOTDIR@,${rootdir},g" \
81 -e "s,@ARCHOS@,${archos},g" \
82 -e "s,@DEBUG@,${debug},g" \
83 -e "s,@KEYPAD@,${keypad},g" \
84 -e "s,@PWD@,${pwd},g" \
85 -e "s,@LANGUAGE@,${language},g" \
86 -e "s,@TARGET@,${target},g" \
87 -e "s,@PLUGINS@,${plugins},g" \
88 -e "s,@SIMVER@,${simver},g" \
90 ## Automaticly generated. http://rockbox.haxx.se
92 export ARCHOS=@ARCHOS@
93 export ROOTDIR=@ROOTDIR@
94 export FIRMDIR=\$(ROOTDIR)/firmware
95 export APPSDIR=\$(ROOTDIR)/apps
96 export TOOLSDIR=\$(ROOTDIR)/tools
97 export DOCSDIR=\$(ROOTDIR)/docs
98 export APPSDIR=@ROOTDIR@/apps
99 export SIMDIR=\$(ROOTDIR)/uisimulator/@SIMVER@
101 export KEYPAD=@KEYPAD@
103 export SIMVER=@SIMVER@
104 export TARGET=@TARGET@
105 export LANGUAGE=@LANGUAGE@
106 export VERSION=\$(shell date +%y%m%d-%H%M)
107 export ENABLEDPLUGINS=@PLUGINS@
114 \$(MAKE) -C \$(SIMDIR)
117 \$(MAKE) -C \$(SIMDIR) clean
122 make -C \$(SIMDIR) tags
125 \$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" sim\$(TARGET)
128 @echo "installing a full setup in your archos dir"
129 @(make zip && cd archos && unzip -oq ../rockbox.zip)
132 echo "Created Makefile"
134 if [ -d "archos" ]; then
135 echo "sub directory archos already present"
138 echo "created an archos subdirectory for simulating the hard disk"
144 # figure out which languages that are around
145 for file in $rootdir/apps
/lang
/*.lang
; do
146 clean
=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
147 langs
="$langs $clean"
151 for one
in $langs; do
162 for one
in $langs; do
163 if [ "$num" = "$pick" ]; then
174 if test "$1" = "--help"; then
175 echo "Rockbox configure script."
176 echo "Invoke this in a directory to generate a Makefile to build Rockbox"
177 echo "Do *NOT* run this within the tools directory!"
181 if test -r "configure"; then
182 # this is a check for a configure script in the current directory, it there
183 # is one, try to figure out if it is this one!
185 if { grep "^# Jukebox" configure
>/dev
/null
2>&1 ; } then
186 echo "WEEEEEEEEP. Don't run this configure script within the tools directory."
187 echo "It will only cause you pain and grief. Instead do this:"
190 echo " mkdir build-dir"
192 echo " ../tools/configure"
194 echo "Much happiness will arise from this. Enjoy"
199 if [ "$target" = "--help" -o \
200 "$target" = "-h" ]; then
201 echo "Just invoke the script and answer the questions."
202 echo "This script will write a Makefile for you"
206 # get our current directory
209 if [ "$target" = "update" ]; then
210 echo "configure update is unfortunately no longer supported"
214 echo "This script will setup your Rockbox build environment."
215 echo "Further docs here: http://rockbox.haxx.se/docs/"
220 if [ -z "$rootdir" ]; then
221 ##################################################################
222 # Figure out where the source code root is!
225 firmfile
="crt0.S" # a file to check for in the firmware root dir
227 for dir
in . .. ..
/.. ..
/rockbox
*; do
228 if [ -f $dir/firmware
/$firmfile ]; then
234 if [ -z "$rootdir" ]; then
235 echo "This script couldn't find your source code root directory. Please enter the"
236 echo "full path to the source code directory here:"
241 #####################################################################
242 # Convert the possibly relative directory name to an absolute version
248 echo "Using this source code root directory:"
252 # cd back to the build dir
256 if [ -z "$archos" ]; then
258 ##################################################################
259 # Figure out target platform
262 echo "Enter target platform: (default is Archos Recorder)"
264 echo "1 - Archos Player/Studio"
265 echo "2 - Archos Recorder"
266 echo "3 - Archos FM Recorder"
267 echo "4 - Archos Recorder v2"
268 echo "5 - Archos Gmini 120"
269 echo "7 - Archos Ondio SP"
270 echo "8 - Archos Ondio FM"
271 echo "9 - Iriver H100"
279 target
="-DARCHOS_PLAYER"
281 tool
="$rootdir/tools/scramble"
284 archosrom
="$pwd/rombox.ucl"
285 flash
="$pwd/rockbox.ucl"
291 target
="-DARCHOS_FMRECORDER"
293 tool
="$rootdir/tools/scramble -fm"
297 flash
="$pwd/rockbox.ucl"
303 target
="-DARCHOS_RECORDERV2"
305 tool
="$rootdir/tools/scramble -v2"
308 archosrom
="$pwd/rombox.ucl"
309 flash
="$pwd/rockbox.ucl"
315 target
="-DARCHOS_GMINI120"
316 memory
=16 # fixed size (16 is a guess, remove comment when checked)
318 tool
="$rootdir/tools/scramble" # not correct but...
319 output
="rockboxgmini"
323 plugins
="" # disabled for now, enable later on
328 target
="-DARCHOS_ONDIOSP"
330 tool
="$rootdir/tools/scramble -osp"
333 archosrom
="$pwd/rombox.ucl"
334 flash
="$pwd/rockbox.ucl"
340 target
="-DARCHOS_ONDIOFM"
342 tool
="$rootdir/tools/scramble -ofm"
345 archosrom
="$pwd/rombox.ucl"
346 flash
="$pwd/rockbox.ucl"
352 target
="-DIRIVER_H100"
356 output
="rockbox.iriver"
365 target
="-DARCHOS_RECORDER"
367 tool
="$rootdir/tools/scramble"
370 archosrom
="$pwd/rombox.ucl"
371 flash
="$pwd/rockbox.ucl"
377 echo "Platform set to $archos"
381 if [ -z "$memory" ]; then
383 if [ -z "$update" ]; then
384 echo "Enter size of your RAM (in MB): (defaults to 2)"
397 echo "Memory size selected: $memory MB"
400 if [ -z "$debug" ]; then
401 ##################################################################
402 # Figure out debug on/off
404 echo "Build (N)ormal, (D)ebug or (S)imulated version? (N)"
412 echo "Simulator build selected"
417 echo "Debug build selected"
418 GCCOPTS
="$GCCOPTS -g -DDEBUG"
422 echo "Normal build selected"
423 GCCOPTS
="$GCCOPTS $GCCOPTIMIZE"
430 if [ -z "$language" ]; then
432 echo "Select a number for the language to use (default is english)"
437 if [ -z "$language" ]; then
441 echo "Language set to $language"
444 if [ "yes" = "$simulator" ]; then
445 # we have already dealt with the simulator Makefile separately
451 -e "s,@ROOTDIR@,${rootdir},g" \
452 -e "s,@DEBUG@,${debug},g" \
453 -e "s,@MEMORY@,${memory},g" \
454 -e "s,@TARGET@,${target},g" \
455 -e "s,@ARCHOS@,${archos},g" \
456 -e "s,@LANGUAGE@,${language},g" \
457 -e "s,@PWD@,${pwd},g" \
458 -e "s,@CC@,${CC},g" \
459 -e "s,@LD@,${LD},g" \
460 -e "s,@AR@,${AR},g" \
461 -e "s,@AS@,${AS},g" \
462 -e "s,@OC@,${OC},g" \
463 -e "s,@TOOL@,${tool},g" \
464 -e "s,@OUTPUT@,${output},g" \
465 -e "s,@APPEXTRA@,${appextra},g" \
466 -e "s,@ARCHOSROM@,${archosrom},g" \
467 -e "s,@FLASHFILE@,${flash},g" \
468 -e "s,@PLUGINS@,${plugins},g" \
469 -e "s,@GCCOPTS@,${GCCOPTS},g" \
471 ## Automaticly generated. http://rockbox.haxx.se
473 export ROOTDIR=@ROOTDIR@
474 export FIRMDIR=\$(ROOTDIR)/firmware
475 export APPSDIR=\$(ROOTDIR)/apps
476 export TOOLSDIR=\$(ROOTDIR)/tools
477 export DOCSDIR=\$(ROOTDIR)/docs
479 export ARCHOS=@ARCHOS@
480 export ARCHOSROM=@ARCHOSROM@
481 export FLASHFILE=@FLASHFILE@
482 export TARGET=@TARGET@
484 export LANGUAGE=@LANGUAGE@
485 export MEMORYSIZE=@MEMORY@
486 export VERSION=\$(shell date +%y%m%d-%H%M)
487 export MKFIRMWARE=@TOOL@
488 export BINARY=@OUTPUT@
489 export APPEXTRA=@APPEXTRA@
490 export ENABLEDPLUGINS=@PLUGINS@
496 export GCCOPTS=@GCCOPTS@
498 .PHONY: all clean tags zip
501 @\$(MAKE) -C \$(FIRMDIR)
502 @\$(MAKE) -C \$(APPSDIR)
505 @\$(MAKE) -C \$(FIRMDIR) clean
506 @\$(MAKE) -C \$(APPSDIR) clean
507 @rm -f rockbox.zip TAGS
511 \$(MAKE) -C \$(FIRMDIR) tags
512 \$(MAKE) -C \$(APPSDIR) tags
513 \$(MAKE) -C \$(APPSDIR)/plugins tags
514 \$(MAKE) -C \$(APPSDIR)/plugins/lib tags
517 \$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" \$(TARGET)
520 echo "Created Makefile"