Index: bootloader/show_logo.c =================================================================== --- bootloader/show_logo.c (revision 19139) +++ bootloader/show_logo.c (working copy) @@ -24,7 +24,7 @@ #include #include -#include "rockboxlogo.h" +#include "bitmaps/rockboxlogo.h" #if LCD_WIDTH <= 128 #define BOOT_VERSION ("Boot " APPSVERSION) Index: bootloader/bootloader.make =================================================================== --- bootloader/bootloader.make (revision 0) +++ bootloader/bootloader.make (revision 0) @@ -0,0 +1,27 @@ +INCLUDES += -I$(APPSDIR) +SRC += $(call preprocess, $(APPSDIR)/SOURCES) + +BOOTLDS := $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/boot.lds +BOOTLINK := $(BUILDDIR)/boot.link + +CLEANOBJS += $(BUILDDIR)/bootloader.* + +.SECONDEXPANSION: + +$(BOOTLINK): $(BOOTLDS) + $(call PRINTS,PP $(@F))$(CC) $(CFLAGS) -DLOADADDRESS=$(LOADADDRESS) -E -P -x c $< >$@ + +$(BUILDDIR)/bootloader.elf: $$(OBJ) $$(FIRMLIB) $$(BOOTLINK) + $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \ + $(FIRMLIB) -lgcc -L$(BUILDDIR)/firmware -T$(BOOTLINK) \ + -Wl,--gc-sections -Wl,-Map,$(BUILDDIR)/bootloader.map + +$(BUILDDIR)/bootloader.bin : $(BUILDDIR)/bootloader.elf + $(call PRINTS,OBJCOPY $(@F))$(OC) $(if $(filter yes, $(USE_ELF)), -S -x, -O binary) $< $@ + +$(BUILDDIR)/bootloader.asm: $(BUILDDIR)/bootloader.bin + $(TOOLSDIR)/sh2d -sh1 $< > $@ + +$(BUILDDIR)/$(BINARY) : $(BUILDDIR)/bootloader.bin + $(call PRINTS,Build bootloader file)$(MKFIRMWARE) $< $@ + Index: flash/bootbox/bootbox.make =================================================================== --- flash/bootbox/bootbox.make (revision 0) +++ flash/bootbox/bootbox.make (revision 0) @@ -0,0 +1,4 @@ +SRC += $(call preprocess,$(APPSDIR)/SOURCES) + +# don't build rombox.ucl +ARCHOSROM= Index: tools/Makefile =================================================================== --- tools/Makefile (revision 19139) +++ tools/Makefile (working copy) @@ -15,8 +15,8 @@ generate_rocklatin mkboot ipod_fw codepages uclpack mi4 gigabeat database \ lngdump telechips gigabeats creative hmac-sha1 mktccboot mknkboot rbspeexenc mkzenboot -all: - @echo "Run make in your build directory!" +all: scramble descramble sh2d rdf2binary mkboot mktccboot mknkboot mkzenboot \ + convbdf codepages uclpack rbspeexenc voicefont scramble: scramble.o iriver.o mi4.o gigabeat.o gigabeats.o telechips.o iaudio_bl_flash.o creative.o hmac-sha1.o descramble: descramble.o iriver.o gigabeat.o Index: tools/configure =================================================================== --- tools/configure (revision 19139) +++ tools/configure (working copy) @@ -1325,8 +1325,6 @@ boottool="$rootdir/tools/scramble -tcc=crc" bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" bmp2rb_native="$rootdir/tools/bmp2rb -f 4" - bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0" - bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0" output="rockbox.d2" appextra="recorder:gui" plugins="yes" @@ -1414,8 +1412,6 @@ tool="cp " bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" bmp2rb_native="$rootdir/tools/bmp2rb -f 4" - bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0" - bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0" output="rockbox.mrobe500" appextra="recorder:gui" plugins="yes" @@ -1438,8 +1434,6 @@ tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS" bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" bmp2rb_native="$rootdir/tools/bmp2rb -f 0" - bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0" - bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0" output="rockbox.mi4" appextra="recorder:gui" plugins="yes" @@ -1487,8 +1481,6 @@ arm926ejscc bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" bmp2rb_native="$rootdir/tools/bmp2rb -f 4" - bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0" - bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0" tool="$rootdir/tools/scramble -creative=zvm" USE_ELF="yes" output="rockbox.zvm" @@ -1512,8 +1504,6 @@ arm926ejscc bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" bmp2rb_native="$rootdir/tools/bmp2rb -f 4" - bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0" - bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0" tool="$rootdir/tools/scramble -creative=zvm60 -no-ciff" USE_ELF="yes" output="rockbox.zvm60" @@ -1537,8 +1527,6 @@ arm926ejscc bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" bmp2rb_native="$rootdir/tools/bmp2rb -f 4" - bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0" - bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0" tool="$rootdir/tools/scramble -creative=zenvision -no-ciff" USE_ELF="yes" output="rockbox.zv" @@ -2074,6 +2062,8 @@ debug="-DDEBUG" simulator="yes" extradefines="-DSIMULATOR" + archosrom="" + flash="" echo "Simulator build selected" ;; [Aa]) @@ -2397,18 +2387,6 @@ <&2 "Consider upgrading to GNU make 3.81+ for optimum build performance.") -ifeq (\$(call info),old) -export info=echo "\$\$(1)"; -endif - export ROOTDIR=@ROOTDIR@ export FIRMDIR=@FIRMDIR@ export APPSDIR=@APPSDIR@ @@ -2428,8 +2406,8 @@ export LANGUAGE=@LANGUAGE@ export VOICELANGUAGE=@VOICELANGUAGE@ export MEMORYSIZE=@MEMORY@ -export VERSION=\$(shell \$(ROOTDIR)/tools/svnversion.sh \$(ROOTDIR)) -export BUILDDATE=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d') +export VERSION:=\$(shell \$(ROOTDIR)/tools/svnversion.sh \$(ROOTDIR)) +export BUILDDATE:=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d') export MKFIRMWARE=@TOOL@ export BMP2RB_MONO=@BMP2RB_MONO@ export BMP2RB_NATIVE=@BMP2RB_NATIVE@ @@ -2469,159 +2447,8 @@ export ENCODER=@ENCODER@ export USE_ELF=@USE_ELF@ -# Do not print "Entering directory ..." -MAKEFLAGS += --no-print-directory +include \$(TOOLSDIR)/root.make -.PHONY: all clean tags zip tools manual bin build info langs - -all: info - -info: build - \$(SILENT)\$(TOOLSDIR)/mkinfo.pl \$(BUILDDIR)/rockbox-info.txt - -build: tools @LANGS@ - @SIMUL1@ - @SIMUL2@ - \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware - \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ - -bin: tools @LANGS@ - @SIMUL1@ - @SIMUL2@ - \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware - \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ \$(BUILDDIR)/\$(BINARY) - -rocks: tools - \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ rocks - -veryclean: clean toolsclean - -toolsclean: - \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) clean - -clean: - \$(SILENT)echo Cleaning build directory - \$(SILENT)rm -rf rockbox.zip rockbox.7z rockbox.tar rockbox.tar.gz \ - rockbox.tar.bz2 TAGS @APPS@ firmware comsim sim lang.[ch] \ - manual *.pdf *.a credits.raw @OUTPUT@ bitmaps pluginbitmaps \ - @ARCHOSROM@ @FLASHFILE@ UI256.bmp rockbox-full.zip \ - html txt rockbox-manual*.zip sysfont.h rockbox-info.txt \ - voicefontids *.wav *.mp3 *.voice max_language_size.h - -tools: - \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) AR=\$(HOSTAR) @TOOLSET@ - -voicetools: - \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) AR=\$(HOSTAR) @VOICETOOLSET@ - -tags: - \$(SILENT)rm -f TAGS - \$(SILENT)\$(MAKE) -C \$(FIRMDIR) tags - \$(SILENT)\$(MAKE) -C \$(APPSDIR) tags - \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins tags - \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins/lib tags - -fontzip: - \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\" -r "\$(ROOTDIR)" -f 1 -o rockbox-fonts.zip \$(TARGET) \$(BINARY) - -zip: info - \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done ; \\ - \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\$\$feat\" -i \"\$(TARGET_ID)\" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY) - -mapzip: info - \$(SILENT)find . -name "*.map" | xargs zip rockbox-maps.zip - -fullzip: info - \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\ - \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\$\$feat\" -i \"\$(TARGET_ID)\" -r "\$(ROOTDIR)" -f 2 -o rockbox-full.zip \$(TARGET) \$(BINARY) - -7zip: info - \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\ - \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\$\$feat\" -i \"\$(TARGET_ID)\" -o "rockbox.7z" -z "7za a -mx=9" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY) - -tar: info - \$(SILENT)rm -f rockbox.tar - \$(SILENT)for f in \`cat \$(BUILDDIR)/@APPS@/features\`; do feat="\$\$feat:\$\$f" ; done; \\ - \$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(MODELNAME)\$\$feat\" -i \"\$(TARGET_ID)\" -o "rockbox.tar" -z "tar -cf" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY) - -bzip2: tar - \$(SILENT)bzip2 -f9 rockbox.tar - -gzip: tar - \$(SILENT)gzip -f9 rockbox.tar - -langs: features - \$(SILENT)mkdir -p \$(BUILDDIR)/apps/lang - \$(SILENT)\$(MAKE) -C \$(APPSDIR)/lang OBJDIR=\$(BUILDDIR)/apps/lang - -manual: manual-pdf -manual-pdf: - \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-pdf -manual-html: - \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-html -manual-zhtml: manual-zip -manual-txt: - \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-txt -manual-ztxt: - \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-txt-zip -manual-zip: - \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-zip - -features: tools - \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ features - -help: - @echo "A few helpful make targets" - @echo "" - @echo "all - builds a full Rockbox (default), including tools" - @echo "bin - builds only the Rockbox. file" - @echo "rocks - builds only plugins and codecs" - @echo "clean - cleans a build directory (not tools)" - @echo "veryclean - cleans the build and tools directories" - @echo "manual - builds a manual" - @echo "manual-html - HTML manual" - @echo "manual-zip - HTML manual (zipped)" - @echo "manual-txt - txt manual" - @echo "fullzip - creates a rockbox.zip of your build with fonts" - @echo "zip - creates a rockbox.zip of your build (no fonts)" - @echo "gzip - creates a rockbox.tar.gz of your build (no fonts)" - @echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)" - @echo "7zip - creates a rockbox.7z of your build (no fonts)" - @echo "fontzip - creates rockbox-fonts.zip" - @echo "mapzip - creates rockbox-maps.zip with all .map files" - @echo "tools - builds the tools only" - @echo "voicetools - builds the voice tools only" - @echo "install - installs your build (for simulator builds only, no fonts)" - @echo "fullinstall - installs your build (for simulator builds only, with fonts)" - EOF -if [ "yes" = "$simulator" ]; then - - cat >> Makefile <> Makefile < $(2)) + +c2obj = $(subst .c,.o,$(subst .S,.o,$(subst $(ROOTDIR),$(BUILDDIR),$(1)))) + +# calculate dependencies for a list of source files $(2) and output them +# to a file $(1) + +mkdepfile = $(shell \ + for each in $(2); do \ + obj=`echo $$each | sed -e 's/\.[cS]/.o/' -e 's:$(ROOTDIR):$(BUILDDIR):'`; \ + $(CC) $(CFLAGS) $(OTHER_INC) -MG -MM -include config.h -MT "$$obj" $$each 2>/dev/null; \ + done | sed -e "s: lang.h: $(BUILDDIR)/lang.o:" \ + -e "s: sysfont.h: $(BUILDDIR)/sysfont.h:" \ + -e "s: max_language_size.h: $(BUILDDIR)/max_language_size.h:" \ + -e "s: bitmaps/: $(BUILDDIR)/bitmaps/:g" \ + -e "s: pluginbitmaps/: $(BUILDDIR)/pluginbitmaps/:g" \ + -e "s: lib/: $(APPSDIR)/plugins/lib/:g" \ + -e "s: codeclib.h: $(APPSDIR)/codecs/lib/codeclib.h:g" \ + > $(1); ) + +# function to create .bmp dependencies +bmpdepfile = $(shell \ + for each in $(2); do \ + obj=`echo $$each | sed -e 's/\.bmp/.o/' -e 's:$(ROOTDIR):$(BUILDDIR):'`; \ + src=`echo $$each | sed -e 's/\.bmp/.c/' -e 's:$(ROOTDIR):$(BUILDDIR):'`; \ + echo $$obj: $$src; \ + echo $$src: $$each; \ + done \ + >> $(1); ) + +ifndef V +SILENT:=@ +else +VERBOSEOPT:=-v +endif +PRINTS=$(SILENT)$(call info,$(1)) + +# old 'make' versions don't have the built-in 'info' function +info=old$(shell echo >&2 "Consider upgrading to GNU make 3.81+ for optimum build performance.") +ifeq ($(call info),old) +export info=echo "$$(1)"; +endif + Property changes on: tools/functions.make ___________________________________________________________________ Added: svn:mergeinfo Index: tools/root.make =================================================================== --- tools/root.make (revision 0) +++ tools/root.make (revision 0) @@ -0,0 +1,282 @@ +include $(TOOLSDIR)/functions.make + +DEFINES = -DROCKBOX -DMEMORYSIZE=$(MEMORYSIZE) -DMEM=$(MEMORYSIZE) $(TARGET) \ + -DTARGET_ID=$(TARGET_ID) -DTARGET_NAME=\"$(MODELNAME)\" \ + -DAPPSVERSION=\"$(VERSION)\" $(BUILDDATE) \ + $(EXTRA_DEFINES) # <-- -DSIMULATOR or not +INCLUDES = -I$(BUILDDIR) $(TARGET_INC) + +CFLAGS = $(INCLUDES) $(DEFINES) $(GCCOPTS) + +TOOLS = $(TOOLSDIR)/rdf2binary $(TOOLSDIR)/convbdf \ + $(TOOLSDIR)/codepages $(TOOLSDIR)/scramble $(TOOLSDIR)/bmp2rb \ + $(TOOLSDIR)/uclpack $(TOOLSDIR)/mktccboot $(TOOLSDIR)/mkboot + +# list suffixes to be understood by $* +.SUFFIXES: .rock .codec .map .elf .c .S .o .bmp .a + +.PHONY: all clean tags zip tools manual bin build info langs + +DEPFILE = $(BUILDDIR)/make.dep + +all: $(DEPFILE) build + +# Subdir makefiles. their primary purpose is to populate SRC & OTHER_SRC +# but they also define special dependencies and compile rules +include $(TOOLSDIR)/tools.make +include $(FIRMDIR)/firmware.make +include $(ROOTDIR)/apps/bitmaps/bitmaps.make + +ifneq (,$(findstring bootloader,$(APPSDIR))) + include $(APPSDIR)/bootloader.make +else ifneq (,$(findstring bootbox,$(APPSDIR))) + include $(APPSDIR)/bootbox.make +else + include $(APPSDIR)/apps.make + include $(APPSDIR)/lang/lang.make + + ifdef SOFTWARECODECS + include $(APPSDIR)/codecs/codecs.make + endif + + ifdef ENABLEDPLUGINS + include $(APPSDIR)/plugins/bitmaps/pluginbitmaps.make + include $(APPSDIR)/plugins/plugins.make + endif + + ifdef SIMVER + include $(ROOTDIR)/uisimulator/uisimulator.make + endif +endif # bootloader + +OBJ := $(SRC:.c=.o) +OBJ := $(OBJ:.S=.o) +OBJ += $(BMP:.bmp=.o) +OBJ := $(subst $(ROOTDIR),$(BUILDDIR),$(OBJ)) + +build: $(TOOLS) $(BUILDDIR)/$(BINARY) $(CODECS) $(ROCKS) $(ARCHOSROM) + $(SILENT)$(TOOLSDIR)/mkinfo.pl $(BUILDDIR)/rockbox-info.txt + +ifneq (clean,$(findstring clean,$(MAKECMDGOALS))) # don't build deps before cleaning +$(DEPFILE) dep: + $(call PRINTS,Generating dependencies) + @echo foo > /dev/null # there must be a "real" command in the rule + $(call mkdepfile,$(DEPFILE),$(SRC) $(OTHER_SRC)) + $(call bmpdepfile,$(DEPFILE),$(BMP) $(PBMP)) +endif + +bin: $(DEPFILE) $(TOOLS) $(BUILDDIR)/$(BINARY) +rocks: $(DEPFILE) $(TOOLS) $(ROCKS) +codecs: $(DEPFILE) $(TOOLS) $(CODECS) + +-include $(DEPFILE) + +veryclean: clean + $(SILENT)rm -rf $(TOOLS) + +clean: + $(SILENT)echo Cleaning build directory + $(SILENT)rm -rf rockbox.zip rockbox.7z rockbox.tar rockbox.tar.gz rockbox.tar.bz2 TAGS apps firmware comsim sim lang.[ch] manual *.pdf *.a credits.raw rockbox.ipod bitmaps pluginbitmaps UI256.bmp rockbox-full.zip html txt rockbox-manual*.zip sysfont.h rockbox-info.txt voicefontids *.wav *.mp3 *.voice max_language_size.h $(CLEANOBJS) $(LINKRAM) $(LINKROM) rockbox.elf rockbox.map rockbox.bin $(DEPFILE) rombox.elf rombox.map rombox.bin $(BINARY) $(FLASHFILE) uisimulator bootloader flash + +#### linking the binaries: #### + +.SECONDEXPANSION: + +ifndef SIMVER + +ifeq (,$(findstring bootloader,$(APPSDIR))) +# not bootloader + +## target build +RAMLDS := $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/app.lds +LINKRAM := $(BUILDDIR)/ram.link +ROMLDS := $(FIRMDIR)/rom.lds +LINKROM := $(BUILDDIR)/rom.link + +$(LINKRAM): $(RAMLDS) + $(call PRINTS,PP $(@F))$(CC) $(CFLAGS) -DLOADADDRESS=$(LOADADDRESS) -E -P -x c $< >$@ + +$(LINKROM): $(ROMLDS) + $(call PRINTS,PP $(@F))$(CC) $(CFLAGS) -DLOADADDRESS=$(LOADADDRESS) -E -P -x c $< >$@ + +$(BUILDDIR)/rockbox.elf : $$(OBJ) $$(FIRMLIB) $$(VOICESPEEXLIB) $$(LINKRAM) + $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Wl,--gc-sections -Os -nostdlib -o $@ $(OBJ) \ + -L$(BUILDDIR)/firmware -lfirmware\ + -L$(BUILDDIR)/apps/codecs $(VOICESPEEXLIB:lib%.a=-l%) \ + -lgcc \ + -T$(LINKRAM) -Wl,-Map,$(BUILDDIR)/rockbox.map + +$(BUILDDIR)/rombox.elf : $$(OBJ) $$(FIRMLIB) $$(VOICESPEEXLIB) $$(LINKROM) + $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \ + $(VOICESPEEXLIB) $(FIRMLIB) -lgcc -L$(BUILDDIR)/firmware \ + -T$(LINKROM) -Wl,-Map,$(BUILDDIR)/rockbox.map + +$(BUILDDIR)/rockbox.bin : $(BUILDDIR)/rockbox.elf + $(call PRINTS,OC $(@F))$(OC) $(if $(filter yes, $(USE_ELF)), -S -x, -O binary) $< $@ + +$(BUILDDIR)/rombox.bin : $(BUILDDIR)/rombox.elf + $(call PRINTS,OC $(@F))$(OC) -O binary $< $@ + +# +# If there's a flashfile defined for this target (rockbox.ucl for Archos +# models) Then check if the mkfirmware script fails, as then it is (likely) +# because the image is too big and we need to create a compressed image +# instead. +# +$(BUILDDIR)/$(BINARY) : $(BUILDDIR)/rockbox.bin $(FLASHFILE) + $(call PRINTS,SCRAMBLE $(notdir $@))($(MKFIRMWARE) $< $@; \ + stat=$$?; \ + if test -n "$(FLASHFILE)"; then \ + if test "$$stat" -ne 0; then \ + echo "Image too big, making a compressed version!"; \ + $(MAKE) -C $(FIRMDIR)/decompressor OBJDIR=$(BUILDDIR)/firmware/decompressor; \ + $(MKFIRMWARE) $(BUILDDIR)/firmware/decompressor/compressed.bin $@; \ + fi \ + fi ) + +# archos +$(BUILDDIR)/rockbox.ucl: $(BUILDDIR)/rockbox.bin + $(call PRINTS,UCLPACK $(@F))$(TOOLSDIR)/uclpack --best --2e -b1048576 $< $@ >/dev/null 2>&1 + +MAXINFILE = $(BUILDDIR)/temp.txt +MAXOUTFILE = $(BUILDDIR)/romstart.txt + +$(BUILDDIR)/rombox.ucl: $(BUILDDIR)/rombox.bin $(MAXOUTFILE) + $(call PRINTS,UCLPACK $(@F))$(TOOLSDIR)/uclpack --none $< $@ >/dev/null; \ + perl $(TOOLSDIR)/romsizetest.pl `cat $(MAXOUTFILE)` $<; \ + if test $$? -ne 0; then \ + echo "removing UCL file again, making it a fake one"; \ + echo "fake" > $@; \ + fi + +$(MAXOUTFILE): + $(call PRINTS,Creating $(@F)) + $(SILENT)$(shell echo '#include "config.h"' > $(MAXINFILE)) + $(SILENT)$(shell echo "ROM_START" >> $(MAXINFILE)) + $(call preprocess2file,$(MAXINFILE),$(MAXOUTFILE)) + $(SILENT)rm $(MAXINFILE) + +# iriver +$(BUILDDIR)/rombox.iriver: $(BUILDDIR)/rombox.bin + $(call PRINTS,Build ROM file)$(MKFIRMWARE) $< $@ + +endif # !bootloader +endif # !SIMVER + + +voicetools: + $(SILENT)$(MAKE) -C $(TOOLSDIR) CC=$(HOSTCC) AR=$(HOSTAR) rbspeexenc voicefont wavtrim + +tags: + $(SILENT)rm -f TAGS + $(SILENT)etags -o $(BUILDDIR)/TAGS $(filter-out %.o,$(SRC) $(OTHER_SRC)) + +fontzip: + $(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) -t \"$(MODELNAME)\" -r "$(ROOTDIR)" -f 1 -o rockbox-fonts.zip $(TARGET) $(BINARY) + +zip: + $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done ; \ + $(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) -t \"$(MODELNAME)$$feat\" -i \"$(TARGET_ID)\" -r "$(ROOTDIR)" $(TARGET) $(BINARY) + +mapzip: + $(SILENT)find . -name "*.map" | xargs zip rockbox-maps.zip + +fullzip: + $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \ + $(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) -t \"$(MODELNAME)$$feat\" -i \"$(TARGET_ID)\" -r "$(ROOTDIR)" -f 2 -o rockbox-full.zip $(TARGET) $(BINARY) + +7zip: + $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \ + $(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) -t \"$(MODELNAME)$$feat\" -i \"$(TARGET_ID)\" -o "rockbox.7z" -z "7za a -mx=9" -r "$(ROOTDIR)" $(TARGET) $(BINARY) + +tar: + $(SILENT)rm -f rockbox.tar + $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \ + $(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) -t \"$(MODELNAME)$$feat\" -i \"$(TARGET_ID)\" -o "rockbox.tar" -z "tar -cf" -r "$(ROOTDIR)" $(TARGET) $(BINARY) + +bzip2: tar + $(SILENT)bzip2 -f9 rockbox.tar + +gzip: tar + $(SILENT)gzip -f9 rockbox.tar + +manual manual-pdf: + $(SILENT)$(MAKE) -C $(MANUALDIR) OBJDIR=$(BUILDDIR)/manual manual-pdf +manual-html: + $(SILENT)$(MAKE) -C $(MANUALDIR) OBJDIR=$(BUILDDIR)/manual manual-html +manual-zhtml: manual-zip +manual-txt: + $(SILENT)$(MAKE) -C $(MANUALDIR) OBJDIR=$(BUILDDIR)/manual manual-txt +manual-ztxt: + $(SILENT)$(MAKE) -C $(MANUALDIR) OBJDIR=$(BUILDDIR)/manual manual-txt-zip +manual-zip: + $(SILENT)$(MAKE) -C $(MANUALDIR) OBJDIR=$(BUILDDIR)/manual manual-zip + +ifdef TTS_ENGINE + +voice: voicetools features + $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done ; \ + for lang in `echo $(VOICELANGUAGE) |sed "s/,/ /g"`; do $(TOOLSDIR)/voice.pl -V -l=$$lang -t=$(MODELNAME)$$feat -i=$(TARGET_ID) -e="$(ENCODER)" -E="$(ENC_OPTS)" -s=$(TTS_ENGINE) -S="$(TTS_OPTS)"; done \ + +endif + +ifdef SIMVER + +install: + @echo "Installing your build in your archos dir" + $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \ + $(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) -t \"$(MODELNAME)$$feat\" -i \"$(TARGET_ID)\" -s -r "$(ROOTDIR)" -f 0 $(TARGET) $(BINARY) + +fullinstall: + @echo "Installing a full setup in your archos dir" + $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \ + $(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) -t \"$(MODELNAME)$$feat\" -i \"$(TARGET_ID)\" -s -r "$(ROOTDIR)" -f 2 $(TARGET) $(BINARY) + +endif + +help: + @echo "A few helpful make targets" + @echo "" + @echo "all - builds a full Rockbox (default), including tools" + @echo "bin - builds only the Rockbox. file" + @echo "rocks - builds only plugins" + @echo "codecs - builds only codecs" + @echo "dep - regenerates make dependency database" + @echo "clean - cleans a build directory (not tools)" + @echo "veryclean - cleans the build and tools directories" + @echo "manual - builds a manual (pdf)" + @echo "manual-html - HTML manual" + @echo "manual-zip - HTML manual (zipped)" + @echo "manual-txt - txt manual" + @echo "fullzip - creates a rockbox.zip of your build with fonts" + @echo "zip - creates a rockbox.zip of your build (no fonts)" + @echo "gzip - creates a rockbox.tar.gz of your build (no fonts)" + @echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)" + @echo "7zip - creates a rockbox.7z of your build (no fonts)" + @echo "fontzip - creates rockbox-fonts.zip" + @echo "mapzip - creates rockbox-maps.zip with all .map files" + @echo "tools - builds the tools only" + @echo "voice - creates the voice clips (voice builds only)" + @echo "voicetools - builds the voice tools only" + @echo "install - installs your build (for simulator builds only, no fonts)" + @echo "fullinstall - installs your build (for simulator builds only, with fonts)" + +### general compile rules: + +# when source and object are in different locations (normal): +$(BUILDDIR)/%.o: $(ROOTDIR)/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) -c $< -o $@ + +$(BUILDDIR)/%.o: $(ROOTDIR)/%.S + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) -c $< -o $@ + +# when source and object are both in BUILDDIR (generated code): +%.o: %.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) -c $< -o $@ + +%.o: %.S + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) -c $< -o $@ Index: tools/tools.make =================================================================== --- tools/tools.make (revision 0) +++ tools/tools.make (revision 0) @@ -0,0 +1,31 @@ +TOOLSCFLAGS := -O -g -W -Wall -Wshadow -pedantic -I$(ROOTDIR)/tools + +$(TOOLSDIR)/scramble: $(TOOLSDIR)/scramble.c $(TOOLSDIR)/iriver.c \ + $(TOOLSDIR)/mi4.c $(TOOLSDIR)/gigabeat.c \ + $(TOOLSDIR)/gigabeats.c $(TOOLSDIR)/telechips.c \ + $(TOOLSDIR)/iaudio_bl_flash.c \ + $(TOOLSDIR)/creative.c $(TOOLSDIR)/hmac-sha1.c +$(TOOLSDIR)/rdf2binary: $(TOOLSDIR)/rdf2binary.c +$(TOOLSDIR)/convbdf: $(TOOLSDIR)/convbdf.c +$(TOOLSDIR)/codepages: $(TOOLSDIR)/codepages.c $(TOOLSDIR)/codepage_tables.c +$(TOOLSDIR)/mkboot: $(TOOLSDIR)/mkboot.c +$(TOOLSDIR)/mktccboot: $(TOOLSDIR)/mktccboot.c $(TOOLSDIR)/telechips.c +$(TOOLSDIR)/wavtrim: $(TOOLSDIR)/wavtrim.c +$(TOOLSDIR)/voicefont: $(TOOLSDIR)/voicefont.c + +$(TOOLSDIR)/iaudio_bl_flash.c $(TOOLSDIR)/iaudio_bl_flash.h: $(TOOLSDIR)/iaudio_bl_flash.bmp $(TOOLSDIR)/bmp2rb + $(call PRINTS,BMP2RB $(@F)) + $(SILENT)$(TOOLSDIR)/bmp2rb -f 7 -h $(TOOLSDIR) $< >$(TOOLSDIR)/iaudio_bl_flash.c + +$(TOOLSDIR)/bmp2rb: $(TOOLSDIR)/bmp2rb.c + $(call PRINTS,CC $(@F)) + $(SILENT)$(HOSTCC) -DAPPLICATION_NAME=\"$@\" $(TOOLSCFLAGS) $+ -o $@ + +$(TOOLSDIR)/uclpack: $(TOOLSDIR)/ucl/uclpack.c $(wildcard $(TOOLSDIR)/ucl/src/*.c) + $(call PRINTS,CC $(@F))$(HOSTCC) $(TOOLSCFLAGS) -I$(TOOLSDIR)/ucl \ + -I$(TOOLSDIR)/ucl/include -o $@ $^ + +# implicit rule for simple tools +$(TOOLSDIR)/%: $(TOOLSDIR)/%.c + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$@)) + $(SILENT)$(HOSTCC) $(TOOLSCFLAGS) -o $@ $^ Index: apps/Makefile (deleted) =================================================================== Index: apps/plugins/xobox.c =================================================================== --- apps/plugins/xobox.c (revision 19139) +++ apps/plugins/xobox.c (working copy) @@ -21,7 +21,7 @@ ****************************************************************************/ #include "plugin.h" -#include "helper.h" +#include "lib/helper.h" PLUGIN_HEADER Index: apps/plugins/test_resize.c =================================================================== --- apps/plugins/test_resize.c (revision 19139) +++ apps/plugins/test_resize.c (working copy) @@ -25,8 +25,8 @@ */ #include "plugin.h" -#include "pluginlib_actions.h" -#include "bmp.h" +#include "lib/pluginlib_actions.h" +#include "lib/bmp.h" PLUGIN_HEADER Index: apps/plugins/keybox.c =================================================================== --- apps/plugins/keybox.c (revision 19139) +++ apps/plugins/keybox.c (working copy) @@ -19,7 +19,7 @@ * ****************************************************************************/ #include "plugin.h" -#include "md5.h" +#include "lib/md5.h" PLUGIN_HEADER #define KEYBOX_FILE PLUGIN_DIR "/apps/keybox.dat" Index: apps/plugins/sliding_puzzle.c =================================================================== --- apps/plugins/sliding_puzzle.c (revision 19139) +++ apps/plugins/sliding_puzzle.c (working copy) @@ -19,7 +19,7 @@ * ****************************************************************************/ #include "plugin.h" -#include "bmp.h" +#include "lib/bmp.h" #ifdef HAVE_LCD_BITMAP PLUGIN_HEADER Index: apps/plugins/jpeg/jpeg.make =================================================================== --- apps/plugins/jpeg/jpeg.make (revision 0) +++ apps/plugins/jpeg/jpeg.make (revision 0) @@ -0,0 +1,12 @@ +JPEGSRCDIR := $(APPSDIR)/plugins/jpeg +JPEGBUILDDIR := $(BUILDDIR)/apps/plugins/jpeg + +ROCKS += $(JPEGBUILDDIR)/jpeg.rock + +JPEG_SRC := $(call preprocess, $(JPEGSRCDIR)/SOURCES) +JPEG_OBJ := $(call c2obj, $(JPEG_SRC)) + +# add source files to OTHER_SRC to get automatic dependencies +OTHER_SRC += $(JPEG_SRC) + +$(JPEGBUILDDIR)/jpeg.rock: $(JPEG_OBJ) Index: apps/plugins/jpeg/Makefile (deleted) =================================================================== Index: apps/plugins/plasma.c =================================================================== --- apps/plugins/plasma.c (revision 19139) +++ apps/plugins/plasma.c (working copy) @@ -25,14 +25,14 @@ ****************************************************************************/ #include "plugin.h" -#include "helper.h" +#include "lib/helper.h" #ifdef HAVE_LCD_BITMAP #ifndef HAVE_LCD_COLOR -#include "grey.h" +#include "lib/grey.h" #endif -#include "fixedpoint.h" +#include "lib/fixedpoint.h" PLUGIN_HEADER Index: apps/plugins/random_folder_advance_config.c =================================================================== --- apps/plugins/random_folder_advance_config.c (revision 19139) +++ apps/plugins/random_folder_advance_config.c (working copy) @@ -19,7 +19,7 @@ * ****************************************************************************/ #include "plugin.h" -#include "oldmenuapi.h" +#include "lib/oldmenuapi.h" PLUGIN_HEADER Index: apps/plugins/mandelbrot.c =================================================================== --- apps/plugins/mandelbrot.c (revision 19139) +++ apps/plugins/mandelbrot.c (working copy) @@ -23,8 +23,8 @@ #include "plugin.h" #ifdef HAVE_LCD_BITMAP -#include "grey.h" -#include "xlcd.h" +#include "lib/grey.h" +#include "lib/xlcd.h" PLUGIN_HEADER Index: apps/plugins/zxbox/Makefile (deleted) =================================================================== Index: apps/plugins/zxbox/zxbox.make =================================================================== --- apps/plugins/zxbox/zxbox.make (revision 0) +++ apps/plugins/zxbox/zxbox.make (revision 0) @@ -0,0 +1,48 @@ +ZXBOX_SRCDIR = $(APPSDIR)/plugins/zxbox +ZXBOX_OBJDIR = $(BUILDDIR)/apps/plugins/zxbox + +ZXBOX_SRC := $(call preprocess, $(ZXBOX_SRCDIR)/SOURCES) +ZXBOX_OBJ := $(call c2obj, $(ZXBOX_SRC)) + +OTHER_SRC += $(ZXBOX_SRC) + +ifndef SIMVER +ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET))))) + ## archos recorder targets + ZXBOX_INLDS := $(ZXBOX_SRCDIR)/archos.lds + ROCKS += $(ZXBOX_OBJDIR)/zxbox.ovl +else + ### all other targets + ZXBOX_INLDS := $(APPSDIR)/plugins/plugin.lds + ROCKS += $(ZXBOX_OBJDIR)/zxbox.rock +endif +else + ### simulator + ROCKS += $(ZXBOX_OBJDIR)/zxbox.rock +endif + +ZXBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O3 -funroll-loops + +ifdef SIMVER + ZXBOX_LDFLAGS = $(SHARED_FLAG) # <-- from Makefile +else + ZXBOX_OUTLDS = $(ZXBOX_OBJDIR)/zxbox.lds + ZXBOX_LDFLAGS = -T$(ZXBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(BUILDDIR)/$*.map +endif + +$(ZXBOX_OUTLDS): $(ZXBOX_INLDS) $(ZXBOX_OBJ) + $(call PRINTS,PP $( #include #ifdef USE_GREY -#include "../lib/grey.h" +#include "lib/grey.h" #endif #include "zxbox_keyb.h" Index: apps/plugins/sudoku/sudoku.make =================================================================== --- apps/plugins/sudoku/sudoku.make (revision 0) +++ apps/plugins/sudoku/sudoku.make (revision 0) @@ -0,0 +1,12 @@ +SUDOKUSRCDIR := $(APPSDIR)/plugins/sudoku +SUDOKUBUILDDIR := $(BUILDDIR)/apps/plugins/sudoku + +ROCKS += $(SUDOKUBUILDDIR)/sudoku.rock + +SUDOKU_SRC := $(call preprocess, $(SUDOKUSRCDIR)/SOURCES) +SUDOKU_OBJ := $(call c2obj, $(SUDOKU_SRC)) + +# add source files to OTHER_SRC to get automatic dependencies +OTHER_SRC += $(SUDOKU_SRC) + +$(SUDOKUBUILDDIR)/sudoku.rock: $(SUDOKU_OBJ) Index: apps/plugins/sudoku/sudoku.c =================================================================== --- apps/plugins/sudoku/sudoku.c (revision 19139) +++ apps/plugins/sudoku/sudoku.c (working copy) @@ -69,9 +69,9 @@ #include "generator.h" /* The bitmaps */ -#include "sudoku_normal.h" -#include "sudoku_inverse.h" -#include "sudoku_start.h" +#include "pluginbitmaps/sudoku_normal.h" +#include "pluginbitmaps/sudoku_inverse.h" +#include "pluginbitmaps/sudoku_start.h" #define BITMAP_HEIGHT (BMPHEIGHT_sudoku_normal/10) #define BITMAP_STRIDE BMPWIDTH_sudoku_normal Index: apps/plugins/sudoku/Makefile (deleted) =================================================================== Index: apps/plugins/maze.c =================================================================== --- apps/plugins/maze.c (revision 19139) +++ apps/plugins/maze.c (working copy) @@ -31,7 +31,7 @@ */ #include "plugin.h" -#include "helper.h" +#include "lib/helper.h" PLUGIN_HEADER @@ -54,7 +54,7 @@ # define MAZE_RDOWN (BUTTON_PLAY | BUTTON_REPEAT) #else -# include "pluginlib_actions.h" +# include "lib/pluginlib_actions.h" # define MAZE_NEW PLA_START # define MAZE_QUIT PLA_QUIT # define MAZE_SOLVE PLA_FIRE Index: apps/plugins/Makefile (deleted) =================================================================== Index: apps/plugins/wavrecord.c =================================================================== --- apps/plugins/wavrecord.c (revision 19139) +++ apps/plugins/wavrecord.c (working copy) @@ -19,7 +19,7 @@ * ****************************************************************************/ #include "plugin.h" -#include "configfile.h" +#include "lib/configfile.h" PLUGIN_HEADER Index: apps/plugins/chessbox/chessbox.c =================================================================== --- apps/plugins/chessbox/chessbox.c (revision 19139) +++ apps/plugins/chessbox/chessbox.c (working copy) @@ -43,7 +43,7 @@ PLUGIN_HEADER /* Tile size defined by the assigned bitmap */ -#include "chessbox_pieces.h" +#include "pluginbitmaps/chessbox_pieces.h" #define TILE_WIDTH BMPWIDTH_chessbox_pieces #define TILE_HEIGHT (BMPHEIGHT_chessbox_pieces/26) Index: apps/plugins/chessbox/SOURCES =================================================================== --- apps/plugins/chessbox/SOURCES (revision 0) +++ apps/plugins/chessbox/SOURCES (revision 0) @@ -0,0 +1,4 @@ +chessbox.c +gnuchess.c +opening.c +chessbox_pgn.c Index: apps/plugins/chessbox/chessbox.make =================================================================== --- apps/plugins/chessbox/chessbox.make (revision 0) +++ apps/plugins/chessbox/chessbox.make (revision 0) @@ -0,0 +1,49 @@ +CHESSBOX_SRCDIR = $(APPSDIR)/plugins/chessbox +CHESSBOX_OBJDIR = $(BUILDDIR)/apps/plugins/chessbox + +CHESSBOX_SRC := $(call preprocess, $(CHESSBOX_SRCDIR)/SOURCES) +CHESSBOX_OBJ := $(call c2obj, $(CHESSBOX_SRC)) + +OTHER_SRC += $(CHESSBOX_SRC) + +ifndef SIMVER +ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET))))) + ## archos recorder targets + CHESSBOX_INLDS := $(CHESSBOX_SRCDIR)/archos.lds + ROCKS += $(CHESSBOX_OBJDIR)/chessbox.ovl +else + ### all other targets + CHESSBOX_INLDS := $(APPSDIR)/plugins/plugin.lds + ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock +endif + CHESSBOX_OVLFLAGS = -T$(CHESSBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$*.map + CHESSBOX_OUTLDS = $(CHESSBOX_OBJDIR)/chessbox.lds +else + ### simulator + ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock + CHESSBOX_OVLFLAGS = $(SHARED_FLAG) # <-- from Makefile +endif + +ifeq ($(CPU),sh) +# sh need to retain its' -Os +CHESSBOXFLAGS = $(PLUGINFLAGS) +else +CHESSBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O2 +endif + +$(CHESSBOX_OUTLDS): $(CHESSBOX_INLDS) $(CHESSBOX_OBJ) + $(call PRINTS,PP $(.make from each subdir (yay!) +$(foreach dir,$(PLUGINSUBDIRS),$(eval include $(dir)/$(notdir $(dir)).make)) + +### build data / rules +PLUGIN_LDS := $(APPSDIR)/plugins/plugin.lds +PLUGINLINK_LDS := $(BUILDDIR)/apps/plugins/plugin.link + +OTHER_INC = -I$(APPSDIR)/plugins + +# special compile flags for plugins: +PLUGINFLAGS = -I$(APPSDIR)/plugins -DPLUGIN $(CFLAGS) + +$(ROCKS): $(PLUGINLIB) $(APPSDIR)/plugin.h $(PLUGINLINK_LDS) $(PLUGINBITMAPLIB) + +$(PLUGINLIB): $(PLUGINLIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 + +$(PLUGINLINK_LDS): $(PLUGIN_LDS) + $(call PRINTS,PP $(@F))$(CC) $(PLUGINFLAGS) -E -P -x c $< >$@ + +$(BUILDDIR)/credits.raw credits.raw: $(DOCSDIR)/CREDITS + $(call PRINTS,Create credits.raw)perl $(APPSDIR)/plugins/credits.pl < $< > $(BUILDDIR)/$(@F) + +# special dependencies +$(BUILDDIR)/apps/plugins/wav2wv.rock: $(BUILDDIR)/apps/codecs/libwavpack.a + +# special pattern rule for compiling plugin lib (with -ffunction-sections) +$(BUILDDIR)/apps/plugins/lib/%.o: $(ROOTDIR)/apps/plugins/lib/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PLUGINFLAGS) -ffunction-sections -c $< -o $@ + +# special pattern rule for compiling plugins with extra flags +$(BUILDDIR)/apps/plugins/%.o: $(ROOTDIR)/apps/plugins/%.c $(PLUGINBITMAPLIB) + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PLUGINFLAGS) -c $< -o $@ + +ifdef SIMVER + PLUGINLDFLAGS = $(SHARED_FLAG) # <-- from Makefile +else + PLUGINLDFLAGS = -T$(PLUGINLINK_LDS) -Wl,--gc-sections -Wl,-Map,$*.map +endif + +$(BUILDDIR)/%.rock: $(BUILDDIR)/%.o $(PLUGINLINK_LDS) + $(call PRINTS,LD $(@F))$(CC) $(PLUGINFLAGS) -o $(BUILDDIR)/$*.elf \ + $(filter %.o, $^) \ + $(filter %.a, $^) \ + -lgcc $(PLUGINLDFLAGS) + $(SILENT)$(OC) -O binary $(BUILDDIR)/$*.elf $@ Index: apps/plugins/starfield.c =================================================================== --- apps/plugins/starfield.c (revision 19139) +++ apps/plugins/starfield.c (working copy) @@ -18,7 +18,7 @@ ****************************************************************************/ #include "plugin.h" -#include "helper.h" +#include "lib/helper.h" #ifdef HAVE_LCD_BITMAP /* and also not for the Player */ Index: apps/plugins/chessbox.c =================================================================== --- apps/plugins/chessbox.c (revision 19139) +++ apps/plugins/chessbox.c (working copy) @@ -24,7 +24,7 @@ #if MEM <= 8 && !defined(SIMULATOR) -#include "overlay.h" +#include "lib/overlay.h" PLUGIN_HEADER Index: apps/plugins/bitmaps/remote_native/SOURCES =================================================================== --- apps/plugins/bitmaps/remote_native/SOURCES (revision 19139) +++ apps/plugins/bitmaps/remote_native/SOURCES (working copy) @@ -18,7 +18,7 @@ /* Logo */ #if (LCD_REMOTE_DEPTH == 1) - remote_rockboxlogo.91x32x1.bmp +remote_rockboxlogo.91x32x1.bmp #elif (LCD_REMOTE_DEPTH == 2) - remote_rockboxlogo.91x32x2.bmp +remote_rockboxlogo.91x32x2.bmp #endif Index: apps/plugins/bitmaps/remote_native/Makefile (deleted) =================================================================== Index: apps/plugins/bitmaps/remote_mono/Makefile (deleted) =================================================================== Index: apps/plugins/bitmaps/native/SOURCES =================================================================== --- apps/plugins/bitmaps/native/SOURCES (revision 19139) +++ apps/plugins/bitmaps/native/SOURCES (working copy) @@ -669,14 +669,14 @@ /* pictureflow */ #if defined(HAVE_LCD_COLOR) && defined(HAVE_ALBUMART) && defined(HAVE_TAGCACHE) #if (LCD_WIDTH < 200) - pictureflow_logo.100x18x16.bmp +pictureflow_logo.100x18x16.bmp #else - pictureflow_logo.193x34x16.bmp +pictureflow_logo.193x34x16.bmp #endif #if (LCD_HEIGHT < 100 ) - pictureflow_emptyslide.50x50x16.bmp +pictureflow_emptyslide.50x50x16.bmp #else - pictureflow_emptyslide.100x100x16.bmp +pictureflow_emptyslide.100x100x16.bmp #endif #endif @@ -689,53 +689,53 @@ #if defined HAVE_LCD_COLOR #if SMALLER_DIMENSION <= 80 - sliding_puzzle.80x80x16.bmp +sliding_puzzle.80x80x16.bmp #elif SMALLER_DIMENSION <= 108 - sliding_puzzle.108x108x16.bmp +sliding_puzzle.108x108x16.bmp #elif SMALLER_DIMENSION <= 128 - sliding_puzzle.128x128x16.bmp +sliding_puzzle.128x128x16.bmp #elif SMALLER_DIMENSION <= 132 - sliding_puzzle.132x132x16.bmp +sliding_puzzle.132x132x16.bmp #elif SMALLER_DIMENSION <= 176 - sliding_puzzle.176x176x16.bmp +sliding_puzzle.176x176x16.bmp #elif SMALLER_DIMENSION <= 240 - sliding_puzzle.240x240x16.bmp +sliding_puzzle.240x240x16.bmp #endif #elif (LCD_DEPTH > 1) #if SMALLER_DIMENSION <= 96 - sliding_puzzle.96x96x2.bmp +sliding_puzzle.96x96x2.bmp #elif SMALLER_DIMENSION <= 110 - sliding_puzzle.108x108x2.bmp +sliding_puzzle.108x108x2.bmp #elif SMALLER_DIMENSION <= 128 - sliding_puzzle.128x128x2.bmp +sliding_puzzle.128x128x2.bmp #endif #else /* mono targets, one size currently */ - sliding_puzzle.80x64x1.bmp +sliding_puzzle.80x64x1.bmp #endif /* Logo */ #if LCD_DEPTH == 16 #if (LCD_WIDTH >= 320) - rockboxlogo.220x68x16.bmp +rockboxlogo.220x68x16.bmp #elif (LCD_WIDTH > 160) - rockboxlogo.128x40x16.bmp +rockboxlogo.128x40x16.bmp #else - rockboxlogo.90x28x16.bmp +rockboxlogo.90x28x16.bmp #endif #elif LCD_DEPTH == 2 #if (LCD_WIDTH > 138) - rockboxlogo.138x46x2.bmp +rockboxlogo.138x46x2.bmp #else - rockboxlogo.91x32x2.bmp +rockboxlogo.91x32x2.bmp #endif #elif LCD_DEPTH == 1 #if (LCD_WIDTH > 112) /* Such a screen isn't currently in any target */ - rockboxlogo.112x30x1.bmp +rockboxlogo.112x30x1.bmp #else - rockboxlogo.91x32x1.bmp +rockboxlogo.91x32x1.bmp #endif #endif Index: apps/plugins/bitmaps/native/Makefile (deleted) =================================================================== Index: apps/plugins/bitmaps/mono/Makefile (deleted) =================================================================== Index: apps/plugins/bitmaps/pluginbitmaps.make =================================================================== --- apps/plugins/bitmaps/pluginbitmaps.make (revision 0) +++ apps/plugins/bitmaps/pluginbitmaps.make (revision 0) @@ -0,0 +1,50 @@ +PBMPINCDIR = $(BUILDDIR)/pluginbitmaps + +PFLAGS += -I$(PBMPINCDIR) + +ifneq ($(strip $(BMP2RB_MONO)),) +PBMP = $(call preprocess, $(APPSDIR)/plugins/bitmaps/mono/SOURCES) +endif +ifneq ($(strip $(BMP2RB_NATIVE)),) +PBMP += $(call preprocess, $(APPSDIR)/plugins/bitmaps/native/SOURCES) +endif +ifneq ($(strip $(BMP2RB_REMOTEMONO)),) +PBMP += $(call preprocess, $(APPSDIR)/plugins/bitmaps/remote_mono/SOURCES) +endif +ifneq ($(strip $(BMP2RB_REMOTENATIVE)),) +PBMP += $(call preprocess, $(APPSDIR)/plugins/bitmaps/remote_native/SOURCES) +endif + +ifdef PBMP # does player use bitmaps? + +PLUGIN_BITMAPS := $(PBMP:$(ROOTDIR)/%.bmp=$(BUILDDIR)/%.o) + +PLUGINBITMAPLIB := $(BUILDDIR)/apps/plugins/bitmaps/libpluginbitmaps.a +PLUGINBITMAPDIR := $(dir $(PLUGINBITMAPLIB)) + +PBMPHFILES := $(subst $(ROOTDIR),$(BUILDDIR),$(PBMP)) +PBMPHFILES := $(shell echo $(PBMPHFILES) | sed -e 's/\.[0-9x]\+\.bmp/.h/g' -e 's/\.bmp/.h/g' -e 's/apps\/plugins\/bitmaps\/\(mono\|native\|remote_mono\|remote_native\)/pluginbitmaps/g') + +$(PBMPHFILES): $(PLUGIN_BITMAPS) + +$(PLUGINBITMAPLIB): $(PLUGIN_BITMAPS) + $(call PRINTS,AR $(@F))$(AR) rs $@ $+ >/dev/null 2>&1 + +# pattern rules to create .c files from .bmp, one for each subdir: +$(BUILDDIR)/apps/plugins/bitmaps/mono/%.c: $(ROOTDIR)/apps/plugins/bitmaps/mono/%.bmp $(TOOLSDIR)/bmp2rb + $(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR) + $(call PRINTS,BMP2RB $( $@ + +$(BUILDDIR)/apps/plugins/bitmaps/native/%.c: $(ROOTDIR)/apps/plugins/bitmaps/native/%.bmp $(TOOLSDIR)/bmp2rb + $(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR) + $(call PRINTS,BMP2RB $( $@ + +$(BUILDDIR)/apps/plugins/bitmaps/remote_mono/%.c: $(ROOTDIR)/apps/plugins/bitmaps/remote_mono/%.bmp $(TOOLSDIR)/bmp2rb + $(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR) + $(call PRINTS,BMP2RB $( $@ + +$(BUILDDIR)/apps/plugins/bitmaps/remote_native/%.c: $(ROOTDIR)/apps/plugins/bitmaps/remote_native/%.bmp $(TOOLSDIR)/bmp2rb + $(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR) + $(call PRINTS,BMP2RB $( $@ + +endif Index: apps/plugins/ppmviewer.c =================================================================== --- apps/plugins/ppmviewer.c (revision 19139) +++ apps/plugins/ppmviewer.c (working copy) @@ -20,7 +20,7 @@ ****************************************************************************/ #include "plugin.h" -#include "bmp.h" +#include "lib/bmp.h" #if defined(HAVE_LCD_COLOR) Index: apps/plugins/test_sampr.c =================================================================== --- apps/plugins/test_sampr.c (revision 19139) +++ apps/plugins/test_sampr.c (working copy) @@ -19,7 +19,7 @@ * ****************************************************************************/ #include "plugin.h" -#include "oldmenuapi.h" +#include "lib/oldmenuapi.h" PLUGIN_HEADER Index: apps/plugins/rockblox.c =================================================================== --- apps/plugins/rockblox.c (revision 19139) +++ apps/plugins/rockblox.c (working copy) @@ -21,9 +21,9 @@ * ****************************************************************************/ #include "plugin.h" -#include "highscore.h" -#include "playergfx.h" -#include "helper.h" +#include "lib/highscore.h" +#include "lib/playergfx.h" +#include "lib/helper.h" PLUGIN_HEADER Index: apps/plugins/mpegplayer/stream_mgr.c =================================================================== --- apps/plugins/mpegplayer/stream_mgr.c (revision 19139) +++ apps/plugins/mpegplayer/stream_mgr.c (working copy) @@ -22,7 +22,7 @@ ****************************************************************************/ #include "plugin.h" #include "mpegplayer.h" -#include "grey.h" +#include "lib/grey.h" #include "mpeg_settings.h" #ifndef HAVE_LCD_COLOR Index: apps/plugins/mpegplayer/mpegplayer.make =================================================================== --- apps/plugins/mpegplayer/mpegplayer.make (revision 0) +++ apps/plugins/mpegplayer/mpegplayer.make (revision 0) @@ -0,0 +1,12 @@ +MPEGSRCDIR := $(APPSDIR)/plugins/mpegplayer +MPEGBUILDDIR := $(BUILDDIR)/apps/plugins/mpegplayer + +ROCKS += $(MPEGBUILDDIR)/mpegplayer.rock + +MPEG_SRC := $(call preprocess, $(MPEGSRCDIR)/SOURCES) +MPEG_OBJ := $(call c2obj, $(MPEG_SRC)) + +# add source files to OTHER_SRC to get automatic dependencies +OTHER_SRC += $(MPEG_SRC) + +$(MPEGBUILDDIR)/mpegplayer.rock: $(MPEG_OBJ) $(CODECDIR)/libmad-mpeg.a Index: apps/plugins/mpegplayer/mpegplayer.c =================================================================== --- apps/plugins/mpegplayer/mpegplayer.c (revision 19139) +++ apps/plugins/mpegplayer/mpegplayer.c (working copy) @@ -101,7 +101,7 @@ *****************************************************************************/ #include "plugin.h" #include "mpegplayer.h" -#include "helper.h" +#include "lib/helper.h" #include "mpeg_settings.h" #include "mpeg2.h" #include "video_out.h" Index: apps/plugins/mpegplayer/mpeg_settings.c =================================================================== --- apps/plugins/mpegplayer/mpeg_settings.c (revision 19139) +++ apps/plugins/mpegplayer/mpeg_settings.c (working copy) @@ -1,5 +1,5 @@ #include "plugin.h" -#include "helper.h" +#include "lib/helper.h" #include "lib/configfile.h" #include "lib/oldmenuapi.h" Index: apps/plugins/mpegplayer/mpegplayer.h =================================================================== --- apps/plugins/mpegplayer/mpegplayer.h (revision 19139) +++ apps/plugins/mpegplayer/mpegplayer.h (working copy) @@ -85,7 +85,7 @@ #else -#include "grey.h" +#include "lib/grey.h" #define DRAW_BLACK GREY_BLACK #define DRAW_DARKGRAY GREY_DARKGRAY #define DRAW_LIGHTGRAY GREY_LIGHTGRAY Index: apps/plugins/mpegplayer/audio_thread.c =================================================================== --- apps/plugins/mpegplayer/audio_thread.c (revision 19139) +++ apps/plugins/mpegplayer/audio_thread.c (working copy) @@ -22,8 +22,8 @@ ****************************************************************************/ #include "plugin.h" #include "mpegplayer.h" -#include "../../codecs/libmad/bit.h" -#include "../../codecs/libmad/mad.h" +#include "codecs/libmad/bit.h" +#include "codecs/libmad/mad.h" /** Audio stream and thread **/ struct pts_queue_slot; Index: apps/plugins/mpegplayer/Makefile (deleted) =================================================================== Index: apps/plugins/mpegplayer/video_thread.c =================================================================== --- apps/plugins/mpegplayer/video_thread.c (revision 19139) +++ apps/plugins/mpegplayer/video_thread.c (working copy) @@ -23,7 +23,7 @@ #include "plugin.h" #include "mpegplayer.h" #include "mpeg2dec_config.h" -#include "grey.h" +#include "lib/grey.h" #include "video_out.h" #include "mpeg_settings.h" Index: apps/plugins/fire.c =================================================================== --- apps/plugins/fire.c (revision 19139) +++ apps/plugins/fire.c (working copy) @@ -22,14 +22,14 @@ ****************************************************************************/ #include "plugin.h" -#include "helper.h" +#include "lib/helper.h" #ifdef HAVE_LCD_BITMAP -#include "pluginlib_actions.h" -#include "fixedpoint.h" +#include "lib/pluginlib_actions.h" +#include "lib/fixedpoint.h" #ifndef HAVE_LCD_COLOR -#include "grey.h" +#include "lib/grey.h" #endif #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) Index: apps/plugins/solitaire.c =================================================================== --- apps/plugins/solitaire.c (revision 19139) +++ apps/plugins/solitaire.c (working copy) @@ -20,11 +20,11 @@ ****************************************************************************/ #include "plugin.h" -#include "playback_control.h" -#include "configfile.h" +#include "lib/playback_control.h" +#include "lib/configfile.h" #include "button.h" #include "lcd.h" -#include "oldmenuapi.h" +#include "lib/oldmenuapi.h" #ifdef HAVE_LCD_BITMAP Index: apps/plugins/rocklife.c =================================================================== --- apps/plugins/rocklife.c (revision 19139) +++ apps/plugins/rocklife.c (working copy) @@ -61,8 +61,8 @@ */ #include "plugin.h" -#include "pluginlib_actions.h" -#include "helper.h" +#include "lib/pluginlib_actions.h" +#include "lib/helper.h" PLUGIN_HEADER Index: apps/plugins/midi/Makefile (deleted) =================================================================== Index: apps/plugins/midi/midi.make =================================================================== --- apps/plugins/midi/midi.make (revision 0) +++ apps/plugins/midi/midi.make (revision 0) @@ -0,0 +1,19 @@ +MIDISRCDIR := $(APPSDIR)/plugins/midi +MIDIBUILDDIR := $(BUILDDIR)/apps/plugins/midi + +ROCKS += $(MIDIBUILDDIR)/midi.rock + +MIDI_SRC := $(call preprocess, $(MIDISRCDIR)/SOURCES) +MIDI_OBJ := $(call c2obj, $(MIDI_SRC)) + +# add source files to OTHER_SRC to get automatic dependencies +OTHER_SRC += $(MIDI_SRC) + +$(MIDIBUILDDIR)/midi.rock: $(MIDI_OBJ) +# for some reason, this doesn't match the implicit rule in plugins.make, +# so we have to duplicate the link command here + $(SILENT)$(CC) $(PLUGINFLAGS) -o $*.elf \ + $(filter %.o, $^) \ + $(filter %.a, $^) \ + -lgcc $(PLUGINLDFLAGS) + $(call PRINTS,LD $(@F))$(OC) -O binary $*.elf $@ Index: apps/plugins/pictureflow.c =================================================================== --- apps/plugins/pictureflow.c (revision 19139) +++ apps/plugins/pictureflow.c (working copy) @@ -24,10 +24,10 @@ ****************************************************************************/ #include "plugin.h" -#include "pluginlib_actions.h" -#include "helper.h" -#include "bmp.h" -#include "picture.h" +#include "lib/pluginlib_actions.h" +#include "lib/helper.h" +#include "lib/bmp.h" +#include "lib/picture.h" #include "pluginbitmaps/pictureflow_logo.h" #include "pluginbitmaps/pictureflow_emptyslide.h" Index: apps/plugins/dice.c =================================================================== --- apps/plugins/dice.c (revision 19139) +++ apps/plugins/dice.c (working copy) @@ -20,8 +20,8 @@ ****************************************************************************/ #include "plugin.h" -#include "pluginlib_actions.h" -#include "configfile.h" +#include "lib/pluginlib_actions.h" +#include "lib/configfile.h" #define MAX_DICES 12 #define INITIAL_NB_DICES 1 Index: apps/plugins/searchengine/Makefile (deleted) =================================================================== Index: apps/plugins/bounce.c =================================================================== --- apps/plugins/bounce.c (revision 19139) +++ apps/plugins/bounce.c (working copy) @@ -20,7 +20,7 @@ **************************************************************************/ #include "plugin.h" #include "time.h" -#include "fixedpoint.h" +#include "lib/fixedpoint.h" PLUGIN_HEADER Index: apps/plugins/shortcuts/shortcuts.make =================================================================== --- apps/plugins/shortcuts/shortcuts.make (revision 0) +++ apps/plugins/shortcuts/shortcuts.make (revision 0) @@ -0,0 +1,16 @@ +SHCUTSRCDIR := $(APPSDIR)/plugins/shortcuts +SHCUTBUILDDIR := $(BUILDDIR)/apps/plugins/shortcuts + +ROCKS += $(SHCUTBUILDDIR)/shortcuts_view.rock +ROCKS += $(SHCUTBUILDDIR)/shortcuts_append.rock + +# add source files to OTHER_SRC to get automatic dependencies +OTHER_SRC += $(SHCUTSRCDIR)/shortcuts_common.c \ + $(SHCUTSRCDIR)/shortcuts_view.c \ + $(SHCUTSRCDIR)/shortcuts_append.c + +$(SHCUTBUILDDIR)/shortcuts_view.rock: \ + $(SHCUTBUILDDIR)/shortcuts_common.o $(SHCUTBUILDDIR)/shortcuts_view.o + +$(SHCUTBUILDDIR)/shortcuts_append.rock: \ + $(SHCUTBUILDDIR)/shortcuts_common.o $(SHCUTBUILDDIR)/shortcuts_append.o Index: apps/plugins/shortcuts/Makefile (deleted) =================================================================== Index: apps/plugins/doom/i_video.c =================================================================== --- apps/plugins/doom/i_video.c (revision 19139) +++ apps/plugins/doom/i_video.c (working copy) @@ -117,7 +117,7 @@ #include "rockmacros.h" #ifndef HAVE_LCD_COLOR -#include "../lib/grey.h" +#include "lib/grey.h" GREY_INFO_STRUCT_IRAM static unsigned char greybuffer[LCD_WIDTH] IBSS_ATTR; /* off screen buffer */ static unsigned char *gbuf; Index: apps/plugins/doom/SOURCES =================================================================== --- apps/plugins/doom/SOURCES (revision 0) +++ apps/plugins/doom/SOURCES (revision 0) @@ -0,0 +1,62 @@ +info.c +doomdef.c +doomstat.c +dstrings.c +tables.c +f_finale.c +f_wipe.c +d_net.c +d_items.c +g_game.c +m_menu.c +m_argv.c +m_cheat.c +m_random.c +am_map.c +p_ceilng.c +p_doors.c +p_genlin.c +p_enemy.c +p_floor.c +p_inter.c +p_lights.c +p_map.c +p_maputl.c +p_plats.c +p_pspr.c +p_setup.c +p_sight.c +p_spec.c +p_switch.c +p_mobj.c +p_telept.c +p_tick.c +p_saveg.c +p_user.c +r_bsp.c +r_data.c +r_draw.c +r_main.c +r_plane.c +r_segs.c +r_sky.c +r_things.c +wi_stuff.c +v_video.c +st_lib.c +st_stuff.c +hu_stuff.c +hu_lib.c +s_sound.c +z_zone.c +z_bmalloc.c +sounds.c +d_main.c +m_misc.c +m_bbox.c +i_system.c +i_sound.c +i_video.c +w_wad.c +rockdoom.c +d_deh.c Index: apps/plugins/doom/doom.make =================================================================== --- apps/plugins/doom/doom.make (revision 0) +++ apps/plugins/doom/doom.make (revision 0) @@ -0,0 +1,45 @@ +DOOMSRCDIR := $(APPSDIR)/plugins/doom +DOOMBUILDDIR := $(BUILDDIR)/apps/plugins/doom + +ROCKS += $(DOOMBUILDDIR)/doom.rock + +DOOM_SRC := $(call preprocess, $(DOOMSRCDIR)/SOURCES) +DOOM_OBJ := $(call c2obj, $(DOOM_SRC)) +DOOM_OBJ += $(DOOMBUILDDIR)/sscanf.o + +# add source files to OTHER_SRC to get automatic dependencies +OTHER_SRC += $(DOOM_SRC) + +DOOMCFLAGS = $(PLUGINFLAGS) -Wno-strict-prototypes + +# The arm code compiles too large for the plugin buffer when set to optimize for speed +ifeq ($(CPU), arm) + DOOMCFLAGS += -Os +ifndef SIMVER +ifeq ($(TARGET), IRIVER_H100) + DOOMCCFLAGS += -mstructure-size-boundary=8 +endif +endif +else + DOOMCFLAGS += -O2 +endif + +$(DOOMBUILDDIR)/sscanf.c: $(FIRMDIR)/common/sscanf.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CP $<)cp $< $@ + +$(DOOMBUILDDIR)/sscanf.o: $(DOOMBUILDDIR)/sscanf.c + +$(DOOMBUILDDIR)/doom.rock: $(DOOM_OBJ) +# for some reason, this doesn't match the implicit rule in plugins.make, +# so we have to duplicate the link command here + $(SILENT)$(CC) $(PLUGINFLAGS) -o $*.elf \ + $(filter %.o, $^) \ + $(filter %.a, $^) \ + -lgcc $(PLUGINLDFLAGS) + $(call PRINTS,LD $(@F))$(OC) -O binary $*.elf $@ + +# new rule needed to use extra compile flags +$(DOOMBUILDDIR)/%.o: $(DOOMSRCDIR)/%.c $(DOOMSRCDIR)/doom.make + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(DOOMCFLAGS) -c $< -o $@ Index: apps/plugins/doom/Makefile (deleted) =================================================================== Index: apps/plugins/cube.c =================================================================== --- apps/plugins/cube.c (revision 19139) +++ apps/plugins/cube.c (working copy) @@ -21,10 +21,10 @@ * ***************************************************************************/ #include "plugin.h" -#include "grey.h" -#include "playergfx.h" -#include "xlcd.h" -#include "fixedpoint.h" +#include "lib/grey.h" +#include "lib/playergfx.h" +#include "lib/xlcd.h" +#include "lib/fixedpoint.h" PLUGIN_HEADER Index: apps/plugins/greyscale.c =================================================================== --- apps/plugins/greyscale.c (revision 19139) +++ apps/plugins/greyscale.c (working copy) @@ -22,10 +22,10 @@ ****************************************************************************/ #include "plugin.h" -#include "helper.h" +#include "lib/helper.h" #if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) -#include "grey.h" +#include "lib/grey.h" PLUGIN_HEADER Index: apps/plugins/lib/Makefile (deleted) =================================================================== Index: apps/plugins/vu_meter.c =================================================================== --- apps/plugins/vu_meter.c (revision 19139) +++ apps/plugins/vu_meter.c (working copy) @@ -18,7 +18,7 @@ * **************************************************************************/ #include "plugin.h" -#include "fixedpoint.h" +#include "lib/fixedpoint.h" #if defined(HAVE_LCD_BITMAP) Index: apps/plugins/snow.c =================================================================== --- apps/plugins/snow.c (revision 19139) +++ apps/plugins/snow.c (working copy) @@ -19,7 +19,7 @@ * **************************************************************************/ #include "plugin.h" -#include "playergfx.h" +#include "lib/playergfx.h" PLUGIN_HEADER Index: apps/plugins/rockboy/rockboy.make =================================================================== --- apps/plugins/rockboy/rockboy.make (revision 0) +++ apps/plugins/rockboy/rockboy.make (revision 0) @@ -0,0 +1,44 @@ +ROCKBOY_SRCDIR = $(APPSDIR)/plugins/rockboy +ROCKBOY_OBJDIR = $(BUILDDIR)/apps/plugins/rockboy + +ROCKBOY_SRC := $(call preprocess, $(ROCKBOY_SRCDIR)/SOURCES) +ROCKBOY_OBJ := $(call c2obj, $(ROCKBOY_SRC)) +ROCKBOY_OBJ += $(ROCKBOY_OBJDIR)/sscanf.o + +OTHER_SRC += $(ROCKBOY_SRC) + +ifndef SIMVER +ifneq (,$(findstring RECORDER,$(TARGET))) + ## archos recorder targets + ROCKBOY_INLDS := $(ROCKBOY_SRCDIR)/archos.lds + ROCKS += $(ROCKBOY_OBJDIR)/rockboy.ovl +else + ### all other targets + ROCKBOY_INLDS := $(APPSDIR)/plugins/plugin.lds + ROCKS += $(ROCKBOY_OBJDIR)/rockboy.rock +endif + ROCKBOY_OVLFLAGS = -T$(ROCKBOY_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(ROCKBOY_OBJDIR)/$*.map + ROCKBOY_OUTLDS = $(ROCKBOY_OBJDIR)/rockboy.lds +else + ### simulator + ROCKS += $(ROCKBOY_OBJDIR)/rockboy.rock + ROCKBOY_OVLFLAGS = $(SHARED_FLAG) # <-- from Makefile +endif + +$(ROCKBOY_OBJDIR)/sscanf.c: $(FIRMDIR)/common/sscanf.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CP $<)cp $< $@ + +$(ROCKBOY_OBJDIR)/sscanf.o: $(ROCKBOY_OBJDIR)/sscanf.c + +$(ROCKBOY_OUTLDS): $(ROCKBOY_INLDS) $(ROCKBOY_OBJ) + $(call PRINTS,PP $( -#include "playback_control.h" -#include "oldmenuapi.h" +#include "lib/playback_control.h" +#include "lib/oldmenuapi.h" PLUGIN_HEADER Index: apps/plugins/beatbox/Makefile (deleted) =================================================================== Index: apps/plugins/mazezam.c =================================================================== --- apps/plugins/mazezam.c (revision 19139) +++ apps/plugins/mazezam.c (working copy) @@ -20,10 +20,10 @@ * ****************************************************************************/ #include "plugin.h" -#include "configfile.h" -#include "helper.h" -#include "pluginlib_actions.h" -#include "playback_control.h" +#include "lib/configfile.h" +#include "lib/helper.h" +#include "lib/pluginlib_actions.h" +#include "lib/playback_control.h" /* Include standard plugin macro */ PLUGIN_HEADER Index: apps/plugins/metronome.c =================================================================== --- apps/plugins/metronome.c (revision 19139) +++ apps/plugins/metronome.c (working copy) @@ -19,7 +19,7 @@ * ****************************************************************************/ #include "plugin.h" -#include "pluginlib_actions.h" +#include "lib/pluginlib_actions.h" PLUGIN_HEADER Index: apps/plugins/rockboy.c =================================================================== --- apps/plugins/rockboy.c (revision 19139) +++ apps/plugins/rockboy.c (working copy) @@ -24,7 +24,7 @@ #if MEM <= 8 && !defined(SIMULATOR) -#include "overlay.h" +#include "lib/overlay.h" PLUGIN_HEADER Index: apps/plugins/demystify.c =================================================================== --- apps/plugins/demystify.c (revision 19139) +++ apps/plugins/demystify.c (working copy) @@ -24,8 +24,8 @@ #include "plugin.h" #ifdef HAVE_LCD_BITMAP -#include "pluginlib_actions.h" -#include "helper.h" +#include "lib/pluginlib_actions.h" +#include "lib/helper.h" PLUGIN_HEADER #define DEFAULT_WAIT_TIME 3 Index: apps/plugins/bubbles.c =================================================================== --- apps/plugins/bubbles.c (revision 19139) +++ apps/plugins/bubbles.c (working copy) @@ -25,9 +25,9 @@ #ifdef HAVE_LCD_BITMAP -#include "xlcd.h" -#include "pluginlib_actions.h" -#include "fixedpoint.h" +#include "lib/xlcd.h" +#include "lib/pluginlib_actions.h" +#include "lib/fixedpoint.h" PLUGIN_HEADER Index: apps/plugins/mosaique.c =================================================================== --- apps/plugins/mosaique.c (revision 19139) +++ apps/plugins/mosaique.c (working copy) @@ -19,7 +19,7 @@ * **************************************************************************/ #include "plugin.h" -#include "playergfx.h" +#include "lib/playergfx.h" PLUGIN_HEADER Index: apps/plugins/test_fps.c =================================================================== --- apps/plugins/test_fps.c (revision 19139) +++ apps/plugins/test_fps.c (working copy) @@ -19,8 +19,8 @@ * ****************************************************************************/ #include "plugin.h" -#include "helper.h" -#include "grey.h" +#include "lib/helper.h" +#include "lib/grey.h" #ifdef HAVE_LCD_BITMAP Index: apps/plugins/robotfindskitten.c =================================================================== --- apps/plugins/robotfindskitten.c (revision 19139) +++ apps/plugins/robotfindskitten.c (working copy) @@ -29,7 +29,7 @@ */ #include "plugin.h" -#include "pluginlib_actions.h" +#include "lib/pluginlib_actions.h" /* This macros must always be included. Should be placed at the top by convention, although the actual position doesn't matter */ @@ -489,6 +489,14 @@ #define ROBOT 0 #define KITTEN 1 +/* if SYSFONT_WIDTH is 0 (which it is during dependency generation) gcc + will abort (div by 0) and this plugin won't get any dependencies +*/ +#if SYSFONT_WIDTH < 1 +#define SYSFONT_WIDTH 10 +#define SYSFONT_HEIGHT 10 +#endif + /*Screen dimensions.*/ #define X_MIN 0 #define X_MAX ((LCD_WIDTH/SYSFONT_WIDTH) - 1) Index: apps/plugins/jewels.c =================================================================== --- apps/plugins/jewels.c (revision 19139) +++ apps/plugins/jewels.c (working copy) @@ -22,7 +22,7 @@ ****************************************************************************/ #include "plugin.h" -#include "playback_control.h" +#include "lib/playback_control.h" #ifdef HAVE_LCD_BITMAP Index: apps/plugins/wormlet.c =================================================================== --- apps/plugins/wormlet.c (revision 19139) +++ apps/plugins/wormlet.c (working copy) @@ -19,8 +19,8 @@ * ****************************************************************************/ #include "plugin.h" -#include "configfile.h" -#include "helper.h" +#include "lib/configfile.h" +#include "lib/helper.h" PLUGIN_HEADER Index: apps/plugins/invadrox.c =================================================================== --- apps/plugins/invadrox.c (revision 19139) +++ apps/plugins/invadrox.c (working copy) @@ -26,8 +26,8 @@ */ #include "plugin.h" -#include "highscore.h" -#include "helper.h" +#include "lib/highscore.h" +#include "lib/helper.h" PLUGIN_HEADER Index: apps/plugins/rockpaint.c =================================================================== --- apps/plugins/rockpaint.c (revision 19139) +++ apps/plugins/rockpaint.c (working copy) @@ -29,7 +29,6 @@ */ #include "plugin.h" -#include "errno.h" #include "lib/bmp.h" #include "lib/rgb_hsv.h" Index: apps/plugins/text_editor.c =================================================================== --- apps/plugins/text_editor.c (revision 19139) +++ apps/plugins/text_editor.c (working copy) @@ -19,7 +19,7 @@ * ****************************************************************************/ #include "plugin.h" -#include "playback_control.h" +#include "lib/playback_control.h" #if PLUGIN_BUFFER_SIZE > 0x45000 #define MAX_CHARS 0x40000 /* 128 kiB */ Index: apps/plugins/pacbox/pacbox.make =================================================================== --- apps/plugins/pacbox/pacbox.make (revision 0) +++ apps/plugins/pacbox/pacbox.make (revision 0) @@ -0,0 +1,18 @@ +PACBOXSRCDIR := $(APPSDIR)/plugins/pacbox +PACBOXBUILDDIR := $(BUILDDIR)/apps/plugins/pacbox + +ROCKS += $(PACBOXBUILDDIR)/pacbox.rock + +PACBOX_SRC := $(call preprocess, $(PACBOXSRCDIR)/SOURCES) +PACBOX_OBJ := $(call c2obj, $(PACBOX_SRC)) + +# add source files to OTHER_SRC to get automatic dependencies +OTHER_SRC += $(PACBOX_SRC) + +PACBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O2 + +$(PACBOXBUILDDIR)/pacbox.rock: $(PACBOX_OBJ) + +$(PACBOXBUILDDIR)/%.o: $(PACBOXSRCDIR)/%.c $(PLUGINBITMAPLIB) $(PACBOXSRCDIR)/pacbox.make + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PACBOXFLAGS) -c $< -o $@ Index: apps/plugins/pacbox/Makefile (deleted) =================================================================== Index: apps/plugins/credits.c =================================================================== --- apps/plugins/credits.c (revision 19139) +++ apps/plugins/credits.c (working copy) @@ -19,7 +19,7 @@ * ****************************************************************************/ #include "plugin.h" -#include "helper.h" +#include "lib/helper.h" PLUGIN_HEADER Index: apps/lang/Makefile (deleted) =================================================================== Index: apps/lang/lang.make =================================================================== --- apps/lang/lang.make (revision 0) +++ apps/lang/lang.make (revision 0) @@ -0,0 +1,25 @@ +LANGS := $(call preprocess, $(APPSDIR)/lang/SOURCES) +LANGOBJ := $(LANGS:$(ROOTDIR)/%.lang=$(BUILDDIR)/%.lng) + +SRC += $(ROOTDIR)/lang.o # yes ROOTDIR. root.make will subst it to BUILDDIR. + +CLEANOBJS += $(BUILDDIR)/max_language_size.h $(BUILDDIR)/lang.* + +# $(BUILDDIR)/apps/lang must exist before we create dependencies on it, +# otherwise make will simply ignore those dependencies. +# Therefore we create it here. +#DUMMY := $(shell mkdir -p $(BUILDDIR)/apps/lang) + +$(BUILDDIR)/max_language_size.h: $(LANGOBJ) + $(call PRINTS,Create $(notdir $@)) + $(SILENT)echo "#define MAX_LANGUAGE_SIZE `ls -ln $(BUILDDIR)/apps/lang/* | awk '{print $$5}' | sort -n | tail -1`" > $@ + +$(BUILDDIR)/lang.o: $(APPSDIR)/lang/$(LANGUAGE).lang $(BUILDDIR)/apps/features + $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \ + perl -s $(TOOLSDIR)/genlang -p=$(BUILDDIR)/lang -t=$(MODELNAME)$$feat $< + $(call PRINTS,CC lang.c)$(CC) $(CFLAGS) -c $(BUILDDIR)/lang.c -o $@ + +$(BUILDDIR)/%.lng : $(ROOTDIR)/%.lang $(BUILDDIR)/apps/genlang-features + $(call PRINTS,GENLANG $(subst $(ROOTDIR)/,,$<)) + $(SILENT)mkdir -p $(dir $@) + $(SILENT)$(TOOLSDIR)/genlang -e=$(APPSDIR)/lang/english.lang -t=$(MODELNAME)`cat $(BUILDDIR)/apps/genlang-features` -i=$(TARGET_ID) -b=$@ $< Index: apps/bitmaps/remote_native/Makefile (deleted) =================================================================== Index: apps/bitmaps/remote_mono/Makefile (deleted) =================================================================== Index: apps/bitmaps/native/Makefile (deleted) =================================================================== Index: apps/bitmaps/mono/Makefile (deleted) =================================================================== Index: apps/bitmaps/bitmaps.make =================================================================== --- apps/bitmaps/bitmaps.make (revision 0) +++ apps/bitmaps/bitmaps.make (revision 0) @@ -0,0 +1,42 @@ +BITMAPDIR = $(ROOTDIR)/apps/bitmaps +BMPINCDIR = $(BUILDDIR)/bitmaps + +INCLUDES += -I$(BMPINCDIR) + +ifneq ($(strip $(BMP2RB_MONO)),) +BMP = $(call preprocess, $(BITMAPDIR)/mono/SOURCES) +endif +ifneq ($(strip $(BMP2RB_NATIVE)),) +BMP += $(call preprocess, $(BITMAPDIR)/native/SOURCES) +endif +ifneq ($(strip $(BMP2RB_REMOTEMONO)),) +BMP += $(call preprocess, $(BITMAPDIR)/remote_mono/SOURCES) +endif +ifneq ($(strip $(BMP2RB_REMOTENATIVE)),) +BMP += $(call preprocess, $(BITMAPDIR)/remote_native/SOURCES) +endif + +BMPOBJ = $(BMP:$(ROOTDIR)/%.bmp=$(BUILDDIR)/%.o) + +BMPHFILES = $(BMPINCDIR)/usblogo.h $(BMPINCDIR)/remote_usblogo.h \ + $(BMPINCDIR)/default_icons.h $(BMPINCDIR)/remote_default_icons.h \ + $(BMPINCDIR)/rockboxlogo.h $(BMPINCDIR)/remote_rockboxlogo.h + +$(BMPHFILES): $(BMPOBJ) + +# pattern rules to create .c files from .bmp, one for each subdir: +$(BUILDDIR)/apps/bitmaps/mono/%.c: $(ROOTDIR)/apps/bitmaps/mono/%.bmp $(TOOLSDIR)/bmp2rb + $(SILENT)mkdir -p $(dir $@) $(BMPINCDIR) + $(call PRINTS,BMP2RB $( $@ + +$(BUILDDIR)/apps/bitmaps/native/%.c: $(ROOTDIR)/apps/bitmaps/native/%.bmp $(TOOLSDIR)/bmp2rb + $(SILENT)mkdir -p $(dir $@) $(BMPINCDIR) + $(call PRINTS,BMP2RB $( $@ + +$(BUILDDIR)/apps/bitmaps/remote_mono/%.c: $(ROOTDIR)/apps/bitmaps/remote_mono/%.bmp $(TOOLSDIR)/bmp2rb + $(SILENT)mkdir -p $(dir $@) $(BMPINCDIR) + $(call PRINTS,BMP2RB $( $@ + +$(BUILDDIR)/apps/bitmaps/remote_native/%.c: $(ROOTDIR)/apps/bitmaps/remote_native/%.bmp $(TOOLSDIR)/bmp2rb + $(SILENT)mkdir -p $(dir $@) $(BMPINCDIR) + $(call PRINTS,BMP2RB $( $@ Index: apps/apps.make =================================================================== --- apps/apps.make (revision 0) +++ apps/apps.make (revision 0) @@ -0,0 +1,16 @@ +INCLUDES += -I$(APPSDIR) $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) +SRC += $(call preprocess, $(APPSDIR)/SOURCES) + +# apps/features.txt is a file that (is preprocessed and) lists named features +# based on defines in the config-*.h files. The named features will be passed +# to genlang and thus (translated) phrases can be used based on those names. +# button.h is included for the HAS_BUTTON_HOLD define. +# +features $(BUILDDIR)/apps/features $(BUILDDIR)/apps/genlang-features: $(APPSDIR)/features.txt + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,PP $( $@; \ + for f in `cat $@`; do feat="$$feat:$$f" ; done ; \ + echo "$$feat" >$(BUILDDIR)/apps/genlang-features Index: apps/debug_menu.c =================================================================== --- apps/debug_menu.c (revision 19139) +++ apps/debug_menu.c (working copy) @@ -114,7 +114,7 @@ #include "usb_core.h" #endif #ifdef USB_STORAGE -#include "../firmware/usbstack/usb_storage.h" +#include "usbstack/usb_storage.h" #endif /*---------------------------------------------------*/ Index: apps/codecs/libffmpegFLAC/decoder.c =================================================================== --- apps/codecs/libffmpegFLAC/decoder.c (revision 19139) +++ apps/codecs/libffmpegFLAC/decoder.c (working copy) @@ -34,7 +34,7 @@ #include #include #ifndef BUILD_STANDALONE -#include "../codec.h" +#include "codeclib.h" #endif #include "bitstream.h" Index: apps/codecs/libffmpegFLAC/tables.c =================================================================== --- apps/codecs/libffmpegFLAC/tables.c (revision 19139) +++ apps/codecs/libffmpegFLAC/tables.c (working copy) @@ -1,7 +1,7 @@ #ifdef BUILD_STANDALONE #define ICONST_ATTR #else -#include "../codec.h" +#include "codeclib.h" #endif #include Index: apps/codecs/libffmpegFLAC/libffmpegFLAC.make =================================================================== --- apps/codecs/libffmpegFLAC/libffmpegFLAC.make (revision 0) +++ apps/codecs/libffmpegFLAC/libffmpegFLAC.make (revision 0) @@ -0,0 +1,8 @@ +# libffmpegFLAC +FFMPEGFLACLIB := $(CODECDIR)/libffmpegFLAC.a +FFMPEGFLACLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libffmpegFLAC/SOURCES) +FFMPEGFLACLIB_OBJ := $(call c2obj, $(FFMPEGFLACLIB_SRC)) +OTHER_SRC += $(FFMPEGFLACLIB_SRC) + +$(FFMPEGFLACLIB): $(FFMPEGFLACLIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 Index: apps/codecs/libffmpegFLAC/Makefile (deleted) =================================================================== Index: apps/codecs/libfaad/Makefile (deleted) =================================================================== Index: apps/codecs/libfaad/libfaad.make =================================================================== --- apps/codecs/libfaad/libfaad.make (revision 0) +++ apps/codecs/libfaad/libfaad.make (revision 0) @@ -0,0 +1,8 @@ +# libfaad +FAADLIB := $(CODECDIR)/libfaad.a +FAADLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libfaad/SOURCES) +FAADLIB_OBJ := $(call c2obj, $(FAADLIB_SRC)) +#OTHER_SRC += $(FAADLIB_SRC) + +$(FAADLIB): $(FAADLIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 Index: apps/codecs/libfaad/common.h =================================================================== --- apps/codecs/libfaad/common.h (revision 19139) +++ apps/codecs/libfaad/common.h (working copy) @@ -33,8 +33,7 @@ #endif #include "faad_config.h" -#include "../codec.h" -#include "../lib/codeclib.h" +#include "codeclib.h" extern struct codec_api* ci; Index: apps/codecs/ape.c =================================================================== --- apps/codecs/ape.c (revision 19139) +++ apps/codecs/ape.c (working copy) @@ -20,7 +20,6 @@ ****************************************************************************/ #include "codeclib.h" -#define ROCKBOX #include CODEC_HEADER Index: apps/codecs/libmad/Makefile (deleted) =================================================================== Index: apps/codecs/libmad/global.h =================================================================== --- apps/codecs/libmad/global.h (revision 19139) +++ apps/codecs/libmad/global.h (working copy) @@ -19,7 +19,7 @@ * $Id$ */ -#include "../codec.h" +#include "codeclib.h" # ifndef LIBMAD_GLOBAL_H # define LIBMAD_GLOBAL_H Index: apps/codecs/libmad/libmad.make =================================================================== --- apps/codecs/libmad/libmad.make (revision 0) +++ apps/codecs/libmad/libmad.make (revision 0) @@ -0,0 +1,45 @@ +# we need to build two different mad libraries +# (one for codec, one for mpegplayer) +# so a little trickery is necessary + +MADFLAGS = $(CODECFLAGS) -UDEBUG -DNDEBUG -I$(APPSDIR)/codecs/libmad +MPEGMADFLAGS = $(MADFLAGS) -DMPEGPLAYER + +# libmad +MADLIB := $(CODECDIR)/libmad.a +MADLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libmad/SOURCES) +MADLIB_OBJ := $(call c2obj, $(MADLIB_SRC)) +OTHER_SRC += $(MADLIB_SRC) + +$(MADLIB): $(MADLIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 + +# libmad-mpeg +MPEGMADLIB := $(CODECDIR)/libmad-mpeg.a +MPEGMADLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libmad/SOURCES) +MPEGMADLIB_OBJ := $(subst .c,.o,$(subst .S,.o,$(subst $(ROOTDIR)/apps/codecs/libmad,$(BUILDDIR)/apps/codecs/libmad-mpeg,$(MPEGMADLIB_SRC)))) + +$(MPEGMADLIB): $(MPEGMADLIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 + +# pattern rules + +$(CODECDIR)/libmad-mpeg/%.o : $(ROOTDIR)/apps/codecs/libmad/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<)) \ + $(CC) $(MPEGMADFLAGS) -c $< -o $@ + +$(CODECDIR)/libmad-mpeg/%.o : $(ROOTDIR)/apps/codecs/libmad/%.S + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<)) \ + $(CC) $(MPEGMADFLAGS) -c $< -o $@ + +$(CODECDIR)/libmad/%.o: $(ROOTDIR)/apps/codecs/libmad/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<)) \ + $(CC) $(MADFLAGS) -c $< -o $@ + +$(CODECDIR)/libmad/%.o: $(ROOTDIR)/apps/codecs/libmad/%.S + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<)) \ + $(CC) $(MADFLAGS) -c $< -o $@ Index: apps/codecs/libmad/frame.c =================================================================== --- apps/codecs/libmad/frame.c (revision 19139) +++ apps/codecs/libmad/frame.c (working copy) @@ -31,7 +31,7 @@ # include "timer.h" # include "layer12.h" # include "layer3.h" -# include "../lib/codeclib.h" +# include "codeclib.h" static unsigned long const bitrate_table[5][15] = { Index: apps/codecs/libmusepack/musepack.h =================================================================== --- apps/codecs/libmusepack/musepack.h (revision 19139) +++ apps/codecs/libmusepack/musepack.h (working copy) @@ -45,7 +45,9 @@ //#include #include -#include "../codec.h" +#ifndef SIMULATOR +#include "codecs.h" +#endif #include "config_types.h" #include "decoder.h" #include "math.h" Index: apps/codecs/libmusepack/libmusepack.make =================================================================== --- apps/codecs/libmusepack/libmusepack.make (revision 0) +++ apps/codecs/libmusepack/libmusepack.make (revision 0) @@ -0,0 +1,20 @@ +# libmusepack +MUSEPACKLIB := $(CODECDIR)/libmusepack.a +MUSEPACKLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libmusepack/SOURCES) +MUSEPACKLIB_OBJ := $(call c2obj, $(MUSEPACKLIB_SRC)) +OTHER_SRC += $(MUSEPACKLIB_SRC) + +$(MUSEPACKLIB): $(MUSEPACKLIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 + +# libmusepack is faster on ARM-targets with -O1 than -O2 +MUSEPACKFLAGS = $(filter-out -O%,$(CODECFLAGS)) -I$(APPSDIR)/codecs/libmusepack +ifeq ($(CPU),arm) + MUSEPACKFLAGS += -O1 +else + MUSEPACKFLAGS += -O2 +endif + +$(CODECDIR)/libmusepack/%.o: $(ROOTDIR)/apps/codecs/libmusepack/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(MUSEPACKFLAGS) -c $< -o $@ Index: apps/codecs/libmusepack/Makefile (deleted) =================================================================== Index: apps/codecs/codec.h (deleted) =================================================================== Index: apps/codecs/lib/libcodec.make =================================================================== --- apps/codecs/lib/libcodec.make (revision 0) +++ apps/codecs/lib/libcodec.make (revision 0) @@ -0,0 +1,14 @@ +CODECLIB := $(CODECDIR)/libcodec.a +CODECLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/lib/SOURCES) +CODECLIB_OBJ := $(call c2obj, $(CODECLIB_SRC)) +OTHER_SRC += $(CODECLIB_SRC) + +$(CODECLIB): $(CODECLIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 + +CODECLIBFLAGS = $(CODECFLAGS) -ffunction-sections + +$(CODECDIR)/lib/%.o: $(ROOTDIR)/apps/codecs/lib/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \ + -I$(dir $<) $(CODECLIBFLAGS) -c $< -o $@ Index: apps/codecs/lib/codeclib.c =================================================================== --- apps/codecs/lib/codeclib.c (revision 19139) +++ apps/codecs/lib/codeclib.c (working copy) @@ -27,8 +27,8 @@ #include "codeclib.h" #include "metadata.h" -long mem_ptr; -long bufsize; +size_t mem_ptr; +size_t bufsize; unsigned char* mp3buf; // The actual MP3 buffer from Rockbox unsigned char* mallocbuf; // 512K from the start of MP3 buffer unsigned char* filebuf; // The rest of the MP3 buffer Index: apps/codecs/lib/codeclib.h =================================================================== --- apps/codecs/lib/codeclib.h (revision 19139) +++ apps/codecs/lib/codeclib.h (working copy) @@ -25,14 +25,23 @@ #include extern struct codec_api *ci; -extern long mem_ptr; -extern long bufsize; +extern size_t mem_ptr; +extern size_t bufsize; extern unsigned char* mp3buf; /* The actual MP3 buffer from Rockbox */ extern unsigned char* mallocbuf; /* The free space after the codec in the codec buffer */ extern unsigned char* filebuf; /* The rest of the MP3 buffer */ /* Standard library functions that are used by the codecs follow here */ +/* Get these functions 'out of the way' of the standard functions. Not doing + * so confuses the cygwin linker, and maybe others. These functions need to + * be implemented elsewhere */ +#define malloc(x) codec_malloc(x) +#define calloc(x,y) codec_calloc(x,y) +#define realloc(x,y) codec_realloc(x,y) +#define free(x) codec_free(x) +#define alloca(x) __builtin_alloca(x) + void* codec_malloc(size_t size); void* codec_calloc(size_t nmemb, size_t size); void* codec_realloc(void* ptr, size_t size); Index: apps/codecs/lib/Makefile (deleted) =================================================================== Index: apps/codecs/libwma/libwma.make =================================================================== --- apps/codecs/libwma/libwma.make (revision 0) +++ apps/codecs/libwma/libwma.make (revision 0) @@ -0,0 +1,8 @@ +# libwma +WMALIB := $(CODECDIR)/libwma.a +WMALIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libwma/SOURCES) +WMALIB_OBJ := $(call c2obj, $(WMALIB_SRC)) +OTHER_SRC += $(WMALIB_SRC) + +$(WMALIB): $(WMALIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 Index: apps/codecs/libwma/Makefile (deleted) =================================================================== Index: apps/codecs/codecs.make =================================================================== --- apps/codecs/codecs.make (revision 0) +++ apps/codecs/codecs.make (revision 0) @@ -0,0 +1,93 @@ +CODECDIR = $(BUILDDIR)/apps/codecs +CODECS_SRC := $(call preprocess, $(APPSDIR)/codecs/SOURCES) +OTHER_SRC += $(CODECS_SRC) + +CODECS := $(CODECS_SRC:.c=.codec) +CODECS := $(subst $(ROOTDIR),$(BUILDDIR),$(CODECS)) + +# the codec helper library +include $(APPSDIR)/codecs/lib/libcodec.make + +# the codec libraries +include $(APPSDIR)/codecs/demac/libdemac.make +include $(APPSDIR)/codecs/liba52/liba52.make +include $(APPSDIR)/codecs/libalac/libalac.make +include $(APPSDIR)/codecs/libasap/libasap.make +include $(APPSDIR)/codecs/libfaad/libfaad.make +include $(APPSDIR)/codecs/libffmpegFLAC/libffmpegFLAC.make +include $(APPSDIR)/codecs/libm4a/libm4a.make +include $(APPSDIR)/codecs/libmad/libmad.make +include $(APPSDIR)/codecs/libmusepack/libmusepack.make +include $(APPSDIR)/codecs/libspc/libspc.make +include $(APPSDIR)/codecs/libspeex/libspeex.make +include $(APPSDIR)/codecs/libtremor/libtremor.make +include $(APPSDIR)/codecs/libwavpack/libwavpack.make +include $(APPSDIR)/codecs/libwma/libwma.make + +# compile flags for codecs +CODECFLAGS = $(CFLAGS) -I$(APPSDIR)/codecs -I$(APPSDIR)/codecs/lib \ + -DCODEC + +CODEC_LDS := $(APPSDIR)/plugins/plugin.lds # codecs and plugins use same file +CODECLINK_LDS := $(CODECDIR)/codec.link +CODEC_CRT0 := $(CODECDIR)/codec_crt0.o + +CODECLIBS := $(DEMACLIB) $(A52LIB) $(ALACLIB) $(ASAPLIB) \ + $(FAADLIB) $(FFMPEGFLACLIB) $(M4ALIB) $(MADLIB) $(MUSEPACKLIB) \ + $(SPCLIB) $(SPEEXLIB) $(TREMORLIB) $(WAVPACKLIB) $(WMALIB) \ + $(CODECLIB) + +$(CODECS): $(CODEC_CRT0) $(CODECLINK_LDS) + +$(CODECLINK_LDS): $(CODEC_LDS) + $(call PRINTS,PP $(@F))$(CC) $(CODECFLAGS) -E -P -x c $< >$@ + +# codec/library dependencies +$(CODECDIR)/spc.codec : $(CODECDIR)/libspc.a +$(CODECDIR)/mpa.codec : $(CODECDIR)/libmad.a +$(CODECDIR)/a52.codec : $(CODECDIR)/liba52.a +$(CODECDIR)/flac.codec : $(CODECDIR)/libffmpegFLAC.a +$(CODECDIR)/vorbis.codec : $(CODECDIR)/libtremor.a +$(CODECDIR)/speex.codec : $(CODECDIR)/libspeex.a +$(CODECDIR)/mpc.codec : $(CODECDIR)/libmusepack.a +$(CODECDIR)/wavpack.codec : $(CODECDIR)/libwavpack.a +$(CODECDIR)/alac.codec : $(CODECDIR)/libalac.a $(CODECDIR)/libm4a.a +$(CODECDIR)/aac.codec : $(CODECDIR)/libfaad.a $(CODECDIR)/libm4a.a +$(CODECDIR)/shorten.codec : $(CODECDIR)/libffmpegFLAC.a +$(CODECDIR)/ape.codec : $(CODECDIR)/libdemac.a +$(CODECDIR)/wma.codec : $(CODECDIR)/libwma.a +$(CODECDIR)/wavpack_enc.codec: $(CODECDIR)/libwavpack.a +$(CODECDIR)/asap.codec : $(CODECDIR)/libasap.a + +$(CODECS): $(CODECLIB) # this must be last in codec dependency list + +# libfaad and libmusepack both contain a huffman.h file, with different +# content. So we compile them with special command lines: + +# pattern rule for compiling codecs +$(CODECDIR)/%.o: $(ROOTDIR)/apps/codecs/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \ + -I$(dir $<) $(CODECFLAGS) -c $< -o $@ + +# pattern rule for compiling codecs +$(CODECDIR)/%.o: $(ROOTDIR)/apps/codecs/%.S + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \ + -I$(dir $<) $(CODECFLAGS) -c $< -o $@ + +ifdef SIMVER + CODECLDFLAGS = $(SHARED_FLAG) # <-- from Makefile +else + CODECLDFLAGS = -T$(CODECLINK_LDS) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map + CODECFLAGS += -UDEBUG -DNDEBUG +endif + +$(CODECDIR)/%.codec: $(CODECDIR)/%.o + $(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/$*.elf \ + $(filter %.o, $^) \ + $(filter %.a, $^) \ + -lgcc $(CODECLDFLAGS) + $(call PRINTS,OC $(@F))$(OC) -O binary $(CODECDIR)/$*.elf $@ + + Index: apps/codecs/Makefile (deleted) =================================================================== Index: apps/codecs/liba52/config-a52.h =================================================================== --- apps/codecs/liba52/config-a52.h (revision 19139) +++ apps/codecs/liba52/config-a52.h (working copy) @@ -1,4 +1,4 @@ -#include "../codec.h" +#include "codeclib.h" /* a52dec profiling */ /* #undef A52DEC_GPROF */ Index: apps/codecs/liba52/liba52.make =================================================================== --- apps/codecs/liba52/liba52.make (revision 0) +++ apps/codecs/liba52/liba52.make (revision 0) @@ -0,0 +1,8 @@ +# liba52 +A52LIB := $(CODECDIR)/liba52.a +A52LIB_SRC := $(call preprocess, $(APPSDIR)/codecs/liba52/SOURCES) +A52LIB_OBJ := $(call c2obj, $(A52LIB_SRC)) +OTHER_SRC += $(A52LIB_SRC) + +$(A52LIB): $(A52LIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 Index: apps/codecs/liba52/Makefile (deleted) =================================================================== Index: apps/codecs/libwavpack/wavpack.h =================================================================== --- apps/codecs/libwavpack/wavpack.h (revision 19139) +++ apps/codecs/libwavpack/wavpack.h (working copy) @@ -7,9 +7,9 @@ //////////////////////////////////////////////////////////////////////////// // wavpack.h - -#include "../codec.h" - +#ifdef CODEC +#include "codeclib.h" +#endif #include // This header file contains all the definitions required by WavPack. Index: apps/codecs/libwavpack/libwavpack.make =================================================================== --- apps/codecs/libwavpack/libwavpack.make (revision 0) +++ apps/codecs/libwavpack/libwavpack.make (revision 0) @@ -0,0 +1,8 @@ +# libwavpack +WAVPACKLIB := $(CODECDIR)/libwavpack.a +WAVPACKLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libwavpack/SOURCES) +WAVPACKLIB_OBJ := $(call c2obj, $(WAVPACKLIB_SRC)) +OTHER_SRC += $(WAVPACKLIB_SRC) + +$(WAVPACKLIB): $(WAVPACKLIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 Index: apps/codecs/libwavpack/Makefile (deleted) =================================================================== Index: apps/codecs/libalac/alac.c =================================================================== --- apps/codecs/libalac/alac.c (revision 19139) +++ apps/codecs/libalac/alac.c (working copy) @@ -35,7 +35,7 @@ #include #include -#include "../codec.h" +#include "codeclib.h" #include "decomp.h" int16_t predictor_coef_table[32] IBSS_ATTR; Index: apps/codecs/libalac/libalac.make =================================================================== --- apps/codecs/libalac/libalac.make (revision 0) +++ apps/codecs/libalac/libalac.make (revision 0) @@ -0,0 +1,15 @@ +# libalac +ALACLIB := $(CODECDIR)/libalac.a +ALACLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libalac/SOURCES) +ALACLIB_OBJ := $(call c2obj, $(ALACLIB_SRC)) +OTHER_SRC += $(ALACLIB_SRC) + +$(ALACLIB): $(ALACLIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 + +ALACFLAGS = $(filter-out -O%,$(CODECFLAGS)) +ALACFLAGS += -O3 + +$(CODECDIR)/libalac/%.o: $(ROOTDIR)/apps/codecs/libalac/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(ALACFLAGS) -c $< -o $@ Index: apps/codecs/libalac/Makefile (deleted) =================================================================== Index: apps/codecs/libtremor/config-tremor.h =================================================================== --- apps/codecs/libtremor/config-tremor.h (revision 19139) +++ apps/codecs/libtremor/config-tremor.h (working copy) @@ -1,4 +1,4 @@ -#include "../codec.h" +#include "codeclib.h" #ifdef CPU_ARM #define _ARM_ASSEM_ #endif Index: apps/codecs/libtremor/Makefile (deleted) =================================================================== Index: apps/codecs/libtremor/oggmalloc.c =================================================================== --- apps/codecs/libtremor/oggmalloc.c (revision 19139) +++ apps/codecs/libtremor/oggmalloc.c (working copy) @@ -1,7 +1,6 @@ #include -static unsigned char *mallocbuf; -static size_t bufsize, tmp_ptr, mem_ptr; +static size_t tmp_ptr; void ogg_malloc_init(void) { Index: apps/codecs/libtremor/ctype.c =================================================================== --- apps/codecs/libtremor/ctype.c (revision 19139) +++ apps/codecs/libtremor/ctype.c (working copy) @@ -1 +1 @@ -#include "../../../firmware/common/ctype.c" +#include "common/ctype.c" Index: apps/codecs/libtremor/libtremor.make =================================================================== --- apps/codecs/libtremor/libtremor.make (revision 0) +++ apps/codecs/libtremor/libtremor.make (revision 0) @@ -0,0 +1,27 @@ +# libtremor +TREMORLIB := $(CODECDIR)/libtremor.a +TREMORLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libtremor/SOURCES) +TREMORLIB_OBJ := $(call c2obj, $(TREMORLIB_SRC)) +OTHER_SRC += $(TREMORLIB_SRC) + +$(TREMORLIB): $(TREMORLIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 + +$(CODECDIR)/libtremor/%.o: $(ROOTDIR)/apps/codecs/libtremor/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \ + -I$(APPSDIR)/codecs/libtremor \ + $(CODECFLAGS) $(CFLAGS) -c $< -o $@ + +TREMORFLAGS = -I$(APPSDIR)/codecs/libtremor $(filter-out -O%,$(CODECFLAGS)) + +# Tremor is slightly faster on coldfire with -O3 +ifeq ($(CPU),coldfire) + TREMORFLAGS += -O3 +else + TREMORFLAGS += -O2 +endif + +$(CODECDIR)/libtremor/%.o: $(ROOTDIR)/apps/codecs/libtremor/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(TREMORFLAGS) -c $< -o $@ Index: apps/codecs/wma.c =================================================================== --- apps/codecs/wma.c (revision 19139) +++ apps/codecs/wma.c (working copy) @@ -464,7 +464,7 @@ int wmares, res; uint8_t* audiobuf; int audiobufsize; - int packetlength; + int packetlength = 0; int errcount = 0; /* Generic codec initialisation */ Index: apps/codecs/libm4a/m4a.c =================================================================== --- apps/codecs/libm4a/m4a.c (revision 19139) +++ apps/codecs/libm4a/m4a.c (working copy) @@ -23,13 +23,6 @@ #include #include "m4a.h" -#if defined(DEBUG) || defined(SIMULATOR) -extern struct codec_api* rb; -#define DEBUGF rb->debugf -#else -#define DEBUGF(...) -#endif - /* Implementation of the stream.h functions used by libalac */ #define _Swap32(v) do { \ Index: apps/codecs/libm4a/demux.c =================================================================== --- apps/codecs/libm4a/demux.c (revision 19139) +++ apps/codecs/libm4a/demux.c (working copy) @@ -33,11 +33,14 @@ #include #include -#include "../codec.h" +#include "codeclib.h" #include "m4a.h" #if defined(DEBUG) || defined(SIMULATOR) +#ifdef DEBUGF +#undef DEBUGF +#endif #define DEBUGF qtmovie->stream->ci->debugf #else #define DEBUGF(...) Index: apps/codecs/libm4a/libm4a.make =================================================================== --- apps/codecs/libm4a/libm4a.make (revision 0) +++ apps/codecs/libm4a/libm4a.make (revision 0) @@ -0,0 +1,15 @@ +# libm4a +M4ALIB := $(CODECDIR)/libm4a.a +M4ALIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libm4a/SOURCES) +M4ALIB_OBJ := $(call c2obj, $(M4ALIB_SRC)) +OTHER_SRC += $(M4ALIB_SRC) + +$(M4ALIB): $(M4ALIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 + +M4AFLAGS = $(filter-out -O%,$(CODECFLAGS)) +M4AFLAGS += -O3 + +$(CODECDIR)/libm4a/%.o: $(ROOTDIR)/apps/codecs/libm4a/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(M4AFLAGS) -c $< -o $@ Index: apps/codecs/libm4a/Makefile (deleted) =================================================================== Index: apps/codecs/demac/libdemac/demac_config.h =================================================================== --- apps/codecs/demac/libdemac/demac_config.h (revision 19139) +++ apps/codecs/demac/libdemac/demac_config.h (working copy) @@ -33,7 +33,7 @@ #include "config.h" #ifndef __ASSEMBLER__ -#include "../lib/codeclib.h" +#include "codeclib.h" #include #endif Index: apps/codecs/demac/libdemac.make =================================================================== --- apps/codecs/demac/libdemac.make (revision 0) +++ apps/codecs/demac/libdemac.make (revision 0) @@ -0,0 +1,15 @@ +# libdemac +DEMACLIB := $(CODECDIR)/libdemac.a +DEMACLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/demac/libdemac/SOURCES) +DEMACLIB_OBJ := $(call c2obj, $(DEMACLIB_SRC)) +OTHER_SRC += $(DEMACLIB_SRC) + +$(DEMACLIB): $(DEMACLIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 + +DEMACFLAGS = $(filter-out -O%,$(CODECFLAGS)) +DEMACFLAGS += -O3 + +$(CODECDIR)/demac/%.o: $(ROOTDIR)/apps/codecs/demac/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(DEMACFLAGS) -c $< -o $@ Index: apps/codecs/libspeex/speex/ogg.h =================================================================== --- apps/codecs/libspeex/speex/ogg.h (revision 19139) +++ apps/codecs/libspeex/speex/ogg.h (working copy) @@ -21,7 +21,7 @@ extern "C" { #endif -#include "../../codec.h" +#include "codeclib.h" typedef short spx_ogg_int16_t; typedef unsigned short spx_ogg_uint16_t; Index: apps/codecs/libspeex/libspeex.make =================================================================== --- apps/codecs/libspeex/libspeex.make (revision 0) +++ apps/codecs/libspeex/libspeex.make (revision 0) @@ -0,0 +1,51 @@ +# we need to build two different speex libraries +# (one for codec, one for core voice) +# so a little trickery is necessary + +SPEEXFLAGS = $(filter-out -O%,$(CODECFLAGS)) \ + -DHAVE_CONFIG_H -DSPEEX_DISABLE_ENCODER \ + -I$(APPSDIR)/codecs/libspeex + +# libspeex is faster on ARM-targets with -O1 instead of -O2 +ifeq ($(CPU),arm) + SPEEXFLAGS += -O1 +else + SPEEXFLAGS += -O2 +endif + +VOICESPEEXFLAGS = $(filter-out -ffunction-sections, $(filter-out -DCODEC,$(SPEEXFLAGS))) -DROCKBOX_VOICE_CODEC + +# libspeex +SPEEXLIB := $(CODECDIR)/libspeex.a +SPEEXLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libspeex/SOURCES) +SPEEXLIB_OBJ := $(call c2obj, $(SPEEXLIB_SRC)) +OTHER_SRC += $(SPEEXLIB_SRC) + +$(SPEEXLIB): $(SPEEXLIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 + +# libspeex-voice +VOICESPEEXLIB := $(CODECDIR)/libspeex-voice.a +VOICESPEEXLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libspeex/SOURCES) +VOICESPEEXLIB_OBJ := $(subst .c,.o,$(subst .S,.o,$(subst $(ROOTDIR)/apps/codecs/libspeex,$(BUILDDIR)/apps/codecs/libspeex-voice,$(VOICESPEEXLIB_SRC)))) + +$(VOICESPEEXLIB): $(VOICESPEEXLIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 + +# pattern rules + +$(CODECDIR)/libspeex-voice/%.o : $(ROOTDIR)/apps/codecs/libspeex/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(VOICESPEEXFLAGS) -c $< -o $@ + +$(CODECDIR)/libspeex-voice/%.o : $(ROOTDIR)/apps/codecs/libspeex/%.S + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(VOICESPEEXFLAGS) -c $< -o $@ + +$(CODECDIR)/libspeex/%.o: $(ROOTDIR)/apps/codecs/libspeex/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SPEEXFLAGS) -c $< -o $@ + +$(CODECDIR)/libspeex/%.o: $(ROOTDIR)/apps/codecs/libspeex/%.S + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SPEEXFLAGS) -c $< -o $@ Index: apps/codecs/libspeex/cb_search.c =================================================================== --- apps/codecs/libspeex/cb_search.c (revision 19139) +++ apps/codecs/libspeex/cb_search.c (working copy) @@ -522,6 +522,9 @@ spx_int32_t *seed ) { + (void)nsf; + (void)stack; + (void)seed; int i,j; VARDECL(int *ind); VARDECL(int *signs); @@ -609,6 +612,9 @@ spx_int32_t *seed ) { + (void)par; + (void)bits; + (void)stack; int i; /* FIXME: This is bad, but I don't think the function ever gets called anyway */ for (i=0;i63) Index: apps/codecs/libspeex/filters.c =================================================================== --- apps/codecs/libspeex/filters.c (revision 19139) +++ apps/codecs/libspeex/filters.c (working copy) @@ -353,6 +353,7 @@ #ifndef OVERRIDE_IIR_MEM16 void iir_mem16(const spx_word16_t *x, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack) { + (void)stack; int i,j; spx_word16_t yi,nyi; @@ -497,6 +498,7 @@ all odd x[i] are zero -- well, actually they are left out of the array now N and M are multiples of 4 */ { + (void)stack; int i, j; int M2, N2; VARDECL(spx_word16_t *xx1); @@ -681,6 +683,9 @@ char *stack ) { + (void)ak; + (void)p; + (void)stack; int i; VARDECL(spx_word16_t *iexc); spx_word16_t old_ener, new_ener; Index: apps/codecs/libspeex/rockbox.h =================================================================== --- apps/codecs/libspeex/rockbox.h (revision 19139) +++ apps/codecs/libspeex/rockbox.h (working copy) @@ -24,8 +24,7 @@ /* We don't want all this stuff if we're building encoder */ #ifndef ROCKBOX_VOICE_ENCODER -#include "../codec.h" -#include "../lib/codeclib.h" +#include "codeclib.h" #include "debug.h" #if !defined(ROCKBOX_VOICE_CODEC) @@ -35,6 +34,7 @@ #define DEBUGF ci->debugf #endif + #ifdef ROCKBOX_HAS_LOGF #undef LOGF #define LOGF ci->logf @@ -75,6 +75,9 @@ #define OVERRIDE_SPEEX_FATAL 1 static inline void _speex_fatal(const char *str, const char *file, int line) { + (void)str; + (void)file; + (void)line; DEBUGF("Fatal error: %s\n", str); //exit(1); } @@ -82,24 +85,30 @@ #define OVERRIDE_SPEEX_WARNING 1 static inline void speex_warning(const char *str) { + (void)str; DEBUGF("warning: %s\n", str); } #define OVERRIDE_SPEEX_WARNING_INT 1 static inline void speex_warning_int(const char *str, int val) { + (void)str; + (void)val; DEBUGF("warning: %s %d\n", str, val); } #define OVERRIDE_SPEEX_NOTIFY 1 static inline void speex_notify(const char *str) { + (void)str; DEBUGF("notice: %s\n", str); } #define OVERRIDE_SPEEX_PUTC 1 static inline void _speex_putc(int ch, void *file) { + (void)ch; + (void)file; //FILE *f = (FILE *)file; //printf("%c", ch); } Index: apps/codecs/libspeex/ltp_arm4.h =================================================================== --- apps/codecs/libspeex/ltp_arm4.h (revision 19139) +++ apps/codecs/libspeex/ltp_arm4.h (working copy) @@ -87,6 +87,7 @@ #define OVERRIDE_PITCH_XCORR void pitch_xcorr(const spx_word16_t *_x, const spx_word16_t *_y, spx_word32_t *corr, int len, int nb_pitch, char *stack) { + (void)stack; int i,j; for (i=0;i/dev/null 2>&1 + +ASAPFLAGS = $(filter-out -O%,$(CODECFLAGS)) +ASAPFLAGS += -O1 + +$(CODECDIR)/libasap/%.o: $(ROOTDIR)/apps/codecs/libasap/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(ASAPFLAGS) -c $< -o $@ Index: apps/codecs/libasap/Makefile (deleted) =================================================================== Index: apps/codecs/libspc/spc_codec.h =================================================================== --- apps/codecs/libspc/spc_codec.h (revision 19139) +++ apps/codecs/libspc/spc_codec.h (working copy) @@ -30,7 +30,9 @@ #define _SPC_CODEC_H_ /* rather than comment out asserts, just define NDEBUG */ +#ifndef NDEBUG #define NDEBUG +#endif #include /** Basic configuration options **/ Index: apps/codecs/libspc/spc_profiler.c =================================================================== --- apps/codecs/libspc/spc_profiler.c (revision 19139) +++ apps/codecs/libspc/spc_profiler.c (working copy) @@ -25,7 +25,7 @@ #if defined(SPC_PROFILE) && defined(USEC_TIMER) -#include "codec.h" +#include "codeclib.h" #include "spc_codec.h" #define SPC_DEFINE_PROFILER_TIMERS #include "spc_profiler.h" Index: apps/codecs/libspc/libspc.make =================================================================== --- apps/codecs/libspc/libspc.make (revision 0) +++ apps/codecs/libspc/libspc.make (revision 0) @@ -0,0 +1,15 @@ +# libspc +SPCLIB := $(CODECDIR)/libspc.a +SPCLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libspc/SOURCES) +SPCLIB_OBJ := $(call c2obj, $(SPCLIB_SRC)) +OTHER_SRC += $(SPCLIB_SRC) + +$(SPCLIB): $(SPCLIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 + +SPCFLAGS = $(filter-out -O%,$(CODECFLAGS)) +SPCFLAGS += -O1 + +$(CODECDIR)/libspc/%.o: $(ROOTDIR)/apps/codecs/libspc/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SPCFLAGS) -c $< -o $@ Index: apps/codecs/libspc/spc_dsp.c =================================================================== --- apps/codecs/libspc/spc_dsp.c (revision 19139) +++ apps/codecs/libspc/spc_dsp.c (working copy) @@ -23,8 +23,7 @@ ****************************************************************************/ /* The DSP portion (awe!) */ -#include "codec.h" -#include "codecs.h" +#include "codeclib.h" #include "spc_codec.h" #include "spc_profiler.h" Index: apps/codecs/libspc/spc_emu.c =================================================================== --- apps/codecs/libspc/spc_emu.c (revision 19139) +++ apps/codecs/libspc/spc_emu.c (working copy) @@ -20,8 +20,7 @@ * KIND, either express or implied. * ****************************************************************************/ -#include "codec.h" -#include "codecs.h" +#include "codeclib.h" #include "spc_codec.h" #include "spc_profiler.h" Index: apps/codecs/libspc/Makefile (deleted) =================================================================== Index: apps/codecs/libspc/spc_cpu.c =================================================================== --- apps/codecs/libspc/spc_cpu.c (revision 19139) +++ apps/codecs/libspc/spc_cpu.c (working copy) @@ -22,8 +22,7 @@ ****************************************************************************/ /* The CPU portion (shock!) */ -#include "codec.h" -#include "codecs.h" +#include "codeclib.h" #include "spc_codec.h" #include "spc_profiler.h" Index: firmware/export/debug.h =================================================================== --- firmware/export/debug.h (revision 19139) +++ firmware/export/debug.h (working copy) @@ -28,6 +28,7 @@ extern void ldebugf(const char* file, int line, const char *fmt, ...) ATTRIBUTE_PRINTF(3, 4); +#ifndef CODEC #ifdef __GNUC__ /* */ @@ -57,5 +58,5 @@ #endif /* GCC */ - +#endif /* CODEC */ #endif Index: firmware/export/config-mrobe500.h =================================================================== --- firmware/export/config-mrobe500.h (revision 19139) +++ firmware/export/config-mrobe500.h (working copy) @@ -147,8 +147,7 @@ /* Define this if you have a Motorola SCF5249 */ #define CONFIG_CPU DM320 -/* Define this if you want to use coldfire's i2c interface */ -//#define CONFIG_I2C I2C_S3C2440 +#define CONFIG_I2C I2C_DM320 /* define this if the hardware can be powered off while charging */ #define HAVE_POWEROFF_WHILE_CHARGING Index: firmware/decompressor/Makefile =================================================================== --- firmware/decompressor/Makefile (revision 19139) +++ firmware/decompressor/Makefile (working copy) @@ -27,6 +27,7 @@ $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/compressed.map $(LINKFILE): $(LDS) + $(SILENT)mkdir -p $(dir $@) $(call PRINTS,Build LDS file)cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@ $(OBJDIR)/decompressor.o : decompressor.c $(OBJDIR)/uclimage.c Index: firmware/Makefile (deleted) =================================================================== Index: firmware/firmware.make =================================================================== --- firmware/firmware.make (revision 0) +++ firmware/firmware.make (revision 0) @@ -0,0 +1,30 @@ +INCLUDES += -I$(FIRMDIR) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers + +FIRMLIB_SRC += $(call preprocess, $(FIRMDIR)/SOURCES) +FIRMLIB_SRC += $(ROOTDIR)/sysfont.o +FIRMLIB_OBJ := $(call c2obj, $(FIRMLIB_SRC)) +OTHER_SRC += $(FIRMLIB_SRC) + +FIRMLIB = $(BUILDDIR)/firmware/libfirmware.a + +SYSFONT = $(ROOTDIR)/fonts/08-Schumacher-Clean.bdf + +CLEANOBJS += $(BUILDDIR)/sysfont.* + +# Limits for the built-in sysfont: ASCII for bootloaders, ISO8859-1 for normal builds +ifneq (,$(findstring -DBOOTLOADER,$(EXTRA_DEFINES))) + MAXCHAR = 127 +else + MAXCHAR = 255 +endif + +$(FIRMLIB): $(FIRMLIB_OBJ) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 + +$(BUILDDIR)/sysfont.h: $(SYSFONT) $(TOOLS) + $(call PRINTS,CONVBDF $(subst $(ROOTDIR)/,,$<))$(TOOLSDIR)/convbdf -l $(MAXCHAR) -h -o $@ $< + +$(BUILDDIR)/sysfont.o: $(SYSFONT) $(BUILDDIR)/sysfont.h + $(call PRINTS,CONVBDF $(subst $(ROOTDIR)/,,$<))$(TOOLSDIR)/convbdf -l $(MAXCHAR) -c -o $(BUILDDIR)/sysfont.c $< + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$(BUILDDIR)/sysfont.c))$(CC) $(CFLAGS) -c $(BUILDDIR)/sysfont.c -o $@ + Index: uisimulator/sdl/uisdl.h =================================================================== --- uisimulator/sdl/uisdl.h (revision 19139) +++ uisimulator/sdl/uisdl.h (working copy) @@ -23,7 +23,7 @@ #define __UISDL_H__ #include -#include "SDL.h" +#include /* colour definitions are R, G, B */ Index: uisimulator/uisimulator.make =================================================================== --- uisimulator/uisimulator.make (revision 0) +++ uisimulator/uisimulator.make (revision 0) @@ -0,0 +1,35 @@ +ifeq ($(SIMVER), win32) +# OK, this is ugly but we need it on the link line to make it do right +EXTRAOBJ = $(BUILDDIR)/sim/uisw32-res.o +LDOPTS += -lwinmm +endif + +INCLUDES += -I$(ROOTDIR)/uisimulator/sdl -I$(ROOTDIR)/uisimulator/common \ + +SIMINCLUDES += -I$(ROOTDIR)/uisimulator/sdl -I$(ROOTDIR)/uisimulator/common \ + -I$(FIRMDIR)/export $(TARGET_INC) -I$(BUILDDIR) -I$(APPSDIR) + +SIMFLAGS += $(SIMINCLUDES) $(DEFINES) -DHAVE_CONFIG_H $(GCCOPTS) + +SIMSRC += $(call preprocess, $(ROOTDIR)/uisimulator/sdl/SOURCES) +SIMSRC += $(call preprocess, $(ROOTDIR)/uisimulator/common/SOURCES) +SIMOBJ = $(call c2obj,$(SIMSRC)) +OTHER_SRC += $(SIMSRC) + +SIMLIB = $(BUILDDIR)/uisimulator/libuisimulator.a +UIBMP = $(BUILDDIR)/uisimulator/UI256.bmp + +.SECONDEXPANSION: # $$(OBJ) is not populated until after this + +$(SIMLIB): $$(SIMOBJ) $(UIBMP) + $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 + +$(BUILDDIR)/$(BINARY): $$(OBJ) $(SIMLIB) $(VOICESPEEXLIB) $(FIRMLIB) + $(call PRINTS,LD $(BINARY))$(CC) $(LDOPTS) -o $@ $^ + +$(BUILDDIR)/uisimulator/%.o: $(ROOTDIR)/uisimulator/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SIMFLAGS) -c $< -o $@ + +$(UIBMP): $(ROOTDIR)/uisimulator/sdl/UI-$(MODELNAME).bmp + $(call PRINTS,CP $(@F))cp $< $@