summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/Makefile180
-rw-r--r--apps/plugins/beatbox/Makefile74
-rw-r--r--apps/plugins/bitmaps/mono/Makefile32
-rw-r--r--apps/plugins/bitmaps/native/Makefile32
-rw-r--r--apps/plugins/bitmaps/native/SOURCES48
-rw-r--r--apps/plugins/bitmaps/native/star_tiles.10x10x2.bmp (renamed from apps/plugins/bitmaps/native/star_tiles.10x10.grey.bmp)bin1678 -> 1678 bytes
-rw-r--r--apps/plugins/bitmaps/native/star_tiles.6x7x1.bmp (renamed from apps/plugins/bitmaps/native/star_tiles.6x7.mono.bmp)bin184 -> 184 bytes
-rw-r--r--apps/plugins/bitmaps/native/star_tiles.8x8x2.bmp (renamed from apps/plugins/bitmaps/native/star_tiles.8x8.grey.bmp)bin390 -> 390 bytes
-rw-r--r--apps/plugins/bitmaps/pluginbitmaps.make59
-rw-r--r--apps/plugins/bitmaps/remote_mono/Makefile32
-rw-r--r--apps/plugins/bitmaps/remote_native/Makefile32
-rw-r--r--apps/plugins/bitmaps/remote_native/SOURCES4
-rw-r--r--apps/plugins/bounce.c2
-rw-r--r--apps/plugins/brickmania.c4
-rw-r--r--apps/plugins/bubbles.c6
-rw-r--r--apps/plugins/chessbox.c2
-rw-r--r--apps/plugins/chessbox/Makefile114
-rw-r--r--apps/plugins/chessbox/SOURCES4
-rw-r--r--apps/plugins/chessbox/chessbox.c2
-rw-r--r--apps/plugins/chessbox/chessbox.make58
-rw-r--r--apps/plugins/chopper.c6
-rw-r--r--apps/plugins/clock/Makefile112
-rw-r--r--apps/plugins/clock/clock.c4
-rw-r--r--apps/plugins/clock/clock.make21
-rw-r--r--apps/plugins/clock/clock_bitmap_strings.h2
-rw-r--r--apps/plugins/clock/clock_bitmaps.c28
-rw-r--r--apps/plugins/clock/clock_bitmaps.h2
-rw-r--r--apps/plugins/clock/clock_counter.h2
-rw-r--r--apps/plugins/clock/clock_draw_analog.c4
-rw-r--r--apps/plugins/clock/clock_draw_binary.c2
-rw-r--r--apps/plugins/clock/clock_draw_digital.c2
-rw-r--r--apps/plugins/clock/clock_settings.c2
-rw-r--r--apps/plugins/credits.c2
-rw-r--r--apps/plugins/cube.c8
-rw-r--r--apps/plugins/demystify.c4
-rw-r--r--apps/plugins/dice.c4
-rw-r--r--apps/plugins/doom/Makefile173
-rw-r--r--apps/plugins/doom/SOURCES62
-rw-r--r--apps/plugins/doom/doom.make54
-rw-r--r--apps/plugins/doom/i_video.c2
-rw-r--r--apps/plugins/euroconverter.c2
-rw-r--r--apps/plugins/fire.c8
-rw-r--r--apps/plugins/fireworks.c4
-rw-r--r--apps/plugins/greyscale.c4
-rw-r--r--apps/plugins/invadrox.c4
-rw-r--r--apps/plugins/jackpot.c4
-rw-r--r--apps/plugins/jewels.c2
-rw-r--r--apps/plugins/jpeg/Makefile75
-rw-r--r--apps/plugins/jpeg/jpeg.make21
-rw-r--r--apps/plugins/keybox.c2
-rw-r--r--apps/plugins/lamp.c2
-rw-r--r--apps/plugins/lib/Makefile50
-rw-r--r--apps/plugins/logo.c2
-rw-r--r--apps/plugins/mandelbrot.c4
-rw-r--r--apps/plugins/maze.c4
-rw-r--r--apps/plugins/mazezam.c8
-rw-r--r--apps/plugins/metronome.c2
-rw-r--r--apps/plugins/midi/Makefile77
-rw-r--r--apps/plugins/midi/midi.make28
-rw-r--r--apps/plugins/mosaique.c2
-rw-r--r--apps/plugins/mpegplayer/Makefile78
-rw-r--r--apps/plugins/mpegplayer/audio_thread.c4
-rw-r--r--apps/plugins/mpegplayer/mpeg_settings.c2
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.c2
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.h2
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.make21
-rw-r--r--apps/plugins/mpegplayer/stream_mgr.c2
-rw-r--r--apps/plugins/mpegplayer/video_thread.c2
-rw-r--r--apps/plugins/oscilloscope.c6
-rw-r--r--apps/plugins/pacbox/Makefile108
-rw-r--r--apps/plugins/pacbox/pacbox.make27
-rw-r--r--apps/plugins/pictureflow.c8
-rw-r--r--apps/plugins/plasma.c6
-rw-r--r--apps/plugins/plugins.make76
-rw-r--r--apps/plugins/ppmviewer.c2
-rw-r--r--apps/plugins/random_folder_advance_config.c2
-rw-r--r--apps/plugins/reversi/Makefile111
-rw-r--r--apps/plugins/reversi/reversi-gui.c2
-rw-r--r--apps/plugins/reversi/reversi.make28
-rw-r--r--apps/plugins/robotfindskitten.c10
-rw-r--r--apps/plugins/rockblox.c6
-rw-r--r--apps/plugins/rockboy.c2
-rw-r--r--apps/plugins/rockboy/Makefile119
-rw-r--r--apps/plugins/rockboy/SOURCES16
-rw-r--r--apps/plugins/rockboy/rockboy.make53
-rw-r--r--apps/plugins/rocklife.c4
-rw-r--r--apps/plugins/rockpaint.c1
-rw-r--r--apps/plugins/searchengine/Makefile105
-rw-r--r--apps/plugins/shortcuts/Makefile90
-rw-r--r--apps/plugins/shortcuts/shortcuts.make25
-rw-r--r--apps/plugins/sliding_puzzle.c2
-rw-r--r--apps/plugins/snow.c2
-rw-r--r--apps/plugins/sokoban.c8
-rw-r--r--apps/plugins/solitaire.c6
-rw-r--r--apps/plugins/spacerocks.c4
-rw-r--r--apps/plugins/starfield.c2
-rw-r--r--apps/plugins/sudoku/Makefile75
-rw-r--r--apps/plugins/sudoku/sudoku.c6
-rw-r--r--apps/plugins/sudoku/sudoku.make21
-rw-r--r--apps/plugins/test_disk.c4
-rw-r--r--apps/plugins/test_fps.c4
-rw-r--r--apps/plugins/test_resize.c4
-rw-r--r--apps/plugins/test_sampr.c2
-rw-r--r--apps/plugins/text_editor.c2
-rw-r--r--apps/plugins/video.c2
-rw-r--r--apps/plugins/viewer.c4
-rw-r--r--apps/plugins/vu_meter.c2
-rw-r--r--apps/plugins/wavrecord.c2
-rw-r--r--apps/plugins/wormlet.c4
-rw-r--r--apps/plugins/xobox.c2
-rw-r--r--apps/plugins/zxbox.c2
-rw-r--r--apps/plugins/zxbox/Makefile84
-rw-r--r--apps/plugins/zxbox/spmain.c2
-rw-r--r--apps/plugins/zxbox/zxbox.make57
-rw-r--r--apps/plugins/zxbox/zxvid_com.h2
115 files changed, 801 insertions, 1910 deletions
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile
deleted file mode 100644
index 19d0622..0000000
--- a/apps/plugins/Makefile
+++ /dev/null
@@ -1,180 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $Id$
-#
-
-INCLUDES = $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/common \
- -I$(FIRMDIR)/drivers -I$(APPSDIR) -Ilib -I$(BUILDDIR)
-
-CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
- -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-ifdef SOFTWARECODECS
- CODECLIBS = -lmad -la52 -lffmpegFLAC -ltremor -lwavpack -lmusepack
-endif
-
-# Set up the bitmap libraries
-BITMAPLIBS =
-LINKBITMAPS =
-ifneq ($(strip $(BMP2RB_MONO)),)
- BITMAPLIBS += pluginbitmapsmono
- LINKBITMAPS += -lpluginbitmapsmono
-endif
-ifneq ($(strip $(BMP2RB_NATIVE)),)
- BITMAPLIBS += pluginbitmapsnative
- LINKBITMAPS += -lpluginbitmapsnative
-endif
-ifneq ($(strip $(BMP2RB_REMOTEMONO)),)
- BITMAPLIBS += pluginbitmapsremotemono
- LINKBITMAPS += -lpluginbitmapsremotemono
-endif
-ifneq ($(strip $(BMP2RB_REMOTENATIVE)),)
- BITMAPLIBS += pluginbitmapsremotenative
- LINKBITMAPS += -lpluginbitmapsremotenative
-endif
-
-LDS := plugin.lds
-LINKFILE := $(OBJDIR)/pluginlink.lds
-DEPFILE = $(OBJDIR)/dep-plugins
-
-# This sets up 'SRC' based on the files mentioned in SOURCES
-include $(TOOLSDIR)/makesrc.inc
-
-# This sets up 'SUBDIRS' based on the directories mentioned in SUBDIRS
-include $(TOOLSDIR)/makesubdirs.inc
-
-ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock)
-SOURCES = $(SRC)
-ELFS := $(SRC:%.c=$(OBJDIR)/%.elf)
-OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
-# as created by the cross-compiler for win32:
-DEFS := $(SRC:%.c=$(OBJDIR)/%.def)
-DIRS = .
-
-.PHONY: $(SUBDIRS)
-all: build
-
-dep: $(DEPFILE)
-
-build: $(DEPFILE) $(BITMAPLIBS)
- $(call PRINTS,MAKE rocks)$(MAKE) rocks
- $(call PRINTS,MAKE subdirs)$(MAKE) subdirs
-
-rocks: $(ROCKS)
-
-subdirs: $(SUBDIRS)
-
-$(BUILDDIR)/credits.raw: $(DOCSDIR)/CREDITS
- $(call PRINTS,create credits.raw)perl credits.pl < $< > $@
-
-$(OBJDIR)/credits.o: credits.c $(BUILDDIR)/credits.raw
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(<F))$(CC) $(CFLAGS) -I$(OBJDIR) -c $< -o $@
-
-pluginbitmapsmono:
- $(call PRINTS,MAKE in plugins/bitmaps/mono)$(MAKE) -C bitmaps/mono OBJDIR=$(OBJDIR)/bitmaps/mono
-
-pluginbitmapsnative:
- $(call PRINTS,MAKE in plugins/bitmaps/native)$(MAKE) -C bitmaps/native OBJDIR=$(OBJDIR)/bitmaps/native
-
-pluginbitmapsremotemono:
- $(call PRINTS,MAKE in plugins/bitmaps/remote_mono)$(MAKE) -C bitmaps/remote_mono OBJDIR=$(OBJDIR)/bitmaps/remote_mono
-
-pluginbitmapsremotenative:
- $(call PRINTS,MAKE in plugins/bitmaps/remote_native)$(MAKE) -C bitmaps/remote_native OBJDIR=$(OBJDIR)/bitmaps/remote_native
-
-ifndef SIMVER
-$(OBJDIR)/%.rock: $(OBJDIR)/%.o $(LINKFILE)
- $(SILENT)$(CC) $(CFLAGS) -o $(OBJDIR)/$*.elf $< -L$(BUILDDIR) \
- $(CODECLIBS) -lplugin $(LINKBITMAPS) -lgcc \
- -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/$*.map
- $(call PRINTS,LINK $(@F))$(OC) -O binary $(OBJDIR)/$*.elf $(OBJDIR)/$*.rock
-
-else
-
-ifeq ($(SIMVER), x11)
-###################################################
-# This is the X11 simulator version
-
-$(OBJDIR)/%.rock : $(OBJDIR)/%.o
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- $(SILENT)chmod -x $@
-endif
-
-else # end of x11-simulator
-ifeq ($(SIMVER), sdl)
-###################################################
-# This is the SDL simulator version
-
-$(OBJDIR)/%.rock : $(OBJDIR)/%.o
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- $(SILENT)chmod -x $@
-endif
-
-else # end of sdl-simulator
-###################################################
-# This is the win32 simulator version
-DLLTOOLFLAGS = --export-all
-DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
-
-$(OBJDIR)/%.rock : $(OBJDIR)/%.o
- $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $<
- $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< $(BUILDDIR)/libplugin.a $(BITMAPLIBS) \
- $(patsubst -l%,$(BUILDDIR)/lib%.a,$(CODECLIBS)) -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- $(SILENT)chmod -x $@
-endif
-endif # end of win32-simulator
-endif
-
-endif # end of simulator section
-
-include $(TOOLSDIR)/make.inc
-
-pluginlib:
- $(SILENT)mkdir -p $(OBJDIR)/lib
- $(call PRINTS,MAKE in plugin/lib)$(MAKE) -C lib OBJDIR=$(OBJDIR)/lib
-
-$(LINKFILE): $(LDS)
- $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P - >$@
-
-$(SUBDIRS):
- $(SILENT)mkdir -p $(OBJDIR)/$@
- $(call PRINTS,MAKE in $@)$(MAKE) -C $@ OUTDIR=$(OBJDIR) OBJDIR=$(OBJDIR)/$@ \
- LINKBITMAPS="$(LINKBITMAPS)"
-
-clean:
- $(call PRINTS,cleaning plugins)rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \
- $(BUILDDIR)/credits.raw $(OBJS) $(DEFS)
- $(SILENT)$(MAKE) -C lib clean OBJDIR=$(OBJDIR)/lib
- $(SILENT)$(MAKE) -C bitmaps/mono clean OBJDIR=$(OBJDIR)/bitmaps/mono
- $(SILENT)$(MAKE) -C bitmaps/native clean OBJDIR=$(OBJDIR)/bitmaps/native
- $(SILENT)$(MAKE) -C bitmaps/remote_mono clean OBJDIR=$(OBJDIR)/bitmaps/remote_mono
- $(SILENT)$(MAKE) -C bitmaps/remote_native clean OBJDIR=$(OBJDIR)/bitmaps/remote_native
- $(SILENT)$(MAKE) -C rockboy clean OBJDIR=$(OBJDIR)/rockboy
- $(SILENT)$(MAKE) -C searchengine clean OBJDIR=$(OBJDIR)/searchengine
- @rm -rf $(BUILDDIR)/pluginbitmaps
-
--include $(DEPFILE)
diff --git a/apps/plugins/beatbox/Makefile b/apps/plugins/beatbox/Makefile
deleted file mode 100644
index 9465c42..0000000
--- a/apps/plugins/beatbox/Makefile
+++ /dev/null
@@ -1,74 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $Id $
-#
-
-INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
- -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
-CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
- -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN -O3
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-LINKFILE := $(OBJDIR)/link.lds
-DEPFILE = $(OBJDIR)/dep-beatbox
-
-# This sets up 'SRC' based on the files mentioned in SOURCES
-include $(TOOLSDIR)/makesrc.inc
-
-SOURCES = $(SRC)
-OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
-DIRS = .
-
-ifndef SIMVER
- LDS := ../plugin.lds
- OUTPUT = $(OUTDIR)/beatbox.rock
-else ## simulators
- OUTPUT = $(OUTDIR)/beatbox.rock
-endif
-
-all: $(OUTPUT)
-
-ifndef SIMVER
-$(OBJDIR)/beatbox.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
- $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/beatbox.map
-
-$(OUTPUT): $(OBJDIR)/beatbox.elf
- $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
-else
-
-###################################################
-# This is the SDL simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-endif # end of simulator section
-
-include $(TOOLSDIR)/make.inc
-
-# MEMORYSIZE should be passed on to this makefile with the chosen memory size
-# given in number of MB
-$(LINKFILE): $(LDS)
- $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
- $(DEFINES) -E -P - >$@
-
-clean:
- $(call PRINTS,cleaning beatbox)rm -rf $(OBJDIR)/beatbox
- $(SILENT)rm -f $(OBJDIR)/beatbox.* $(DEPFILE)
-
--include $(DEPFILE)
diff --git a/apps/plugins/bitmaps/mono/Makefile b/apps/plugins/bitmaps/mono/Makefile
deleted file mode 100644
index 03eb77a..0000000
--- a/apps/plugins/bitmaps/mono/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $Id$
-#
-
-INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \
- -I$(OBJDIR)
-CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES)
-
-# This sets up 'SRC' based on the files mentioned in SOURCES
-include $(TOOLSDIR)/makesrc.inc
-
-SOURCES = $(SRC)
-CSRC := $(SRC:%.bmp=$(OBJDIR)/%.c)
-OBJS := $(CSRC:%.c=%.o)
-DEPFILE = $(OBJDIR)/dep-bitmaps-mono
-
-BMP2RB = $(BMP2RB_MONO)
-OUTPUT = $(BUILDDIR)/libpluginbitmapsmono.a
-BMPINCDIR = $(BUILDDIR)/pluginbitmaps
-
-include $(TOOLSDIR)/makebmp.inc
-
-clean:
- $(call PRINTS,cleaning plugins/bitmaps/mono)rm -f $(CSRC) $(OBJS) $(OUTPUT) $(DEPFILE)
- @rmdir $(OBJDIR)
-
--include $(DEPFILE)
diff --git a/apps/plugins/bitmaps/native/Makefile b/apps/plugins/bitmaps/native/Makefile
deleted file mode 100644
index 071f0d4..0000000
--- a/apps/plugins/bitmaps/native/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $Id$
-#
-
-INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \
- -I$(OBJDIR)
-CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES)
-
-# This sets up 'SRC' based on the files mentioned in SOURCES
-include $(TOOLSDIR)/makesrc.inc
-
-SOURCES = $(SRC)
-CSRC := $(SRC:%.bmp=$(OBJDIR)/%.c)
-OBJS := $(CSRC:%.c=%.o)
-DEPFILE = $(OBJDIR)/dep-bitmaps-native
-
-BMP2RB = $(BMP2RB_NATIVE)
-OUTPUT = $(BUILDDIR)/libpluginbitmapsnative.a
-BMPINCDIR = $(BUILDDIR)/pluginbitmaps
-
-include $(TOOLSDIR)/makebmp.inc
-
-clean:
- $(call PRINTS,cleaning plugins/bitmaps/native)rm -f $(CSRC) $(OBJS) $(OUTPUT) $(DEPFILE)
- @rmdir $(OBJDIR)
-
--include $(DEPFILE)
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES
index b95fd37..c248bcb 100644
--- a/apps/plugins/bitmaps/native/SOURCES
+++ b/apps/plugins/bitmaps/native/SOURCES
@@ -574,13 +574,13 @@ star_tiles.8x8.bmp
#endif
#elif LCD_DEPTH > 1 /* grey */
#if LCD_WIDTH >= 160 && LCD_HEIGHT >= 98
-star_tiles.10x10.grey.bmp
+star_tiles.10x10x2.bmp
#elif LCD_WIDTH >= 128 && LCD_HEIGHT >= 80
-star_tiles.8x8.grey.bmp
+star_tiles.8x8x2.bmp
#endif
#else /* monochrome */
#if LCD_WIDTH >= 112 && LCD_HEIGHT >= 62
-star_tiles.6x7.mono.bmp
+star_tiles.6x7x1.bmp
#endif
#endif
@@ -669,14 +669,14 @@ matrix_normal.bmp
/* 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 @@ matrix_normal.bmp
#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
diff --git a/apps/plugins/bitmaps/native/star_tiles.10x10.grey.bmp b/apps/plugins/bitmaps/native/star_tiles.10x10x2.bmp
index 54e14bb..54e14bb 100644
--- a/apps/plugins/bitmaps/native/star_tiles.10x10.grey.bmp
+++ b/apps/plugins/bitmaps/native/star_tiles.10x10x2.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/star_tiles.6x7.mono.bmp b/apps/plugins/bitmaps/native/star_tiles.6x7x1.bmp
index ebc59b9..ebc59b9 100644
--- a/apps/plugins/bitmaps/native/star_tiles.6x7.mono.bmp
+++ b/apps/plugins/bitmaps/native/star_tiles.6x7x1.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/star_tiles.8x8.grey.bmp b/apps/plugins/bitmaps/native/star_tiles.8x8x2.bmp
index 6f810ce..6f810ce 100644
--- a/apps/plugins/bitmaps/native/star_tiles.8x8.grey.bmp
+++ b/apps/plugins/bitmaps/native/star_tiles.8x8x2.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/pluginbitmaps.make b/apps/plugins/bitmaps/pluginbitmaps.make
new file mode 100644
index 0000000..7dbcc0b
--- /dev/null
+++ b/apps/plugins/bitmaps/pluginbitmaps.make
@@ -0,0 +1,59 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
+#
+
+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 $(<F))$(BMP2RB_MONO) -h $(PBMPINCDIR) $< > $@
+
+$(BUILDDIR)/apps/plugins/bitmaps/native/%.c: $(ROOTDIR)/apps/plugins/bitmaps/native/%.bmp $(TOOLSDIR)/bmp2rb
+ $(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR)
+ $(call PRINTS,BMP2RB $(<F))$(BMP2RB_NATIVE) -h $(PBMPINCDIR) $< > $@
+
+$(BUILDDIR)/apps/plugins/bitmaps/remote_mono/%.c: $(ROOTDIR)/apps/plugins/bitmaps/remote_mono/%.bmp $(TOOLSDIR)/bmp2rb
+ $(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR)
+ $(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTEMONO) -h $(PBMPINCDIR) $< > $@
+
+$(BUILDDIR)/apps/plugins/bitmaps/remote_native/%.c: $(ROOTDIR)/apps/plugins/bitmaps/remote_native/%.bmp $(TOOLSDIR)/bmp2rb
+ $(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR)
+ $(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTENATIVE) -h $(PBMPINCDIR) $< > $@
+
+endif
diff --git a/apps/plugins/bitmaps/remote_mono/Makefile b/apps/plugins/bitmaps/remote_mono/Makefile
deleted file mode 100644
index d3858fa..0000000
--- a/apps/plugins/bitmaps/remote_mono/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $Id$
-#
-
-INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \
- -I$(OBJDIR)
-CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES)
-
-# This sets up 'SRC' based on the files mentioned in SOURCES
-include $(TOOLSDIR)/makesrc.inc
-
-SOURCES = $(SRC)
-CSRC := $(SRC:%.bmp=$(OBJDIR)/%.c)
-OBJS := $(CSRC:%.c=%.o)
-DEPFILE = $(OBJDIR)/dep-bitmaps-remotemono
-
-BMP2RB = $(BMP2RB_REMOTEMONO)
-OUTPUT = $(BUILDDIR)/libpluginbitmapsremotemono.a
-BMPINCDIR = $(BUILDDIR)/pluginbitmaps
-
-include $(TOOLSDIR)/makebmp.inc
-
-clean:
- $(call PRINTS,cleaning plugins/bitmaps/remotemono)rm -f $(CSRC) $(OBJS) $(OUTPUT) $(DEPFILE)
- @rmdir $(OBJDIR)
-
--include $(DEPFILE)
diff --git a/apps/plugins/bitmaps/remote_native/Makefile b/apps/plugins/bitmaps/remote_native/Makefile
deleted file mode 100644
index 3802e75..0000000
--- a/apps/plugins/bitmaps/remote_native/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $Id$
-#
-
-INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \
- -I$(OBJDIR)
-CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES)
-
-# This sets up 'SRC' based on the files mentioned in SOURCES
-include $(TOOLSDIR)/makesrc.inc
-
-SOURCES = $(SRC)
-CSRC := $(SRC:%.bmp=$(OBJDIR)/%.c)
-OBJS := $(CSRC:%.c=%.o)
-DEPFILE = $(OBJDIR)/dep-bitmaps-remotenative
-
-BMP2RB = $(BMP2RB_REMOTENATIVE)
-OUTPUT = $(BUILDDIR)/libpluginbitmapsremotenative.a
-BMPINCDIR = $(BUILDDIR)/pluginbitmaps
-
-include $(TOOLSDIR)/makebmp.inc
-
-clean:
- $(call PRINTS,cleaning plugins/bitmaps/remote_native)rm -f $(CSRC) $(OBJS) $(OUTPUT) $(DEPFILE)
- @rmdir $(OBJDIR)
-
--include $(DEPFILE)
diff --git a/apps/plugins/bitmaps/remote_native/SOURCES b/apps/plugins/bitmaps/remote_native/SOURCES
index 3633f23..2bc3d59 100644
--- a/apps/plugins/bitmaps/remote_native/SOURCES
+++ b/apps/plugins/bitmaps/remote_native/SOURCES
@@ -18,7 +18,7 @@ clock_smallsegments_remote.112x64x1.bmp
/* 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
diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c
index 65aaa3e..5d92ed1 100644
--- a/apps/plugins/bounce.c
+++ b/apps/plugins/bounce.c
@@ -20,7 +20,7 @@
**************************************************************************/
#include "plugin.h"
#include "time.h"
-#include "fixedpoint.h"
+#include "lib/fixedpoint.h"
PLUGIN_HEADER
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index 159e1ec..6d84d2b 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -20,8 +20,8 @@
****************************************************************************/
#include "plugin.h"
-#include "configfile.h" /* Part of libplugin */
-#include "helper.h"
+#include "lib/configfile.h" /* Part of libplugin */
+#include "lib/helper.h"
PLUGIN_HEADER
diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c
index 17bfeca..5415f3b 100644
--- a/apps/plugins/bubbles.c
+++ b/apps/plugins/bubbles.c
@@ -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
diff --git a/apps/plugins/chessbox.c b/apps/plugins/chessbox.c
index 51ff184..9e86c39 100644
--- a/apps/plugins/chessbox.c
+++ b/apps/plugins/chessbox.c
@@ -24,7 +24,7 @@
#if MEM <= 8 && !defined(SIMULATOR)
-#include "overlay.h"
+#include "lib/overlay.h"
PLUGIN_HEADER
diff --git a/apps/plugins/chessbox/Makefile b/apps/plugins/chessbox/Makefile
deleted file mode 100644
index 4efb40d..0000000
--- a/apps/plugins/chessbox/Makefile
+++ /dev/null
@@ -1,114 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $Id$
-#
-
-INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
- -I$(BUILDDIR)/pluginbitmaps -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) \
- -I$(BUILDDIR)
-CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
- -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-LINKFILE := $(OBJDIR)/link.lds
-DEPFILE = $(OBJDIR)/dep-chessbox
-SRC = chessbox.c gnuchess.c opening.c chessbox_pgn.c
-
-SOURCES = $(SRC)
-OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
-DIRS = .
-
-ifndef SIMVER
-ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
- LDS := archos.lds
- OUTPUT = $(OUTDIR)/chessbox.ovl
-else ## iRiver target
- LDS := ../plugin.lds
- OUTPUT = $(OUTDIR)/chessbox.rock
-endif
-else ## simulators
- OUTPUT = $(OUTDIR)/chessbox.rock
-endif
-
-all: $(OUTPUT)
-
-ifndef SIMVER
-$(OBJDIR)/chessbox.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
- $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/chessbox.map
-
-$(OUTPUT): $(OBJDIR)/chessbox.elf
- $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
-else
-
-ifeq ($(SIMVER), x11)
-###################################################
-# This is the X11 simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-else # end of x11-simulator
-ifeq ($(SIMVER), sdl)
-###################################################
-# This is the SDL simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-else # end of sdl-simulator
-###################################################
-# This is the win32 simulator version
-DLLTOOLFLAGS = --export-all
-DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
- $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
- $(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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-endif # end of win32-simulator
-endif
-endif # end of simulator section
-
-
-include $(TOOLSDIR)/make.inc
-
-# MEMORYSIZE should be passed on to this makefile with the chosen memory size
-# given in number of MB
-$(LINKFILE): $(LDS)
- $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
- $(DEFINES) -E -P - >$@
-
-clean:
- $(call PRINTS,cleaning chessbox)rm -rf $(OBJDIR)/chessbox
- $(SILENT)rm -f $(OBJDIR)/chessbox.* $(DEPFILE)
-
--include $(DEPFILE)
diff --git a/apps/plugins/chessbox/SOURCES b/apps/plugins/chessbox/SOURCES
new file mode 100644
index 0000000..067e3f0
--- /dev/null
+++ b/apps/plugins/chessbox/SOURCES
@@ -0,0 +1,4 @@
+chessbox.c
+gnuchess.c
+opening.c
+chessbox_pgn.c
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c
index f34bdbf..f8db7d9 100644
--- a/apps/plugins/chessbox/chessbox.c
+++ b/apps/plugins/chessbox/chessbox.c
@@ -43,7 +43,7 @@ extern const fb_data chessbox_pieces[];
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)
diff --git a/apps/plugins/chessbox/chessbox.make b/apps/plugins/chessbox/chessbox.make
new file mode 100644
index 0000000..d42984c
--- /dev/null
+++ b/apps/plugins/chessbox/chessbox.make
@@ -0,0 +1,58 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
+#
+
+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 $(<F))$(call preprocess2file,$<,$@)
+
+$(CHESSBOX_OBJDIR)/chessbox.rock: $(CHESSBOX_OBJ) $(CHESSBOX_OUTLDS) $(PLUGINBITMAPLIB)
+
+$(CHESSBOX_OBJDIR)/chessbox.ovl: $(CHESSBOX_OBJ) $(CHESSBOX_OUTLDS) $(PLUGINBITMAPLIB)
+ $(SILENT)$(CC) $(PLUGINFLAGS) -o $(CHESSBOX_OBJDIR)/$*.elf \
+ $(filter %.o, $^) \
+ $(filter %.a, $^) \
+ -lgcc $(CHESSBOX_OVLFLAGS)
+ $(call PRINTS,LD $(@F))$(OC) -O binary $(CHESSBOX_OBJDIR)/$*.elf $@
+
+# special pattern rule for compiling chessbox with extra flags
+$(CHESSBOX_OBJDIR)/%.o: $(CHESSBOX_SRCDIR)/%.c $(PLUGINBITMAPLIB) $(CHESSBOX_SRCDIR)/chessbox.make
+ $(SILENT)mkdir -p $(dir $@)
+ $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(CHESSBOXFLAGS) -c $< -o $@
diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c
index 1329777..b497b16 100644
--- a/apps/plugins/chopper.c
+++ b/apps/plugins/chopper.c
@@ -21,9 +21,9 @@
****************************************************************************/
#include "plugin.h"
-#include "xlcd.h"
-#include "configfile.h"
-#include "helper.h"
+#include "lib/xlcd.h"
+#include "lib/configfile.h"
+#include "lib/helper.h"
PLUGIN_HEADER
diff --git a/apps/plugins/clock/Makefile b/apps/plugins/clock/Makefile
deleted file mode 100644
index abf932a..0000000
--- a/apps/plugins/clock/Makefile
+++ /dev/null
@@ -1,112 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $$Id: $$
-#
-
-INCLUDES = -I$(APPSDIR) -I.. -I. -I$(APPSDIR)/plugins/lib \
- $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
- -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) \
- -I$(BUILDDIR)/pluginbitmaps
-CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
- -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-LINKFILE := $(OBJDIR)/link.lds
-DEPFILE = $(OBJDIR)/dep-clock
-
-# This sets up 'SRC' based on the files mentioned in SOURCES
-include $(TOOLSDIR)/makesrc.inc
-
-SOURCES = $(SRC)
-OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
-DIRS = .
-
-ifndef SIMVER
- LDS := ../plugin.lds
- OUTPUT = $(OUTDIR)/clock.rock
-else ## simulators
- OUTPUT = $(OUTDIR)/clock.rock
-endif
-
-all: $(OUTPUT)
-
-ifndef SIMVER
-$(OBJDIR)/clock.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
- $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
- $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/clock.map
-
-$(OUTPUT): $(OBJDIR)/clock.elf
- $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
-else
-
-ifeq ($(SIMVER), x11)
-###################################################
-# This is the X11 simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-else # end of x11-simulator
-ifeq ($(SIMVER), sdl)
-###################################################
-# This is the SDL simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-else # end of sdl-simulator
-###################################################
-# This is the win32 simulator version
-DLLTOOLFLAGS = --export-all
-DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
- $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
- $(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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-endif # end of win32-simulator
-endif
-endif # end of simulator section
-
-
-include $(TOOLSDIR)/make.inc
-
-# MEMORYSIZE should be passed on to this makefile with the chosen memory size
-# given in number of MB
-$(LINKFILE): $(LDS)
- $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
- $(DEFINES) -E -P - >$@
-
-clean:
- $(call PRINTS,cleaning clock)rm -rf $(OBJDIR)/clock
- $(SILENT)rm -f $(OBJDIR)/clock.* $(DEPFILE)
-
--include $(DEPFILE)
diff --git a/apps/plugins/clock/clock.c b/apps/plugins/clock/clock.c
index 1d257fd..9279a18 100644
--- a/apps/plugins/clock/clock.c
+++ b/apps/plugins/clock/clock.c
@@ -21,8 +21,8 @@
#include "plugin.h"
#include "time.h"
-#include "pluginlib_actions.h"
-#include "xlcd.h"
+#include "lib/pluginlib_actions.h"
+#include "lib/xlcd.h"
#include "clock.h"
#include "clock_counter.h"
diff --git a/apps/plugins/clock/clock.make b/apps/plugins/clock/clock.make
new file mode 100644
index 0000000..c864d67
--- /dev/null
+++ b/apps/plugins/clock/clock.make
@@ -0,0 +1,21 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
+#
+
+CLOCKSRCDIR := $(APPSDIR)/plugins/clock
+CLOCKBUILDDIR := $(BUILDDIR)/apps/plugins/clock
+
+ROCKS += $(CLOCKBUILDDIR)/clock.rock
+
+CLOCK_SRC := $(call preprocess, $(CLOCKSRCDIR)/SOURCES)
+CLOCK_OBJ := $(call c2obj, $(CLOCK_SRC))
+
+# add source files to OTHER_SRC to get automatic dependencies
+OTHER_SRC += $(CLOCK_SRC)
+
+$(CLOCKBUILDDIR)/clock.rock: $(CLOCK_OBJ)
diff --git a/apps/plugins/clock/clock_bitmap_strings.h b/apps/plugins/clock/clock_bitmap_strings.h
index 549a4a9..3f5a09d 100644
--- a/apps/plugins/clock/clock_bitmap_strings.h
+++ b/apps/plugins/clock/clock_bitmap_strings.h
@@ -23,7 +23,7 @@
#ifndef _CLOCK_BITMAP_STRINGS_
#define _CLOCK_BITMAP_STRINGS_
#include "plugin.h"
-#include "picture.h"
+#include "lib/picture.h"
void draw_string(struct screen* display, const struct picture* bitmaps,
char* str, int x, int y);
diff --git a/apps/plugins/clock/clock_bitmaps.c b/apps/plugins/clock/clock_bitmaps.c
index 2a05900..c237a29 100644
--- a/apps/plugins/clock/clock_bitmaps.c
+++ b/apps/plugins/clock/clock_bitmaps.c
@@ -23,24 +23,24 @@
#include "clock_bitmaps.h"
/* bitmaps */
-#include "clock_binary.h"
-#include "clock_digits.h"
-#include "clock_smalldigits.h"
-#include "clock_segments.h"
-#include "clock_smallsegments.h"
+#include "pluginbitmaps/clock_binary.h"
+#include "pluginbitmaps/clock_digits.h"
+#include "pluginbitmaps/clock_smalldigits.h"
+#include "pluginbitmaps/clock_segments.h"
+#include "pluginbitmaps/clock_smallsegments.h"
-#include "clock_logo.h"
-#include "clock_messages.h"
+#include "pluginbitmaps/clock_logo.h"
+#include "pluginbitmaps/clock_messages.h"
#if NB_SCREENS==2
-#include "clock_binary_remote.h"
-#include "clock_digits_remote.h"
-#include "clock_smalldigits_remote.h"
-#include "clock_segments_remote.h"
-#include "clock_smallsegments_remote.h"
+#include "pluginbitmaps/clock_binary_remote.h"
+#include "pluginbitmaps/clock_digits_remote.h"
+#include "pluginbitmaps/clock_smalldigits_remote.h"
+#include "pluginbitmaps/clock_segments_remote.h"
+#include "pluginbitmaps/clock_smallsegments_remote.h"
-#include "clock_logo_remote.h"
-#include "clock_messages_remote.h"
+#include "pluginbitmaps/clock_logo_remote.h"
+#include "pluginbitmaps/clock_messages_remote.h"
#endif
diff --git a/apps/plugins/clock/clock_bitmaps.h b/apps/plugins/clock/clock_bitmaps.h
index e6e0965..750c4d3 100644
--- a/apps/plugins/clock/clock_bitmaps.h
+++ b/apps/plugins/clock/clock_bitmaps.h
@@ -21,7 +21,7 @@
#ifndef _CLOCK_BITMAPS_
#define _CLOCK_BITMAPS_
-#include "picture.h"
+#include "lib/picture.h"
extern const struct picture logos[];
extern const struct picture messages[];
diff --git a/apps/plugins/clock/clock_counter.h b/apps/plugins/clock/clock_counter.h
index 25523d4..46563e9 100644
--- a/apps/plugins/clock/clock_counter.h
+++ b/apps/plugins/clock/clock_counter.h
@@ -2,7 +2,7 @@
#define _CLOCK_MESSAGE_
#include "clock.h"
#include "plugin.h"
-#include "picture.h"
+#include "lib/picture.h"
struct counter{
int ticks_at_last_unpause;/* to count the time from last pause to now */
diff --git a/apps/plugins/clock/clock_draw_analog.c b/apps/plugins/clock/clock_draw_analog.c
index 391bd73..c41ec3b 100644
--- a/apps/plugins/clock/clock_draw_analog.c
+++ b/apps/plugins/clock/clock_draw_analog.c
@@ -20,8 +20,8 @@
****************************************************************************/
#include "clock_draw_analog.h"
-#include "xlcd.h"
-#include "fixedpoint.h"
+#include "lib/xlcd.h"
+#include "lib/fixedpoint.h"
#include "clock_bitmaps.h"
#include "clock_bitmap_strings.h"
diff --git a/apps/plugins/clock/clock_draw_binary.c b/apps/plugins/clock/clock_draw_binary.c
index b6c7a9a..99f9093 100644
--- a/apps/plugins/clock/clock_draw_binary.c
+++ b/apps/plugins/clock/clock_draw_binary.c
@@ -21,7 +21,7 @@
#include "clock_draw_binary.h"
#include "clock_bitmap_strings.h"
#include "clock_bitmaps.h"
-#include "picture.h"
+#include "lib/picture.h"
const struct picture* binary_skin[]={binary,digits,segments};
diff --git a/apps/plugins/clock/clock_draw_digital.c b/apps/plugins/clock/clock_draw_digital.c
index 7c5925d..de5f427 100644
--- a/apps/plugins/clock/clock_draw_digital.c
+++ b/apps/plugins/clock/clock_draw_digital.c
@@ -23,7 +23,7 @@
#include "clock_draw_digital.h"
#include "clock_bitmap_strings.h"
#include "clock_bitmaps.h"
-#include "picture.h"
+#include "lib/picture.h"
const struct picture* digits_skin[]={digits,segments};
const struct picture* smalldigits_skin[]={smalldigits,smallsegments};
diff --git a/apps/plugins/clock/clock_settings.c b/apps/plugins/clock/clock_settings.c
index 1147055..1d78c47 100644
--- a/apps/plugins/clock/clock_settings.c
+++ b/apps/plugins/clock/clock_settings.c
@@ -23,7 +23,7 @@
#include "clock_bitmaps.h"
#include "clock_draw.h"
#include "clock_settings.h"
-#include "picture.h"
+#include "lib/picture.h"
static int max_skin[]={
[ANALOG]=2,
diff --git a/apps/plugins/credits.c b/apps/plugins/credits.c
index 11a5d2f..e3e659b 100644
--- a/apps/plugins/credits.c
+++ b/apps/plugins/credits.c
@@ -19,7 +19,7 @@
*
****************************************************************************/
#include "plugin.h"
-#include "helper.h"
+#include "lib/helper.h"
PLUGIN_HEADER
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c
index 8be304e..ec1930f 100644
--- a/apps/plugins/cube.c
+++ b/apps/plugins/cube.c
@@ -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
diff --git a/apps/plugins/demystify.c b/apps/plugins/demystify.c
index 96cb5a4..145c3ce 100644
--- a/apps/plugins/demystify.c
+++ b/apps/plugins/demystify.c
@@ -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
diff --git a/apps/plugins/dice.c b/apps/plugins/dice.c
index 086309a..77bbda3 100644
--- a/apps/plugins/dice.c
+++ b/apps/plugins/dice.c
@@ -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
diff --git a/apps/plugins/doom/Makefile b/apps/plugins/doom/Makefile
deleted file mode 100644
index df6baf7..0000000
--- a/apps/plugins/doom/Makefile
+++ /dev/null
@@ -1,173 +0,0 @@
-################################################################
-#
-# $Id$
-#
-# $Log: Makefile,v $
-# Revision 1.13 2006-12-13 06:52:09 kkurbjun
-# Free more plugin memory
-#
-# Revision 1.12 2006-12-13 05:46:51 kkurbjun
-# Will it fit?
-#
-# Revision 1.11 2006-12-13 04:44:17 kkurbjun
-# Dehacked and BEX support for Doom - currently only supports a DEHACKED file in a WAD (not as a standalone file yet).
-#
-# Revision 1.10 2006-10-27 21:47:55 amiconn
-# Next step of Makefile tuning: * Use 'make' internal commands for printing messages. Saves build time especially on cygwin. * SILENT variable used in more places. * Bitmap build system uses one Makefille less.
-#
-# Revision 1.9 2006-10-23 22:33:36 amiconn
-# Consistent style of 'make' messages. Always use ranlib after ar.
-#
-# Revision 1.8 2006-10-23 14:09:28 markun
-# rearrange compiler options to avoid conflicts with header files on FreeBSD
-#
-# Revision 1.7 2006-10-22 00:21:56 amiconn
-# Speed up build process in general by using internal functions of make instead of spawning sub-shells where possible.
-#
-# Revision 1.6 2006-09-29 20:04:35 barrywardell
-# Cleaner implementation of the recent OSX simulator build fix. No need to define SHARED_FLAG in each Makefile. Just have configure create it in the root Makefile instead.
-#
-# Revision 1.5 2006-09-29 16:15:08 barrywardell
-# Allow UI simulator to be build on OS (Slightly updated version of FS5767)
-#
-# Revision 1.4 2006-07-27 13:27:19 linus
-# Moved the X5 button driver to the target tree
-#
-# Revision 1.3 2006-04-14 21:07:56 kkurbjun
-# Start of profiling support for doom.
-#
-# Revision 1.2 2006-03-29 21:16:45 kkurbjun
-# Use rockbox endian defines
-#
-# Revision 1.1 2006-03-28 15:44:01 dave
-# Patch #2969 - Doom! Currently only working on the H300.
-#
-#
-
-INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
- -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
-CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
- -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \
- -Wno-strict-prototypes $(PROFILE_OPTS)
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-# The arm code compiles too large for the plugin buffer when set to optimize for speed
-ifeq ($(CPU), arm)
- CFLAGS += -Os
-ifndef SIMVER
-ifeq ($(TARGET), IRIVER_H100)
- CFLAGS += -mstructure-size-boundary=8
-endif
-endif
-else
- CFLAGS += -O2
-endif
-
-LINKFILE := $(OBJDIR)/link.lds
-DEPFILE = $(OBJDIR)/dep-doom
-SRC = 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 ../../../firmware/common/sscanf.c
-
-# sscanf isn't built into the core right now - should remove from here if that
-# changes
-
-SOURCES = $(SRC)
-OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
-#OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
-#OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
-DIRS = .
-
-
-ifndef SIMVER
- LDS := ../plugin.lds
- OUTPUT = $(OUTDIR)/doom.rock
-else ## simulators
- OUTPUT = $(OUTDIR)/doom.rock
-endif
-
-all: $(OUTPUT)
-
-ifndef SIMVER
-$(OBJDIR)/doom.elf: $(OBJS) $(LINKFILE)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc\
- -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/doom.map
-
-$(OUTPUT): $(OBJDIR)/doom.elf
- $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
-else
-
-ifeq ($(SIMVER), x11)
-###################################################
-# This is the X11 simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-else # end of x11-simulator
-ifeq ($(SIMVER), sdl)
-###################################################
-# This is the sdl simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-else # end of sdl-simulator
-###################################################
-# This is the win32 simulator version
-DLLTOOLFLAGS = --export-all
-DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
- $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
- $(BUILDDIR)/libplugin.a -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-endif # end of win32-simulator
-endif
-endif # end of simulator section
-
-
-include $(TOOLSDIR)/make.inc
-
-# MEMORYSIZE should be passed on to this makefile with the chosen memory size
-# given in number of MB
-$(LINKFILE): $(LDS)
- $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) \
- -E -P - >$@
-
-clean:
- $(call PRINTS,cleaning doom)rm -rf $(OBJDIR)/doom
- $(SILENT)rm -f $(OBJDIR)/doom.* $(DEPFILE)
-
--include $(DEPFILE)
diff --git a/apps/plugins/doom/SOURCES b/apps/plugins/doom/SOURCES
new file mode 100644
index 0000000..6cd69fa
--- /dev/null
+++ b/apps/plugins/doom/SOURCES
@@ -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
diff --git a/apps/plugins/doom/doom.make b/apps/plugins/doom/doom.make
new file mode 100644
index 0000000..d566f53
--- /dev/null
+++ b/apps/plugins/doom/doom.make
@@ -0,0 +1,54 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
+#
+
+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 $@
diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c
index 15d0166..7713fe1 100644
--- a/apps/plugins/doom/i_video.c
+++ b/apps/plugins/doom/i_video.c
@@ -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;
diff --git a/apps/plugins/euroconverter.c b/apps/plugins/euroconverter.c
index e982af9..02617ab 100644
--- a/apps/plugins/euroconverter.c
+++ b/apps/plugins/euroconverter.c
@@ -19,7 +19,7 @@
*
****************************************************************************/
#include "plugin.h"
-#include "configfile.h"
+#include "lib/configfile.h"
#ifdef HAVE_LCD_CHARCELLS
diff --git a/apps/plugins/fire.c b/apps/plugins/fire.c
index 5987e9c..f1b62f5 100644
--- a/apps/plugins/fire.c
+++ b/apps/plugins/fire.c
@@ -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)
diff --git a/apps/plugins/fireworks.c b/apps/plugins/fireworks.c
index e79f0ff..5134d01 100644
--- a/apps/plugins/fireworks.c
+++ b/apps/plugins/fireworks.c
@@ -19,8 +19,8 @@
*
****************************************************************************/
#include "plugin.h"
-#include "oldmenuapi.h"
-#include "helper.h"
+#include "lib/oldmenuapi.h"
+#include "lib/helper.h"
PLUGIN_HEADER
diff --git a/apps/plugins/greyscale.c b/apps/plugins/greyscale.c
index b5fabe0..cd8db5b 100644
--- a/apps/plugins/greyscale.c
+++ b/apps/plugins/greyscale.c
@@ -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
diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c
index 0f8b92d..8b73221 100644
--- a/apps/plugins/invadrox.c
+++ b/apps/plugins/invadrox.c
@@ -26,8 +26,8 @@
*/
#include "plugin.h"
-#include "highscore.h"
-#include "helper.h"
+#include "lib/highscore.h"
+#include "lib/helper.h"
PLUGIN_HEADER
diff --git a/apps/plugins/jackpot.c b/apps/plugins/jackpot.c
index a4865b4..2380dad 100644
--- a/apps/plugins/jackpot.c
+++ b/apps/plugins/jackpot.c
@@ -20,8 +20,8 @@
****************************************************************************/
#include "plugin.h"
-#include "pluginlib_actions.h"
-#include "picture.h"
+#include "lib/pluginlib_actions.h"
+#include "lib/picture.h"
PLUGIN_HEADER
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c
index 075edfd..239827c 100644
--- a/apps/plugins/jewels.c
+++ b/apps/plugins/jewels.c
@@ -22,7 +22,7 @@
****************************************************************************/
#include "plugin.h"
-#include "playback_control.h"
+#include "lib/playback_control.h"
#ifdef HAVE_LCD_BITMAP
diff --git a/apps/plugins/jpeg/Makefile b/apps/plugins/jpeg/Makefile
deleted file mode 100644
index 8320725..0000000
--- a/apps/plugins/jpeg/Makefile
+++ /dev/null
@@ -1,75 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $Id$
-#
-
-INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
- -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) \
- -I$(BUILDDIR)/pluginbitmaps -I$(APPSDIR)/plugins/lib
-CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
- -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-LINKFILE := $(OBJDIR)/link.lds
-DEPFILE = $(OBJDIR)/dep-jpeg
-
-# This sets up 'SRC' based on the files mentioned in SOURCES
-include $(TOOLSDIR)/makesrc.inc
-
-SOURCES = $(SRC)
-OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
-DIRS = .
-
-ifndef SIMVER
- LDS := ../plugin.lds
- OUTPUT = $(OUTDIR)/jpeg.rock
-else ## simulators
- OUTPUT = $(OUTDIR)/jpeg.rock
-endif
-
-all: $(OUTPUT)
-
-ifndef SIMVER
-$(OBJDIR)/jpeg.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
- $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/jpeg.map
-
-$(OUTPUT): $(OBJDIR)/jpeg.elf
- $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
-else
-###################################################
-# This is the SDL simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-endif # end of simulator section
-
-
-include $(TOOLSDIR)/make.inc
-
-# MEMORYSIZE should be passed on to this makefile with the chosen memory size
-# given in number of MB
-$(LINKFILE): $(LDS)
- $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
- $(DEFINES) -E -P - >$@
-
-clean:
- $(call PRINTS,cleaning jpeg)rm -rf $(OBJDIR)/jpeg
- $(SILENT)rm -f $(OBJDIR)/jpeg.* $(DEPFILE)
-
--include $(DEPFILE)
diff --git a/apps/plugins/jpeg/jpeg.make b/apps/plugins/jpeg/jpeg.make
new file mode 100644
index 0000000..9413ef2
--- /dev/null
+++ b/apps/plugins/jpeg/jpeg.make
@@ -0,0 +1,21 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
+#
+
+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)
diff --git a/apps/plugins/keybox.c b/apps/plugins/keybox.c
index fef3d4f..dae413c 100644
--- a/apps/plugins/keybox.c
+++ b/apps/plugins/keybox.c
@@ -19,7 +19,7 @@
*
****************************************************************************/
#include "plugin.h"
-#include "md5.h"
+#include "lib/md5.h"
PLUGIN_HEADER
#define KEYBOX_FILE PLUGIN_DIR "/apps/keybox.dat"
diff --git a/apps/plugins/lamp.c b/apps/plugins/lamp.c
index 94f48ea..bad757c 100644
--- a/apps/plugins/lamp.c
+++ b/apps/plugins/lamp.c
@@ -23,7 +23,7 @@
****************************************************************************/
#include "plugin.h"
-#include "helper.h"
+#include "lib/helper.h"
PLUGIN_HEADER
diff --git a/apps/plugins/lib/Makefile b/apps/plugins/lib/Makefile
deleted file mode 100644
index c75cca1..0000000
--- a/apps/plugins/lib/Makefile
+++ /dev/null
@@ -1,50 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $Id$
-#
-
-# ../.. for the plugin.h in the apps dir
-# .. for stuff in the plugins dir
-# . for stuff in the pluginlib dir
-INCLUDES=-I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
- -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
- -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
-
-# Sectioned compilation for target
-ifndef SIMVER
- CFLAGS += -ffunction-sections -fdata-sections
-endif
-
-# This sets up 'SRC' based on the files mentioned in SOURCES
-include $(TOOLSDIR)/makesrc.inc
-
-SOURCES = $(SRC)
-OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
-OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
-DEPFILE = $(OBJDIR)/dep-pluginlib
-DIRS = .
-
-OUTPUT = $(BUILDDIR)/libplugin.a
-
-all: $(OUTPUT)
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
- $(SILENT)$(RANLIB) $@
-
-include $(TOOLSDIR)/make.inc
-
-clean:
- $(call PRINTS,cleaning lib)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
-
--include $(DEPFILE)
diff --git a/apps/plugins/logo.c b/apps/plugins/logo.c
index be4a39c..b2e6401 100644
--- a/apps/plugins/logo.c
+++ b/apps/plugins/logo.c
@@ -19,7 +19,7 @@
*
**************************************************************************/
#include "plugin.h"
-#include "playergfx.h"
+#include "lib/playergfx.h"
PLUGIN_HEADER
diff --git a/apps/plugins/mandelbrot.c b/apps/plugins/mandelbrot.c
index ca7f708..56483bd 100644
--- a/apps/plugins/mandelbrot.c
+++ b/apps/plugins/mandelbrot.c
@@ -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
diff --git a/apps/plugins/maze.c b/apps/plugins/maze.c
index f7751ce..67c0623 100644
--- a/apps/plugins/maze.c
+++ b/apps/plugins/maze.c
@@ -31,7 +31,7 @@
*/
#include "plugin.h"
-#include "helper.h"
+#include "lib/helper.h"
PLUGIN_HEADER
@@ -54,7 +54,7 @@ PLUGIN_HEADER
# 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
diff --git a/apps/plugins/mazezam.c b/apps/plugins/mazezam.c
index c1726a5..fac12de 100644
--- a/apps/plugins/mazezam.c
+++ b/apps/plugins/mazezam.c
@@ -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
diff --git a/apps/plugins/metronome.c b/apps/plugins/metronome.c
index 1841860..58abbca 100644
--- a/apps/plugins/metronome.c
+++ b/apps/plugins/metronome.c
@@ -19,7 +19,7 @@
*
****************************************************************************/
#include "plugin.h"
-#include "pluginlib_actions.h"
+#include "lib/pluginlib_actions.h"
PLUGIN_HEADER
diff --git a/apps/plugins/midi/Makefile b/apps/plugins/midi/Makefile
deleted file mode 100644
index 03d6bc6..0000000
--- a/apps/plugins/midi/Makefile
+++ /dev/null
@@ -1,77 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $Id $
-#
-
-INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
- -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
-
- MIDIOPTS = -O2
-
-CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) $(MIDIOPTS) \
- -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-LINKFILE := $(OBJDIR)/link.lds
-DEPFILE = $(OBJDIR)/dep-midiplay
-
-# This sets up 'SRC' based on the files mentioned in SOURCES
-include $(TOOLSDIR)/makesrc.inc
-
-SOURCES = $(SRC)
-OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
-DIRS = .
-
-ifndef SIMVER
- LDS := ../plugin.lds
- OUTPUT = $(OUTDIR)/midiplay.rock
-else ## simulators
- OUTPUT = $(OUTDIR)/midiplay.rock
-endif
-
-all: $(OUTPUT)
-
-ifndef SIMVER
-$(OBJDIR)/midiplay.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
- $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/midiplay.map
-
-$(OUTPUT): $(OBJDIR)/midiplay.elf
- $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
-else
-
-###################################################
-# This is the SDL simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-endif # end of simulator section
-
-include $(TOOLSDIR)/make.inc
-
-# MEMORYSIZE should be passed on to this makefile with the chosen memory size
-# given in number of MB
-$(LINKFILE): $(LDS)
- $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
- $(DEFINES) -E -P - >$@
-
-clean:
- $(call PRINTS,cleaning midiplay)rm -rf $(OBJDIR)/midiplay
- $(SILENT)rm -f $(OBJDIR)/midiplay.* $(DEPFILE)
-
--include $(DEPFILE)
diff --git a/apps/plugins/midi/midi.make b/apps/plugins/midi/midi.make
new file mode 100644
index 0000000..9100764
--- /dev/null
+++ b/apps/plugins/midi/midi.make
@@ -0,0 +1,28 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
+#
+
+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 $@
diff --git a/apps/plugins/mosaique.c b/apps/plugins/mosaique.c
index 90ffa37..4c8139c 100644
--- a/apps/plugins/mosaique.c
+++ b/apps/plugins/mosaique.c
@@ -19,7 +19,7 @@
*
**************************************************************************/
#include "plugin.h"
-#include "playergfx.h"
+#include "lib/playergfx.h"
PLUGIN_HEADER
diff --git a/apps/plugins/mpegplayer/Makefile b/apps/plugins/mpegplayer/Makefile
deleted file mode 100644
index 7f90cbc..0000000
--- a/apps/plugins/mpegplayer/Makefile
+++ /dev/null
@@ -1,78 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $Id$
-#
-
-INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
- -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(APPSDIR)/plugins/lib -I$(OUTDIR) -I$(BUILDDIR)
-CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
- -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN -DMPEGPLAYER
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-LINKFILE := $(OBJDIR)/link.lds
-DEPFILE = $(OBJDIR)/dep-mpegplayer
-
-# This sets up 'SRC' based on the files mentioned in SOURCES
-include $(TOOLSDIR)/makesrc.inc
-
-SOURCES = $(SRC)
-OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
-OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
-DIRS = .
-
-LDS := ../plugin.lds
-OUTPUT = $(OUTDIR)/mpegplayer.rock
-
-all: $(OUTPUT)
-
-.PHONY: libmad-mpegplayer
-
-$(BUILDDIR)/libmad-mpegplayer.a: libmad-mpegplayer
-
-libmad-mpegplayer:
- $(SILENT)mkdir -p $(OBJDIR)/libmad-mpegplayer
- $(call PRINTS,MAKE in libmad for mpegplayer)$(MAKE) -C $(APPSDIR)/codecs/libmad MPEGPLAYER=1 OBJDIR=$(OBJDIR)/libmad-mpegplayer OUTPUT=$(BUILDDIR)/libmad-mpegplayer.a
-
-ifndef SIMVER
-$(OBJDIR)/mpegplayer.elf: $(OBJS) $(LINKFILE) $(BUILDDIR)/libmad-mpegplayer.a
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lmad-mpegplayer -lgcc\
- $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/mpegplayer.map
-
-$(OUTPUT): $(OBJDIR)/mpegplayer.elf
- $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
-else
-# This is the SDL simulator version
-
-$(OUTPUT): $(OBJS) $(BUILDDIR)/libmad-mpegplayer.a
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -lmad-mpegplayer -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-endif # end of sdl-simulator
-
-include $(TOOLSDIR)/make.inc
-
-# MEMORYSIZE should be passed on to this makefile with the chosen memory size
-# given in number of MB
-$(LINKFILE): $(LDS)
- $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
- $(DEFINES) -E -P - >$@
-
-clean:
- $(call PRINTS,cleaning mpegplayer)rm -rf $(OBJDIR)/mpegplayer
- $(SILENT)rm -f $(OBJDIR)/mpegplayer.* $(DEPFILE)
-
--include $(DEPFILE)
-
diff --git a/apps/plugins/mpegplayer/audio_thread.c b/apps/plugins/mpegplayer/audio_thread.c
index 3515815..4522657 100644
--- a/apps/plugins/mpegplayer/audio_thread.c
+++ b/apps/plugins/mpegplayer/audio_thread.c
@@ -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;
diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c
index 14863c9..0c66f3f 100644
--- a/apps/plugins/mpegplayer/mpeg_settings.c
+++ b/apps/plugins/mpegplayer/mpeg_settings.c
@@ -1,5 +1,5 @@
#include "plugin.h"
-#include "helper.h"
+#include "lib/helper.h"
#include "lib/configfile.h"
#include "lib/oldmenuapi.h"
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c
index 5e34c2b..dc2dc0d 100644
--- a/apps/plugins/mpegplayer/mpegplayer.c
+++ b/apps/plugins/mpegplayer/mpegplayer.c
@@ -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"
diff --git a/apps/plugins/mpegplayer/mpegplayer.h b/apps/plugins/mpegplayer/mpegplayer.h
index 4ee30b7..323f8f3 100644
--- a/apps/plugins/mpegplayer/mpegplayer.h
+++ b/apps/plugins/mpegplayer/mpegplayer.h
@@ -85,7 +85,7 @@ enum mpeg_malloc_reason_t
#else
-#include "grey.h"
+#include "lib/grey.h"
#define DRAW_BLACK GREY_BLACK
#define DRAW_DARKGRAY GREY_DARKGRAY
#define DRAW_LIGHTGRAY GREY_LIGHTGRAY
diff --git a/apps/plugins/mpegplayer/mpegplayer.make b/apps/plugins/mpegplayer/mpegplayer.make
new file mode 100644
index 0000000..7242be3
--- /dev/null
+++ b/apps/plugins/mpegplayer/mpegplayer.make
@@ -0,0 +1,21 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
+#
+
+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
diff --git a/apps/plugins/mpegplayer/stream_mgr.c b/apps/plugins/mpegplayer/stream_mgr.c
index ae1ff51..424d2fe 100644
--- a/apps/plugins/mpegplayer/stream_mgr.c
+++ b/apps/plugins/mpegplayer/stream_mgr.c
@@ -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
diff --git a/apps/plugins/mpegplayer/video_thread.c b/apps/plugins/mpegplayer/video_thread.c
index 91f08a5..100904b 100644
--- a/apps/plugins/mpegplayer/video_thread.c
+++ b/apps/plugins/mpegplayer/video_thread.c
@@ -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"
diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c
index 9cb59a8..68b4530 100644
--- a/apps/plugins/oscilloscope.c
+++ b/apps/plugins/oscilloscope.c
@@ -22,11 +22,11 @@
****************************************************************************/
#include "plugin.h"
-#include "helper.h"
+#include "lib/helper.h"
#ifdef HAVE_LCD_BITMAP
-#include "xlcd.h"
-#include "configfile.h"
+#include "lib/xlcd.h"
+#include "lib/configfile.h"
PLUGIN_HEADER
diff --git a/apps/plugins/pacbox/Makefile b/apps/plugins/pacbox/Makefile
deleted file mode 100644
index e1b998a..0000000
--- a/apps/plugins/pacbox/Makefile
+++ /dev/null
@@ -1,108 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $Id$
-#
-
-INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
- -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
-CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
- -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-LINKFILE := $(OBJDIR)/link.lds
-DEPFILE = $(OBJDIR)/dep-pacbox
-
-# This sets up 'SRC' based on the files mentioned in SOURCES
-include $(TOOLSDIR)/makesrc.inc
-
-SOURCES = $(SRC)
-OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
-OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
-DIRS = .
-
-LDS := ../plugin.lds
-OUTPUT = $(OUTDIR)/pacbox.rock
-
-all: $(OUTPUT)
-
-ifndef SIMVER
-$(OBJDIR)/pacbox.elf: $(OBJS) $(LINKFILE)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
- -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/pacbox.map
-
-$(OUTPUT): $(OBJDIR)/pacbox.elf
- $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
-else
-
-ifeq ($(SIMVER), x11)
-###################################################
-# This is the X11 simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-else # end of x11-simulator
-ifeq ($(SIMVER), sdl)
-###################################################
-# This is the SDL simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-else # end of sdl-simulator
-###################################################
-# This is the win32 simulator version
-DLLTOOLFLAGS = --export-all
-DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
- $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
- $(BUILDDIR)/libplugin.a -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-endif # end of win32-simulator
-endif
-endif # end of simulator section
-
-
-include $(TOOLSDIR)/make.inc
-
-# MEMORYSIZE should be passed on to this makefile with the chosen memory size
-# given in number of MB
-$(LINKFILE): $(LDS)
- $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
- $(DEFINES) -E -P - >$@
-
-clean:
- $(call PRINTS,cleaning pacbox)rm -rf $(OBJDIR)/pacbox
- $(SILENT)rm -f $(OBJDIR)/pacbox.* $(DEPFILE)
-
--include $(DEPFILE)
-
diff --git a/apps/plugins/pacbox/pacbox.make b/apps/plugins/pacbox/pacbox.make
new file mode 100644
index 0000000..75a599d
--- /dev/null
+++ b/apps/plugins/pacbox/pacbox.make
@@ -0,0 +1,27 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
+#
+
+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 $@
diff --git a/apps/plugins/pictureflow.c b/apps/plugins/pictureflow.c
index 4dde74a..29e8a74 100644
--- a/apps/plugins/pictureflow.c
+++ b/apps/plugins/pictureflow.c
@@ -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"
diff --git a/apps/plugins/plasma.c b/apps/plugins/plasma.c
index 22d67b6..5d12818 100644
--- a/apps/plugins/plasma.c
+++ b/apps/plugins/plasma.c
@@ -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
diff --git a/apps/plugins/plugins.make b/apps/plugins/plugins.make
new file mode 100644
index 0000000..2e266cb
--- /dev/null
+++ b/apps/plugins/plugins.make
@@ -0,0 +1,76 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
+#
+
+# single-file plugins:
+PLUGINS_SRC = $(call preprocess, $(APPSDIR)/plugins/SOURCES)
+OTHER_SRC += $(PLUGINS_SRC)
+ROCKS := $(PLUGINS_SRC:.c=.rock)
+ROCKS := $(subst $(ROOTDIR),$(BUILDDIR),$(ROCKS))
+
+# libplugin.a
+PLUGINLIB := $(BUILDDIR)/apps/plugins/libplugin.a
+PLUGINLIB_SRC = $(call preprocess, $(APPSDIR)/plugins/lib/SOURCES)
+OTHER_SRC += $(PLUGINLIB_SRC)
+
+PLUGINLIB_OBJ := $(PLUGINLIB_SRC:.c=.o)
+PLUGINLIB_OBJ := $(PLUGINLIB_OBJ:.S=.o)
+PLUGINLIB_OBJ := $(subst $(ROOTDIR),$(BUILDDIR),$(PLUGINLIB_OBJ))
+
+# multifile plugins (subdirs):
+PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS)
+
+# include <dir>.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))
+ $(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS))
+
+$(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 $@
diff --git a/apps/plugins/ppmviewer.c b/apps/plugins/ppmviewer.c
index 01513c4..97f085a 100644
--- a/apps/plugins/ppmviewer.c
+++ b/apps/plugins/ppmviewer.c
@@ -20,7 +20,7 @@
****************************************************************************/
#include "plugin.h"
-#include "bmp.h"
+#include "lib/bmp.h"
#if defined(HAVE_LCD_COLOR)
diff --git a/apps/plugins/random_folder_advance_config.c b/apps/plugins/random_folder_advance_config.c
index 3df3808..9c568df 100644
--- a/apps/plugins/random_folder_advance_config.c
+++ b/apps/plugins/random_folder_advance_config.c
@@ -19,7 +19,7 @@
*
****************************************************************************/
#include "plugin.h"
-#include "oldmenuapi.h"
+#include "lib/oldmenuapi.h"
PLUGIN_HEADER
diff --git a/apps/plugins/reversi/Makefile b/apps/plugins/reversi/Makefile
deleted file mode 100644
index 97a042e..0000000
--- a/apps/plugins/reversi/Makefile
+++ /dev/null
@@ -1,111 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $$Id: $$
-#
-
-INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
- -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) \
- -I$(BUILDDIR)/pluginbitmaps
-CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
- -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-LINKFILE := $(OBJDIR)/link.lds
-DEPFILE = $(OBJDIR)/dep-reversi
-
-# This sets up 'SRC' based on the files mentioned in SOURCES
-include $(TOOLSDIR)/makesrc.inc
-
-SOURCES = $(SRC)
-OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
-DIRS = .
-
-ifndef SIMVER
- LDS := ../plugin.lds
- OUTPUT = $(OUTDIR)/reversi.rock
-else ## simulators
- OUTPUT = $(OUTDIR)/reversi.rock
-endif
-
-all: $(OUTPUT)
-
-ifndef SIMVER
-$(OBJDIR)/reversi.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
- $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
- $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/reversi.map
-
-$(OUTPUT): $(OBJDIR)/reversi.elf
- $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
-else
-
-ifeq ($(SIMVER), x11)
-###################################################
-# This is the X11 simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-else # end of x11-simulator
-ifeq ($(SIMVER), sdl)
-###################################################
-# This is the SDL simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-else # end of sdl-simulator
-###################################################
-# This is the win32 simulator version
-DLLTOOLFLAGS = --export-all
-DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
- $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
- $(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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-endif # end of win32-simulator
-endif
-endif # end of simulator section
-
-
-include $(TOOLSDIR)/make.inc
-
-# MEMORYSIZE should be passed on to this makefile with the chosen memory size
-# given in number of MB
-$(LINKFILE): $(LDS)
- $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
- $(DEFINES) -E -P - >$@
-
-clean:
- $(call PRINTS,cleaning reversi)rm -rf $(OBJDIR)/reversi
- $(SILENT)rm -f $(OBJDIR)/reversi.* $(DEPFILE)
-
--include $(DEPFILE)
diff --git a/apps/plugins/reversi/reversi-gui.c b/apps/plugins/reversi/reversi-gui.c
index d91f24b..1c1cf56 100644
--- a/apps/plugins/reversi/reversi-gui.c
+++ b/apps/plugins/reversi/reversi-gui.c
@@ -47,7 +47,7 @@ further options:
#include "reversi-strategy.h"
#include "reversi-gui.h"
-#include "../lib/oldmenuapi.h"
+#include "lib/oldmenuapi.h"
PLUGIN_HEADER
diff --git a/apps/plugins/reversi/reversi.make b/apps/plugins/reversi/reversi.make
new file mode 100644
index 0000000..be73694
--- /dev/null
+++ b/apps/plugins/reversi/reversi.make
@@ -0,0 +1,28 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
+#
+
+REVERSISRCDIR := $(APPSDIR)/plugins/reversi
+REVERSIBUILDDIR := $(BUILDDIR)/apps/plugins/reversi
+
+ROCKS += $(REVERSIBUILDDIR)/reversi.rock
+
+REVERSI_SRC := $(call preprocess, $(REVERSISRCDIR)/SOURCES)
+REVERSI_OBJ := $(call c2obj, $(REVERSI_SRC))
+
+# add source files to OTHER_SRC to get automatic dependencies
+OTHER_SRC += $(REVERSI_SRC)
+
+$(REVERSIBUILDDIR)/reversi.rock: $(REVERSI_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 $@
diff --git a/apps/plugins/robotfindskitten.c b/apps/plugins/robotfindskitten.c
index 4b33513..747689d 100644
--- a/apps/plugins/robotfindskitten.c
+++ b/apps/plugins/robotfindskitten.c
@@ -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 @@ static char* messages[] =
#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)
diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c
index 5ff220f..d9b1c0a 100644
--- a/apps/plugins/rockblox.c
+++ b/apps/plugins/rockblox.c
@@ -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
diff --git a/apps/plugins/rockboy.c b/apps/plugins/rockboy.c
index af38771..f3d25e2 100644
--- a/apps/plugins/rockboy.c
+++ b/apps/plugins/rockboy.c
@@ -24,7 +24,7 @@
#if MEM <= 8 && !defined(SIMULATOR)
-#include "overlay.h"
+#include "lib/overlay.h"
PLUGIN_HEADER
diff --git a/apps/plugins/rockboy/Makefile b/apps/plugins/rockboy/Makefile
deleted file mode 100644
index 4aa8526..0000000
--- a/apps/plugins/rockboy/Makefile
+++ /dev/null
@@ -1,119 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $Id$
-#
-
-INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
- -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
-CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
- -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN -finline-functions
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-LINKFILE := $(OBJDIR)/link.lds
-DEPFILE = $(OBJDIR)/dep-rockboy
-SRC = cpu.c emu.c events.c fastmem.c hw.c lcd.c lcdc.c loader.c \
- mem.c menu.c rbsound.c rockboy.c rtc.c save.c sound.c sys_rockbox.c \
- ../../../firmware/common/sscanf.c
-
-#CFLAGS += -DDYNAREC
-#SRC += dynarec.c
-
-SOURCES = $(SRC)
-OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
-DIRS = .
-
-ifndef SIMVER
-ifneq (,$(findstring RECORDER,$(TARGET))) ## Archos recorder targets
- LDS := archos.lds
- OUTPUT = $(OUTDIR)/rockboy.ovl
-else ## iRiver target
- LDS := ../plugin.lds
- OUTPUT = $(OUTDIR)/rockboy.rock
-endif
-else ## simulators
- OUTPUT = $(OUTDIR)/rockboy.rock
-endif
-
-all: $(OUTPUT)
-
-ifndef SIMVER
-$(OBJDIR)/rockboy.elf: $(OBJS) $(LINKFILE)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -fast -lgcc \
- -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/rockboy.map
-
-$(OUTPUT): $(OBJDIR)/rockboy.elf
- $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
-else
-
-ifeq ($(SIMVER), x11)
-###################################################
-# This is the X11 simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-else # end of x11-simulator
-ifeq ($(SIMVER), sdl)
-###################################################
-# This is the sdl simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-else # end of sdl-simulator
-###################################################
-# This is the win32 simulator version
-DLLTOOLFLAGS = --export-all
-DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
- $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
- $(BUILDDIR)/libplugin.a -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-endif # end of win32-simulator
-endif
-endif # end of simulator section
-
-
-include $(TOOLSDIR)/make.inc
-
-# MEMORYSIZE should be passed on to this makefile with the chosen memory size
-# given in number of MB
-$(LINKFILE): $(LDS)
- $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) \
- -E -P - >$@
-
-clean:
- $(call PRINTS,cleaning rockboy)rm -rf $(OBJDIR)/rockboy
- $(SILENT)rm -f $(OBJDIR)/rockboy.* $(DEPFILE)
-
--include $(DEPFILE)
-
diff --git a/apps/plugins/rockboy/SOURCES b/apps/plugins/rockboy/SOURCES
new file mode 100644
index 0000000..8806b58
--- /dev/null
+++ b/apps/plugins/rockboy/SOURCES
@@ -0,0 +1,16 @@
+cpu.c
+emu.c
+events.c
+fastmem.c
+hw.c
+lcd.c
+lcdc.c
+loader.c
+mem.c
+menu.c
+rbsound.c
+rockboy.c
+rtc.c
+save.c
+sound.c
+sys_rockbox.c
diff --git a/apps/plugins/rockboy/rockboy.make b/apps/plugins/rockboy/rockboy.make
new file mode 100644
index 0000000..62196cf
--- /dev/null
+++ b/apps/plugins/rockboy/rockboy.make
@@ -0,0 +1,53 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
+#
+
+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 $(<F))$(call preprocess2file,$<,$@)
+
+$(ROCKBOY_OBJDIR)/rockboy.rock: $(ROCKBOY_OBJ) $(ROCKBOY_OUTLDS) $(PLUGINBITMAPLIB)
+
+$(ROCKBOY_OBJDIR)/rockboy.ovl: $(ROCKBOY_OBJ) $(ROCKBOY_OUTLDS) $(PLUGINBITMAPLIB)
+ $(SILENT)$(CC) $(PLUGINFLAGS) -o $(ROCKBOY_OBJDIR)/$*.elf \
+ $(filter %.o, $^) \
+ $(filter %.a, $^) \
+ -lgcc $(ROCKBOY_OVLFLAGS)
+ $(call PRINTS,LD $(@F))$(OC) -O binary $(ROCKBOY_OBJDIR)/$*.elf $@
diff --git a/apps/plugins/rocklife.c b/apps/plugins/rocklife.c
index 5587525..e22cb33 100644
--- a/apps/plugins/rocklife.c
+++ b/apps/plugins/rocklife.c
@@ -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
diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c
index 32c746c..c9a0c6a 100644
--- a/apps/plugins/rockpaint.c
+++ b/apps/plugins/rockpaint.c
@@ -29,7 +29,6 @@
*/
#include "plugin.h"
-#include "errno.h"
#include "lib/bmp.h"
#include "lib/rgb_hsv.h"
diff --git a/apps/plugins/searchengine/Makefile b/apps/plugins/searchengine/Makefile
deleted file mode 100644
index 7e3cca4..0000000
--- a/apps/plugins/searchengine/Makefile
+++ /dev/null
@@ -1,105 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $Id$
-#
-
-INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
- -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
-CFLAGS = $(INCLUDES) $(GCCOPTS) -O3 $(TARGET) $(EXTRA_DEFINES) \
- -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-LINKFILE := $(OBJDIR)/link.lds
-DEPFILE = $(OBJDIR)/dep-searchengine
-SRC = searchengine.c parser.c token.c dbinterface.c
-
-SOURCES = $(SRC)
-OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
-DIRS = .
-
-LDS := ../plugin.lds
-OUTPUT = $(OUTDIR)/searchengine.rock
-
-all: $(OUTPUT)
-
-ifndef SIMVER
-$(OBJDIR)/searchengine.elf: $(OBJS) $(LINKFILE)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
- -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/searchengine.map
-
-$(OUTPUT): $(OBJDIR)/searchengine.elf
- $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
-else
-
-ifeq ($(SIMVER), x11)
-###################################################
-# This is the X11 simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-else # end of x11-simulator
-ifeq ($(SIMVER), sdl)
-###################################################
-# This is the SDL simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-else # end of sdl-simulator
-###################################################
-# This is the win32 simulator version
-DLLTOOLFLAGS = --export-all
-DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
- $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
- $(BUILDDIR)/libplugin.a -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-endif # end of win32-simulator
-endif
-endif # end of simulator section
-
-
-include $(TOOLSDIR)/make.inc
-
-# MEMORYSIZE should be passed on to this makefile with the chosen memory size
-# given in number of MB
-$(LINKFILE): $(LDS)
- $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
- $(DEFINES) -E -P - >$@
-
-clean:
- $(call PRINTS,cleaning searchengine)rm -rf $(OBJDIR)/searchengine
- $(SILENT)rm -f $(OBJDIR)/searchengine.* $(DEPFILE)
-
--include $(DEPFILE)
-
diff --git a/apps/plugins/shortcuts/Makefile b/apps/plugins/shortcuts/Makefile
deleted file mode 100644
index 2958af8..0000000
--- a/apps/plugins/shortcuts/Makefile
+++ /dev/null
@@ -1,90 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $$Id: $$
-#
-
-INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
- -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) \
- -I$(BUILDDIR)/pluginbitmaps
-CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
- -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-LINKFILE := $(OBJDIR)/link.lds
-DEPFILE = $(OBJDIR)/dep-shortcuts
-
-SOURCES := shortcuts_common.c shortcuts_view.c shortcuts_append.c
-VIEW_OBJS := $(OBJDIR)/shortcuts_common.o $(OBJDIR)/shortcuts_view.o
-APPEND_OBJS := $(OBJDIR)/shortcuts_common.o $(OBJDIR)/shortcuts_append.o
-DIRS = .
-
-ifndef SIMVER
- LDS := ../plugin.lds
-endif
-
-OUTPUT = $(OUTDIR)/shortcuts_view.rock $(OUTDIR)/shortcuts_append.rock
-
-all: $(OUTPUT)
-
-ifndef SIMVER
-$(OBJDIR)/shortcuts_view.elf: $(VIEW_OBJS) $(LINKFILE) $(BITMAPLIBS)
- $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(VIEW_OBJS) -L$(BUILDDIR) -lplugin -lgcc \
- $(LINKBITMAPS) -Wl,--gc-sections -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/shortcuts_view.map
-
-$(OUTDIR)/shortcuts_view.rock: $(OBJDIR)/shortcuts_view.elf
- $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
-
-$(OBJDIR)/shortcuts_append.elf: $(APPEND_OBJS) $(LINKFILE) $(BITMAPLIBS)
- $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(APPEND_OBJS) -L$(BUILDDIR) -lplugin -lgcc \
- $(LINKBITMAPS) -Wl,--gc-sections -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/shortcuts_append.map
-
-$(OUTDIR)/shortcuts_append.rock: $(OBJDIR)/shortcuts_append.elf
- $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
-else
-
-###################################################
-# This is the SDL simulator version
-
-$(OUTDIR)/shortcuts_view.rock: $(VIEW_OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(VIEW_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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-$(OUTDIR)/shortcuts_append.rock: $(APPEND_OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(APPEND_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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-endif # end of simulator section
-
-
-include $(TOOLSDIR)/make.inc
-
-# MEMORYSIZE should be passed on to this makefile with the chosen memory size
-# given in number of MB
-$(LINKFILE): $(LDS)
- $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
- $(DEFINES) -E -P - >$@
-
-clean:
- $(call PRINTS,cleaning shortcuts)rm -rf $(OBJDIR)/shortcuts
- $(SILENT)rm -f $(OBJDIR)/shortcuts* $(DEPFILE)
-
--include $(DEPFILE)
diff --git a/apps/plugins/shortcuts/shortcuts.make b/apps/plugins/shortcuts/shortcuts.make
new file mode 100644
index 0000000..fc2a77a
--- /dev/null
+++ b/apps/plugins/shortcuts/shortcuts.make
@@ -0,0 +1,25 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
+#
+
+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
diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c
index ef33a4f..0d12556 100644
--- a/apps/plugins/sliding_puzzle.c
+++ b/apps/plugins/sliding_puzzle.c
@@ -19,7 +19,7 @@
*
****************************************************************************/
#include "plugin.h"
-#include "bmp.h"
+#include "lib/bmp.h"
#ifdef HAVE_LCD_BITMAP
PLUGIN_HEADER
diff --git a/apps/plugins/snow.c b/apps/plugins/snow.c
index 056ab78..28315cc 100644
--- a/apps/plugins/snow.c
+++ b/apps/plugins/snow.c
@@ -19,7 +19,7 @@
*
**************************************************************************/
#include "plugin.h"
-#include "playergfx.h"
+#include "lib/playergfx.h"
PLUGIN_HEADER
diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c
index 9b9cd29..0a032f6 100644
--- a/apps/plugins/sokoban.c
+++ b/apps/plugins/sokoban.c
@@ -34,6 +34,14 @@ PLUGIN_HEADER
#include "pluginbitmaps/sokoban_tiles.h"
#define SOKOBAN_TILESIZE BMPWIDTH_sokoban_tiles
+
+/* If tilesize is 0 (which it is during dependency generation) gcc will abort
+ (div by 0) and this plugin won't get any dependencies
+*/
+#if SOKOBAN_TILESIZE < 1
+#define SOKOBAN_TILESIZE 10
+#endif
+
/* SOKOBAN_TILESIZE is the number of pixels for each block.
* Set dynamically so all targets can support levels
* that fill their entire screen, less the stat box.
diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c
index d487334..f95777e 100644
--- a/apps/plugins/solitaire.c
+++ b/apps/plugins/solitaire.c
@@ -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
diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c
index 21cfb1e..b8cf043 100644
--- a/apps/plugins/spacerocks.c
+++ b/apps/plugins/spacerocks.c
@@ -20,9 +20,7 @@
****************************************************************************/
#include "plugin.h"
-#include "math.h"
-#include "stdio.h"
-#include "helper.h"
+#include "lib/helper.h"
PLUGIN_HEADER
diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c
index f8f24b9..5362136 100644
--- a/apps/plugins/starfield.c
+++ b/apps/plugins/starfield.c
@@ -18,7 +18,7 @@
****************************************************************************/
#include "plugin.h"
-#include "helper.h"
+#include "lib/helper.h"
#ifdef HAVE_LCD_BITMAP /* and also not for the Player */
diff --git a/apps/plugins/sudoku/Makefile b/apps/plugins/sudoku/Makefile
deleted file mode 100644
index 948b315..0000000
--- a/apps/plugins/sudoku/Makefile
+++ /dev/null
@@ -1,75 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $Id$
-#
-
-INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
- -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) \
- -I$(BUILDDIR)/pluginbitmaps
-CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
- -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-LINKFILE := $(OBJDIR)/link.lds
-DEPFILE = $(OBJDIR)/dep-sudoku
-
-# This sets up 'SRC' based on the files mentioned in SOURCES
-include $(TOOLSDIR)/makesrc.inc
-
-SOURCES = $(SRC)
-OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
-DIRS = .
-
-ifndef SIMVER
- LDS := ../plugin.lds
- OUTPUT = $(OUTDIR)/sudoku.rock
-else ## simulators
- OUTPUT = $(OUTDIR)/sudoku.rock
-endif
-
-all: $(OUTPUT)
-
-ifndef SIMVER
-$(OBJDIR)/sudoku.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
- $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/sudoku.map
-
-$(OUTPUT): $(OBJDIR)/sudoku.elf
- $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
-else
-###################################################
-# This is the SDL simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-endif # end of simulator section
-
-
-include $(TOOLSDIR)/make.inc
-
-# MEMORYSIZE should be passed on to this makefile with the chosen memory size
-# given in number of MB
-$(LINKFILE): $(LDS)
- $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
- $(DEFINES) -E -P - >$@
-
-clean:
- $(call PRINTS,cleaning sudoku)rm -rf $(OBJDIR)/sudoku
- $(SILENT)rm -f $(OBJDIR)/sudoku.* $(DEPFILE)
-
--include $(DEPFILE)
diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c
index 150edab..4430778 100644
--- a/apps/plugins/sudoku/sudoku.c
+++ b/apps/plugins/sudoku/sudoku.c
@@ -69,9 +69,9 @@ Example ".ss" file, and one with a saved state:
#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
diff --git a/apps/plugins/sudoku/sudoku.make b/apps/plugins/sudoku/sudoku.make
new file mode 100644
index 0000000..e1f397c
--- /dev/null
+++ b/apps/plugins/sudoku/sudoku.make
@@ -0,0 +1,21 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
+#
+
+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)
diff --git a/apps/plugins/test_disk.c b/apps/plugins/test_disk.c
index 2e421e1..085435e 100644
--- a/apps/plugins/test_disk.c
+++ b/apps/plugins/test_disk.c
@@ -20,8 +20,8 @@
****************************************************************************/
#include "plugin.h"
-#include "oldmenuapi.h"
-#include "helper.h"
+#include "lib/oldmenuapi.h"
+#include "lib/helper.h"
PLUGIN_HEADER
diff --git a/apps/plugins/test_fps.c b/apps/plugins/test_fps.c
index 7148cfc..6d34773 100644
--- a/apps/plugins/test_fps.c
+++ b/apps/plugins/test_fps.c
@@ -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
diff --git a/apps/plugins/test_resize.c b/apps/plugins/test_resize.c
index 108360b..b0ef787 100644
--- a/apps/plugins/test_resize.c
+++ b/apps/plugins/test_resize.c
@@ -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
diff --git a/apps/plugins/test_sampr.c b/apps/plugins/test_sampr.c
index 7073494..01f24b5 100644
--- a/apps/plugins/test_sampr.c
+++ b/apps/plugins/test_sampr.c
@@ -19,7 +19,7 @@
*
****************************************************************************/
#include "plugin.h"
-#include "oldmenuapi.h"
+#include "lib/oldmenuapi.h"
PLUGIN_HEADER
diff --git a/apps/plugins/text_editor.c b/apps/plugins/text_editor.c
index 6910c6c..c9d973f 100644
--- a/apps/plugins/text_editor.c
+++ b/apps/plugins/text_editor.c
@@ -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 */
diff --git a/apps/plugins/video.c b/apps/plugins/video.c
index 69c6f4e..a31b7c5 100644
--- a/apps/plugins/video.c
+++ b/apps/plugins/video.c
@@ -29,7 +29,7 @@
#include "plugin.h"
#include "sh7034.h"
#include "system.h"
-#include "helper.h"
+#include "lib/helper.h"
#ifndef SIMULATOR /* not for simulator by now */
#ifdef HAVE_LCD_BITMAP /* and definitely not for the Player, haha */
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c
index 51fb791..e85a979 100644
--- a/apps/plugins/viewer.c
+++ b/apps/plugins/viewer.c
@@ -21,8 +21,8 @@
****************************************************************************/
#include "plugin.h"
#include <ctype.h>
-#include "playback_control.h"
-#include "oldmenuapi.h"
+#include "lib/playback_control.h"
+#include "lib/oldmenuapi.h"
PLUGIN_HEADER
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c
index 405f6df..f07eb09 100644
--- a/apps/plugins/vu_meter.c
+++ b/apps/plugins/vu_meter.c
@@ -18,7 +18,7 @@
*
**************************************************************************/
#include "plugin.h"
-#include "fixedpoint.h"
+#include "lib/fixedpoint.h"
#if defined(HAVE_LCD_BITMAP)
diff --git a/apps/plugins/wavrecord.c b/apps/plugins/wavrecord.c
index d4b8bf1..c26e2c4 100644
--- a/apps/plugins/wavrecord.c
+++ b/apps/plugins/wavrecord.c
@@ -19,7 +19,7 @@
*
****************************************************************************/
#include "plugin.h"
-#include "configfile.h"
+#include "lib/configfile.h"
PLUGIN_HEADER
diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c
index 6586e78..5411d0c 100644
--- a/apps/plugins/wormlet.c
+++ b/apps/plugins/wormlet.c
@@ -19,8 +19,8 @@
*
****************************************************************************/
#include "plugin.h"
-#include "configfile.h"
-#include "helper.h"
+#include "lib/configfile.h"
+#include "lib/helper.h"
PLUGIN_HEADER
diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c
index 59e080d..d345c44 100644
--- a/apps/plugins/xobox.c
+++ b/apps/plugins/xobox.c
@@ -21,7 +21,7 @@
****************************************************************************/
#include "plugin.h"
-#include "helper.h"
+#include "lib/helper.h"
PLUGIN_HEADER
diff --git a/apps/plugins/zxbox.c b/apps/plugins/zxbox.c
index 10e43c4..3c1c78f 100644
--- a/apps/plugins/zxbox.c
+++ b/apps/plugins/zxbox.c
@@ -21,7 +21,7 @@
#if MEM <= 8 && !defined(SIMULATOR)
-#include "overlay.h"
+#include "lib/overlay.h"
PLUGIN_HEADER
diff --git a/apps/plugins/zxbox/Makefile b/apps/plugins/zxbox/Makefile
deleted file mode 100644
index d7862c5..0000000
--- a/apps/plugins/zxbox/Makefile
+++ /dev/null
@@ -1,84 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-#
-OPT_FLAGS=-O3 -funroll-loops
-
-INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
- -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) -I. $(TARGET_INC)
-CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
- -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN $(OPT_FLAGS) $(PROFILE_OPTS)
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-LINKFILE := $(OBJDIR)/link.lds
-DEPFILE = $(OBJDIR)/dep-zxbox
-
-# This sets up 'SRC' based on the files mentioned in SOURCES
-include $(TOOLSDIR)/makesrc.inc
-
-SOURCES = $(SRC)
-OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
-OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
-DIRS = .
-
-ifndef SIMVER
-ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
- LDS := archos.lds
- OUTPUT = $(OUTDIR)/zxbox.ovl
-else ## iRiver/iPod/... targets
- LDS := ../plugin.lds
- OUTPUT = $(OUTDIR)/zxbox.rock
-endif
-else ## simulators
- OUTPUT = $(OUTDIR)/zxbox.rock
-endif
-
-all: $(OUTPUT)
-
-ifndef SIMVER
-$(OBJDIR)/zxbox.elf: $(OBJS) $(LINKFILE)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
- -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/zxbox.map
-
-$(OUTPUT): $(OBJDIR)/zxbox.elf
- $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
-else
-
-ifeq ($(SIMVER), sdl)
-###################################################
-# This is the SDL simulator version
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -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
-# #define ERROR_ACCESS_DENIED 5L
-else
- @chmod -x $@
-endif
-
-endif
-endif # end of simulator section
-
-
-include $(TOOLSDIR)/make.inc
-
-# MEMORYSIZE should be passed on to this makefile with the chosen memory size
-# given in number of MB
-$(LINKFILE): $(LDS)
- $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
- $(DEFINES) -E -P - >$@
-
-clean:
- $(call PRINTS,cleaning zxbox)rm -rf $(OBJDIR)/zxbox
- $(SILENT)rm -f $(OBJDIR)/zxbox.* $(DEPFILE)
-
--include $(DEPFILE)
-
diff --git a/apps/plugins/zxbox/spmain.c b/apps/plugins/zxbox/spmain.c
index 6c58656..bc5df48 100644
--- a/apps/plugins/zxbox/spmain.c
+++ b/apps/plugins/zxbox/spmain.c
@@ -43,7 +43,7 @@
#include <stdlib.h>
#include <errno.h>
#ifdef USE_GREY
-#include "../lib/grey.h"
+#include "lib/grey.h"
#endif
#include "zxbox_keyb.h"
diff --git a/apps/plugins/zxbox/zxbox.make b/apps/plugins/zxbox/zxbox.make
new file mode 100644
index 0000000..e617ba3
--- /dev/null
+++ b/apps/plugins/zxbox/zxbox.make
@@ -0,0 +1,57 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
+#
+
+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 $(<F))$(call preprocess2file,$<,$@)
+
+$(ZXBOX_OBJDIR)/zxbox.rock: $(ZXBOX_OBJ) $(ZXBOX_OUTLDS) $(PLUGINBITMAPLIB)
+
+$(ZXBOX_OBJDIR)/zxbox.ovl: $(ZXBOX_OBJ) $(ZXBOX_OUTLDS) $(PLUGINBITMAPLIB) $(PLUGINLIB)
+ $(SILENT)$(CC) $(PLUGINFLAGS) -o $(ZXBOX_OBJDIR)/$*.elf \
+ $(filter %.o, $^) \
+ $(filter %.a, $^) \
+ -lgcc $(ZXBOX_LDFLAGS)
+ $(call PRINTS,LD $(@F))$(OC) -O binary $(ZXBOX_OBJDIR)/$*.elf $@
+
+# special pattern rule for compiling zxbox with extra flags
+$(ZXBOX_OBJDIR)/%.o: $(ZXBOX_SRCDIR)/%.c $(PLUGINBITMAPLIB) $(ZXBOX_SRCDIR)/zxbox.make
+ $(SILENT)mkdir -p $(dir $@)
+ $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(ZXBOXFLAGS) -c $< -o $@
diff --git a/apps/plugins/zxbox/zxvid_com.h b/apps/plugins/zxbox/zxvid_com.h
index 2ef67c6..1e23ca0 100644
--- a/apps/plugins/zxbox/zxvid_com.h
+++ b/apps/plugins/zxbox/zxvid_com.h
@@ -3,7 +3,7 @@
#include "zxconfig.h"
#ifdef USE_GREY
-#include "../lib/grey.h"
+#include "lib/grey.h"
#endif
#include "spscr_p.h"