From 6e075ebc9e7ad907e79a42096d816a7a94cf5596 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Thu, 23 Feb 2006 10:02:48 +0000 Subject: Add chessbox to the build system (currently only for iRiver H1x0/H3x0 and iPods - it is too large for the Archos plugin buffer) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8798 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/Makefile | 12 ++++++++++-- apps/plugins/chessbox/Makefile | 10 +++++----- apps/plugins/chessbox/chessbox.c | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) (limited to 'apps/plugins') diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile index 404f1662e2..3da2d46895 100644 --- a/apps/plugins/Makefile +++ b/apps/plugins/Makefile @@ -69,6 +69,13 @@ ifneq (-DIRIVER_IFP7XX,$(TARGET)) endif endif +# chessbox is too big to fit in the 32KB Archos plugin buffer, so we only +# build for IRIVER and IPOD targets +ifneq (,$(strip $(foreach tgt,IRIVER IPOD,$(findstring $(tgt),$(TARGET))))) +ifneq (-DIRIVER_IFP7XX,$(TARGET)) + SUBDIRS += chessbox +endif +endif .PHONY: $(SUBDIRS) all: $(BUILDDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE) @@ -186,10 +193,11 @@ $(LINKFILE): $(LDS) @echo "build $@" $(SILENT)cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P - >$@ -$(SUBDIRS): +$(SUBDIRS): $(BITMAPLIBS) @echo "MAKE in $@" $(SILENT)mkdir -p $(OBJDIR)/$@ - $(SILENT)$(MAKE) -C $@ OUTDIR=$(OBJDIR) OBJDIR=$(OBJDIR)/$@ + $(SILENT)$(MAKE) -C $@ OUTDIR=$(OBJDIR) OBJDIR=$(OBJDIR)/$@ \ + LINKBITMAPS="$(LINKBITMAPS)" BITMAPLIBS="$(BITMAPLIBS)" clean: @echo "cleaning plugins" diff --git a/apps/plugins/chessbox/Makefile b/apps/plugins/chessbox/Makefile index 3d9f024ba3..be75b2c5e1 100644 --- a/apps/plugins/chessbox/Makefile +++ b/apps/plugins/chessbox/Makefile @@ -30,10 +30,10 @@ OUTPUT = $(OUTDIR)/chessbox.rock all: $(OUTPUT) ifndef SIMVER -$(OBJDIR)/chessbox.elf: $(OBJS) $(LINKFILE) +$(OBJDIR)/chessbox.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS) @echo "LD "`basename $@` @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \ - -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/chessbox.map + $(LINKBITMAPS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/chessbox.map $(OUTPUT): $(OBJDIR)/chessbox.elf @echo "OBJCOPY "`basename $@` @@ -46,7 +46,7 @@ ifeq ($(SIMVER), x11) $(OUTPUT): $(OBJS) @echo "LD $<" - @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@ + @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@ ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) # 'x' must be kept or you'll have "Win32 error 5" # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 @@ -62,7 +62,7 @@ ifeq ($(SIMVER), sdl) $(OUTPUT): $(OBJS) @echo "LD $<" - @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@ + @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@ ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) # 'x' must be kept or you'll have "Win32 error 5" # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 @@ -81,7 +81,7 @@ $(OUTPUT): $(OBJS) @echo "DLL "`basename $@` @$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS) @$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \ - $(BUILDDIR)/libplugin.a -o $@ + $(BUILDDIR)/libplugin.a $(BITMAPLIBS) -o $@ ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) # 'x' must be kept or you'll have "Win32 error 5" # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c index 6cf77b4347..d16497dc6a 100644 --- a/apps/plugins/chessbox/chessbox.c +++ b/apps/plugins/chessbox/chessbox.c @@ -292,7 +292,7 @@ struct cb_command cb_getcommand (void) { int button = BUTTON_NONE; int marked = false , from_marked = false ; short marked_x = 0 , marked_y = 0 ; - struct cb_command result; + struct cb_command result = { 0, {0,0,0,0,0}, 0 }; cb_switch ( x , y ); /* main loop */ -- cgit v1.2.3