summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2008-11-20 11:27:31 +0000
committerBjörn Stenberg <bjorn@haxx.se>2008-11-20 11:27:31 +0000
commitc6b3d38a156dd624760a8eb1bb374affd43b4f2a (patch)
tree493eba929e2396d86cf4f077709aa09fe172cd35 /apps/plugins
parentf66c30346783a400a029bedcd60ab67c81c34a07 (diff)
downloadrockbox-c6b3d38a156dd624760a8eb1bb374affd43b4f2a.tar.gz
rockbox-c6b3d38a156dd624760a8eb1bb374affd43b4f2a.zip
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
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/Makefile180
-rw-r--r--apps/plugins/beatbox/Makefile74
-rw-r--r--apps/plugins/bitmaps/mono/Makefile32
-rw-r--r--apps/plugins/bitmaps/native/Makefile32
-rw-r--r--apps/plugins/bitmaps/native/SOURCES48
-rw-r--r--apps/plugins/bitmaps/native/star_tiles.10x10x2.bmp (renamed from apps/plugins/bitmaps/native/star_tiles.10x10.grey.bmp)bin1678 -> 1678 bytes
-rw-r--r--apps/plugins/bitmaps/native/star_tiles.6x7x1.bmp (renamed from apps/plugins/bitmaps/native/star_tiles.6x7.mono.bmp)bin184 -> 184 bytes
-rw-r--r--apps/plugins/bitmaps/native/star_tiles.8x8x2.bmp (renamed from apps/plugins/bitmaps/native/star_tiles.8x8.grey.bmp)bin390 -> 390 bytes
-rw-r--r--apps/plugins/bitmaps/pluginbitmaps.make59
-rw-r--r--apps/plugins/bitmaps/remote_mono/Makefile32
-rw-r--r--apps/plugins/bitmaps/remote_native/Makefile32
-rw-r--r--apps/plugins/bitmaps/remote_native/SOURCES4
-rw-r--r--apps/plugins/bounce.c2
-rw-r--r--apps/plugins/brickmania.c4
-rw-r--r--apps/plugins/bubbles.c6
-rw-r--r--apps/plugins/chessbox.c2
-rw-r--r--apps/plugins/chessbox/Makefile114
-rw-r--r--apps/plugins/chessbox/SOURCES4
-rw-r--r--apps/plugins/chessbox/chessbox.c2
-rw-r--r--apps/plugins/chessbox/chessbox.make58
-rw-r--r--apps/plugins/chopper.c6
-rw-r--r--apps/plugins/clock/Makefile112
-rw-r--r--apps/plugins/clock/clock.c4
-rw-r--r--apps/plugins/clock/clock.make21
-rw-r--r--apps/plugins/clock/clock_bitmap_strings.h2
-rw-r--r--apps/plugins/clock/clock_bitmaps.c28
-rw-r--r--apps/plugins/clock/clock_bitmaps.h2
-rw-r--r--apps/plugins/clock/clock_counter.h2
-rw-r--r--apps/plugins/clock/clock_draw_analog.c4
-rw-r--r--apps/plugins/clock/clock_draw_binary.c2
-rw-r--r--apps/plugins/clock/clock_draw_digital.c2
-rw-r--r--apps/plugins/clock/clock_settings.c2
-rw-r--r--apps/plugins/credits.c2
-rw-r--r--apps/plugins/cube.c8
-rw-r--r--apps/plugins/demystify.c4
-rw-r--r--apps/plugins/dice.c4
-rw-r--r--apps/plugins/doom/Makefile173
-rw-r--r--apps/plugins/doom/SOURCES62
-rw-r--r--apps/plugins/doom/doom.make54
-rw-r--r--apps/plugins/doom/i_video.c2
-rw-r--r--apps/plugins/euroconverter.c2
-rw-r--r--apps/plugins/fire.c8
-rw-r--r--apps/plugins/fireworks.c4
-rw-r--r--apps/plugins/greyscale.c4
-rw-r--r--apps/plugins/invadrox.c4
-rw-r--r--apps/plugins/jackpot.c4
-rw-r--r--apps/plugins/jewels.c2
-rw-r--r--apps/plugins/jpeg/Makefile75
-rw-r--r--apps/plugins/jpeg/jpeg.make21
-rw-r--r--apps/plugins/keybox.c2
-rw-r--r--apps/plugins/lamp.c2
-rw-r--r--apps/plugins/lib/Makefile50
-rw-r--r--apps/plugins/logo.c2
-rw-r--r--apps/plugins/mandelbrot.c4
-rw-r--r--apps/plugins/maze.c4
-rw-r--r--apps/plugins/mazezam.c8
-rw-r--r--apps/plugins/metronome.c2
-rw-r--r--apps/plugins/midi/Makefile77
-rw-r--r--apps/plugins/midi/midi.make28
-rw-r--r--apps/plugins/mosaique.c2
-rw-r--r--apps/plugins/mpegplayer/Makefile78
-rw-r--r--apps/plugins/mpegplayer/audio_thread.c4
-rw-r--r--apps/plugins/mpegplayer/mpeg_settings.c2
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.c2
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.h2
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.make21
-rw-r--r--apps/plugins/mpegplayer/stream_mgr.c2
-rw-r--r--apps/plugins/mpegplayer/video_thread.c2
-rw-r--r--apps/plugins/oscilloscope.c6
-rw-r--r--apps/plugins/pacbox/Makefile108
-rw-r--r--apps/plugins/pacbox/pacbox.make27
-rw-r--r--apps/plugins/pictureflow.c8
-rw-r--r--apps/plugins/plasma.c6
-rw-r--r--apps/plugins/plugins.make76
-rw-r--r--apps/plugins/ppmviewer.c2
-rw-r--r--apps/plugins/random_folder_advance_config.c2
-rw-r--r--apps/plugins/reversi/Makefile111
-rw-r--r--apps/plugins/reversi/reversi-gui.c2
-rw-r--r--apps/plugins/reversi/reversi.make28
-rw-r--r--apps/plugins/robotfindskitten.c10
-rw-r--r--apps/plugins/rockblox.c6
-rw-r--r--apps/plugins/rockboy.c2
-rw-r--r--apps/plugins/rockboy/Makefile119
-rw-r--r--apps/plugins/rockboy/SOURCES16
-rw-r--r--apps/plugins/rockboy/rockboy.make53
-rw-r--r--apps/plugins/rocklife.c4
-rw-r--r--apps/plugins/rockpaint.c1
-rw-r--r--apps/plugins/searchengine/Makefile105
-rw-r--r--apps/plugins/shortcuts/Makefile90
-rw-r--r--apps/plugins/shortcuts/shortcuts.make25
-rw-r--r--apps/plugins/sliding_puzzle.c2
-rw-r--r--apps/plugins/snow.c2
-rw-r--r--apps/plugins/sokoban.c8
-rw-r--r--apps/plugins/solitaire.c6
-rw-r--r--apps/plugins/spacerocks.c4
-rw-r--r--apps/plugins/starfield.c2
-rw-r--r--apps/plugins/sudoku/Makefile75
-rw-r--r--apps/plugins/sudoku/sudoku.c6
-rw-r--r--apps/plugins/sudoku/sudoku.make21
-rw-r--r--apps/plugins/test_disk.c4
-rw-r--r--apps/plugins/test_fps.c4
-rw-r--r--apps/plugins/test_resize.c4
-rw-r--r--apps/plugins/test_sampr.c2
-rw-r--r--apps/plugins/text_editor.c2
-rw-r--r--apps/plugins/video.c2
-rw-r--r--apps/plugins/viewer.c4
-rw-r--r--apps/plugins/vu_meter.c2
-rw-r--r--apps/plugins/wavrecord.c2
-rw-r--r--apps/plugins/wormlet.c4
-rw-r--r--apps/plugins/xobox.c2
-rw-r--r--apps/plugins/zxbox.c2
-rw-r--r--apps/plugins/zxbox/Makefile84
-rw-r--r--apps/plugins/zxbox/spmain.c2
-rw-r--r--apps/plugins/zxbox/zxbox.make57
-rw-r--r--apps/plugins/zxbox/zxvid_com.h2
115 files changed, 801 insertions, 1910 deletions
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile
deleted file mode 100644
index 19d062286c..0000000000
--- a/apps/plugins/Makefile
+++ /dev/null
@@ -1,180 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10INCLUDES = $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/common \
11 -I$(FIRMDIR)/drivers -I$(APPSDIR) -Ilib -I$(BUILDDIR)
12
13CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
14 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
15
16ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
18endif
19
20ifdef SOFTWARECODECS
21 CODECLIBS = -lmad -la52 -lffmpegFLAC -ltremor -lwavpack -lmusepack
22endif
23
24# Set up the bitmap libraries
25BITMAPLIBS =
26LINKBITMAPS =
27ifneq ($(strip $(BMP2RB_MONO)),)
28 BITMAPLIBS += pluginbitmapsmono
29 LINKBITMAPS += -lpluginbitmapsmono
30endif
31ifneq ($(strip $(BMP2RB_NATIVE)),)
32 BITMAPLIBS += pluginbitmapsnative
33 LINKBITMAPS += -lpluginbitmapsnative
34endif
35ifneq ($(strip $(BMP2RB_REMOTEMONO)),)
36 BITMAPLIBS += pluginbitmapsremotemono
37 LINKBITMAPS += -lpluginbitmapsremotemono
38endif
39ifneq ($(strip $(BMP2RB_REMOTENATIVE)),)
40 BITMAPLIBS += pluginbitmapsremotenative
41 LINKBITMAPS += -lpluginbitmapsremotenative
42endif
43
44LDS := plugin.lds
45LINKFILE := $(OBJDIR)/pluginlink.lds
46DEPFILE = $(OBJDIR)/dep-plugins
47
48# This sets up 'SRC' based on the files mentioned in SOURCES
49include $(TOOLSDIR)/makesrc.inc
50
51# This sets up 'SUBDIRS' based on the directories mentioned in SUBDIRS
52include $(TOOLSDIR)/makesubdirs.inc
53
54ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock)
55SOURCES = $(SRC)
56ELFS := $(SRC:%.c=$(OBJDIR)/%.elf)
57OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
58# as created by the cross-compiler for win32:
59DEFS := $(SRC:%.c=$(OBJDIR)/%.def)
60DIRS = .
61
62.PHONY: $(SUBDIRS)
63all: build
64
65dep: $(DEPFILE)
66
67build: $(DEPFILE) $(BITMAPLIBS)
68 $(call PRINTS,MAKE rocks)$(MAKE) rocks
69 $(call PRINTS,MAKE subdirs)$(MAKE) subdirs
70
71rocks: $(ROCKS)
72
73subdirs: $(SUBDIRS)
74
75$(BUILDDIR)/credits.raw: $(DOCSDIR)/CREDITS
76 $(call PRINTS,create credits.raw)perl credits.pl < $< > $@
77
78$(OBJDIR)/credits.o: credits.c $(BUILDDIR)/credits.raw
79 $(SILENT)mkdir -p $(dir $@)
80 $(call PRINTS,CC $(<F))$(CC) $(CFLAGS) -I$(OBJDIR) -c $< -o $@
81
82pluginbitmapsmono:
83 $(call PRINTS,MAKE in plugins/bitmaps/mono)$(MAKE) -C bitmaps/mono OBJDIR=$(OBJDIR)/bitmaps/mono
84
85pluginbitmapsnative:
86 $(call PRINTS,MAKE in plugins/bitmaps/native)$(MAKE) -C bitmaps/native OBJDIR=$(OBJDIR)/bitmaps/native
87
88pluginbitmapsremotemono:
89 $(call PRINTS,MAKE in plugins/bitmaps/remote_mono)$(MAKE) -C bitmaps/remote_mono OBJDIR=$(OBJDIR)/bitmaps/remote_mono
90
91pluginbitmapsremotenative:
92 $(call PRINTS,MAKE in plugins/bitmaps/remote_native)$(MAKE) -C bitmaps/remote_native OBJDIR=$(OBJDIR)/bitmaps/remote_native
93
94ifndef SIMVER
95$(OBJDIR)/%.rock: $(OBJDIR)/%.o $(LINKFILE)
96 $(SILENT)$(CC) $(CFLAGS) -o $(OBJDIR)/$*.elf $< -L$(BUILDDIR) \
97 $(CODECLIBS) -lplugin $(LINKBITMAPS) -lgcc \
98 -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/$*.map
99 $(call PRINTS,LINK $(@F))$(OC) -O binary $(OBJDIR)/$*.elf $(OBJDIR)/$*.rock
100
101else
102
103ifeq ($(SIMVER), x11)
104###################################################
105# This is the X11 simulator version
106
107$(OBJDIR)/%.rock : $(OBJDIR)/%.o
108 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -o $@
109ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
110# 'x' must be kept or you'll have "Win32 error 5"
111# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
112# #define ERROR_ACCESS_DENIED 5L
113else
114 $(SILENT)chmod -x $@
115endif
116
117else # end of x11-simulator
118ifeq ($(SIMVER), sdl)
119###################################################
120# This is the SDL simulator version
121
122$(OBJDIR)/%.rock : $(OBJDIR)/%.o
123 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -o $@
124ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
125# 'x' must be kept or you'll have "Win32 error 5"
126# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
127# #define ERROR_ACCESS_DENIED 5L
128else
129 $(SILENT)chmod -x $@
130endif
131
132else # end of sdl-simulator
133###################################################
134# This is the win32 simulator version
135DLLTOOLFLAGS = --export-all
136DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
137
138$(OBJDIR)/%.rock : $(OBJDIR)/%.o
139 $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $<
140 $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< $(BUILDDIR)/libplugin.a $(BITMAPLIBS) \
141 $(patsubst -l%,$(BUILDDIR)/lib%.a,$(CODECLIBS)) -o $@
142ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
143# 'x' must be kept or you'll have "Win32 error 5"
144# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
145# #define ERROR_ACCESS_DENIED 5L
146else
147 $(SILENT)chmod -x $@
148endif
149endif # end of win32-simulator
150endif
151
152endif # end of simulator section
153
154include $(TOOLSDIR)/make.inc
155
156pluginlib:
157 $(SILENT)mkdir -p $(OBJDIR)/lib
158 $(call PRINTS,MAKE in plugin/lib)$(MAKE) -C lib OBJDIR=$(OBJDIR)/lib
159
160$(LINKFILE): $(LDS)
161 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P - >$@
162
163$(SUBDIRS):
164 $(SILENT)mkdir -p $(OBJDIR)/$@
165 $(call PRINTS,MAKE in $@)$(MAKE) -C $@ OUTDIR=$(OBJDIR) OBJDIR=$(OBJDIR)/$@ \
166 LINKBITMAPS="$(LINKBITMAPS)"
167
168clean:
169 $(call PRINTS,cleaning plugins)rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \
170 $(BUILDDIR)/credits.raw $(OBJS) $(DEFS)
171 $(SILENT)$(MAKE) -C lib clean OBJDIR=$(OBJDIR)/lib
172 $(SILENT)$(MAKE) -C bitmaps/mono clean OBJDIR=$(OBJDIR)/bitmaps/mono
173 $(SILENT)$(MAKE) -C bitmaps/native clean OBJDIR=$(OBJDIR)/bitmaps/native
174 $(SILENT)$(MAKE) -C bitmaps/remote_mono clean OBJDIR=$(OBJDIR)/bitmaps/remote_mono
175 $(SILENT)$(MAKE) -C bitmaps/remote_native clean OBJDIR=$(OBJDIR)/bitmaps/remote_native
176 $(SILENT)$(MAKE) -C rockboy clean OBJDIR=$(OBJDIR)/rockboy
177 $(SILENT)$(MAKE) -C searchengine clean OBJDIR=$(OBJDIR)/searchengine
178 @rm -rf $(BUILDDIR)/pluginbitmaps
179
180-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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id $
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
12CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN -O3
14
15ifdef APPEXTRA
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17endif
18
19LINKFILE := $(OBJDIR)/link.lds
20DEPFILE = $(OBJDIR)/dep-beatbox
21
22# This sets up 'SRC' based on the files mentioned in SOURCES
23include $(TOOLSDIR)/makesrc.inc
24
25SOURCES = $(SRC)
26OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
27DIRS = .
28
29ifndef SIMVER
30 LDS := ../plugin.lds
31 OUTPUT = $(OUTDIR)/beatbox.rock
32else ## simulators
33 OUTPUT = $(OUTDIR)/beatbox.rock
34endif
35
36all: $(OUTPUT)
37
38ifndef SIMVER
39$(OBJDIR)/beatbox.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
40 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
41 $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/beatbox.map
42
43$(OUTPUT): $(OBJDIR)/beatbox.elf
44 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
45else
46
47###################################################
48# This is the SDL simulator version
49
50$(OUTPUT): $(OBJS)
51 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
52ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
53# 'x' must be kept or you'll have "Win32 error 5"
54# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
55# #define ERROR_ACCESS_DENIED 5L
56else
57 @chmod -x $@
58endif
59
60endif # end of simulator section
61
62include $(TOOLSDIR)/make.inc
63
64# MEMORYSIZE should be passed on to this makefile with the chosen memory size
65# given in number of MB
66$(LINKFILE): $(LDS)
67 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
68 $(DEFINES) -E -P - >$@
69
70clean:
71 $(call PRINTS,cleaning beatbox)rm -rf $(OBJDIR)/beatbox
72 $(SILENT)rm -f $(OBJDIR)/beatbox.* $(DEPFILE)
73
74-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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \
11 -I$(OBJDIR)
12CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES)
13
14# This sets up 'SRC' based on the files mentioned in SOURCES
15include $(TOOLSDIR)/makesrc.inc
16
17SOURCES = $(SRC)
18CSRC := $(SRC:%.bmp=$(OBJDIR)/%.c)
19OBJS := $(CSRC:%.c=%.o)
20DEPFILE = $(OBJDIR)/dep-bitmaps-mono
21
22BMP2RB = $(BMP2RB_MONO)
23OUTPUT = $(BUILDDIR)/libpluginbitmapsmono.a
24BMPINCDIR = $(BUILDDIR)/pluginbitmaps
25
26include $(TOOLSDIR)/makebmp.inc
27
28clean:
29 $(call PRINTS,cleaning plugins/bitmaps/mono)rm -f $(CSRC) $(OBJS) $(OUTPUT) $(DEPFILE)
30 @rmdir $(OBJDIR)
31
32-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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \
11 -I$(OBJDIR)
12CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES)
13
14# This sets up 'SRC' based on the files mentioned in SOURCES
15include $(TOOLSDIR)/makesrc.inc
16
17SOURCES = $(SRC)
18CSRC := $(SRC:%.bmp=$(OBJDIR)/%.c)
19OBJS := $(CSRC:%.c=%.o)
20DEPFILE = $(OBJDIR)/dep-bitmaps-native
21
22BMP2RB = $(BMP2RB_NATIVE)
23OUTPUT = $(BUILDDIR)/libpluginbitmapsnative.a
24BMPINCDIR = $(BUILDDIR)/pluginbitmaps
25
26include $(TOOLSDIR)/makebmp.inc
27
28clean:
29 $(call PRINTS,cleaning plugins/bitmaps/native)rm -f $(CSRC) $(OBJS) $(OUTPUT) $(DEPFILE)
30 @rmdir $(OBJDIR)
31
32-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
574#endif 574#endif
575#elif LCD_DEPTH > 1 /* grey */ 575#elif LCD_DEPTH > 1 /* grey */
576#if LCD_WIDTH >= 160 && LCD_HEIGHT >= 98 576#if LCD_WIDTH >= 160 && LCD_HEIGHT >= 98
577star_tiles.10x10.grey.bmp 577star_tiles.10x10x2.bmp
578#elif LCD_WIDTH >= 128 && LCD_HEIGHT >= 80 578#elif LCD_WIDTH >= 128 && LCD_HEIGHT >= 80
579star_tiles.8x8.grey.bmp 579star_tiles.8x8x2.bmp
580#endif 580#endif
581#else /* monochrome */ 581#else /* monochrome */
582#if LCD_WIDTH >= 112 && LCD_HEIGHT >= 62 582#if LCD_WIDTH >= 112 && LCD_HEIGHT >= 62
583star_tiles.6x7.mono.bmp 583star_tiles.6x7x1.bmp
584#endif 584#endif
585#endif 585#endif
586 586
@@ -669,14 +669,14 @@ matrix_normal.bmp
669/* pictureflow */ 669/* pictureflow */
670#if defined(HAVE_LCD_COLOR) && defined(HAVE_ALBUMART) && defined(HAVE_TAGCACHE) 670#if defined(HAVE_LCD_COLOR) && defined(HAVE_ALBUMART) && defined(HAVE_TAGCACHE)
671#if (LCD_WIDTH < 200) 671#if (LCD_WIDTH < 200)
672 pictureflow_logo.100x18x16.bmp 672pictureflow_logo.100x18x16.bmp
673#else 673#else
674 pictureflow_logo.193x34x16.bmp 674pictureflow_logo.193x34x16.bmp
675#endif 675#endif
676#if (LCD_HEIGHT < 100 ) 676#if (LCD_HEIGHT < 100 )
677 pictureflow_emptyslide.50x50x16.bmp 677pictureflow_emptyslide.50x50x16.bmp
678#else 678#else
679 pictureflow_emptyslide.100x100x16.bmp 679pictureflow_emptyslide.100x100x16.bmp
680#endif 680#endif
681#endif 681#endif
682 682
@@ -689,53 +689,53 @@ matrix_normal.bmp
689 689
690#if defined HAVE_LCD_COLOR 690#if defined HAVE_LCD_COLOR
691#if SMALLER_DIMENSION <= 80 691#if SMALLER_DIMENSION <= 80
692 sliding_puzzle.80x80x16.bmp 692sliding_puzzle.80x80x16.bmp
693#elif SMALLER_DIMENSION <= 108 693#elif SMALLER_DIMENSION <= 108
694 sliding_puzzle.108x108x16.bmp 694sliding_puzzle.108x108x16.bmp
695#elif SMALLER_DIMENSION <= 128 695#elif SMALLER_DIMENSION <= 128
696 sliding_puzzle.128x128x16.bmp 696sliding_puzzle.128x128x16.bmp
697#elif SMALLER_DIMENSION <= 132 697#elif SMALLER_DIMENSION <= 132
698 sliding_puzzle.132x132x16.bmp 698sliding_puzzle.132x132x16.bmp
699#elif SMALLER_DIMENSION <= 176 699#elif SMALLER_DIMENSION <= 176
700 sliding_puzzle.176x176x16.bmp 700sliding_puzzle.176x176x16.bmp
701#elif SMALLER_DIMENSION <= 240 701#elif SMALLER_DIMENSION <= 240
702 sliding_puzzle.240x240x16.bmp 702sliding_puzzle.240x240x16.bmp
703#endif 703#endif
704#elif (LCD_DEPTH > 1) 704#elif (LCD_DEPTH > 1)
705#if SMALLER_DIMENSION <= 96 705#if SMALLER_DIMENSION <= 96
706 sliding_puzzle.96x96x2.bmp 706sliding_puzzle.96x96x2.bmp
707#elif SMALLER_DIMENSION <= 110 707#elif SMALLER_DIMENSION <= 110
708 sliding_puzzle.108x108x2.bmp 708sliding_puzzle.108x108x2.bmp
709#elif SMALLER_DIMENSION <= 128 709#elif SMALLER_DIMENSION <= 128
710 sliding_puzzle.128x128x2.bmp 710sliding_puzzle.128x128x2.bmp
711#endif 711#endif
712#else /* mono targets, one size currently */ 712#else /* mono targets, one size currently */
713 sliding_puzzle.80x64x1.bmp 713sliding_puzzle.80x64x1.bmp
714#endif 714#endif
715 715
716/* Logo */ 716/* Logo */
717#if LCD_DEPTH == 16 717#if LCD_DEPTH == 16
718#if (LCD_WIDTH >= 320) 718#if (LCD_WIDTH >= 320)
719 rockboxlogo.220x68x16.bmp 719rockboxlogo.220x68x16.bmp
720#elif (LCD_WIDTH > 160) 720#elif (LCD_WIDTH > 160)
721 rockboxlogo.128x40x16.bmp 721rockboxlogo.128x40x16.bmp
722#else 722#else
723 rockboxlogo.90x28x16.bmp 723rockboxlogo.90x28x16.bmp
724#endif 724#endif
725 725
726#elif LCD_DEPTH == 2 726#elif LCD_DEPTH == 2
727#if (LCD_WIDTH > 138) 727#if (LCD_WIDTH > 138)
728 rockboxlogo.138x46x2.bmp 728rockboxlogo.138x46x2.bmp
729#else 729#else
730 rockboxlogo.91x32x2.bmp 730rockboxlogo.91x32x2.bmp
731#endif 731#endif
732 732
733#elif LCD_DEPTH == 1 733#elif LCD_DEPTH == 1
734#if (LCD_WIDTH > 112) 734#if (LCD_WIDTH > 112)
735 /* Such a screen isn't currently in any target */ 735 /* Such a screen isn't currently in any target */
736 rockboxlogo.112x30x1.bmp 736rockboxlogo.112x30x1.bmp
737#else 737#else
738 rockboxlogo.91x32x1.bmp 738rockboxlogo.91x32x1.bmp
739#endif 739#endif
740#endif 740#endif
741 741
diff --git a/apps/plugins/bitmaps/native/star_tiles.10x10.grey.bmp b/apps/plugins/bitmaps/native/star_tiles.10x10x2.bmp
index 54e14bbbe1..54e14bbbe1 100644
--- a/apps/plugins/bitmaps/native/star_tiles.10x10.grey.bmp
+++ b/apps/plugins/bitmaps/native/star_tiles.10x10x2.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/star_tiles.6x7.mono.bmp b/apps/plugins/bitmaps/native/star_tiles.6x7x1.bmp
index ebc59b9b11..ebc59b9b11 100644
--- a/apps/plugins/bitmaps/native/star_tiles.6x7.mono.bmp
+++ b/apps/plugins/bitmaps/native/star_tiles.6x7x1.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/star_tiles.8x8.grey.bmp b/apps/plugins/bitmaps/native/star_tiles.8x8x2.bmp
index 6f810ce562..6f810ce562 100644
--- a/apps/plugins/bitmaps/native/star_tiles.8x8.grey.bmp
+++ b/apps/plugins/bitmaps/native/star_tiles.8x8x2.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/pluginbitmaps.make b/apps/plugins/bitmaps/pluginbitmaps.make
new file mode 100644
index 0000000000..7dbcc0bdff
--- /dev/null
+++ b/apps/plugins/bitmaps/pluginbitmaps.make
@@ -0,0 +1,59 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10PBMPINCDIR = $(BUILDDIR)/pluginbitmaps
11
12PFLAGS += -I$(PBMPINCDIR)
13
14ifneq ($(strip $(BMP2RB_MONO)),)
15PBMP = $(call preprocess, $(APPSDIR)/plugins/bitmaps/mono/SOURCES)
16endif
17ifneq ($(strip $(BMP2RB_NATIVE)),)
18PBMP += $(call preprocess, $(APPSDIR)/plugins/bitmaps/native/SOURCES)
19endif
20ifneq ($(strip $(BMP2RB_REMOTEMONO)),)
21PBMP += $(call preprocess, $(APPSDIR)/plugins/bitmaps/remote_mono/SOURCES)
22endif
23ifneq ($(strip $(BMP2RB_REMOTENATIVE)),)
24PBMP += $(call preprocess, $(APPSDIR)/plugins/bitmaps/remote_native/SOURCES)
25endif
26
27ifdef PBMP # does player use bitmaps?
28
29PLUGIN_BITMAPS := $(PBMP:$(ROOTDIR)/%.bmp=$(BUILDDIR)/%.o)
30
31PLUGINBITMAPLIB := $(BUILDDIR)/apps/plugins/bitmaps/libpluginbitmaps.a
32PLUGINBITMAPDIR := $(dir $(PLUGINBITMAPLIB))
33
34PBMPHFILES := $(subst $(ROOTDIR),$(BUILDDIR),$(PBMP))
35PBMPHFILES := $(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')
36
37$(PBMPHFILES): $(PLUGIN_BITMAPS)
38
39$(PLUGINBITMAPLIB): $(PLUGIN_BITMAPS)
40 $(call PRINTS,AR $(@F))$(AR) rs $@ $+ >/dev/null 2>&1
41
42# pattern rules to create .c files from .bmp, one for each subdir:
43$(BUILDDIR)/apps/plugins/bitmaps/mono/%.c: $(ROOTDIR)/apps/plugins/bitmaps/mono/%.bmp $(TOOLSDIR)/bmp2rb
44 $(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR)
45 $(call PRINTS,BMP2RB $(<F))$(BMP2RB_MONO) -h $(PBMPINCDIR) $< > $@
46
47$(BUILDDIR)/apps/plugins/bitmaps/native/%.c: $(ROOTDIR)/apps/plugins/bitmaps/native/%.bmp $(TOOLSDIR)/bmp2rb
48 $(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR)
49 $(call PRINTS,BMP2RB $(<F))$(BMP2RB_NATIVE) -h $(PBMPINCDIR) $< > $@
50
51$(BUILDDIR)/apps/plugins/bitmaps/remote_mono/%.c: $(ROOTDIR)/apps/plugins/bitmaps/remote_mono/%.bmp $(TOOLSDIR)/bmp2rb
52 $(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR)
53 $(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTEMONO) -h $(PBMPINCDIR) $< > $@
54
55$(BUILDDIR)/apps/plugins/bitmaps/remote_native/%.c: $(ROOTDIR)/apps/plugins/bitmaps/remote_native/%.bmp $(TOOLSDIR)/bmp2rb
56 $(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR)
57 $(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTENATIVE) -h $(PBMPINCDIR) $< > $@
58
59endif
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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \
11 -I$(OBJDIR)
12CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES)
13
14# This sets up 'SRC' based on the files mentioned in SOURCES
15include $(TOOLSDIR)/makesrc.inc
16
17SOURCES = $(SRC)
18CSRC := $(SRC:%.bmp=$(OBJDIR)/%.c)
19OBJS := $(CSRC:%.c=%.o)
20DEPFILE = $(OBJDIR)/dep-bitmaps-remotemono
21
22BMP2RB = $(BMP2RB_REMOTEMONO)
23OUTPUT = $(BUILDDIR)/libpluginbitmapsremotemono.a
24BMPINCDIR = $(BUILDDIR)/pluginbitmaps
25
26include $(TOOLSDIR)/makebmp.inc
27
28clean:
29 $(call PRINTS,cleaning plugins/bitmaps/remotemono)rm -f $(CSRC) $(OBJS) $(OUTPUT) $(DEPFILE)
30 @rmdir $(OBJDIR)
31
32-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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \
11 -I$(OBJDIR)
12CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES)
13
14# This sets up 'SRC' based on the files mentioned in SOURCES
15include $(TOOLSDIR)/makesrc.inc
16
17SOURCES = $(SRC)
18CSRC := $(SRC:%.bmp=$(OBJDIR)/%.c)
19OBJS := $(CSRC:%.c=%.o)
20DEPFILE = $(OBJDIR)/dep-bitmaps-remotenative
21
22BMP2RB = $(BMP2RB_REMOTENATIVE)
23OUTPUT = $(BUILDDIR)/libpluginbitmapsremotenative.a
24BMPINCDIR = $(BUILDDIR)/pluginbitmaps
25
26include $(TOOLSDIR)/makebmp.inc
27
28clean:
29 $(call PRINTS,cleaning plugins/bitmaps/remote_native)rm -f $(CSRC) $(OBJS) $(OUTPUT) $(DEPFILE)
30 @rmdir $(OBJDIR)
31
32-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
18 18
19/* Logo */ 19/* Logo */
20#if (LCD_REMOTE_DEPTH == 1) 20#if (LCD_REMOTE_DEPTH == 1)
21 remote_rockboxlogo.91x32x1.bmp 21remote_rockboxlogo.91x32x1.bmp
22#elif (LCD_REMOTE_DEPTH == 2) 22#elif (LCD_REMOTE_DEPTH == 2)
23 remote_rockboxlogo.91x32x2.bmp 23remote_rockboxlogo.91x32x2.bmp
24#endif 24#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 @@
20 **************************************************************************/ 20 **************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "time.h" 22#include "time.h"
23#include "fixedpoint.h" 23#include "lib/fixedpoint.h"
24 24
25PLUGIN_HEADER 25PLUGIN_HEADER
26 26
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 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#include "plugin.h" 22#include "plugin.h"
23#include "configfile.h" /* Part of libplugin */ 23#include "lib/configfile.h" /* Part of libplugin */
24#include "helper.h" 24#include "lib/helper.h"
25 25
26PLUGIN_HEADER 26PLUGIN_HEADER
27 27
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 @@
25 25
26#ifdef HAVE_LCD_BITMAP 26#ifdef HAVE_LCD_BITMAP
27 27
28#include "xlcd.h" 28#include "lib/xlcd.h"
29#include "pluginlib_actions.h" 29#include "lib/pluginlib_actions.h"
30#include "fixedpoint.h" 30#include "lib/fixedpoint.h"
31 31
32PLUGIN_HEADER 32PLUGIN_HEADER
33 33
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 @@
24 24
25#if MEM <= 8 && !defined(SIMULATOR) 25#if MEM <= 8 && !defined(SIMULATOR)
26 26
27#include "overlay.h" 27#include "lib/overlay.h"
28 28
29PLUGIN_HEADER 29PLUGIN_HEADER
30 30
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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(BUILDDIR)/pluginbitmaps -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) \
12 -I$(BUILDDIR)
13CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
14 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
15
16ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
18endif
19
20LINKFILE := $(OBJDIR)/link.lds
21DEPFILE = $(OBJDIR)/dep-chessbox
22SRC = chessbox.c gnuchess.c opening.c chessbox_pgn.c
23
24SOURCES = $(SRC)
25OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
26DIRS = .
27
28ifndef SIMVER
29ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
30 LDS := archos.lds
31 OUTPUT = $(OUTDIR)/chessbox.ovl
32else ## iRiver target
33 LDS := ../plugin.lds
34 OUTPUT = $(OUTDIR)/chessbox.rock
35endif
36else ## simulators
37 OUTPUT = $(OUTDIR)/chessbox.rock
38endif
39
40all: $(OUTPUT)
41
42ifndef SIMVER
43$(OBJDIR)/chessbox.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
44 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
45 $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/chessbox.map
46
47$(OUTPUT): $(OBJDIR)/chessbox.elf
48 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
49else
50
51ifeq ($(SIMVER), x11)
52###################################################
53# This is the X11 simulator version
54
55$(OUTPUT): $(OBJS)
56 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
57ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
58# 'x' must be kept or you'll have "Win32 error 5"
59# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
60# #define ERROR_ACCESS_DENIED 5L
61else
62 @chmod -x $@
63endif
64
65else # end of x11-simulator
66ifeq ($(SIMVER), sdl)
67###################################################
68# This is the SDL simulator version
69
70$(OUTPUT): $(OBJS)
71 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
72ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
73# 'x' must be kept or you'll have "Win32 error 5"
74# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
75# #define ERROR_ACCESS_DENIED 5L
76else
77 @chmod -x $@
78endif
79
80else # end of sdl-simulator
81###################################################
82# This is the win32 simulator version
83DLLTOOLFLAGS = --export-all
84DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
85
86$(OUTPUT): $(OBJS)
87 $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
88 $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
89 $(BUILDDIR)/libplugin.a $(BITMAPLIBS) -o $@
90ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
91# 'x' must be kept or you'll have "Win32 error 5"
92# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
93# #define ERROR_ACCESS_DENIED 5L
94else
95 @chmod -x $@
96endif
97endif # end of win32-simulator
98endif
99endif # end of simulator section
100
101
102include $(TOOLSDIR)/make.inc
103
104# MEMORYSIZE should be passed on to this makefile with the chosen memory size
105# given in number of MB
106$(LINKFILE): $(LDS)
107 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
108 $(DEFINES) -E -P - >$@
109
110clean:
111 $(call PRINTS,cleaning chessbox)rm -rf $(OBJDIR)/chessbox
112 $(SILENT)rm -f $(OBJDIR)/chessbox.* $(DEPFILE)
113
114-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 @@
1chessbox.c
2gnuchess.c
3opening.c
4chessbox_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[];
43PLUGIN_HEADER 43PLUGIN_HEADER
44 44
45/* Tile size defined by the assigned bitmap */ 45/* Tile size defined by the assigned bitmap */
46#include "chessbox_pieces.h" 46#include "pluginbitmaps/chessbox_pieces.h"
47#define TILE_WIDTH BMPWIDTH_chessbox_pieces 47#define TILE_WIDTH BMPWIDTH_chessbox_pieces
48#define TILE_HEIGHT (BMPHEIGHT_chessbox_pieces/26) 48#define TILE_HEIGHT (BMPHEIGHT_chessbox_pieces/26)
49 49
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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10CHESSBOX_SRCDIR = $(APPSDIR)/plugins/chessbox
11CHESSBOX_OBJDIR = $(BUILDDIR)/apps/plugins/chessbox
12
13CHESSBOX_SRC := $(call preprocess, $(CHESSBOX_SRCDIR)/SOURCES)
14CHESSBOX_OBJ := $(call c2obj, $(CHESSBOX_SRC))
15
16OTHER_SRC += $(CHESSBOX_SRC)
17
18ifndef SIMVER
19ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
20 ## archos recorder targets
21 CHESSBOX_INLDS := $(CHESSBOX_SRCDIR)/archos.lds
22 ROCKS += $(CHESSBOX_OBJDIR)/chessbox.ovl
23else
24 ### all other targets
25 CHESSBOX_INLDS := $(APPSDIR)/plugins/plugin.lds
26 ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock
27endif
28 CHESSBOX_OVLFLAGS = -T$(CHESSBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$*.map
29 CHESSBOX_OUTLDS = $(CHESSBOX_OBJDIR)/chessbox.lds
30else
31 ### simulator
32 ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock
33 CHESSBOX_OVLFLAGS = $(SHARED_FLAG) # <-- from Makefile
34endif
35
36ifeq ($(CPU),sh)
37# sh need to retain its' -Os
38CHESSBOXFLAGS = $(PLUGINFLAGS)
39else
40CHESSBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O2
41endif
42
43$(CHESSBOX_OUTLDS): $(CHESSBOX_INLDS) $(CHESSBOX_OBJ)
44 $(call PRINTS,PP $(<F))$(call preprocess2file,$<,$@)
45
46$(CHESSBOX_OBJDIR)/chessbox.rock: $(CHESSBOX_OBJ) $(CHESSBOX_OUTLDS) $(PLUGINBITMAPLIB)
47
48$(CHESSBOX_OBJDIR)/chessbox.ovl: $(CHESSBOX_OBJ) $(CHESSBOX_OUTLDS) $(PLUGINBITMAPLIB)
49 $(SILENT)$(CC) $(PLUGINFLAGS) -o $(CHESSBOX_OBJDIR)/$*.elf \
50 $(filter %.o, $^) \
51 $(filter %.a, $^) \
52 -lgcc $(CHESSBOX_OVLFLAGS)
53 $(call PRINTS,LD $(@F))$(OC) -O binary $(CHESSBOX_OBJDIR)/$*.elf $@
54
55# special pattern rule for compiling chessbox with extra flags
56$(CHESSBOX_OBJDIR)/%.o: $(CHESSBOX_SRCDIR)/%.c $(PLUGINBITMAPLIB) $(CHESSBOX_SRCDIR)/chessbox.make
57 $(SILENT)mkdir -p $(dir $@)
58 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(CHESSBOXFLAGS) -c $< -o $@
diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c
index 132977753a..b497b161b5 100644
--- a/apps/plugins/chopper.c
+++ b/apps/plugins/chopper.c
@@ -21,9 +21,9 @@
21 ****************************************************************************/ 21 ****************************************************************************/
22 22
23#include "plugin.h" 23#include "plugin.h"
24#include "xlcd.h" 24#include "lib/xlcd.h"
25#include "configfile.h" 25#include "lib/configfile.h"
26#include "helper.h" 26#include "lib/helper.h"
27 27
28PLUGIN_HEADER 28PLUGIN_HEADER
29 29
diff --git a/apps/plugins/clock/Makefile b/apps/plugins/clock/Makefile
deleted file mode 100644
index abf932a682..0000000000
--- a/apps/plugins/clock/Makefile
+++ /dev/null
@@ -1,112 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $$Id: $$
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. -I$(APPSDIR)/plugins/lib \
11 $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
12 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) \
13 -I$(BUILDDIR)/pluginbitmaps
14CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
15 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
16
17ifdef APPEXTRA
18 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
19endif
20
21LINKFILE := $(OBJDIR)/link.lds
22DEPFILE = $(OBJDIR)/dep-clock
23
24# This sets up 'SRC' based on the files mentioned in SOURCES
25include $(TOOLSDIR)/makesrc.inc
26
27SOURCES = $(SRC)
28OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
29DIRS = .
30
31ifndef SIMVER
32 LDS := ../plugin.lds
33 OUTPUT = $(OUTDIR)/clock.rock
34else ## simulators
35 OUTPUT = $(OUTDIR)/clock.rock
36endif
37
38all: $(OUTPUT)
39
40ifndef SIMVER
41$(OBJDIR)/clock.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
42 $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
43 $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/clock.map
44
45$(OUTPUT): $(OBJDIR)/clock.elf
46 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
47else
48
49ifeq ($(SIMVER), x11)
50###################################################
51# This is the X11 simulator version
52
53$(OUTPUT): $(OBJS)
54 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
55ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
56# 'x' must be kept or you'll have "Win32 error 5"
57# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
58# #define ERROR_ACCESS_DENIED 5L
59else
60 @chmod -x $@
61endif
62
63else # end of x11-simulator
64ifeq ($(SIMVER), sdl)
65###################################################
66# This is the SDL simulator version
67
68$(OUTPUT): $(OBJS)
69 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
70ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
71# 'x' must be kept or you'll have "Win32 error 5"
72# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
73# #define ERROR_ACCESS_DENIED 5L
74else
75 @chmod -x $@
76endif
77
78else # end of sdl-simulator
79###################################################
80# This is the win32 simulator version
81DLLTOOLFLAGS = --export-all
82DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
83
84$(OUTPUT): $(OBJS)
85 $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
86 $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
87 $(BUILDDIR)/libplugin.a $(BITMAPLIBS) -o $@
88ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
89# 'x' must be kept or you'll have "Win32 error 5"
90# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
91# #define ERROR_ACCESS_DENIED 5L
92else
93 @chmod -x $@
94endif
95endif # end of win32-simulator
96endif
97endif # end of simulator section
98
99
100include $(TOOLSDIR)/make.inc
101
102# MEMORYSIZE should be passed on to this makefile with the chosen memory size
103# given in number of MB
104$(LINKFILE): $(LDS)
105 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
106 $(DEFINES) -E -P - >$@
107
108clean:
109 $(call PRINTS,cleaning clock)rm -rf $(OBJDIR)/clock
110 $(SILENT)rm -f $(OBJDIR)/clock.* $(DEPFILE)
111
112-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 @@
21 21
22#include "plugin.h" 22#include "plugin.h"
23#include "time.h" 23#include "time.h"
24#include "pluginlib_actions.h" 24#include "lib/pluginlib_actions.h"
25#include "xlcd.h" 25#include "lib/xlcd.h"
26 26
27#include "clock.h" 27#include "clock.h"
28#include "clock_counter.h" 28#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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10CLOCKSRCDIR := $(APPSDIR)/plugins/clock
11CLOCKBUILDDIR := $(BUILDDIR)/apps/plugins/clock
12
13ROCKS += $(CLOCKBUILDDIR)/clock.rock
14
15CLOCK_SRC := $(call preprocess, $(CLOCKSRCDIR)/SOURCES)
16CLOCK_OBJ := $(call c2obj, $(CLOCK_SRC))
17
18# add source files to OTHER_SRC to get automatic dependencies
19OTHER_SRC += $(CLOCK_SRC)
20
21$(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 @@
23#ifndef _CLOCK_BITMAP_STRINGS_ 23#ifndef _CLOCK_BITMAP_STRINGS_
24#define _CLOCK_BITMAP_STRINGS_ 24#define _CLOCK_BITMAP_STRINGS_
25#include "plugin.h" 25#include "plugin.h"
26#include "picture.h" 26#include "lib/picture.h"
27 27
28void draw_string(struct screen* display, const struct picture* bitmaps, 28void draw_string(struct screen* display, const struct picture* bitmaps,
29 char* str, int x, int y); 29 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 @@
23#include "clock_bitmaps.h" 23#include "clock_bitmaps.h"
24 24
25/* bitmaps */ 25/* bitmaps */
26#include "clock_binary.h" 26#include "pluginbitmaps/clock_binary.h"
27#include "clock_digits.h" 27#include "pluginbitmaps/clock_digits.h"
28#include "clock_smalldigits.h" 28#include "pluginbitmaps/clock_smalldigits.h"
29#include "clock_segments.h" 29#include "pluginbitmaps/clock_segments.h"
30#include "clock_smallsegments.h" 30#include "pluginbitmaps/clock_smallsegments.h"
31 31
32#include "clock_logo.h" 32#include "pluginbitmaps/clock_logo.h"
33#include "clock_messages.h" 33#include "pluginbitmaps/clock_messages.h"
34 34
35#if NB_SCREENS==2 35#if NB_SCREENS==2
36#include "clock_binary_remote.h" 36#include "pluginbitmaps/clock_binary_remote.h"
37#include "clock_digits_remote.h" 37#include "pluginbitmaps/clock_digits_remote.h"
38#include "clock_smalldigits_remote.h" 38#include "pluginbitmaps/clock_smalldigits_remote.h"
39#include "clock_segments_remote.h" 39#include "pluginbitmaps/clock_segments_remote.h"
40#include "clock_smallsegments_remote.h" 40#include "pluginbitmaps/clock_smallsegments_remote.h"
41 41
42#include "clock_logo_remote.h" 42#include "pluginbitmaps/clock_logo_remote.h"
43#include "clock_messages_remote.h" 43#include "pluginbitmaps/clock_messages_remote.h"
44 44
45#endif 45#endif
46 46
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 @@
21 21
22#ifndef _CLOCK_BITMAPS_ 22#ifndef _CLOCK_BITMAPS_
23#define _CLOCK_BITMAPS_ 23#define _CLOCK_BITMAPS_
24#include "picture.h" 24#include "lib/picture.h"
25 25
26extern const struct picture logos[]; 26extern const struct picture logos[];
27extern const struct picture messages[]; 27extern 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 @@
2#define _CLOCK_MESSAGE_ 2#define _CLOCK_MESSAGE_
3#include "clock.h" 3#include "clock.h"
4#include "plugin.h" 4#include "plugin.h"
5#include "picture.h" 5#include "lib/picture.h"
6 6
7struct counter{ 7struct counter{
8 int ticks_at_last_unpause;/* to count the time from last pause to now */ 8 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 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#include "clock_draw_analog.h" 22#include "clock_draw_analog.h"
23#include "xlcd.h" 23#include "lib/xlcd.h"
24#include "fixedpoint.h" 24#include "lib/fixedpoint.h"
25#include "clock_bitmaps.h" 25#include "clock_bitmaps.h"
26#include "clock_bitmap_strings.h" 26#include "clock_bitmap_strings.h"
27 27
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 @@
21#include "clock_draw_binary.h" 21#include "clock_draw_binary.h"
22#include "clock_bitmap_strings.h" 22#include "clock_bitmap_strings.h"
23#include "clock_bitmaps.h" 23#include "clock_bitmaps.h"
24#include "picture.h" 24#include "lib/picture.h"
25 25
26const struct picture* binary_skin[]={binary,digits,segments}; 26const struct picture* binary_skin[]={binary,digits,segments};
27 27
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 @@
23#include "clock_draw_digital.h" 23#include "clock_draw_digital.h"
24#include "clock_bitmap_strings.h" 24#include "clock_bitmap_strings.h"
25#include "clock_bitmaps.h" 25#include "clock_bitmaps.h"
26#include "picture.h" 26#include "lib/picture.h"
27 27
28const struct picture* digits_skin[]={digits,segments}; 28const struct picture* digits_skin[]={digits,segments};
29const struct picture* smalldigits_skin[]={smalldigits,smallsegments}; 29const 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 @@
23#include "clock_bitmaps.h" 23#include "clock_bitmaps.h"
24#include "clock_draw.h" 24#include "clock_draw.h"
25#include "clock_settings.h" 25#include "clock_settings.h"
26#include "picture.h" 26#include "lib/picture.h"
27 27
28static int max_skin[]={ 28static int max_skin[]={
29 [ANALOG]=2, 29 [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 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "helper.h" 22#include "lib/helper.h"
23 23
24PLUGIN_HEADER 24PLUGIN_HEADER
25 25
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 @@
21* 21*
22***************************************************************************/ 22***************************************************************************/
23#include "plugin.h" 23#include "plugin.h"
24#include "grey.h" 24#include "lib/grey.h"
25#include "playergfx.h" 25#include "lib/playergfx.h"
26#include "xlcd.h" 26#include "lib/xlcd.h"
27#include "fixedpoint.h" 27#include "lib/fixedpoint.h"
28 28
29PLUGIN_HEADER 29PLUGIN_HEADER
30 30
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 @@
24#include "plugin.h" 24#include "plugin.h"
25 25
26#ifdef HAVE_LCD_BITMAP 26#ifdef HAVE_LCD_BITMAP
27#include "pluginlib_actions.h" 27#include "lib/pluginlib_actions.h"
28#include "helper.h" 28#include "lib/helper.h"
29PLUGIN_HEADER 29PLUGIN_HEADER
30 30
31#define DEFAULT_WAIT_TIME 3 31#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 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#include "plugin.h" 22#include "plugin.h"
23#include "pluginlib_actions.h" 23#include "lib/pluginlib_actions.h"
24#include "configfile.h" 24#include "lib/configfile.h"
25 25
26#define MAX_DICES 12 26#define MAX_DICES 12
27#define INITIAL_NB_DICES 1 27#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 @@
1################################################################
2#
3# $Id$
4#
5# $Log: Makefile,v $
6# Revision 1.13 2006-12-13 06:52:09 kkurbjun
7# Free more plugin memory
8#
9# Revision 1.12 2006-12-13 05:46:51 kkurbjun
10# Will it fit?
11#
12# Revision 1.11 2006-12-13 04:44:17 kkurbjun
13# Dehacked and BEX support for Doom - currently only supports a DEHACKED file in a WAD (not as a standalone file yet).
14#
15# Revision 1.10 2006-10-27 21:47:55 amiconn
16# 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.
17#
18# Revision 1.9 2006-10-23 22:33:36 amiconn
19# Consistent style of 'make' messages. Always use ranlib after ar.
20#
21# Revision 1.8 2006-10-23 14:09:28 markun
22# rearrange compiler options to avoid conflicts with header files on FreeBSD
23#
24# Revision 1.7 2006-10-22 00:21:56 amiconn
25# Speed up build process in general by using internal functions of make instead of spawning sub-shells where possible.
26#
27# Revision 1.6 2006-09-29 20:04:35 barrywardell
28# 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.
29#
30# Revision 1.5 2006-09-29 16:15:08 barrywardell
31# Allow UI simulator to be build on OS (Slightly updated version of FS5767)
32#
33# Revision 1.4 2006-07-27 13:27:19 linus
34# Moved the X5 button driver to the target tree
35#
36# Revision 1.3 2006-04-14 21:07:56 kkurbjun
37# Start of profiling support for doom.
38#
39# Revision 1.2 2006-03-29 21:16:45 kkurbjun
40# Use rockbox endian defines
41#
42# Revision 1.1 2006-03-28 15:44:01 dave
43# Patch #2969 - Doom! Currently only working on the H300.
44#
45#
46
47INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
48 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
49CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
50 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \
51 -Wno-strict-prototypes $(PROFILE_OPTS)
52
53ifdef APPEXTRA
54 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
55endif
56
57# The arm code compiles too large for the plugin buffer when set to optimize for speed
58ifeq ($(CPU), arm)
59 CFLAGS += -Os
60ifndef SIMVER
61ifeq ($(TARGET), IRIVER_H100)
62 CFLAGS += -mstructure-size-boundary=8
63endif
64endif
65else
66 CFLAGS += -O2
67endif
68
69LINKFILE := $(OBJDIR)/link.lds
70DEPFILE = $(OBJDIR)/dep-doom
71SRC = info.c doomdef.c doomstat.c dstrings.c tables.c \
72 f_finale.c f_wipe.c d_net.c d_items.c g_game.c m_menu.c m_argv.c \
73 m_cheat.c m_random.c am_map.c p_ceilng.c p_doors.c p_genlin.c \
74 p_enemy.c p_floor.c p_inter.c p_lights.c p_map.c p_maputl.c p_plats.c \
75 p_pspr.c p_setup.c p_sight.c p_spec.c p_switch.c p_mobj.c p_telept.c \
76 p_tick.c p_saveg.c p_user.c r_bsp.c r_data.c r_draw.c r_main.c \
77 r_plane.c r_segs.c r_sky.c r_things.c wi_stuff.c v_video.c st_lib.c \
78 st_stuff.c hu_stuff.c hu_lib.c s_sound.c z_zone.c z_bmalloc.c sounds.c \
79 d_main.c m_misc.c m_bbox.c i_system.c i_sound.c i_video.c \
80 w_wad.c rockdoom.c d_deh.c ../../../firmware/common/sscanf.c
81
82# sscanf isn't built into the core right now - should remove from here if that
83# changes
84
85SOURCES = $(SRC)
86OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
87#OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
88#OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
89DIRS = .
90
91
92ifndef SIMVER
93 LDS := ../plugin.lds
94 OUTPUT = $(OUTDIR)/doom.rock
95else ## simulators
96 OUTPUT = $(OUTDIR)/doom.rock
97endif
98
99all: $(OUTPUT)
100
101ifndef SIMVER
102$(OBJDIR)/doom.elf: $(OBJS) $(LINKFILE)
103 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc\
104 -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/doom.map
105
106$(OUTPUT): $(OBJDIR)/doom.elf
107 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
108else
109
110ifeq ($(SIMVER), x11)
111###################################################
112# This is the X11 simulator version
113
114$(OUTPUT): $(OBJS)
115 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
116ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
117# 'x' must be kept or you'll have "Win32 error 5"
118# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
119# #define ERROR_ACCESS_DENIED 5L
120else
121 @chmod -x $@
122endif
123
124else # end of x11-simulator
125ifeq ($(SIMVER), sdl)
126###################################################
127# This is the sdl simulator version
128
129$(OUTPUT): $(OBJS)
130 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
131ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
132# 'x' must be kept or you'll have "Win32 error 5"
133# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
134# #define ERROR_ACCESS_DENIED 5L
135else
136 @chmod -x $@
137endif
138
139else # end of sdl-simulator
140###################################################
141# This is the win32 simulator version
142DLLTOOLFLAGS = --export-all
143DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
144
145$(OUTPUT): $(OBJS)
146 $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
147 $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
148 $(BUILDDIR)/libplugin.a -o $@
149ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
150# 'x' must be kept or you'll have "Win32 error 5"
151# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
152# #define ERROR_ACCESS_DENIED 5L
153else
154 @chmod -x $@
155endif
156endif # end of win32-simulator
157endif
158endif # end of simulator section
159
160
161include $(TOOLSDIR)/make.inc
162
163# MEMORYSIZE should be passed on to this makefile with the chosen memory size
164# given in number of MB
165$(LINKFILE): $(LDS)
166 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) \
167 -E -P - >$@
168
169clean:
170 $(call PRINTS,cleaning doom)rm -rf $(OBJDIR)/doom
171 $(SILENT)rm -f $(OBJDIR)/doom.* $(DEPFILE)
172
173-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 @@
1info.c
2doomdef.c
3doomstat.c
4dstrings.c
5tables.c
6f_finale.c
7f_wipe.c
8d_net.c
9d_items.c
10g_game.c
11m_menu.c
12m_argv.c
13m_cheat.c
14m_random.c
15am_map.c
16p_ceilng.c
17p_doors.c
18p_genlin.c
19p_enemy.c
20p_floor.c
21p_inter.c
22p_lights.c
23p_map.c
24p_maputl.c
25p_plats.c
26p_pspr.c
27p_setup.c
28p_sight.c
29p_spec.c
30p_switch.c
31p_mobj.c
32p_telept.c
33p_tick.c
34p_saveg.c
35p_user.c
36r_bsp.c
37r_data.c
38r_draw.c
39r_main.c
40r_plane.c
41r_segs.c
42r_sky.c
43r_things.c
44wi_stuff.c
45v_video.c
46st_lib.c
47st_stuff.c
48hu_stuff.c
49hu_lib.c
50s_sound.c
51z_zone.c
52z_bmalloc.c
53sounds.c
54d_main.c
55m_misc.c
56m_bbox.c
57i_system.c
58i_sound.c
59i_video.c
60w_wad.c
61rockdoom.c
62d_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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10DOOMSRCDIR := $(APPSDIR)/plugins/doom
11DOOMBUILDDIR := $(BUILDDIR)/apps/plugins/doom
12
13ROCKS += $(DOOMBUILDDIR)/doom.rock
14
15DOOM_SRC := $(call preprocess, $(DOOMSRCDIR)/SOURCES)
16DOOM_OBJ := $(call c2obj, $(DOOM_SRC))
17DOOM_OBJ += $(DOOMBUILDDIR)/sscanf.o
18
19# add source files to OTHER_SRC to get automatic dependencies
20OTHER_SRC += $(DOOM_SRC)
21
22DOOMCFLAGS = $(PLUGINFLAGS) -Wno-strict-prototypes
23
24# The arm code compiles too large for the plugin buffer when set to optimize for speed
25ifeq ($(CPU), arm)
26 DOOMCFLAGS += -Os
27ifndef SIMVER
28ifeq ($(TARGET), IRIVER_H100)
29 DOOMCCFLAGS += -mstructure-size-boundary=8
30endif
31endif
32else
33 DOOMCFLAGS += -O2
34endif
35
36$(DOOMBUILDDIR)/sscanf.c: $(FIRMDIR)/common/sscanf.c
37 $(SILENT)mkdir -p $(dir $@)
38 $(call PRINTS,CP $<)cp $< $@
39
40$(DOOMBUILDDIR)/sscanf.o: $(DOOMBUILDDIR)/sscanf.c
41
42$(DOOMBUILDDIR)/doom.rock: $(DOOM_OBJ)
43# for some reason, this doesn't match the implicit rule in plugins.make,
44# so we have to duplicate the link command here
45 $(SILENT)$(CC) $(PLUGINFLAGS) -o $*.elf \
46 $(filter %.o, $^) \
47 $(filter %.a, $^) \
48 -lgcc $(PLUGINLDFLAGS)
49 $(call PRINTS,LD $(@F))$(OC) -O binary $*.elf $@
50
51# new rule needed to use extra compile flags
52$(DOOMBUILDDIR)/%.o: $(DOOMSRCDIR)/%.c $(DOOMSRCDIR)/doom.make
53 $(SILENT)mkdir -p $(dir $@)
54 $(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 @@
117#include "rockmacros.h" 117#include "rockmacros.h"
118 118
119#ifndef HAVE_LCD_COLOR 119#ifndef HAVE_LCD_COLOR
120#include "../lib/grey.h" 120#include "lib/grey.h"
121GREY_INFO_STRUCT_IRAM 121GREY_INFO_STRUCT_IRAM
122static unsigned char greybuffer[LCD_WIDTH] IBSS_ATTR; /* off screen buffer */ 122static unsigned char greybuffer[LCD_WIDTH] IBSS_ATTR; /* off screen buffer */
123static unsigned char *gbuf; 123static 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 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "configfile.h" 22#include "lib/configfile.h"
23 23
24#ifdef HAVE_LCD_CHARCELLS 24#ifdef HAVE_LCD_CHARCELLS
25 25
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 @@
22****************************************************************************/ 22****************************************************************************/
23 23
24#include "plugin.h" 24#include "plugin.h"
25#include "helper.h" 25#include "lib/helper.h"
26#ifdef HAVE_LCD_BITMAP 26#ifdef HAVE_LCD_BITMAP
27 27
28#include "pluginlib_actions.h" 28#include "lib/pluginlib_actions.h"
29#include "fixedpoint.h" 29#include "lib/fixedpoint.h"
30 30
31#ifndef HAVE_LCD_COLOR 31#ifndef HAVE_LCD_COLOR
32#include "grey.h" 32#include "lib/grey.h"
33#endif 33#endif
34 34
35#if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) 35#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 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "oldmenuapi.h" 22#include "lib/oldmenuapi.h"
23#include "helper.h" 23#include "lib/helper.h"
24 24
25PLUGIN_HEADER 25PLUGIN_HEADER
26 26
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 @@
22****************************************************************************/ 22****************************************************************************/
23 23
24#include "plugin.h" 24#include "plugin.h"
25#include "helper.h" 25#include "lib/helper.h"
26 26
27#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) 27#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4)
28#include "grey.h" 28#include "lib/grey.h"
29 29
30PLUGIN_HEADER 30PLUGIN_HEADER
31 31
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 @@
26 */ 26 */
27 27
28#include "plugin.h" 28#include "plugin.h"
29#include "highscore.h" 29#include "lib/highscore.h"
30#include "helper.h" 30#include "lib/helper.h"
31 31
32PLUGIN_HEADER 32PLUGIN_HEADER
33 33
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 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#include "plugin.h" 22#include "plugin.h"
23#include "pluginlib_actions.h" 23#include "lib/pluginlib_actions.h"
24#include "picture.h" 24#include "lib/picture.h"
25 25
26PLUGIN_HEADER 26PLUGIN_HEADER
27 27
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 @@
22****************************************************************************/ 22****************************************************************************/
23 23
24#include "plugin.h" 24#include "plugin.h"
25#include "playback_control.h" 25#include "lib/playback_control.h"
26 26
27#ifdef HAVE_LCD_BITMAP 27#ifdef HAVE_LCD_BITMAP
28 28
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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) \
12 -I$(BUILDDIR)/pluginbitmaps -I$(APPSDIR)/plugins/lib
13CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
14 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
15
16ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
18endif
19
20LINKFILE := $(OBJDIR)/link.lds
21DEPFILE = $(OBJDIR)/dep-jpeg
22
23# This sets up 'SRC' based on the files mentioned in SOURCES
24include $(TOOLSDIR)/makesrc.inc
25
26SOURCES = $(SRC)
27OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
28DIRS = .
29
30ifndef SIMVER
31 LDS := ../plugin.lds
32 OUTPUT = $(OUTDIR)/jpeg.rock
33else ## simulators
34 OUTPUT = $(OUTDIR)/jpeg.rock
35endif
36
37all: $(OUTPUT)
38
39ifndef SIMVER
40$(OBJDIR)/jpeg.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
41 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
42 $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/jpeg.map
43
44$(OUTPUT): $(OBJDIR)/jpeg.elf
45 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
46else
47###################################################
48# This is the SDL simulator version
49
50$(OUTPUT): $(OBJS)
51 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
52ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
53# 'x' must be kept or you'll have "Win32 error 5"
54# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
55# #define ERROR_ACCESS_DENIED 5L
56else
57 @chmod -x $@
58endif
59
60endif # end of simulator section
61
62
63include $(TOOLSDIR)/make.inc
64
65# MEMORYSIZE should be passed on to this makefile with the chosen memory size
66# given in number of MB
67$(LINKFILE): $(LDS)
68 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
69 $(DEFINES) -E -P - >$@
70
71clean:
72 $(call PRINTS,cleaning jpeg)rm -rf $(OBJDIR)/jpeg
73 $(SILENT)rm -f $(OBJDIR)/jpeg.* $(DEPFILE)
74
75-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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10JPEGSRCDIR := $(APPSDIR)/plugins/jpeg
11JPEGBUILDDIR := $(BUILDDIR)/apps/plugins/jpeg
12
13ROCKS += $(JPEGBUILDDIR)/jpeg.rock
14
15JPEG_SRC := $(call preprocess, $(JPEGSRCDIR)/SOURCES)
16JPEG_OBJ := $(call c2obj, $(JPEG_SRC))
17
18# add source files to OTHER_SRC to get automatic dependencies
19OTHER_SRC += $(JPEG_SRC)
20
21$(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 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "md5.h" 22#include "lib/md5.h"
23PLUGIN_HEADER 23PLUGIN_HEADER
24 24
25#define KEYBOX_FILE PLUGIN_DIR "/apps/keybox.dat" 25#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 @@
23 ****************************************************************************/ 23 ****************************************************************************/
24 24
25#include "plugin.h" 25#include "plugin.h"
26#include "helper.h" 26#include "lib/helper.h"
27 27
28PLUGIN_HEADER 28PLUGIN_HEADER
29 29
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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10# ../.. for the plugin.h in the apps dir
11# .. for stuff in the plugins dir
12# . for stuff in the pluginlib dir
13INCLUDES=-I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
14 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
15
16ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
18endif
19
20CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
21 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
22
23# Sectioned compilation for target
24ifndef SIMVER
25 CFLAGS += -ffunction-sections -fdata-sections
26endif
27
28# This sets up 'SRC' based on the files mentioned in SOURCES
29include $(TOOLSDIR)/makesrc.inc
30
31SOURCES = $(SRC)
32OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
33OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
34DEPFILE = $(OBJDIR)/dep-pluginlib
35DIRS = .
36
37OUTPUT = $(BUILDDIR)/libplugin.a
38
39all: $(OUTPUT)
40
41$(OUTPUT): $(OBJS)
42 $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
43 $(SILENT)$(RANLIB) $@
44
45include $(TOOLSDIR)/make.inc
46
47clean:
48 $(call PRINTS,cleaning lib)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
49
50-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 @@
19 * 19 *
20 **************************************************************************/ 20 **************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "playergfx.h" 22#include "lib/playergfx.h"
23 23
24PLUGIN_HEADER 24PLUGIN_HEADER
25 25
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 @@
23#include "plugin.h" 23#include "plugin.h"
24 24
25#ifdef HAVE_LCD_BITMAP 25#ifdef HAVE_LCD_BITMAP
26#include "grey.h" 26#include "lib/grey.h"
27#include "xlcd.h" 27#include "lib/xlcd.h"
28 28
29PLUGIN_HEADER 29PLUGIN_HEADER
30 30
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 @@
31 */ 31 */
32 32
33#include "plugin.h" 33#include "plugin.h"
34#include "helper.h" 34#include "lib/helper.h"
35 35
36PLUGIN_HEADER 36PLUGIN_HEADER
37 37
@@ -54,7 +54,7 @@ PLUGIN_HEADER
54# define MAZE_RDOWN (BUTTON_PLAY | BUTTON_REPEAT) 54# define MAZE_RDOWN (BUTTON_PLAY | BUTTON_REPEAT)
55 55
56#else 56#else
57# include "pluginlib_actions.h" 57# include "lib/pluginlib_actions.h"
58# define MAZE_NEW PLA_START 58# define MAZE_NEW PLA_START
59# define MAZE_QUIT PLA_QUIT 59# define MAZE_QUIT PLA_QUIT
60# define MAZE_SOLVE PLA_FIRE 60# 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 @@
20 * 20 *
21 ****************************************************************************/ 21 ****************************************************************************/
22#include "plugin.h" 22#include "plugin.h"
23#include "configfile.h" 23#include "lib/configfile.h"
24#include "helper.h" 24#include "lib/helper.h"
25#include "pluginlib_actions.h" 25#include "lib/pluginlib_actions.h"
26#include "playback_control.h" 26#include "lib/playback_control.h"
27 27
28/* Include standard plugin macro */ 28/* Include standard plugin macro */
29PLUGIN_HEADER 29PLUGIN_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 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "pluginlib_actions.h" 22#include "lib/pluginlib_actions.h"
23 23
24PLUGIN_HEADER 24PLUGIN_HEADER
25 25
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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id $
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
12
13 MIDIOPTS = -O2
14
15CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) $(MIDIOPTS) \
16 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
17
18ifdef APPEXTRA
19 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
20endif
21
22LINKFILE := $(OBJDIR)/link.lds
23DEPFILE = $(OBJDIR)/dep-midiplay
24
25# This sets up 'SRC' based on the files mentioned in SOURCES
26include $(TOOLSDIR)/makesrc.inc
27
28SOURCES = $(SRC)
29OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
30DIRS = .
31
32ifndef SIMVER
33 LDS := ../plugin.lds
34 OUTPUT = $(OUTDIR)/midiplay.rock
35else ## simulators
36 OUTPUT = $(OUTDIR)/midiplay.rock
37endif
38
39all: $(OUTPUT)
40
41ifndef SIMVER
42$(OBJDIR)/midiplay.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
43 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
44 $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/midiplay.map
45
46$(OUTPUT): $(OBJDIR)/midiplay.elf
47 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
48else
49
50###################################################
51# This is the SDL simulator version
52
53$(OUTPUT): $(OBJS)
54 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
55ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
56# 'x' must be kept or you'll have "Win32 error 5"
57# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
58# #define ERROR_ACCESS_DENIED 5L
59else
60 @chmod -x $@
61endif
62
63endif # end of simulator section
64
65include $(TOOLSDIR)/make.inc
66
67# MEMORYSIZE should be passed on to this makefile with the chosen memory size
68# given in number of MB
69$(LINKFILE): $(LDS)
70 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
71 $(DEFINES) -E -P - >$@
72
73clean:
74 $(call PRINTS,cleaning midiplay)rm -rf $(OBJDIR)/midiplay
75 $(SILENT)rm -f $(OBJDIR)/midiplay.* $(DEPFILE)
76
77-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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10MIDISRCDIR := $(APPSDIR)/plugins/midi
11MIDIBUILDDIR := $(BUILDDIR)/apps/plugins/midi
12
13ROCKS += $(MIDIBUILDDIR)/midi.rock
14
15MIDI_SRC := $(call preprocess, $(MIDISRCDIR)/SOURCES)
16MIDI_OBJ := $(call c2obj, $(MIDI_SRC))
17
18# add source files to OTHER_SRC to get automatic dependencies
19OTHER_SRC += $(MIDI_SRC)
20
21$(MIDIBUILDDIR)/midi.rock: $(MIDI_OBJ)
22# for some reason, this doesn't match the implicit rule in plugins.make,
23# so we have to duplicate the link command here
24 $(SILENT)$(CC) $(PLUGINFLAGS) -o $*.elf \
25 $(filter %.o, $^) \
26 $(filter %.a, $^) \
27 -lgcc $(PLUGINLDFLAGS)
28 $(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 @@
19 * 19 *
20 **************************************************************************/ 20 **************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "playergfx.h" 22#include "lib/playergfx.h"
23 23
24PLUGIN_HEADER 24PLUGIN_HEADER
25 25
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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(APPSDIR)/plugins/lib -I$(OUTDIR) -I$(BUILDDIR)
12CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN -DMPEGPLAYER
14
15ifdef APPEXTRA
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17endif
18
19LINKFILE := $(OBJDIR)/link.lds
20DEPFILE = $(OBJDIR)/dep-mpegplayer
21
22# This sets up 'SRC' based on the files mentioned in SOURCES
23include $(TOOLSDIR)/makesrc.inc
24
25SOURCES = $(SRC)
26OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
27OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
28DIRS = .
29
30LDS := ../plugin.lds
31OUTPUT = $(OUTDIR)/mpegplayer.rock
32
33all: $(OUTPUT)
34
35.PHONY: libmad-mpegplayer
36
37$(BUILDDIR)/libmad-mpegplayer.a: libmad-mpegplayer
38
39libmad-mpegplayer:
40 $(SILENT)mkdir -p $(OBJDIR)/libmad-mpegplayer
41 $(call PRINTS,MAKE in libmad for mpegplayer)$(MAKE) -C $(APPSDIR)/codecs/libmad MPEGPLAYER=1 OBJDIR=$(OBJDIR)/libmad-mpegplayer OUTPUT=$(BUILDDIR)/libmad-mpegplayer.a
42
43ifndef SIMVER
44$(OBJDIR)/mpegplayer.elf: $(OBJS) $(LINKFILE) $(BUILDDIR)/libmad-mpegplayer.a
45 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lmad-mpegplayer -lgcc\
46 $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/mpegplayer.map
47
48$(OUTPUT): $(OBJDIR)/mpegplayer.elf
49 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
50else
51# This is the SDL simulator version
52
53$(OUTPUT): $(OBJS) $(BUILDDIR)/libmad-mpegplayer.a
54 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -lmad-mpegplayer -o $@
55ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
56# 'x' must be kept or you'll have "Win32 error 5"
57# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
58# #define ERROR_ACCESS_DENIED 5L
59else
60 @chmod -x $@
61endif
62
63endif # end of sdl-simulator
64
65include $(TOOLSDIR)/make.inc
66
67# MEMORYSIZE should be passed on to this makefile with the chosen memory size
68# given in number of MB
69$(LINKFILE): $(LDS)
70 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
71 $(DEFINES) -E -P - >$@
72
73clean:
74 $(call PRINTS,cleaning mpegplayer)rm -rf $(OBJDIR)/mpegplayer
75 $(SILENT)rm -f $(OBJDIR)/mpegplayer.* $(DEPFILE)
76
77-include $(DEPFILE)
78
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 @@
22 ****************************************************************************/ 22 ****************************************************************************/
23#include "plugin.h" 23#include "plugin.h"
24#include "mpegplayer.h" 24#include "mpegplayer.h"
25#include "../../codecs/libmad/bit.h" 25#include "codecs/libmad/bit.h"
26#include "../../codecs/libmad/mad.h" 26#include "codecs/libmad/mad.h"
27 27
28/** Audio stream and thread **/ 28/** Audio stream and thread **/
29struct pts_queue_slot; 29struct 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 @@
1#include "plugin.h" 1#include "plugin.h"
2#include "helper.h" 2#include "lib/helper.h"
3#include "lib/configfile.h" 3#include "lib/configfile.h"
4#include "lib/oldmenuapi.h" 4#include "lib/oldmenuapi.h"
5 5
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 @@
101 *****************************************************************************/ 101 *****************************************************************************/
102#include "plugin.h" 102#include "plugin.h"
103#include "mpegplayer.h" 103#include "mpegplayer.h"
104#include "helper.h" 104#include "lib/helper.h"
105#include "mpeg_settings.h" 105#include "mpeg_settings.h"
106#include "mpeg2.h" 106#include "mpeg2.h"
107#include "video_out.h" 107#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
85 85
86#else 86#else
87 87
88#include "grey.h" 88#include "lib/grey.h"
89#define DRAW_BLACK GREY_BLACK 89#define DRAW_BLACK GREY_BLACK
90#define DRAW_DARKGRAY GREY_DARKGRAY 90#define DRAW_DARKGRAY GREY_DARKGRAY
91#define DRAW_LIGHTGRAY GREY_LIGHTGRAY 91#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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10MPEGSRCDIR := $(APPSDIR)/plugins/mpegplayer
11MPEGBUILDDIR := $(BUILDDIR)/apps/plugins/mpegplayer
12
13ROCKS += $(MPEGBUILDDIR)/mpegplayer.rock
14
15MPEG_SRC := $(call preprocess, $(MPEGSRCDIR)/SOURCES)
16MPEG_OBJ := $(call c2obj, $(MPEG_SRC))
17
18# add source files to OTHER_SRC to get automatic dependencies
19OTHER_SRC += $(MPEG_SRC)
20
21$(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 @@
22 ****************************************************************************/ 22 ****************************************************************************/
23#include "plugin.h" 23#include "plugin.h"
24#include "mpegplayer.h" 24#include "mpegplayer.h"
25#include "grey.h" 25#include "lib/grey.h"
26#include "mpeg_settings.h" 26#include "mpeg_settings.h"
27 27
28#ifndef HAVE_LCD_COLOR 28#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 @@
23#include "plugin.h" 23#include "plugin.h"
24#include "mpegplayer.h" 24#include "mpegplayer.h"
25#include "mpeg2dec_config.h" 25#include "mpeg2dec_config.h"
26#include "grey.h" 26#include "lib/grey.h"
27#include "video_out.h" 27#include "video_out.h"
28#include "mpeg_settings.h" 28#include "mpeg_settings.h"
29 29
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 @@
22****************************************************************************/ 22****************************************************************************/
23 23
24#include "plugin.h" 24#include "plugin.h"
25#include "helper.h" 25#include "lib/helper.h"
26 26
27#ifdef HAVE_LCD_BITMAP 27#ifdef HAVE_LCD_BITMAP
28#include "xlcd.h" 28#include "lib/xlcd.h"
29#include "configfile.h" 29#include "lib/configfile.h"
30 30
31PLUGIN_HEADER 31PLUGIN_HEADER
32 32
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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
12CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
14
15ifdef APPEXTRA
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17endif
18
19LINKFILE := $(OBJDIR)/link.lds
20DEPFILE = $(OBJDIR)/dep-pacbox
21
22# This sets up 'SRC' based on the files mentioned in SOURCES
23include $(TOOLSDIR)/makesrc.inc
24
25SOURCES = $(SRC)
26OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
27OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
28DIRS = .
29
30LDS := ../plugin.lds
31OUTPUT = $(OUTDIR)/pacbox.rock
32
33all: $(OUTPUT)
34
35ifndef SIMVER
36$(OBJDIR)/pacbox.elf: $(OBJS) $(LINKFILE)
37 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
38 -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/pacbox.map
39
40$(OUTPUT): $(OBJDIR)/pacbox.elf
41 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
42else
43
44ifeq ($(SIMVER), x11)
45###################################################
46# This is the X11 simulator version
47
48$(OUTPUT): $(OBJS)
49 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
50ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
51# 'x' must be kept or you'll have "Win32 error 5"
52# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
53# #define ERROR_ACCESS_DENIED 5L
54else
55 @chmod -x $@
56endif
57
58else # end of x11-simulator
59ifeq ($(SIMVER), sdl)
60###################################################
61# This is the SDL simulator version
62
63$(OUTPUT): $(OBJS)
64 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
65ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
66# 'x' must be kept or you'll have "Win32 error 5"
67# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
68# #define ERROR_ACCESS_DENIED 5L
69else
70 @chmod -x $@
71endif
72
73else # end of sdl-simulator
74###################################################
75# This is the win32 simulator version
76DLLTOOLFLAGS = --export-all
77DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
78
79$(OUTPUT): $(OBJS)
80 $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
81 $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
82 $(BUILDDIR)/libplugin.a -o $@
83ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
84# 'x' must be kept or you'll have "Win32 error 5"
85# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
86# #define ERROR_ACCESS_DENIED 5L
87else
88 @chmod -x $@
89endif
90endif # end of win32-simulator
91endif
92endif # end of simulator section
93
94
95include $(TOOLSDIR)/make.inc
96
97# MEMORYSIZE should be passed on to this makefile with the chosen memory size
98# given in number of MB
99$(LINKFILE): $(LDS)
100 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
101 $(DEFINES) -E -P - >$@
102
103clean:
104 $(call PRINTS,cleaning pacbox)rm -rf $(OBJDIR)/pacbox
105 $(SILENT)rm -f $(OBJDIR)/pacbox.* $(DEPFILE)
106
107-include $(DEPFILE)
108
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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10PACBOXSRCDIR := $(APPSDIR)/plugins/pacbox
11PACBOXBUILDDIR := $(BUILDDIR)/apps/plugins/pacbox
12
13ROCKS += $(PACBOXBUILDDIR)/pacbox.rock
14
15PACBOX_SRC := $(call preprocess, $(PACBOXSRCDIR)/SOURCES)
16PACBOX_OBJ := $(call c2obj, $(PACBOX_SRC))
17
18# add source files to OTHER_SRC to get automatic dependencies
19OTHER_SRC += $(PACBOX_SRC)
20
21PACBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O2
22
23$(PACBOXBUILDDIR)/pacbox.rock: $(PACBOX_OBJ)
24
25$(PACBOXBUILDDIR)/%.o: $(PACBOXSRCDIR)/%.c $(PLUGINBITMAPLIB) $(PACBOXSRCDIR)/pacbox.make
26 $(SILENT)mkdir -p $(dir $@)
27 $(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 @@
24****************************************************************************/ 24****************************************************************************/
25 25
26#include "plugin.h" 26#include "plugin.h"
27#include "pluginlib_actions.h" 27#include "lib/pluginlib_actions.h"
28#include "helper.h" 28#include "lib/helper.h"
29#include "bmp.h" 29#include "lib/bmp.h"
30#include "picture.h" 30#include "lib/picture.h"
31#include "pluginbitmaps/pictureflow_logo.h" 31#include "pluginbitmaps/pictureflow_logo.h"
32#include "pluginbitmaps/pictureflow_emptyslide.h" 32#include "pluginbitmaps/pictureflow_emptyslide.h"
33 33
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 @@
25****************************************************************************/ 25****************************************************************************/
26 26
27#include "plugin.h" 27#include "plugin.h"
28#include "helper.h" 28#include "lib/helper.h"
29 29
30#ifdef HAVE_LCD_BITMAP 30#ifdef HAVE_LCD_BITMAP
31 31
32#ifndef HAVE_LCD_COLOR 32#ifndef HAVE_LCD_COLOR
33#include "grey.h" 33#include "lib/grey.h"
34#endif 34#endif
35#include "fixedpoint.h" 35#include "lib/fixedpoint.h"
36 36
37PLUGIN_HEADER 37PLUGIN_HEADER
38 38
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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10# single-file plugins:
11PLUGINS_SRC = $(call preprocess, $(APPSDIR)/plugins/SOURCES)
12OTHER_SRC += $(PLUGINS_SRC)
13ROCKS := $(PLUGINS_SRC:.c=.rock)
14ROCKS := $(subst $(ROOTDIR),$(BUILDDIR),$(ROCKS))
15
16# libplugin.a
17PLUGINLIB := $(BUILDDIR)/apps/plugins/libplugin.a
18PLUGINLIB_SRC = $(call preprocess, $(APPSDIR)/plugins/lib/SOURCES)
19OTHER_SRC += $(PLUGINLIB_SRC)
20
21PLUGINLIB_OBJ := $(PLUGINLIB_SRC:.c=.o)
22PLUGINLIB_OBJ := $(PLUGINLIB_OBJ:.S=.o)
23PLUGINLIB_OBJ := $(subst $(ROOTDIR),$(BUILDDIR),$(PLUGINLIB_OBJ))
24
25# multifile plugins (subdirs):
26PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS)
27
28# include <dir>.make from each subdir (yay!)
29$(foreach dir,$(PLUGINSUBDIRS),$(eval include $(dir)/$(notdir $(dir)).make))
30
31### build data / rules
32PLUGIN_LDS := $(APPSDIR)/plugins/plugin.lds
33PLUGINLINK_LDS := $(BUILDDIR)/apps/plugins/plugin.link
34
35OTHER_INC += -I$(APPSDIR)/plugins
36
37# special compile flags for plugins:
38PLUGINFLAGS = -I$(APPSDIR)/plugins -DPLUGIN $(CFLAGS)
39
40$(ROCKS): $(PLUGINLIB) $(APPSDIR)/plugin.h $(PLUGINLINK_LDS) $(PLUGINBITMAPLIB)
41
42$(PLUGINLIB): $(PLUGINLIB_OBJ)
43 $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1
44
45$(PLUGINLINK_LDS): $(PLUGIN_LDS)
46 $(call PRINTS,PP $(@F))
47 $(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS))
48
49$(BUILDDIR)/credits.raw credits.raw: $(DOCSDIR)/CREDITS
50 $(call PRINTS,Create credits.raw)perl $(APPSDIR)/plugins/credits.pl < $< > $(BUILDDIR)/$(@F)
51
52# special dependencies
53$(BUILDDIR)/apps/plugins/wav2wv.rock: $(BUILDDIR)/apps/codecs/libwavpack.a
54
55# special pattern rule for compiling plugin lib (with -ffunction-sections)
56$(BUILDDIR)/apps/plugins/lib/%.o: $(ROOTDIR)/apps/plugins/lib/%.c
57 $(SILENT)mkdir -p $(dir $@)
58 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PLUGINFLAGS) -ffunction-sections -c $< -o $@
59
60# special pattern rule for compiling plugins with extra flags
61$(BUILDDIR)/apps/plugins/%.o: $(ROOTDIR)/apps/plugins/%.c $(PLUGINBITMAPLIB)
62 $(SILENT)mkdir -p $(dir $@)
63 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PLUGINFLAGS) -c $< -o $@
64
65ifdef SIMVER
66 PLUGINLDFLAGS = $(SHARED_FLAG) # <-- from Makefile
67else
68 PLUGINLDFLAGS = -T$(PLUGINLINK_LDS) -Wl,--gc-sections -Wl,-Map,$*.map
69endif
70
71$(BUILDDIR)/%.rock: $(BUILDDIR)/%.o $(PLUGINLINK_LDS)
72 $(call PRINTS,LD $(@F))$(CC) $(PLUGINFLAGS) -o $(BUILDDIR)/$*.elf \
73 $(filter %.o, $^) \
74 $(filter %.a, $^) \
75 -lgcc $(PLUGINLDFLAGS)
76 $(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 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#include "plugin.h" 22#include "plugin.h"
23#include "bmp.h" 23#include "lib/bmp.h"
24 24
25#if defined(HAVE_LCD_COLOR) 25#if defined(HAVE_LCD_COLOR)
26 26
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 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "oldmenuapi.h" 22#include "lib/oldmenuapi.h"
23 23
24PLUGIN_HEADER 24PLUGIN_HEADER
25 25
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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $$Id: $$
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) \
12 -I$(BUILDDIR)/pluginbitmaps
13CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
14 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
15
16ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
18endif
19
20LINKFILE := $(OBJDIR)/link.lds
21DEPFILE = $(OBJDIR)/dep-reversi
22
23# This sets up 'SRC' based on the files mentioned in SOURCES
24include $(TOOLSDIR)/makesrc.inc
25
26SOURCES = $(SRC)
27OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
28DIRS = .
29
30ifndef SIMVER
31 LDS := ../plugin.lds
32 OUTPUT = $(OUTDIR)/reversi.rock
33else ## simulators
34 OUTPUT = $(OUTDIR)/reversi.rock
35endif
36
37all: $(OUTPUT)
38
39ifndef SIMVER
40$(OBJDIR)/reversi.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
41 $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
42 $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/reversi.map
43
44$(OUTPUT): $(OBJDIR)/reversi.elf
45 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
46else
47
48ifeq ($(SIMVER), x11)
49###################################################
50# This is the X11 simulator version
51
52$(OUTPUT): $(OBJS)
53 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
54ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
55# 'x' must be kept or you'll have "Win32 error 5"
56# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
57# #define ERROR_ACCESS_DENIED 5L
58else
59 @chmod -x $@
60endif
61
62else # end of x11-simulator
63ifeq ($(SIMVER), sdl)
64###################################################
65# This is the SDL simulator version
66
67$(OUTPUT): $(OBJS)
68 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
69ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
70# 'x' must be kept or you'll have "Win32 error 5"
71# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
72# #define ERROR_ACCESS_DENIED 5L
73else
74 @chmod -x $@
75endif
76
77else # end of sdl-simulator
78###################################################
79# This is the win32 simulator version
80DLLTOOLFLAGS = --export-all
81DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
82
83$(OUTPUT): $(OBJS)
84 $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
85 $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
86 $(BUILDDIR)/libplugin.a $(BITMAPLIBS) -o $@
87ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
88# 'x' must be kept or you'll have "Win32 error 5"
89# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
90# #define ERROR_ACCESS_DENIED 5L
91else
92 @chmod -x $@
93endif
94endif # end of win32-simulator
95endif
96endif # end of simulator section
97
98
99include $(TOOLSDIR)/make.inc
100
101# MEMORYSIZE should be passed on to this makefile with the chosen memory size
102# given in number of MB
103$(LINKFILE): $(LDS)
104 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
105 $(DEFINES) -E -P - >$@
106
107clean:
108 $(call PRINTS,cleaning reversi)rm -rf $(OBJDIR)/reversi
109 $(SILENT)rm -f $(OBJDIR)/reversi.* $(DEPFILE)
110
111-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:
47#include "reversi-strategy.h" 47#include "reversi-strategy.h"
48#include "reversi-gui.h" 48#include "reversi-gui.h"
49 49
50#include "../lib/oldmenuapi.h" 50#include "lib/oldmenuapi.h"
51 51
52PLUGIN_HEADER 52PLUGIN_HEADER
53 53
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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10REVERSISRCDIR := $(APPSDIR)/plugins/reversi
11REVERSIBUILDDIR := $(BUILDDIR)/apps/plugins/reversi
12
13ROCKS += $(REVERSIBUILDDIR)/reversi.rock
14
15REVERSI_SRC := $(call preprocess, $(REVERSISRCDIR)/SOURCES)
16REVERSI_OBJ := $(call c2obj, $(REVERSI_SRC))
17
18# add source files to OTHER_SRC to get automatic dependencies
19OTHER_SRC += $(REVERSI_SRC)
20
21$(REVERSIBUILDDIR)/reversi.rock: $(REVERSI_OBJ)
22# for some reason, this doesn't match the implicit rule in plugins.make,
23# so we have to duplicate the link command here
24 $(SILENT)$(CC) $(PLUGINFLAGS) -o $*.elf \
25 $(filter %.o, $^) \
26 $(filter %.a, $^) \
27 -lgcc $(PLUGINLDFLAGS)
28 $(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 @@
29 */ 29 */
30 30
31#include "plugin.h" 31#include "plugin.h"
32#include "pluginlib_actions.h" 32#include "lib/pluginlib_actions.h"
33 33
34/* This macros must always be included. Should be placed at the top by 34/* This macros must always be included. Should be placed at the top by
35 convention, although the actual position doesn't matter */ 35 convention, although the actual position doesn't matter */
@@ -489,6 +489,14 @@ static char* messages[] =
489#define ROBOT 0 489#define ROBOT 0
490#define KITTEN 1 490#define KITTEN 1
491 491
492/* if SYSFONT_WIDTH is 0 (which it is during dependency generation) gcc
493 will abort (div by 0) and this plugin won't get any dependencies
494*/
495#if SYSFONT_WIDTH < 1
496#define SYSFONT_WIDTH 10
497#define SYSFONT_HEIGHT 10
498#endif
499
492/*Screen dimensions.*/ 500/*Screen dimensions.*/
493#define X_MIN 0 501#define X_MIN 0
494#define X_MAX ((LCD_WIDTH/SYSFONT_WIDTH) - 1) 502#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 @@
21 * 21 *
22 ****************************************************************************/ 22 ****************************************************************************/
23#include "plugin.h" 23#include "plugin.h"
24#include "highscore.h" 24#include "lib/highscore.h"
25#include "playergfx.h" 25#include "lib/playergfx.h"
26#include "helper.h" 26#include "lib/helper.h"
27 27
28PLUGIN_HEADER 28PLUGIN_HEADER
29 29
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 @@
24 24
25#if MEM <= 8 && !defined(SIMULATOR) 25#if MEM <= 8 && !defined(SIMULATOR)
26 26
27#include "overlay.h" 27#include "lib/overlay.h"
28 28
29PLUGIN_HEADER 29PLUGIN_HEADER
30 30
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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
12CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN -finline-functions
14
15ifdef APPEXTRA
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17endif
18
19LINKFILE := $(OBJDIR)/link.lds
20DEPFILE = $(OBJDIR)/dep-rockboy
21SRC = cpu.c emu.c events.c fastmem.c hw.c lcd.c lcdc.c loader.c \
22 mem.c menu.c rbsound.c rockboy.c rtc.c save.c sound.c sys_rockbox.c \
23 ../../../firmware/common/sscanf.c
24
25#CFLAGS += -DDYNAREC
26#SRC += dynarec.c
27
28SOURCES = $(SRC)
29OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
30DIRS = .
31
32ifndef SIMVER
33ifneq (,$(findstring RECORDER,$(TARGET))) ## Archos recorder targets
34 LDS := archos.lds
35 OUTPUT = $(OUTDIR)/rockboy.ovl
36else ## iRiver target
37 LDS := ../plugin.lds
38 OUTPUT = $(OUTDIR)/rockboy.rock
39endif
40else ## simulators
41 OUTPUT = $(OUTDIR)/rockboy.rock
42endif
43
44all: $(OUTPUT)
45
46ifndef SIMVER
47$(OBJDIR)/rockboy.elf: $(OBJS) $(LINKFILE)
48 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -fast -lgcc \
49 -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/rockboy.map
50
51$(OUTPUT): $(OBJDIR)/rockboy.elf
52 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
53else
54
55ifeq ($(SIMVER), x11)
56###################################################
57# This is the X11 simulator version
58
59$(OUTPUT): $(OBJS)
60 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
61ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
62# 'x' must be kept or you'll have "Win32 error 5"
63# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
64# #define ERROR_ACCESS_DENIED 5L
65else
66 @chmod -x $@
67endif
68
69else # end of x11-simulator
70ifeq ($(SIMVER), sdl)
71###################################################
72# This is the sdl simulator version
73
74$(OUTPUT): $(OBJS)
75 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
76ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
77# 'x' must be kept or you'll have "Win32 error 5"
78# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
79# #define ERROR_ACCESS_DENIED 5L
80else
81 @chmod -x $@
82endif
83
84else # end of sdl-simulator
85###################################################
86# This is the win32 simulator version
87DLLTOOLFLAGS = --export-all
88DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
89
90$(OUTPUT): $(OBJS)
91 $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
92 $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
93 $(BUILDDIR)/libplugin.a -o $@
94ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
95# 'x' must be kept or you'll have "Win32 error 5"
96# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
97# #define ERROR_ACCESS_DENIED 5L
98else
99 @chmod -x $@
100endif
101endif # end of win32-simulator
102endif
103endif # end of simulator section
104
105
106include $(TOOLSDIR)/make.inc
107
108# MEMORYSIZE should be passed on to this makefile with the chosen memory size
109# given in number of MB
110$(LINKFILE): $(LDS)
111 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) \
112 -E -P - >$@
113
114clean:
115 $(call PRINTS,cleaning rockboy)rm -rf $(OBJDIR)/rockboy
116 $(SILENT)rm -f $(OBJDIR)/rockboy.* $(DEPFILE)
117
118-include $(DEPFILE)
119
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 @@
1cpu.c
2emu.c
3events.c
4fastmem.c
5hw.c
6lcd.c
7lcdc.c
8loader.c
9mem.c
10menu.c
11rbsound.c
12rockboy.c
13rtc.c
14save.c
15sound.c
16sys_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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10ROCKBOY_SRCDIR = $(APPSDIR)/plugins/rockboy
11ROCKBOY_OBJDIR = $(BUILDDIR)/apps/plugins/rockboy
12
13ROCKBOY_SRC := $(call preprocess, $(ROCKBOY_SRCDIR)/SOURCES)
14ROCKBOY_OBJ := $(call c2obj, $(ROCKBOY_SRC))
15ROCKBOY_OBJ += $(ROCKBOY_OBJDIR)/sscanf.o
16
17OTHER_SRC += $(ROCKBOY_SRC)
18
19ifndef SIMVER
20ifneq (,$(findstring RECORDER,$(TARGET)))
21 ## archos recorder targets
22 ROCKBOY_INLDS := $(ROCKBOY_SRCDIR)/archos.lds
23 ROCKS += $(ROCKBOY_OBJDIR)/rockboy.ovl
24else
25 ### all other targets
26 ROCKBOY_INLDS := $(APPSDIR)/plugins/plugin.lds
27 ROCKS += $(ROCKBOY_OBJDIR)/rockboy.rock
28endif
29 ROCKBOY_OVLFLAGS = -T$(ROCKBOY_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(ROCKBOY_OBJDIR)/$*.map
30 ROCKBOY_OUTLDS = $(ROCKBOY_OBJDIR)/rockboy.lds
31else
32 ### simulator
33 ROCKS += $(ROCKBOY_OBJDIR)/rockboy.rock
34 ROCKBOY_OVLFLAGS = $(SHARED_FLAG) # <-- from Makefile
35endif
36
37$(ROCKBOY_OBJDIR)/sscanf.c: $(FIRMDIR)/common/sscanf.c
38 $(SILENT)mkdir -p $(dir $@)
39 $(call PRINTS,CP $<)cp $< $@
40
41$(ROCKBOY_OBJDIR)/sscanf.o: $(ROCKBOY_OBJDIR)/sscanf.c
42
43$(ROCKBOY_OUTLDS): $(ROCKBOY_INLDS) $(ROCKBOY_OBJ)
44 $(call PRINTS,PP $(<F))$(call preprocess2file,$<,$@)
45
46$(ROCKBOY_OBJDIR)/rockboy.rock: $(ROCKBOY_OBJ) $(ROCKBOY_OUTLDS) $(PLUGINBITMAPLIB)
47
48$(ROCKBOY_OBJDIR)/rockboy.ovl: $(ROCKBOY_OBJ) $(ROCKBOY_OUTLDS) $(PLUGINBITMAPLIB)
49 $(SILENT)$(CC) $(PLUGINFLAGS) -o $(ROCKBOY_OBJDIR)/$*.elf \
50 $(filter %.o, $^) \
51 $(filter %.a, $^) \
52 -lgcc $(ROCKBOY_OVLFLAGS)
53 $(call PRINTS,LD $(@F))$(OC) -O binary $(ROCKBOY_OBJDIR)/$*.elf $@
diff --git a/apps/plugins/rocklife.c b/apps/plugins/rocklife.c
index 55875257f9..e22cb33cae 100644
--- a/apps/plugins/rocklife.c
+++ b/apps/plugins/rocklife.c
@@ -61,8 +61,8 @@
61 */ 61 */
62 62
63#include "plugin.h" 63#include "plugin.h"
64#include "pluginlib_actions.h" 64#include "lib/pluginlib_actions.h"
65#include "helper.h" 65#include "lib/helper.h"
66 66
67PLUGIN_HEADER 67PLUGIN_HEADER
68 68
diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c
index 32c746cc3e..c9a0c6a840 100644
--- a/apps/plugins/rockpaint.c
+++ b/apps/plugins/rockpaint.c
@@ -29,7 +29,6 @@
29 */ 29 */
30 30
31#include "plugin.h" 31#include "plugin.h"
32#include "errno.h"
33#include "lib/bmp.h" 32#include "lib/bmp.h"
34#include "lib/rgb_hsv.h" 33#include "lib/rgb_hsv.h"
35 34
diff --git a/apps/plugins/searchengine/Makefile b/apps/plugins/searchengine/Makefile
deleted file mode 100644
index 7e3cca4940..0000000000
--- a/apps/plugins/searchengine/Makefile
+++ /dev/null
@@ -1,105 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
12CFLAGS = $(INCLUDES) $(GCCOPTS) -O3 $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
14
15ifdef APPEXTRA
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17endif
18
19LINKFILE := $(OBJDIR)/link.lds
20DEPFILE = $(OBJDIR)/dep-searchengine
21SRC = searchengine.c parser.c token.c dbinterface.c
22
23SOURCES = $(SRC)
24OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
25DIRS = .
26
27LDS := ../plugin.lds
28OUTPUT = $(OUTDIR)/searchengine.rock
29
30all: $(OUTPUT)
31
32ifndef SIMVER
33$(OBJDIR)/searchengine.elf: $(OBJS) $(LINKFILE)
34 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
35 -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/searchengine.map
36
37$(OUTPUT): $(OBJDIR)/searchengine.elf
38 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
39else
40
41ifeq ($(SIMVER), x11)
42###################################################
43# This is the X11 simulator version
44
45$(OUTPUT): $(OBJS)
46 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
47ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
48# 'x' must be kept or you'll have "Win32 error 5"
49# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
50# #define ERROR_ACCESS_DENIED 5L
51else
52 @chmod -x $@
53endif
54
55else # end of x11-simulator
56ifeq ($(SIMVER), sdl)
57###################################################
58# This is the SDL simulator version
59
60$(OUTPUT): $(OBJS)
61 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
62ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
63# 'x' must be kept or you'll have "Win32 error 5"
64# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
65# #define ERROR_ACCESS_DENIED 5L
66else
67 @chmod -x $@
68endif
69
70else # end of sdl-simulator
71###################################################
72# This is the win32 simulator version
73DLLTOOLFLAGS = --export-all
74DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
75
76$(OUTPUT): $(OBJS)
77 $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
78 $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
79 $(BUILDDIR)/libplugin.a -o $@
80ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
81# 'x' must be kept or you'll have "Win32 error 5"
82# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
83# #define ERROR_ACCESS_DENIED 5L
84else
85 @chmod -x $@
86endif
87endif # end of win32-simulator
88endif
89endif # end of simulator section
90
91
92include $(TOOLSDIR)/make.inc
93
94# MEMORYSIZE should be passed on to this makefile with the chosen memory size
95# given in number of MB
96$(LINKFILE): $(LDS)
97 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
98 $(DEFINES) -E -P - >$@
99
100clean:
101 $(call PRINTS,cleaning searchengine)rm -rf $(OBJDIR)/searchengine
102 $(SILENT)rm -f $(OBJDIR)/searchengine.* $(DEPFILE)
103
104-include $(DEPFILE)
105
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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $$Id: $$
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) \
12 -I$(BUILDDIR)/pluginbitmaps
13CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
14 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
15
16ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
18endif
19
20LINKFILE := $(OBJDIR)/link.lds
21DEPFILE = $(OBJDIR)/dep-shortcuts
22
23SOURCES := shortcuts_common.c shortcuts_view.c shortcuts_append.c
24VIEW_OBJS := $(OBJDIR)/shortcuts_common.o $(OBJDIR)/shortcuts_view.o
25APPEND_OBJS := $(OBJDIR)/shortcuts_common.o $(OBJDIR)/shortcuts_append.o
26DIRS = .
27
28ifndef SIMVER
29 LDS := ../plugin.lds
30endif
31
32OUTPUT = $(OUTDIR)/shortcuts_view.rock $(OUTDIR)/shortcuts_append.rock
33
34all: $(OUTPUT)
35
36ifndef SIMVER
37$(OBJDIR)/shortcuts_view.elf: $(VIEW_OBJS) $(LINKFILE) $(BITMAPLIBS)
38 $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(VIEW_OBJS) -L$(BUILDDIR) -lplugin -lgcc \
39 $(LINKBITMAPS) -Wl,--gc-sections -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/shortcuts_view.map
40
41$(OUTDIR)/shortcuts_view.rock: $(OBJDIR)/shortcuts_view.elf
42 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
43
44$(OBJDIR)/shortcuts_append.elf: $(APPEND_OBJS) $(LINKFILE) $(BITMAPLIBS)
45 $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(APPEND_OBJS) -L$(BUILDDIR) -lplugin -lgcc \
46 $(LINKBITMAPS) -Wl,--gc-sections -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/shortcuts_append.map
47
48$(OUTDIR)/shortcuts_append.rock: $(OBJDIR)/shortcuts_append.elf
49 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
50else
51
52###################################################
53# This is the SDL simulator version
54
55$(OUTDIR)/shortcuts_view.rock: $(VIEW_OBJS)
56 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(VIEW_OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
57ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
58# 'x' must be kept or you'll have "Win32 error 5"
59# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
60# #define ERROR_ACCESS_DENIED 5L
61else
62 @chmod -x $@
63endif
64
65$(OUTDIR)/shortcuts_append.rock: $(APPEND_OBJS)
66 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(APPEND_OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
67ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
68# 'x' must be kept or you'll have "Win32 error 5"
69# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
70# #define ERROR_ACCESS_DENIED 5L
71else
72 @chmod -x $@
73endif
74
75endif # end of simulator section
76
77
78include $(TOOLSDIR)/make.inc
79
80# MEMORYSIZE should be passed on to this makefile with the chosen memory size
81# given in number of MB
82$(LINKFILE): $(LDS)
83 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
84 $(DEFINES) -E -P - >$@
85
86clean:
87 $(call PRINTS,cleaning shortcuts)rm -rf $(OBJDIR)/shortcuts
88 $(SILENT)rm -f $(OBJDIR)/shortcuts* $(DEPFILE)
89
90-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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10SHCUTSRCDIR := $(APPSDIR)/plugins/shortcuts
11SHCUTBUILDDIR := $(BUILDDIR)/apps/plugins/shortcuts
12
13ROCKS += $(SHCUTBUILDDIR)/shortcuts_view.rock
14ROCKS += $(SHCUTBUILDDIR)/shortcuts_append.rock
15
16# add source files to OTHER_SRC to get automatic dependencies
17OTHER_SRC += $(SHCUTSRCDIR)/shortcuts_common.c \
18 $(SHCUTSRCDIR)/shortcuts_view.c \
19 $(SHCUTSRCDIR)/shortcuts_append.c
20
21$(SHCUTBUILDDIR)/shortcuts_view.rock: \
22 $(SHCUTBUILDDIR)/shortcuts_common.o $(SHCUTBUILDDIR)/shortcuts_view.o
23
24$(SHCUTBUILDDIR)/shortcuts_append.rock: \
25 $(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 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "bmp.h" 22#include "lib/bmp.h"
23 23
24#ifdef HAVE_LCD_BITMAP 24#ifdef HAVE_LCD_BITMAP
25PLUGIN_HEADER 25PLUGIN_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 @@
19 * 19 *
20 **************************************************************************/ 20 **************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "playergfx.h" 22#include "lib/playergfx.h"
23 23
24PLUGIN_HEADER 24PLUGIN_HEADER
25 25
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
34 34
35#include "pluginbitmaps/sokoban_tiles.h" 35#include "pluginbitmaps/sokoban_tiles.h"
36#define SOKOBAN_TILESIZE BMPWIDTH_sokoban_tiles 36#define SOKOBAN_TILESIZE BMPWIDTH_sokoban_tiles
37
38/* If tilesize is 0 (which it is during dependency generation) gcc will abort
39 (div by 0) and this plugin won't get any dependencies
40*/
41#if SOKOBAN_TILESIZE < 1
42#define SOKOBAN_TILESIZE 10
43#endif
44
37/* SOKOBAN_TILESIZE is the number of pixels for each block. 45/* SOKOBAN_TILESIZE is the number of pixels for each block.
38 * Set dynamically so all targets can support levels 46 * Set dynamically so all targets can support levels
39 * that fill their entire screen, less the stat box. 47 * 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 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#include "plugin.h" 22#include "plugin.h"
23#include "playback_control.h" 23#include "lib/playback_control.h"
24#include "configfile.h" 24#include "lib/configfile.h"
25#include "button.h" 25#include "button.h"
26#include "lcd.h" 26#include "lcd.h"
27#include "oldmenuapi.h" 27#include "lib/oldmenuapi.h"
28 28
29#ifdef HAVE_LCD_BITMAP 29#ifdef HAVE_LCD_BITMAP
30 30
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 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#include "plugin.h" 22#include "plugin.h"
23#include "math.h" 23#include "lib/helper.h"
24#include "stdio.h"
25#include "helper.h"
26 24
27PLUGIN_HEADER 25PLUGIN_HEADER
28 26
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 @@
18****************************************************************************/ 18****************************************************************************/
19 19
20#include "plugin.h" 20#include "plugin.h"
21#include "helper.h" 21#include "lib/helper.h"
22 22
23#ifdef HAVE_LCD_BITMAP /* and also not for the Player */ 23#ifdef HAVE_LCD_BITMAP /* and also not for the Player */
24 24
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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) \
12 -I$(BUILDDIR)/pluginbitmaps
13CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
14 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
15
16ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
18endif
19
20LINKFILE := $(OBJDIR)/link.lds
21DEPFILE = $(OBJDIR)/dep-sudoku
22
23# This sets up 'SRC' based on the files mentioned in SOURCES
24include $(TOOLSDIR)/makesrc.inc
25
26SOURCES = $(SRC)
27OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
28DIRS = .
29
30ifndef SIMVER
31 LDS := ../plugin.lds
32 OUTPUT = $(OUTDIR)/sudoku.rock
33else ## simulators
34 OUTPUT = $(OUTDIR)/sudoku.rock
35endif
36
37all: $(OUTPUT)
38
39ifndef SIMVER
40$(OBJDIR)/sudoku.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
41 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
42 $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/sudoku.map
43
44$(OUTPUT): $(OBJDIR)/sudoku.elf
45 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
46else
47###################################################
48# This is the SDL simulator version
49
50$(OUTPUT): $(OBJS)
51 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
52ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
53# 'x' must be kept or you'll have "Win32 error 5"
54# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
55# #define ERROR_ACCESS_DENIED 5L
56else
57 @chmod -x $@
58endif
59
60endif # end of simulator section
61
62
63include $(TOOLSDIR)/make.inc
64
65# MEMORYSIZE should be passed on to this makefile with the chosen memory size
66# given in number of MB
67$(LINKFILE): $(LDS)
68 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
69 $(DEFINES) -E -P - >$@
70
71clean:
72 $(call PRINTS,cleaning sudoku)rm -rf $(OBJDIR)/sudoku
73 $(SILENT)rm -f $(OBJDIR)/sudoku.* $(DEPFILE)
74
75-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:
69#include "generator.h" 69#include "generator.h"
70 70
71/* The bitmaps */ 71/* The bitmaps */
72#include "sudoku_normal.h" 72#include "pluginbitmaps/sudoku_normal.h"
73#include "sudoku_inverse.h" 73#include "pluginbitmaps/sudoku_inverse.h"
74#include "sudoku_start.h" 74#include "pluginbitmaps/sudoku_start.h"
75 75
76#define BITMAP_HEIGHT (BMPHEIGHT_sudoku_normal/10) 76#define BITMAP_HEIGHT (BMPHEIGHT_sudoku_normal/10)
77#define BITMAP_STRIDE BMPWIDTH_sudoku_normal 77#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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10SUDOKUSRCDIR := $(APPSDIR)/plugins/sudoku
11SUDOKUBUILDDIR := $(BUILDDIR)/apps/plugins/sudoku
12
13ROCKS += $(SUDOKUBUILDDIR)/sudoku.rock
14
15SUDOKU_SRC := $(call preprocess, $(SUDOKUSRCDIR)/SOURCES)
16SUDOKU_OBJ := $(call c2obj, $(SUDOKU_SRC))
17
18# add source files to OTHER_SRC to get automatic dependencies
19OTHER_SRC += $(SUDOKU_SRC)
20
21$(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 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#include "plugin.h" 22#include "plugin.h"
23#include "oldmenuapi.h" 23#include "lib/oldmenuapi.h"
24#include "helper.h" 24#include "lib/helper.h"
25 25
26PLUGIN_HEADER 26PLUGIN_HEADER
27 27
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 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "helper.h" 22#include "lib/helper.h"
23#include "grey.h" 23#include "lib/grey.h"
24 24
25#ifdef HAVE_LCD_BITMAP 25#ifdef HAVE_LCD_BITMAP
26 26
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 @@
25 */ 25 */
26 26
27#include "plugin.h" 27#include "plugin.h"
28#include "pluginlib_actions.h" 28#include "lib/pluginlib_actions.h"
29#include "bmp.h" 29#include "lib/bmp.h"
30 30
31PLUGIN_HEADER 31PLUGIN_HEADER
32 32
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 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "oldmenuapi.h" 22#include "lib/oldmenuapi.h"
23 23
24PLUGIN_HEADER 24PLUGIN_HEADER
25 25
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 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "playback_control.h" 22#include "lib/playback_control.h"
23 23
24#if PLUGIN_BUFFER_SIZE > 0x45000 24#if PLUGIN_BUFFER_SIZE > 0x45000
25#define MAX_CHARS 0x40000 /* 128 kiB */ 25#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 @@
29#include "plugin.h" 29#include "plugin.h"
30#include "sh7034.h" 30#include "sh7034.h"
31#include "system.h" 31#include "system.h"
32#include "helper.h" 32#include "lib/helper.h"
33 33
34#ifndef SIMULATOR /* not for simulator by now */ 34#ifndef SIMULATOR /* not for simulator by now */
35#ifdef HAVE_LCD_BITMAP /* and definitely not for the Player, haha */ 35#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 @@
21 ****************************************************************************/ 21 ****************************************************************************/
22#include "plugin.h" 22#include "plugin.h"
23#include <ctype.h> 23#include <ctype.h>
24#include "playback_control.h" 24#include "lib/playback_control.h"
25#include "oldmenuapi.h" 25#include "lib/oldmenuapi.h"
26 26
27PLUGIN_HEADER 27PLUGIN_HEADER
28 28
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 @@
18 * 18 *
19 **************************************************************************/ 19 **************************************************************************/
20#include "plugin.h" 20#include "plugin.h"
21#include "fixedpoint.h" 21#include "lib/fixedpoint.h"
22 22
23#if defined(HAVE_LCD_BITMAP) 23#if defined(HAVE_LCD_BITMAP)
24 24
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 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "configfile.h" 22#include "lib/configfile.h"
23 23
24PLUGIN_HEADER 24PLUGIN_HEADER
25 25
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 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "configfile.h" 22#include "lib/configfile.h"
23#include "helper.h" 23#include "lib/helper.h"
24 24
25PLUGIN_HEADER 25PLUGIN_HEADER
26 26
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 @@
21 ****************************************************************************/ 21 ****************************************************************************/
22 22
23#include "plugin.h" 23#include "plugin.h"
24#include "helper.h" 24#include "lib/helper.h"
25 25
26PLUGIN_HEADER 26PLUGIN_HEADER
27 27
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 @@
21 21
22#if MEM <= 8 && !defined(SIMULATOR) 22#if MEM <= 8 && !defined(SIMULATOR)
23 23
24#include "overlay.h" 24#include "lib/overlay.h"
25 25
26PLUGIN_HEADER 26PLUGIN_HEADER
27 27
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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7#
8OPT_FLAGS=-O3 -funroll-loops
9
10INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) -I. $(TARGET_INC)
12CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN $(OPT_FLAGS) $(PROFILE_OPTS)
14
15ifdef APPEXTRA
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17endif
18
19LINKFILE := $(OBJDIR)/link.lds
20DEPFILE = $(OBJDIR)/dep-zxbox
21
22# This sets up 'SRC' based on the files mentioned in SOURCES
23include $(TOOLSDIR)/makesrc.inc
24
25SOURCES = $(SRC)
26OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
27OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
28DIRS = .
29
30ifndef SIMVER
31ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
32 LDS := archos.lds
33 OUTPUT = $(OUTDIR)/zxbox.ovl
34else ## iRiver/iPod/... targets
35 LDS := ../plugin.lds
36 OUTPUT = $(OUTDIR)/zxbox.rock
37endif
38else ## simulators
39 OUTPUT = $(OUTDIR)/zxbox.rock
40endif
41
42all: $(OUTPUT)
43
44ifndef SIMVER
45$(OBJDIR)/zxbox.elf: $(OBJS) $(LINKFILE)
46 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
47 -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/zxbox.map
48
49$(OUTPUT): $(OBJDIR)/zxbox.elf
50 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
51else
52
53ifeq ($(SIMVER), sdl)
54###################################################
55# This is the SDL simulator version
56
57$(OUTPUT): $(OBJS)
58 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
59ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
60# 'x' must be kept or you'll have "Win32 error 5"
61# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
62# #define ERROR_ACCESS_DENIED 5L
63else
64 @chmod -x $@
65endif
66
67endif
68endif # end of simulator section
69
70
71include $(TOOLSDIR)/make.inc
72
73# MEMORYSIZE should be passed on to this makefile with the chosen memory size
74# given in number of MB
75$(LINKFILE): $(LDS)
76 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
77 $(DEFINES) -E -P - >$@
78
79clean:
80 $(call PRINTS,cleaning zxbox)rm -rf $(OBJDIR)/zxbox
81 $(SILENT)rm -f $(OBJDIR)/zxbox.* $(DEPFILE)
82
83-include $(DEPFILE)
84
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 @@
43#include <stdlib.h> 43#include <stdlib.h>
44#include <errno.h> 44#include <errno.h>
45#ifdef USE_GREY 45#ifdef USE_GREY
46#include "../lib/grey.h" 46#include "lib/grey.h"
47#endif 47#endif
48 48
49#include "zxbox_keyb.h" 49#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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10ZXBOX_SRCDIR = $(APPSDIR)/plugins/zxbox
11ZXBOX_OBJDIR = $(BUILDDIR)/apps/plugins/zxbox
12
13ZXBOX_SRC := $(call preprocess, $(ZXBOX_SRCDIR)/SOURCES)
14ZXBOX_OBJ := $(call c2obj, $(ZXBOX_SRC))
15
16OTHER_SRC += $(ZXBOX_SRC)
17
18ifndef SIMVER
19ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
20 ## archos recorder targets
21 ZXBOX_INLDS := $(ZXBOX_SRCDIR)/archos.lds
22 ROCKS += $(ZXBOX_OBJDIR)/zxbox.ovl
23else
24 ### all other targets
25 ZXBOX_INLDS := $(APPSDIR)/plugins/plugin.lds
26 ROCKS += $(ZXBOX_OBJDIR)/zxbox.rock
27endif
28else
29 ### simulator
30 ROCKS += $(ZXBOX_OBJDIR)/zxbox.rock
31endif
32
33ZXBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O3 -funroll-loops
34
35ifdef SIMVER
36 ZXBOX_LDFLAGS = $(SHARED_FLAG) # <-- from Makefile
37else
38 ZXBOX_OUTLDS = $(ZXBOX_OBJDIR)/zxbox.lds
39 ZXBOX_LDFLAGS = -T$(ZXBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(BUILDDIR)/$*.map
40endif
41
42$(ZXBOX_OUTLDS): $(ZXBOX_INLDS) $(ZXBOX_OBJ)
43 $(call PRINTS,PP $(<F))$(call preprocess2file,$<,$@)
44
45$(ZXBOX_OBJDIR)/zxbox.rock: $(ZXBOX_OBJ) $(ZXBOX_OUTLDS) $(PLUGINBITMAPLIB)
46
47$(ZXBOX_OBJDIR)/zxbox.ovl: $(ZXBOX_OBJ) $(ZXBOX_OUTLDS) $(PLUGINBITMAPLIB) $(PLUGINLIB)
48 $(SILENT)$(CC) $(PLUGINFLAGS) -o $(ZXBOX_OBJDIR)/$*.elf \
49 $(filter %.o, $^) \
50 $(filter %.a, $^) \
51 -lgcc $(ZXBOX_LDFLAGS)
52 $(call PRINTS,LD $(@F))$(OC) -O binary $(ZXBOX_OBJDIR)/$*.elf $@
53
54# special pattern rule for compiling zxbox with extra flags
55$(ZXBOX_OBJDIR)/%.o: $(ZXBOX_SRCDIR)/%.c $(PLUGINBITMAPLIB) $(ZXBOX_SRCDIR)/zxbox.make
56 $(SILENT)mkdir -p $(dir $@)
57 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(ZXBOXFLAGS) -c $< -o $@
diff --git a/apps/plugins/zxbox/zxvid_com.h b/apps/plugins/zxbox/zxvid_com.h
index 2ef67c6385..1e23ca03e3 100644
--- a/apps/plugins/zxbox/zxvid_com.h
+++ b/apps/plugins/zxbox/zxvid_com.h
@@ -3,7 +3,7 @@
3#include "zxconfig.h" 3#include "zxconfig.h"
4 4
5#ifdef USE_GREY 5#ifdef USE_GREY
6#include "../lib/grey.h" 6#include "lib/grey.h"
7#endif 7#endif
8 8
9#include "spscr_p.h" 9#include "spscr_p.h"