From c6b3d38a156dd624760a8eb1bb374affd43b4f2a Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Thu, 20 Nov 2008 11:27:31 +0000 Subject: New makefile solution: A single invocation of 'make' to build the entire tree. Fully controlled dependencies give faster and more correct recompiles. Many #include lines adjusted to conform to the new standards. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19146 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/Makefile | 180 --------------------- apps/plugins/beatbox/Makefile | 74 --------- apps/plugins/bitmaps/mono/Makefile | 32 ---- apps/plugins/bitmaps/native/Makefile | 32 ---- apps/plugins/bitmaps/native/SOURCES | 48 +++--- .../bitmaps/native/star_tiles.10x10.grey.bmp | Bin 1678 -> 0 bytes apps/plugins/bitmaps/native/star_tiles.10x10x2.bmp | Bin 0 -> 1678 bytes .../plugins/bitmaps/native/star_tiles.6x7.mono.bmp | Bin 184 -> 0 bytes apps/plugins/bitmaps/native/star_tiles.6x7x1.bmp | Bin 0 -> 184 bytes .../plugins/bitmaps/native/star_tiles.8x8.grey.bmp | Bin 390 -> 0 bytes apps/plugins/bitmaps/native/star_tiles.8x8x2.bmp | Bin 0 -> 390 bytes apps/plugins/bitmaps/pluginbitmaps.make | 59 +++++++ apps/plugins/bitmaps/remote_mono/Makefile | 32 ---- apps/plugins/bitmaps/remote_native/Makefile | 32 ---- apps/plugins/bitmaps/remote_native/SOURCES | 4 +- apps/plugins/bounce.c | 2 +- apps/plugins/brickmania.c | 4 +- apps/plugins/bubbles.c | 6 +- apps/plugins/chessbox.c | 2 +- apps/plugins/chessbox/Makefile | 114 ------------- apps/plugins/chessbox/SOURCES | 4 + apps/plugins/chessbox/chessbox.c | 2 +- apps/plugins/chessbox/chessbox.make | 58 +++++++ apps/plugins/chopper.c | 6 +- apps/plugins/clock/Makefile | 112 ------------- apps/plugins/clock/clock.c | 4 +- apps/plugins/clock/clock.make | 21 +++ apps/plugins/clock/clock_bitmap_strings.h | 2 +- apps/plugins/clock/clock_bitmaps.c | 28 ++-- apps/plugins/clock/clock_bitmaps.h | 2 +- apps/plugins/clock/clock_counter.h | 2 +- apps/plugins/clock/clock_draw_analog.c | 4 +- apps/plugins/clock/clock_draw_binary.c | 2 +- apps/plugins/clock/clock_draw_digital.c | 2 +- apps/plugins/clock/clock_settings.c | 2 +- apps/plugins/credits.c | 2 +- apps/plugins/cube.c | 8 +- apps/plugins/demystify.c | 4 +- apps/plugins/dice.c | 4 +- apps/plugins/doom/Makefile | 173 -------------------- apps/plugins/doom/SOURCES | 62 +++++++ apps/plugins/doom/doom.make | 54 +++++++ apps/plugins/doom/i_video.c | 2 +- apps/plugins/euroconverter.c | 2 +- apps/plugins/fire.c | 8 +- apps/plugins/fireworks.c | 4 +- apps/plugins/greyscale.c | 4 +- apps/plugins/invadrox.c | 4 +- apps/plugins/jackpot.c | 4 +- apps/plugins/jewels.c | 2 +- apps/plugins/jpeg/Makefile | 75 --------- apps/plugins/jpeg/jpeg.make | 21 +++ apps/plugins/keybox.c | 2 +- apps/plugins/lamp.c | 2 +- apps/plugins/lib/Makefile | 50 ------ apps/plugins/logo.c | 2 +- apps/plugins/mandelbrot.c | 4 +- apps/plugins/maze.c | 4 +- apps/plugins/mazezam.c | 8 +- apps/plugins/metronome.c | 2 +- apps/plugins/midi/Makefile | 77 --------- apps/plugins/midi/midi.make | 28 ++++ apps/plugins/mosaique.c | 2 +- apps/plugins/mpegplayer/Makefile | 78 --------- apps/plugins/mpegplayer/audio_thread.c | 4 +- apps/plugins/mpegplayer/mpeg_settings.c | 2 +- apps/plugins/mpegplayer/mpegplayer.c | 2 +- apps/plugins/mpegplayer/mpegplayer.h | 2 +- apps/plugins/mpegplayer/mpegplayer.make | 21 +++ apps/plugins/mpegplayer/stream_mgr.c | 2 +- apps/plugins/mpegplayer/video_thread.c | 2 +- apps/plugins/oscilloscope.c | 6 +- apps/plugins/pacbox/Makefile | 108 ------------- apps/plugins/pacbox/pacbox.make | 27 ++++ apps/plugins/pictureflow.c | 8 +- apps/plugins/plasma.c | 6 +- apps/plugins/plugins.make | 76 +++++++++ apps/plugins/ppmviewer.c | 2 +- apps/plugins/random_folder_advance_config.c | 2 +- apps/plugins/reversi/Makefile | 111 ------------- apps/plugins/reversi/reversi-gui.c | 2 +- apps/plugins/reversi/reversi.make | 28 ++++ apps/plugins/robotfindskitten.c | 10 +- apps/plugins/rockblox.c | 6 +- apps/plugins/rockboy.c | 2 +- apps/plugins/rockboy/Makefile | 119 -------------- apps/plugins/rockboy/SOURCES | 16 ++ apps/plugins/rockboy/rockboy.make | 53 ++++++ apps/plugins/rocklife.c | 4 +- apps/plugins/rockpaint.c | 1 - apps/plugins/searchengine/Makefile | 105 ------------ apps/plugins/shortcuts/Makefile | 90 ----------- apps/plugins/shortcuts/shortcuts.make | 25 +++ apps/plugins/sliding_puzzle.c | 2 +- apps/plugins/snow.c | 2 +- apps/plugins/sokoban.c | 8 + apps/plugins/solitaire.c | 6 +- apps/plugins/spacerocks.c | 4 +- apps/plugins/starfield.c | 2 +- apps/plugins/sudoku/Makefile | 75 --------- apps/plugins/sudoku/sudoku.c | 6 +- apps/plugins/sudoku/sudoku.make | 21 +++ apps/plugins/test_disk.c | 4 +- apps/plugins/test_fps.c | 4 +- apps/plugins/test_resize.c | 4 +- apps/plugins/test_sampr.c | 2 +- apps/plugins/text_editor.c | 2 +- apps/plugins/video.c | 2 +- apps/plugins/viewer.c | 4 +- apps/plugins/vu_meter.c | 2 +- apps/plugins/wavrecord.c | 2 +- apps/plugins/wormlet.c | 4 +- apps/plugins/xobox.c | 2 +- apps/plugins/zxbox.c | 2 +- apps/plugins/zxbox/Makefile | 84 ---------- apps/plugins/zxbox/spmain.c | 2 +- apps/plugins/zxbox/zxbox.make | 57 +++++++ apps/plugins/zxbox/zxvid_com.h | 2 +- 118 files changed, 801 insertions(+), 1910 deletions(-) delete mode 100644 apps/plugins/Makefile delete mode 100644 apps/plugins/beatbox/Makefile delete mode 100644 apps/plugins/bitmaps/mono/Makefile delete mode 100644 apps/plugins/bitmaps/native/Makefile delete mode 100644 apps/plugins/bitmaps/native/star_tiles.10x10.grey.bmp create mode 100644 apps/plugins/bitmaps/native/star_tiles.10x10x2.bmp delete mode 100644 apps/plugins/bitmaps/native/star_tiles.6x7.mono.bmp create mode 100644 apps/plugins/bitmaps/native/star_tiles.6x7x1.bmp delete mode 100644 apps/plugins/bitmaps/native/star_tiles.8x8.grey.bmp create mode 100644 apps/plugins/bitmaps/native/star_tiles.8x8x2.bmp create mode 100644 apps/plugins/bitmaps/pluginbitmaps.make delete mode 100644 apps/plugins/bitmaps/remote_mono/Makefile delete mode 100644 apps/plugins/bitmaps/remote_native/Makefile delete mode 100644 apps/plugins/chessbox/Makefile create mode 100644 apps/plugins/chessbox/SOURCES create mode 100644 apps/plugins/chessbox/chessbox.make delete mode 100644 apps/plugins/clock/Makefile create mode 100644 apps/plugins/clock/clock.make delete mode 100644 apps/plugins/doom/Makefile create mode 100644 apps/plugins/doom/SOURCES create mode 100644 apps/plugins/doom/doom.make delete mode 100644 apps/plugins/jpeg/Makefile create mode 100644 apps/plugins/jpeg/jpeg.make delete mode 100644 apps/plugins/lib/Makefile delete mode 100644 apps/plugins/midi/Makefile create mode 100644 apps/plugins/midi/midi.make delete mode 100644 apps/plugins/mpegplayer/Makefile create mode 100644 apps/plugins/mpegplayer/mpegplayer.make delete mode 100644 apps/plugins/pacbox/Makefile create mode 100644 apps/plugins/pacbox/pacbox.make create mode 100644 apps/plugins/plugins.make delete mode 100644 apps/plugins/reversi/Makefile create mode 100644 apps/plugins/reversi/reversi.make delete mode 100644 apps/plugins/rockboy/Makefile create mode 100644 apps/plugins/rockboy/SOURCES create mode 100644 apps/plugins/rockboy/rockboy.make delete mode 100644 apps/plugins/searchengine/Makefile delete mode 100644 apps/plugins/shortcuts/Makefile create mode 100644 apps/plugins/shortcuts/shortcuts.make delete mode 100644 apps/plugins/sudoku/Makefile create mode 100644 apps/plugins/sudoku/sudoku.make delete mode 100644 apps/plugins/zxbox/Makefile create mode 100644 apps/plugins/zxbox/zxbox.make (limited to 'apps/plugins') diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile deleted file mode 100644 index 19d062286c..0000000000 --- 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 $($@ - -$(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 9465c420d2..0000000000 --- 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 03eb77a55b..0000000000 --- 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 071f0d4ba1..0000000000 --- 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 b95fd379c0..c248bcb97b 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.10x10.grey.bmp deleted file mode 100644 index 54e14bbbe1..0000000000 Binary files a/apps/plugins/bitmaps/native/star_tiles.10x10.grey.bmp and /dev/null differ diff --git a/apps/plugins/bitmaps/native/star_tiles.10x10x2.bmp b/apps/plugins/bitmaps/native/star_tiles.10x10x2.bmp new file mode 100644 index 0000000000..54e14bbbe1 Binary files /dev/null and b/apps/plugins/bitmaps/native/star_tiles.10x10x2.bmp differ diff --git a/apps/plugins/bitmaps/native/star_tiles.6x7.mono.bmp b/apps/plugins/bitmaps/native/star_tiles.6x7.mono.bmp deleted file mode 100644 index ebc59b9b11..0000000000 Binary files a/apps/plugins/bitmaps/native/star_tiles.6x7.mono.bmp and /dev/null differ diff --git a/apps/plugins/bitmaps/native/star_tiles.6x7x1.bmp b/apps/plugins/bitmaps/native/star_tiles.6x7x1.bmp new file mode 100644 index 0000000000..ebc59b9b11 Binary files /dev/null and b/apps/plugins/bitmaps/native/star_tiles.6x7x1.bmp differ diff --git a/apps/plugins/bitmaps/native/star_tiles.8x8.grey.bmp b/apps/plugins/bitmaps/native/star_tiles.8x8.grey.bmp deleted file mode 100644 index 6f810ce562..0000000000 Binary files a/apps/plugins/bitmaps/native/star_tiles.8x8.grey.bmp and /dev/null differ diff --git a/apps/plugins/bitmaps/native/star_tiles.8x8x2.bmp b/apps/plugins/bitmaps/native/star_tiles.8x8x2.bmp new file mode 100644 index 0000000000..6f810ce562 Binary files /dev/null and b/apps/plugins/bitmaps/native/star_tiles.8x8x2.bmp differ diff --git a/apps/plugins/bitmaps/pluginbitmaps.make b/apps/plugins/bitmaps/pluginbitmaps.make new file mode 100644 index 0000000000..7dbcc0bdff --- /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 $( $@ + +$(BUILDDIR)/apps/plugins/bitmaps/native/%.c: $(ROOTDIR)/apps/plugins/bitmaps/native/%.bmp $(TOOLSDIR)/bmp2rb + $(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR) + $(call PRINTS,BMP2RB $( $@ + +$(BUILDDIR)/apps/plugins/bitmaps/remote_mono/%.c: $(ROOTDIR)/apps/plugins/bitmaps/remote_mono/%.bmp $(TOOLSDIR)/bmp2rb + $(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR) + $(call PRINTS,BMP2RB $( $@ + +$(BUILDDIR)/apps/plugins/bitmaps/remote_native/%.c: $(ROOTDIR)/apps/plugins/bitmaps/remote_native/%.bmp $(TOOLSDIR)/bmp2rb + $(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR) + $(call PRINTS,BMP2RB $( $@ + +endif diff --git a/apps/plugins/bitmaps/remote_mono/Makefile b/apps/plugins/bitmaps/remote_mono/Makefile deleted file mode 100644 index d3858fa46a..0000000000 --- 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 3802e75781..0000000000 --- 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 3633f23eb1..2bc3d59c07 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 65aaa3ef09..5d92ed1c4b 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 159e1ecfb4..6d84d2bc85 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 17bfeca01d..5415f3b506 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 51ff184d62..9e86c39b11 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 4efb40df4c..0000000000 --- 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 0000000000..067e3f084a --- /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 f34bdbf24a..f8db7d9b7f 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 0000000000..d42984c771 --- /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 $( ) \___| < | \_\ ( <_> > < < -# 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 1d257fde6e..9279a182ee 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 0000000000..c864d67503 --- /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 549a4a9448..3f5a09d34b 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 2a0590015a..c237a290ec 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 e6e09652d1..750c4d397e 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 25523d45f6..46563e9eb7 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 391bd73519..c41ec3b24c 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 b6c7a9ac29..99f90934d9 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 7c5925d75f..de5f427c8c 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 1147055ce5..1d78c4705e 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 11a5d2fda2..e3e659bf48 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 8be304e808..ec1930f547 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 96cb5a4cc0..145c3ce0be 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 086309a1b8..77bbda3cae 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 df6baf704b..0000000000 --- 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 0000000000..6cd69faee6 --- /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 0000000000..d566f5307b --- /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 15d0166733..7713fe19f2 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 e982af9f24..02617abc39 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 5987e9c429..f1b62f5b26 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 e79f0ff377..5134d01538 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 b5fabe030d..cd8db5bf8b 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 0f8b92d9b3..8b73221331 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 a4865b47fb..2380dad2b9 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 075edfda33..239827c123 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 83207258b5..0000000000 --- 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 0000000000..9413ef24b3 --- /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 fef3d4f23a..dae413ccbc 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 94f48eae30..bad757c161 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 c75cca1be9..0000000000 --- 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 be4a39c2b5..b2e640161d 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 ca7f708fc8..56483bdfd3 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 f7751ceb48..67c0623dec 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 c1726a5e95..fac12def4f 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 1841860144..58abbcaa6c 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 03d6bc69bb..0000000000 --- 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 0000000000..9100764974 --- /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 90ffa37e07..4c8139cb0a 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 7f90cbcc8d..0000000000 --- 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 351581548f..45226575c9 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 14863c943d..0c66f3ff32 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 5e34c2b041..dc2dc0d1fd 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 4ee30b7b00..323f8f34f1 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 0000000000..7242be3715 --- /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 ae1ff512ea..424d2fe503 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 91f08a5a66..100904b01b 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 9cb59a8fad..68b4530e40 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 e1b998a7aa..0000000000 --- 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 0000000000..75a599d602 --- /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 4dde74a94f..29e8a749d5 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 22d67b6775..5d12818beb 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 0000000000..2e266cb190 --- /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 .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 01513c4877..97f085ad6f 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 3df38082ba..9c568df3be 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 97a042e0f7..0000000000 --- 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 d91f24b3d9..1c1cf56168 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 0000000000..be7369423e --- /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 4b33513eb2..747689d9db 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 5ff220f2f1..d9b1c0aeb5 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 af3877154a..f3d25e21cd 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 4aa8526125..0000000000 --- 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 0000000000..8806b58389 --- /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 0000000000..62196cf0b7 --- /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 $( ) \___| < | \_\ ( <_> > < < -# 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 2958af8818..0000000000 --- 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 0000000000..fc2a77a2f5 --- /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 ef33a4f642..0d12556696 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 056ab7818b..28315cc34f 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 9b9cd29e0a..0a032f6bd1 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 d48733461d..f95777e024 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 21cfb1e794..b8cf043125 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 f8f24b93d4..536213686a 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 948b315a32..0000000000 --- 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 150edaba54..4430778cac 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 0000000000..e1f397c121 --- /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 2e421e151e..085435e4c9 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 7148cfc8b7..6d347738b7 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 108360b69a..b0ef787d36 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 7073494d63..01f24b5987 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 6910c6c7e2..c9d973fe22 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 69c6f4ed9e..a31b7c5415 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 51fb791b1d..e85a979bd5 100644 --- a/apps/plugins/viewer.c +++ b/apps/plugins/viewer.c @@ -21,8 +21,8 @@ ****************************************************************************/ #include "plugin.h" #include -#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 405f6df01d..f07eb098a3 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 d4b8bf1fd2..c26e2c4973 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 6586e78b2c..5411d0cb68 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 59e080d2e0..d345c4404f 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 10e43c4a42..3c1c78f9d2 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 d7862c514b..0000000000 --- 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 6c586566f9..bc5df48059 100644 --- a/apps/plugins/zxbox/spmain.c +++ b/apps/plugins/zxbox/spmain.c @@ -43,7 +43,7 @@ #include #include #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 0000000000..e617ba3a12 --- /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 $(