diff options
author | Björn Stenberg <bjorn@haxx.se> | 2008-11-20 11:27:31 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2008-11-20 11:27:31 +0000 |
commit | c6b3d38a156dd624760a8eb1bb374affd43b4f2a (patch) | |
tree | 493eba929e2396d86cf4f077709aa09fe172cd35 /apps | |
parent | f66c30346783a400a029bedcd60ab67c81c34a07 (diff) | |
download | rockbox-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')
204 files changed, 1539 insertions, 3368 deletions
diff --git a/apps/Makefile b/apps/Makefile deleted file mode 100644 index 97d7c7716f..0000000000 --- a/apps/Makefile +++ /dev/null | |||
@@ -1,268 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES= $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. \ | ||
11 | -I$(BUILDDIR) -I$(BUILDDIR)/bitmaps -I$(OBJDIR) | ||
12 | |||
13 | DEPFILE = $(OBJDIR)/dep-apps | ||
14 | |||
15 | LDS := $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/app.lds | ||
16 | |||
17 | ROMLDS := $(FIRMDIR)/rom.lds | ||
18 | |||
19 | ifdef SOFTWARECODECS | ||
20 | CODECS=build-codecs | ||
21 | |||
22 | # This sets up the parameters for building and linking libspeex for core voice | ||
23 | VOICE=libspeex-rockbox | ||
24 | LINKVOICE= -lspeex-rockbox | ||
25 | |||
26 | endif | ||
27 | |||
28 | # Set up the bitmap libraries | ||
29 | BITMAPLIBS = | ||
30 | LINKBITMAPS = | ||
31 | ifneq ($(strip $(BMP2RB_MONO)),) | ||
32 | BITMAPLIBS += bitmapsmono | ||
33 | LINKBITMAPS += -lbitmapsmono | ||
34 | endif | ||
35 | ifneq ($(strip $(BMP2RB_NATIVE)),) | ||
36 | BITMAPLIBS += bitmapsnative | ||
37 | LINKBITMAPS += -lbitmapsnative | ||
38 | endif | ||
39 | ifneq ($(strip $(BMP2RB_REMOTEMONO)),) | ||
40 | BITMAPLIBS += bitmapsremotemono | ||
41 | LINKBITMAPS += -lbitmapsremotemono | ||
42 | endif | ||
43 | ifneq ($(strip $(BMP2RB_REMOTENATIVE)),) | ||
44 | BITMAPLIBS += bitmapsremotenative | ||
45 | LINKBITMAPS += -lbitmapsremotenative | ||
46 | endif | ||
47 | |||
48 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
49 | include $(TOOLSDIR)/makesrc.inc | ||
50 | |||
51 | DEFINES = $(DEBUG) | ||
52 | |||
53 | DIRS = . | ||
54 | |||
55 | ifdef APPEXTRA | ||
56 | DIRS += $(subst :, ,$(APPEXTRA)) | ||
57 | INCLUDES += $(patsubst %,-I%,$(subst :, ,$(APPEXTRA))) | ||
58 | endif | ||
59 | |||
60 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(BUILDDATE) $(DEFINES) \ | ||
61 | -DTARGET_ID=$(TARGET_ID) \ | ||
62 | -DAPPSVERSION=\"$(VERSION)\" $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} \ | ||
63 | -DTARGET_NAME=\"$(MODELNAME)\" | ||
64 | |||
65 | OBJS2 := $(OBJDIR)/lang.o $(patsubst %.c, $(OBJDIR)/%.o, $(SRC)) | ||
66 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
67 | SOURCES = $(SRC) | ||
68 | LINKFILE = $(OBJDIR)/linkage.lds | ||
69 | LINKROM = $(OBJDIR)/linkrom.lds | ||
70 | MAXINFILE = $(OBJDIR)/romstart.temp | ||
71 | MAXOUTFILE = $(OBJDIR)/romstart | ||
72 | |||
73 | LIBROCKBOX = $(BUILDDIR)/librockbox.a | ||
74 | |||
75 | ifdef SIMVER | ||
76 | # this is a sim build | ||
77 | |||
78 | all: simbuild | ||
79 | |||
80 | else | ||
81 | # regular target build | ||
82 | |||
83 | ifdef DEBUG | ||
84 | REALBIN = $(OBJDIR)/rockbox.elf | ||
85 | else | ||
86 | # this is not needed to get built when doing debug builds | ||
87 | REALBIN = $(BUILDDIR)/$(BINARY) | ||
88 | endif | ||
89 | |||
90 | all: build | ||
91 | |||
92 | endif | ||
93 | |||
94 | build: $(DEPFILE) $(BITMAPLIBS) build-codecs build-pluginlib | ||
95 | ifdef ENABLEDPLUGINS | ||
96 | $(call PRINTS,MAKE in plugins)$(MAKE) -C plugins OBJDIR=$(OBJDIR)/plugins | ||
97 | endif | ||
98 | $(call PRINTS,MAKE in apps)$(MAKE) $(REALBIN) $(FLASHFILE) $(ARCHOSROM) | ||
99 | |||
100 | simbuild: $(DEPFILE) $(BITMAPLIBS) build-codecs build-pluginlib | ||
101 | ifdef ENABLEDPLUGINS | ||
102 | $(call PRINTS,MAKE in plugins)$(MAKE) -C plugins OBJDIR=$(OBJDIR)/plugins | ||
103 | endif | ||
104 | $(call PRINTS,MAKE in apps)$(MAKE) $(BUILDDIR)/$(BINARY) | ||
105 | |||
106 | build-codecs: | ||
107 | ifdef SOFTWARECODECS | ||
108 | $(SILENT)$(MAKE) -C codecs/lib OBJDIR=$(OBJDIR)/codecs/lib | ||
109 | $(SILENT)$(MAKE) -C codecs OBJDIR=$(OBJDIR)/codecs | ||
110 | endif | ||
111 | |||
112 | build-pluginlib: | ||
113 | ifdef ENABLEDPLUGINS | ||
114 | $(SILENT)$(MAKE) -C plugins/lib OBJDIR=$(OBJDIR)/plugins/lib | ||
115 | endif | ||
116 | |||
117 | bitmapsmono: | ||
118 | $(call PRINTS,MAKE in bitmaps/mono)$(MAKE) -C bitmaps/mono OBJDIR=$(OBJDIR)/bitmaps/mono | ||
119 | |||
120 | bitmapsnative: | ||
121 | $(call PRINTS,MAKE in bitmaps/native)$(MAKE) -C bitmaps/native OBJDIR=$(OBJDIR)/bitmaps/native | ||
122 | |||
123 | bitmapsremotemono: | ||
124 | $(call PRINTS,MAKE in bitmaps/remote_mono)$(MAKE) -C bitmaps/remote_mono OBJDIR=$(OBJDIR)/bitmaps/remote_mono | ||
125 | |||
126 | bitmapsremotenative: | ||
127 | $(call PRINTS,MAKE in bitmaps/remote_native)$(MAKE) -C bitmaps/remote_native OBJDIR=$(OBJDIR)/bitmaps/remote_native | ||
128 | |||
129 | rocks: build-codecs build-pluginlib | ||
130 | $(SILENT)$(MAKE) -C plugins OBJDIR=$(OBJDIR)/plugins | ||
131 | |||
132 | libspeex-rockbox: | ||
133 | $(SILENT)mkdir -p $(OBJDIR)/libspeex-rockbox | ||
134 | $(call PRINTS,MAKE in libspeex for rockbox core)$(MAKE) -C $(APPSDIR)/codecs/libspeex ROCKBOX_VOICE_CODEC=1 OBJDIR=$(OBJDIR)/libspeex-rockbox OUTPUT=$(BUILDDIR)/libspeex-rockbox.a | ||
135 | |||
136 | $(LINKFILE): $(LDS) | ||
137 | $(call PRINTS,Build $(@F))cat $< | $(CC) -DLOADADDRESS=$(LOADADDRESS) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@ | ||
138 | |||
139 | $(LINKROM): $(ROMLDS) | ||
140 | $(call PRINTS,Build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@ | ||
141 | |||
142 | $(MAXOUTFILE): | ||
143 | $(SILENT)echo '#include "config.h"' > $(MAXINFILE) | ||
144 | $(SILENT)echo "ROM_START" >> $(MAXINFILE) | ||
145 | $(SILENT)cat $(MAXINFILE) | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - > $(MAXOUTFILE) | ||
146 | $(SILENT)rm $(MAXINFILE) | ||
147 | |||
148 | $(OBJDIR)/rombox.elf : $(LINKROM) $(LIBROCKBOX) $(VOICE) | ||
149 | $(call PRINTS,MAKE objs)$(MAKE) objs | ||
150 | $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lrockbox -lgcc $(LINKVOICE) $(LINKBITMAPS) -L$(BUILDDIR)/firmware -T$(LINKROM) -Wl,-Map,$(OBJDIR)/rombox.map | ||
151 | |||
152 | objs: $(OBJS) | ||
153 | |||
154 | ifndef SIMVER | ||
155 | |||
156 | $(OBJDIR)/rockbox.elf : $(LINKFILE) $(LIBROCKBOX) $(VOICE) $(BITMAPLIBS) | ||
157 | $(call PRINTS,MAKE objs)$(MAKE) objs | ||
158 | $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR)/firmware -L$(BUILDDIR) -lrockbox $(LINKVOICE) $(LINKBITMAPS) -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/rockbox.map | ||
159 | |||
160 | $(OBJDIR)/rockbox.bin : $(OBJDIR)/rockbox.elf | ||
161 | $(call PRINTS,OBJCOPY $(@F))$(OC) $(if $(filter yes, $(USE_ELF)), -S -x, -O binary) $< $@ | ||
162 | |||
163 | $(OBJDIR)/rombox.bin : $(OBJDIR)/rombox.elf | ||
164 | $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@ | ||
165 | |||
166 | $(OBJDIR)/rockbox.asm: $(OBJDIR)/rockbox.bin | ||
167 | $(TOOLSDIR)/sh2d -sh1 $< > $@ | ||
168 | |||
169 | # | ||
170 | # If there's a flashfile defined for this target (rockbox.ucl for Archos | ||
171 | # models) Then check if the mkfirmware script fails, as then it is (likely) | ||
172 | # because the image is too big and we need to create a compressed image | ||
173 | # instead. | ||
174 | # | ||
175 | $(BUILDDIR)/$(BINARY) : $(OBJDIR)/rockbox.bin $(FLASHFILE) $(BITMAPLIBS) | ||
176 | $(call PRINTS,Build firmware file)($(MKFIRMWARE) $< $@; \ | ||
177 | stat=$$?; \ | ||
178 | if test -n "$(FLASHFILE)"; then \ | ||
179 | if test "$$stat" -ne 0; then \ | ||
180 | echo "Image too big, making a compressed version!"; \ | ||
181 | $(MAKE) -C $(FIRMDIR)/decompressor OBJDIR=$(BUILDDIR)/firmware/decompressor; \ | ||
182 | $(MKFIRMWARE) $(BUILDDIR)/firmware/decompressor/compressed.bin $@; \ | ||
183 | fi \ | ||
184 | fi ) | ||
185 | |||
186 | else | ||
187 | # this is a simulator build | ||
188 | |||
189 | ifeq ($(SIMVER), win32) | ||
190 | # OK, this is ugly but we need it on the link line to make it do right | ||
191 | EXTRAOBJ = $(BUILDDIR)/sim/uisw32-res.o | ||
192 | LDOPTS += -lwinmm | ||
193 | endif | ||
194 | |||
195 | # OS X's ld does not support -Map | ||
196 | ifeq ($(UNAME), Darwin) | ||
197 | SIMULATOR_MAP= | ||
198 | else | ||
199 | #SIMULATOR_MAP=-Wl,-Map,$(OBJDIR)/rockbox.map | ||
200 | endif | ||
201 | |||
202 | $(BUILDDIR)/$(BINARY) : $(BUILDDIR)/libsim.a \ | ||
203 | $(BUILDDIR)/libcomsim.a $(LIBROCKBOX) $(VOICE) $(BITMAPLIBS) | ||
204 | $(call PRINTS,MAKE objs)$(MAKE) objs | ||
205 | $(call PRINTS,LD $(BINARY))$(CC) $(GCCOPTS) -o $@ $(OBJS) -L$(BUILDDIR) -lrockbox -lsim -lcomsim $(LINKVOICE) $(LINKBITMAPS) $(LDOPTS) $(EXTRAOBJ) $(SIMULATOR_MAP) | ||
206 | endif | ||
207 | |||
208 | $(BUILDDIR)/rockbox.ucl: $(OBJDIR)/rockbox.bin | ||
209 | $(call PRINTS,UCLPACK rockbox)$(TOOLSDIR)/uclpack --best --2e -b1048576 $< $@ >/dev/null 2>&1 | ||
210 | |||
211 | $(BUILDDIR)/rombox.ucl: $(OBJDIR)/rombox.bin $(MAXOUTFILE) | ||
212 | $(call PRINTS,UCLPACK rombox)$(TOOLSDIR)/uclpack --none $< $@ >/dev/null 2>&1; \ | ||
213 | perl $(TOOLSDIR)/romsizetest.pl `cat $(MAXOUTFILE)` $<; \ | ||
214 | if test $$? -ne 0; then \ | ||
215 | echo "removing UCL file again, making it a fake one"; \ | ||
216 | echo "fake" > $@; \ | ||
217 | fi | ||
218 | |||
219 | $(BUILDDIR)/rombox.iriver: $(OBJDIR)/rombox.bin | ||
220 | $(call PRINTS,Build ROM file)$(MKFIRMWARE) $< $@ | ||
221 | |||
222 | # make.inc contains the $(DEPFILE) generation | ||
223 | include $(TOOLSDIR)/make.inc | ||
224 | |||
225 | # apps/features.txt is a file that (is preprocessed and) lists named features | ||
226 | # based on defines in the config-*.h files. The named features will be passed | ||
227 | # to genlang and thus (translated) phrases can be used based on those names. | ||
228 | # button.h is included for the HAS_BUTTON_HOLD define. | ||
229 | # | ||
230 | |||
231 | features: $(OBJDIR)/features | ||
232 | |||
233 | $(OBJDIR)/features: features.txt | ||
234 | $(SILENT)mkdir -p $(OBJDIR) | ||
235 | $(SILENT)cat $< | $(HOSTCC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \ | ||
236 | $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -imacros "config.h" -imacros "button.h" - | \ | ||
237 | grep -v "^\#" | grep -v "^$$" > $@; \ | ||
238 | for f in `cat $(OBJDIR)/features`; do feat="$$feat:$$f" ; done ; \ | ||
239 | echo "$$feat" >$(OBJDIR)/genlang-features | ||
240 | |||
241 | $(OBJDIR)/lang.o: lang/$(LANGUAGE).lang $(OBJDIR)/features | ||
242 | $(SILENT)for f in `cat $(OBJDIR)/features`; do feat="$$feat:$$f" ; done; \ | ||
243 | perl -s $(TOOLSDIR)/genlang -p=$(BUILDDIR)/lang -t=$(MODELNAME)$$feat $< | ||
244 | $(call PRINTS,CC lang.c)$(CC) $(CFLAGS) -c $(BUILDDIR)/lang.c -o $@ | ||
245 | |||
246 | clean: | ||
247 | $(call PRINTS,cleaning apps)-rm -f $(OBJS) $(BUILDDIR)/$(BINARY) $(OBJDIR)/rockbox.asm \ | ||
248 | $(OBJDIR)/rockbox.bin $(OBJDIR)/rockbox.elf $(OBJDIR)/*.map \ | ||
249 | $(OBJDIR)/lang.o $(OBJDIR)/build.lang $(BUILDDIR)/lang.[ch] \ | ||
250 | $(LINKFILE) $(BUILDDIR)/rockbox.ucl $(LINKROM) \ | ||
251 | $(BUILDDIR)/rombox.ucl $(OBJDIR)/rombox.bin $(OBJDIR)/rombox.elf \ | ||
252 | $(MAXOUTFILE) $(DEPFILE) | ||
253 | $(SILENT)$(MAKE) -C bitmaps/mono clean OBJDIR=$(OBJDIR)/bitmaps/mono | ||
254 | $(SILENT)$(MAKE) -C bitmaps/native clean OBJDIR=$(OBJDIR)/bitmaps/native | ||
255 | $(SILENT)$(MAKE) -C bitmaps/remote_mono clean OBJDIR=$(OBJDIR)/bitmaps/remote_mono | ||
256 | $(SILENT)$(MAKE) -C bitmaps/remote_native clean OBJDIR=$(OBJDIR)/bitmaps/remote_native | ||
257 | $(SILENT)$(MAKE) -C plugins clean OBJDIR=$(OBJDIR)/plugins | ||
258 | $(SILENT)$(MAKE) -C codecs clean OBJDIR=$(OBJDIR)/codecs | ||
259 | $(SILENT)rm -rf $(OBJDIR)/recorder $(OBJDIR)/player | ||
260 | $(SILENT)rm -rf $(BUILDDIR)/bitmaps | ||
261 | $(SILENT)rm -rf $(BUILDDIR)/pluginbitmaps | ||
262 | ifdef SIMVER | ||
263 | $(SILENT)$(MAKE) -C $(SIMDIR) clean | ||
264 | endif | ||
265 | |||
266 | ifneq ($(MAKECMDGOALS),clean) | ||
267 | -include $(DEPFILE) | ||
268 | endif | ||
diff --git a/apps/apps.make b/apps/apps.make new file mode 100644 index 0000000000..1b0bf648f4 --- /dev/null +++ b/apps/apps.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 | |||
10 | INCLUDES += -I$(APPSDIR) $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
11 | SRC += $(call preprocess, $(APPSDIR)/SOURCES) | ||
12 | |||
13 | # apps/features.txt is a file that (is preprocessed and) lists named features | ||
14 | # based on defines in the config-*.h files. The named features will be passed | ||
15 | # to genlang and thus (translated) phrases can be used based on those names. | ||
16 | # button.h is included for the HAS_BUTTON_HOLD define. | ||
17 | # | ||
18 | features $(BUILDDIR)/apps/features $(BUILDDIR)/apps/genlang-features: $(APPSDIR)/features.txt | ||
19 | $(SILENT)mkdir -p $(dir $@) | ||
20 | $(call PRINTS,PP $(<F)) | ||
21 | $(SILENT)$(CC) $(PPCFLAGS) \ | ||
22 | -E -P -imacros "config.h" -imacros "button.h" -x c $< | \ | ||
23 | grep -v "^\#" | grep -v "^$$" > $@; \ | ||
24 | for f in `cat $@`; do feat="$$feat:$$f" ; done ; \ | ||
25 | echo "$$feat" >$(BUILDDIR)/apps/genlang-features | ||
diff --git a/apps/bitmaps/bitmaps.make b/apps/bitmaps/bitmaps.make new file mode 100644 index 0000000000..8d0054532e --- /dev/null +++ b/apps/bitmaps/bitmaps.make | |||
@@ -0,0 +1,51 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | BITMAPDIR = $(ROOTDIR)/apps/bitmaps | ||
11 | BMPINCDIR = $(BUILDDIR)/bitmaps | ||
12 | |||
13 | INCLUDES += -I$(BMPINCDIR) | ||
14 | |||
15 | ifneq ($(strip $(BMP2RB_MONO)),) | ||
16 | BMP = $(call preprocess, $(BITMAPDIR)/mono/SOURCES) | ||
17 | endif | ||
18 | ifneq ($(strip $(BMP2RB_NATIVE)),) | ||
19 | BMP += $(call preprocess, $(BITMAPDIR)/native/SOURCES) | ||
20 | endif | ||
21 | ifneq ($(strip $(BMP2RB_REMOTEMONO)),) | ||
22 | BMP += $(call preprocess, $(BITMAPDIR)/remote_mono/SOURCES) | ||
23 | endif | ||
24 | ifneq ($(strip $(BMP2RB_REMOTENATIVE)),) | ||
25 | BMP += $(call preprocess, $(BITMAPDIR)/remote_native/SOURCES) | ||
26 | endif | ||
27 | |||
28 | BMPOBJ = $(BMP:$(ROOTDIR)/%.bmp=$(BUILDDIR)/%.o) | ||
29 | |||
30 | BMPHFILES = $(BMPINCDIR)/usblogo.h $(BMPINCDIR)/remote_usblogo.h \ | ||
31 | $(BMPINCDIR)/default_icons.h $(BMPINCDIR)/remote_default_icons.h \ | ||
32 | $(BMPINCDIR)/rockboxlogo.h $(BMPINCDIR)/remote_rockboxlogo.h | ||
33 | |||
34 | $(BMPHFILES): $(BMPOBJ) | ||
35 | |||
36 | # pattern rules to create .c files from .bmp, one for each subdir: | ||
37 | $(BUILDDIR)/apps/bitmaps/mono/%.c: $(ROOTDIR)/apps/bitmaps/mono/%.bmp $(TOOLSDIR)/bmp2rb | ||
38 | $(SILENT)mkdir -p $(dir $@) $(BMPINCDIR) | ||
39 | $(call PRINTS,BMP2RB $(<F))$(BMP2RB_MONO) -h $(BMPINCDIR) $< > $@ | ||
40 | |||
41 | $(BUILDDIR)/apps/bitmaps/native/%.c: $(ROOTDIR)/apps/bitmaps/native/%.bmp $(TOOLSDIR)/bmp2rb | ||
42 | $(SILENT)mkdir -p $(dir $@) $(BMPINCDIR) | ||
43 | $(call PRINTS,BMP2RB $(<F))$(BMP2RB_NATIVE) -h $(BMPINCDIR) $< > $@ | ||
44 | |||
45 | $(BUILDDIR)/apps/bitmaps/remote_mono/%.c: $(ROOTDIR)/apps/bitmaps/remote_mono/%.bmp $(TOOLSDIR)/bmp2rb | ||
46 | $(SILENT)mkdir -p $(dir $@) $(BMPINCDIR) | ||
47 | $(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTEMONO) -h $(BMPINCDIR) $< > $@ | ||
48 | |||
49 | $(BUILDDIR)/apps/bitmaps/remote_native/%.c: $(ROOTDIR)/apps/bitmaps/remote_native/%.bmp $(TOOLSDIR)/bmp2rb | ||
50 | $(SILENT)mkdir -p $(dir $@) $(BMPINCDIR) | ||
51 | $(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTENATIVE) -h $(BMPINCDIR) $< > $@ | ||
diff --git a/apps/bitmaps/mono/Makefile b/apps/bitmaps/mono/Makefile deleted file mode 100644 index 28893e914d..0000000000 --- a/apps/bitmaps/mono/Makefile +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \ | ||
11 | -I$(OBJDIR) | ||
12 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) | ||
13 | |||
14 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
15 | include $(TOOLSDIR)/makesrc.inc | ||
16 | |||
17 | SOURCES = $(SRC) | ||
18 | CSRC := $(SRC:%.bmp=$(OBJDIR)/%.c) | ||
19 | OBJS := $(CSRC:%.c=%.o) | ||
20 | DEPFILE = $(OBJDIR)/dep-bitmaps-mono | ||
21 | |||
22 | BMP2RB = $(BMP2RB_MONO) | ||
23 | OUTPUT = $(BUILDDIR)/libbitmapsmono.a | ||
24 | BMPINCDIR = $(BUILDDIR)/bitmaps | ||
25 | |||
26 | include $(TOOLSDIR)/makebmp.inc | ||
27 | |||
28 | clean: | ||
29 | $(call PRINTS,cleaning bitmaps/mono)rm -f $(CSRC) $(OBJS) $(OUTPUT) $(DEPFILE) | ||
30 | $(SILENT)rmdir $(OBJDIR) | ||
31 | |||
32 | -include $(DEPFILE) | ||
diff --git a/apps/bitmaps/native/Makefile b/apps/bitmaps/native/Makefile deleted file mode 100644 index 96f7e50a56..0000000000 --- a/apps/bitmaps/native/Makefile +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \ | ||
11 | -I$(OBJDIR) | ||
12 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) | ||
13 | |||
14 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
15 | include $(TOOLSDIR)/makesrc.inc | ||
16 | |||
17 | SOURCES = $(SRC) | ||
18 | CSRC := $(SRC:%.bmp=$(OBJDIR)/%.c) | ||
19 | OBJS := $(CSRC:%.c=%.o) | ||
20 | DEPFILE = $(OBJDIR)/dep-bitmaps-native | ||
21 | |||
22 | BMP2RB = $(BMP2RB_NATIVE) | ||
23 | OUTPUT = $(BUILDDIR)/libbitmapsnative.a | ||
24 | BMPINCDIR = $(BUILDDIR)/bitmaps | ||
25 | |||
26 | include $(TOOLSDIR)/makebmp.inc | ||
27 | |||
28 | clean: | ||
29 | $(call PRINTS,cleaning bitmaps/native)rm -f $(CSRC) $(OBJS) $(OUTPUT) $(DEPFILE) | ||
30 | $(SILENT)rmdir $(OBJDIR) | ||
31 | |||
32 | -include $(DEPFILE) | ||
diff --git a/apps/bitmaps/remote_mono/Makefile b/apps/bitmaps/remote_mono/Makefile deleted file mode 100644 index db707c7542..0000000000 --- a/apps/bitmaps/remote_mono/Makefile +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \ | ||
11 | -I$(OBJDIR) | ||
12 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) | ||
13 | |||
14 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
15 | include $(TOOLSDIR)/makesrc.inc | ||
16 | |||
17 | SOURCES = $(SRC) | ||
18 | CSRC := $(SRC:%.bmp=$(OBJDIR)/%.c) | ||
19 | OBJS := $(CSRC:%.c=%.o) | ||
20 | DEPFILE = $(OBJDIR)/dep-bitmaps-remotemono | ||
21 | |||
22 | BMP2RB = $(BMP2RB_REMOTEMONO) | ||
23 | OUTPUT = $(BUILDDIR)/libbitmapsremotemono.a | ||
24 | BMPINCDIR = $(BUILDDIR)/bitmaps | ||
25 | |||
26 | include $(TOOLSDIR)/makebmp.inc | ||
27 | |||
28 | clean: | ||
29 | $(call PRINTS,cleaning bitmaps/remotemono)rm -f $(CSRC) $(OBJS) $(OUTPUT) $(DEPFILE) | ||
30 | $(SILENT)rmdir $(OBJDIR) | ||
31 | |||
32 | -include $(DEPFILE) | ||
diff --git a/apps/bitmaps/remote_native/Makefile b/apps/bitmaps/remote_native/Makefile deleted file mode 100644 index 03eccfd5ce..0000000000 --- a/apps/bitmaps/remote_native/Makefile +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \ | ||
11 | -I$(OBJDIR) | ||
12 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) | ||
13 | |||
14 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
15 | include $(TOOLSDIR)/makesrc.inc | ||
16 | |||
17 | SOURCES = $(SRC) | ||
18 | CSRC := $(SRC:%.bmp=$(OBJDIR)/%.c) | ||
19 | OBJS := $(CSRC:%.c=%.o) | ||
20 | DEPFILE = $(OBJDIR)/dep-bitmaps-remotenative | ||
21 | |||
22 | BMP2RB = $(BMP2RB_REMOTENATIVE) | ||
23 | OUTPUT = $(BUILDDIR)/libbitmapsremotenative.a | ||
24 | BMPINCDIR = $(BUILDDIR)/bitmaps | ||
25 | |||
26 | include $(TOOLSDIR)/makebmp.inc | ||
27 | |||
28 | clean: | ||
29 | $(call PRINTS,cleaning bitmaps/remote_native)rm -f $(CSRC) $(OBJS) $(OUTPUT) $(DEPFILE) | ||
30 | $(SILENT)rmdir $(OBJDIR) | ||
31 | |||
32 | -include $(DEPFILE) | ||
diff --git a/apps/codecs/Makefile b/apps/codecs/Makefile deleted file mode 100644 index 6d3f1f683a..0000000000 --- a/apps/codecs/Makefile +++ /dev/null | |||
@@ -1,256 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES = -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/common \ | ||
11 | -I$(FIRMDIR)/drivers -I$(APPSDIR) -Ilib -I$(BUILDDIR) | ||
12 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(TARGET) $(EXTRA_DEFINES) \ | ||
13 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DCODEC | ||
14 | |||
15 | ifdef APPEXTRA | ||
16 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
17 | endif | ||
18 | |||
19 | ifdef SOFTWARECODECS | ||
20 | CODECLIBS = -lspc -lmad -la52 -lffmpegFLAC -ltremor -lwavpack -lmusepack -lalac -lfaad -lm4a -lspeex -ldemac -lwma -lasap | ||
21 | OUTPUT = libspc libmad liba52 libffmpegFLAC libwma libtremor libwavpack libmusepack libalac libfaad libm4a libspeex libdemac libasap | ||
22 | endif | ||
23 | |||
24 | # we "borrow" the plugin LDS file | ||
25 | LDS := $(APPSDIR)/plugins/plugin.lds | ||
26 | |||
27 | LINKCODEC := $(OBJDIR)/codeclink.lds | ||
28 | DEPFILE = $(OBJDIR)/dep-codecs | ||
29 | |||
30 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
31 | include $(TOOLSDIR)/makesrc.inc | ||
32 | |||
33 | ROCKS := $(SRC:%.c=$(OBJDIR)/%.codec) | ||
34 | SOURCES = $(SRC) | ||
35 | ELFS := $(SRC:%.c=$(OBJDIR)/%.elf) | ||
36 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
37 | # as created by the cross-compiler for win32: | ||
38 | DEFS := $(SRC:%.c=$(OBJDIR)/%.def) | ||
39 | DIRS = . | ||
40 | |||
41 | CODECLIB := $(BUILDDIR)/libcodec.a | ||
42 | CODECDEPS = $(LINKCODEC) $(CODECLIB) | ||
43 | |||
44 | .PHONY: libspc libmad liba52 libffmpegFLAC libtremor libspeex libwavpack libmusepack libalac libfaad libm4a libdemac libwma libasap | ||
45 | |||
46 | all: $(LINKCODEC) $(ROCKS) | ||
47 | |||
48 | ifndef SIMVER | ||
49 | $(BUILDDIR)/%.a : % $(CODECDEPS) | ||
50 | |||
51 | # special dependencies | ||
52 | $(OBJDIR)/spc.elf : $(BUILDDIR)/libspc.a | ||
53 | $(OBJDIR)/mpa.elf : $(BUILDDIR)/libmad.a | ||
54 | $(OBJDIR)/a52.elf : $(BUILDDIR)/liba52.a | ||
55 | $(OBJDIR)/flac.elf : $(BUILDDIR)/libffmpegFLAC.a | ||
56 | $(OBJDIR)/vorbis.elf : $(BUILDDIR)/libtremor.a | ||
57 | $(OBJDIR)/speex.elf : $(BUILDDIR)/libspeex.a | ||
58 | $(OBJDIR)/mpc.elf : $(BUILDDIR)/libmusepack.a | ||
59 | $(OBJDIR)/wavpack.elf : $(BUILDDIR)/libwavpack.a | ||
60 | $(OBJDIR)/alac.elf : $(BUILDDIR)/libalac.a $(BUILDDIR)/libm4a.a | ||
61 | $(OBJDIR)/aac.elf : $(BUILDDIR)/libfaad.a $(BUILDDIR)/libm4a.a | ||
62 | $(OBJDIR)/shorten.elf : $(BUILDDIR)/libffmpegFLAC.a | ||
63 | $(OBJDIR)/ape.elf : $(BUILDDIR)/libdemac.a | ||
64 | $(OBJDIR)/wma.elf : $(BUILDDIR)/libwma.a | ||
65 | $(OBJDIR)/wavpack_enc.elf: $(BUILDDIR)/libwavpack.a | ||
66 | $(OBJDIR)/asap.elf : $(BUILDDIR)/libasap.a | ||
67 | |||
68 | # standard dependencies | ||
69 | $(OBJDIR)/%.elf: $(OBJDIR)/%.o $(OBJDIR)/codec_crt0.o $(CODECLIB) | ||
70 | $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $^ \ | ||
71 | -L$(BUILDDIR) -lcodec -lgcc -T$(LINKCODEC) \ | ||
72 | -Wl,--gc-sections,-Map,$(OBJDIR)/$*.map | ||
73 | |||
74 | $(OBJDIR)/%.codec : $(OBJDIR)/%.elf | ||
75 | $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@ | ||
76 | else | ||
77 | |||
78 | ifeq ($(SIMVER), x11) | ||
79 | ################################################### | ||
80 | # This is the X11 simulator version | ||
81 | |||
82 | $(OBJDIR)/%.codec : $(OBJDIR)/%.o $(OBJDIR)/codec_crt0.o $(BUILDDIR)/libcodec.a $(OUTPUT) | ||
83 | $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $< $(OBJDIR)/codec_crt0.o -L$(BUILDDIR) $(CODECLIBS) -lcodec -o $@ | ||
84 | ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) | ||
85 | # 'x' must be kept or you'll have "Win32 error 5" | ||
86 | # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 | ||
87 | # #define ERROR_ACCESS_DENIED 5L | ||
88 | else | ||
89 | $(SILENT)chmod -x $@ | ||
90 | endif | ||
91 | |||
92 | else # end of x11-simulator | ||
93 | ifeq ($(SIMVER), sdl) | ||
94 | ################################################### | ||
95 | # This is the SDL simulator version | ||
96 | |||
97 | $(OBJDIR)/%.codec : $(OBJDIR)/%.o $(OBJDIR)/codec_crt0.o $(BUILDDIR)/libcodec.a $(OUTPUT) | ||
98 | $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $< $(OBJDIR)/codec_crt0.o -L$(BUILDDIR) $(CODECLIBS) -lcodec -o $@ | ||
99 | ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) | ||
100 | # 'x' must be kept or you'll have "Win32 error 5" | ||
101 | # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 | ||
102 | # #define ERROR_ACCESS_DENIED 5L | ||
103 | else | ||
104 | $(SILENT)chmod -x $@ | ||
105 | endif | ||
106 | |||
107 | else # end of sdl-simulator | ||
108 | ################################################### | ||
109 | # This is the win32 simulator version | ||
110 | DLLTOOLFLAGS = --export-all | ||
111 | DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin | ||
112 | |||
113 | $(OBJDIR)/%.codec : $(OBJDIR)/%.o $(OBJDIR)/codec_crt0.o $(BUILDDIR)/libcodec.a $(OUTPUT) | ||
114 | $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $< $(OBJDIR)/codec_crt0.o | ||
115 | $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< $(OBJDIR)/codec_crt0.o\ | ||
116 | $(BUILDDIR)/libcodec.a $(patsubst -l%,$(BUILDDIR)/lib%.a,$(CODECLIBS)) \ | ||
117 | -o $@ | ||
118 | ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) | ||
119 | # 'x' must be kept or you'll have "Win32 error 5" | ||
120 | # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 | ||
121 | # #define ERROR_ACCESS_DENIED 5L | ||
122 | else | ||
123 | $(SILENT)chmod -x $@ | ||
124 | endif | ||
125 | endif # end of win32-simulator | ||
126 | endif | ||
127 | |||
128 | endif # end of simulator section | ||
129 | |||
130 | include $(TOOLSDIR)/make.inc | ||
131 | |||
132 | $(BUILDDIR)/libcodec.a: | ||
133 | $(SILENT)mkdir -p $(OBJDIR)/lib | ||
134 | $(call PRINTS,MAKE in codecs/lib)$(MAKE) -C lib OBJDIR=$(OBJDIR)/lib | ||
135 | |||
136 | $(LINKCODEC): $(LDS) | ||
137 | $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) -DCODEC $(INCLUDES) $(TARGET) $(DEFINES) -E -P - >$@ | ||
138 | |||
139 | $(BUILDDIR)/libspc.a: libspc | ||
140 | |||
141 | libspc: | ||
142 | $(SILENT)mkdir -p $(OBJDIR)/libspc | ||
143 | $(call PRINTS,MAKE in libspc)$(MAKE) -C libspc OBJDIR=$(OBJDIR)/libspc OUTPUT=$(BUILDDIR)/libspc.a | ||
144 | |||
145 | $(BUILDDIR)/libmad.a: libmad | ||
146 | |||
147 | libmad: | ||
148 | $(SILENT)mkdir -p $(OBJDIR)/libmad | ||
149 | $(call PRINTS,MAKE in libmad)$(MAKE) -C libmad OBJDIR=$(OBJDIR)/libmad OUTPUT=$(BUILDDIR)/libmad.a | ||
150 | |||
151 | $(BUILDDIR)/liba52.a: liba52 | ||
152 | |||
153 | liba52: | ||
154 | $(SILENT)mkdir -p $(OBJDIR)/liba52 | ||
155 | $(call PRINTS,MAKE in liba52)$(MAKE) -C liba52 OBJDIR=$(OBJDIR)/liba52 OUTPUT=$(BUILDDIR)/liba52.a | ||
156 | |||
157 | $(BUILDDIR)/libwma.a: libwma | ||
158 | |||
159 | libwma: | ||
160 | $(SILENT)mkdir -p $(OBJDIR)/libwma | ||
161 | $(call PRINTS,MAKE in libwma)$(MAKE) -C libwma OBJDIR=$(OBJDIR)/libwma OUTPUT=$(BUILDDIR)/libwma.a | ||
162 | |||
163 | $(BUILDDIR)/libffmpegFLAC.a: libffmpegFLAC | ||
164 | |||
165 | libffmpegFLAC: | ||
166 | $(SILENT)mkdir -p $(OBJDIR)/libffmpegFLAC | ||
167 | $(call PRINTS,MAKE in libffmpegFLAC)$(MAKE) -C libffmpegFLAC OBJDIR=$(OBJDIR)/libffmpegFLAC OUTPUT=$(BUILDDIR)/libffmpegFLAC.a | ||
168 | |||
169 | $(BUILDDIR)/libtremor.a: libtremor | ||
170 | |||
171 | libtremor: | ||
172 | $(SILENT)mkdir -p $(OBJDIR)/libtremor | ||
173 | $(call PRINTS,MAKE in libtremor)$(MAKE) -C libtremor OBJDIR=$(OBJDIR)/libtremor OUTPUT=$(BUILDDIR)/libtremor.a | ||
174 | |||
175 | $(BUILDDIR)/libspeex.a: libspeex | ||
176 | |||
177 | libspeex: | ||
178 | $(SILENT)mkdir -p $(OBJDIR)/libspeex | ||
179 | $(call PRINTS,MAKE in libspeex)$(MAKE) -C libspeex OBJDIR=$(OBJDIR)/libspeex OUTPUT=$(BUILDDIR)/libspeex.a | ||
180 | |||
181 | $(BUILDDIR)/libwavpack.a: libwavpack | ||
182 | |||
183 | libwavpack: | ||
184 | $(SILENT)mkdir -p $(OBJDIR)/libwavpack | ||
185 | $(call PRINTS,MAKE in libwavpack)$(MAKE) -C libwavpack OBJDIR=$(OBJDIR)/libwavpack OUTPUT=$(BUILDDIR)/libwavpack.a | ||
186 | |||
187 | $(BUILDDIR)/libmusepack.a: libmusepack | ||
188 | |||
189 | libmusepack: | ||
190 | $(SILENT)mkdir -p $(OBJDIR)/libmusepack | ||
191 | $(call PRINTS,MAKE in libmusepack)$(MAKE) -C libmusepack OBJDIR=$(OBJDIR)/libmusepack OUTPUT=$(BUILDDIR)/libmusepack.a | ||
192 | |||
193 | $(BUILDDIR)/libalac.a: libalac | ||
194 | |||
195 | libalac: | ||
196 | $(SILENT)mkdir -p $(OBJDIR)/libalac | ||
197 | $(call PRINTS,MAKE in libalac)$(MAKE) -C libalac OBJDIR=$(OBJDIR)/libalac OUTPUT=$(BUILDDIR)/libalac.a | ||
198 | |||
199 | $(BUILDDIR)/libm4a.a: libm4a | ||
200 | |||
201 | libm4a: | ||
202 | $(SILENT)mkdir -p $(OBJDIR)/libm4a | ||
203 | $(call PRINTS,MAKE in libm4a)$(MAKE) -C libm4a OBJDIR=$(OBJDIR)/libm4a OUTPUT=$(BUILDDIR)/libm4a.a | ||
204 | |||
205 | $(BUILDDIR)/libfaad.a: libfaad | ||
206 | |||
207 | libfaad: | ||
208 | $(SILENT)mkdir -p $(OBJDIR)/libfaad | ||
209 | $(call PRINTS,MAKE in libfaad)$(MAKE) -C libfaad OBJDIR=$(OBJDIR)/libfaad OUTPUT=$(BUILDDIR)/libfaad.a | ||
210 | |||
211 | $(BUILDDIR)/libdemac.a: libdemac | ||
212 | |||
213 | libdemac: | ||
214 | $(SILENT)mkdir -p $(OBJDIR)/libdemac | ||
215 | $(call PRINTS,MAKE in libdemac)$(MAKE) -C demac/libdemac OBJDIR=$(OBJDIR)/libdemac OUTPUT=$(BUILDDIR)/libdemac.a | ||
216 | |||
217 | $(BUILDDIR)/libasap.a: libasap | ||
218 | |||
219 | libasap: | ||
220 | $(SILENT)mkdir -p $(OBJDIR)/libasap | ||
221 | $(call PRINTS,MAKE in libasap)$(MAKE) -C libasap OBJDIR=$(OBJDIR)/libasap OUTPUT=$(BUILDDIR)/libasap.a | ||
222 | clean: | ||
223 | $(call PRINTS,cleaning codecs)rm -fr \ | ||
224 | $(OBJDIR)/libspc $(BUILDDIR)/libspc.a \ | ||
225 | $(OBJDIR)/libmad $(BUILDDIR)/libmad.a \ | ||
226 | $(OBJDIR)/liba52 $(BUILDDIR)/liba52.a \ | ||
227 | $(OBJDIR)/libffmpegFLAC $(BUILDDIR)/libffmpegFLAC.a \ | ||
228 | $(OBJDIR)/libtremor $(BUILDDIR)/libtremor.a \ | ||
229 | $(OBJDIR)/libspeex $(BUILDDIR)/libSpeex.a \ | ||
230 | $(OBJDIR)/libwavpack $(BUILDDIR)/libwavpack.a \ | ||
231 | $(OBJDIR)/libmusepack $(BUILDDIR)/libmusepack.a \ | ||
232 | $(OBJDIR)/libalac $(BUILDDIR)/libalac.a \ | ||
233 | $(OBJDIR)/libfaad $(BUILDDIR)/libfaad.a \ | ||
234 | $(OBJDIR)/libm4a $(BUILDDIR)/libm4a.a \ | ||
235 | $(OBJDIR)/libdemac $(BUILDDIR)/libdemac.a \ | ||
236 | $(OBJDIR)/libwma $(BUILDDIR)/libwma.a | ||
237 | $(OBJDIR)/libasap $(BUILDDIR)/libasap.a | ||
238 | $(SILENT)$(MAKE) -C libspc clean OBJDIR=$(OBJDIR)/libspc | ||
239 | $(SILENT)$(MAKE) -C libmad clean OBJDIR=$(OBJDIR)/libmad | ||
240 | $(SILENT)$(MAKE) -C liba52 clean OBJDIR=$(OBJDIR)/liba52 | ||
241 | $(SILENT)$(MAKE) -C libffmpegFLAC clean OBJDIR=$(OBJDIR)/libffmpegFLAC | ||
242 | $(SILENT)$(MAKE) -C libtremor clean OBJDIR=$(OBJDIR)/libtremor | ||
243 | $(SILENT)$(MAKE) -C libspeex clean OBJDIR=$(OBJDIR)/libspeex | ||
244 | $(SILENT)$(MAKE) -C libwavpack clean OBJDIR=$(OBJDIR)/libwavpack | ||
245 | $(SILENT)$(MAKE) -C libmusepack clean OBJDIR=$(OBJDIR)/libmusepack | ||
246 | $(SILENT)$(MAKE) -C libalac clean OBJDIR=$(OBJDIR)/libalac | ||
247 | $(SILENT)$(MAKE) -C libfaad clean OBJDIR=$(OBJDIR)/libfaad | ||
248 | $(SILENT)$(MAKE) -C libm4a clean OBJDIR=$(OBJDIR)/libm4a | ||
249 | $(SILENT)$(MAKE) -C demac/libdemac clean OBJDIR=$(OBJDIR)/libdemac | ||
250 | $(SILENT)$(MAKE) -C libwma clean OBJDIR=$(OBJDIR)/libwma | ||
251 | $(SILENT)$(MAKE) -C libasap clean OBJDIR=$(OBJDIR)/libasap | ||
252 | $(SILENT)$(MAKE) -C lib clean OBJDIR=$(OBJDIR)/lib | ||
253 | |||
254 | ifneq ($(MAKECMDGOALS),clean) | ||
255 | -include $(DEPFILE) | ||
256 | endif | ||
diff --git a/apps/codecs/ape.c b/apps/codecs/ape.c index f0d15ee67b..97f9ee6639 100644 --- a/apps/codecs/ape.c +++ b/apps/codecs/ape.c | |||
@@ -20,7 +20,6 @@ | |||
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | 21 | ||
22 | #include "codeclib.h" | 22 | #include "codeclib.h" |
23 | #define ROCKBOX | ||
24 | #include <codecs/demac/libdemac/demac.h> | 23 | #include <codecs/demac/libdemac/demac.h> |
25 | 24 | ||
26 | CODEC_HEADER | 25 | CODEC_HEADER |
diff --git a/apps/codecs/codec.h b/apps/codecs/codec.h deleted file mode 100644 index 2ee4e471b2..0000000000 --- a/apps/codecs/codec.h +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2005 Jens Arnold | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | /* Global declarations to be used in rockbox software codecs */ | ||
23 | |||
24 | #include "config.h" | ||
25 | #include "system.h" | ||
26 | |||
27 | #include <sys/types.h> | ||
28 | |||
29 | extern struct codec_api *ci; | ||
30 | |||
31 | /* Get these functions 'out of the way' of the standard functions. Not doing | ||
32 | * so confuses the cygwin linker, and maybe others. These functions need to | ||
33 | * be implemented elsewhere */ | ||
34 | #define malloc(x) codec_malloc(x) | ||
35 | #define calloc(x,y) codec_calloc(x,y) | ||
36 | #define realloc(x,y) codec_realloc(x,y) | ||
37 | #define free(x) codec_free(x) | ||
38 | #define alloca(x) __builtin_alloca(x) | ||
39 | |||
40 | void* codec_malloc(size_t size); | ||
41 | void* codec_calloc(size_t nmemb, size_t size); | ||
42 | void* codec_realloc(void* ptr, size_t size); | ||
43 | void codec_free(void* ptr); | ||
44 | |||
45 | #define abs(x) ((x)>0?(x):-(x)) | ||
46 | #define labs(x) abs(x) | ||
47 | |||
48 | void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); | ||
49 | |||
diff --git a/apps/codecs/codecs.make b/apps/codecs/codecs.make new file mode 100644 index 0000000000..a65dc4f67e --- /dev/null +++ b/apps/codecs/codecs.make | |||
@@ -0,0 +1,103 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | CODECDIR = $(BUILDDIR)/apps/codecs | ||
11 | CODECS_SRC := $(call preprocess, $(APPSDIR)/codecs/SOURCES) | ||
12 | OTHER_SRC += $(CODECS_SRC) | ||
13 | |||
14 | CODECS := $(CODECS_SRC:.c=.codec) | ||
15 | CODECS := $(subst $(ROOTDIR),$(BUILDDIR),$(CODECS)) | ||
16 | |||
17 | # the codec helper library | ||
18 | include $(APPSDIR)/codecs/lib/libcodec.make | ||
19 | |||
20 | # the codec libraries | ||
21 | include $(APPSDIR)/codecs/demac/libdemac.make | ||
22 | include $(APPSDIR)/codecs/liba52/liba52.make | ||
23 | include $(APPSDIR)/codecs/libalac/libalac.make | ||
24 | include $(APPSDIR)/codecs/libasap/libasap.make | ||
25 | include $(APPSDIR)/codecs/libfaad/libfaad.make | ||
26 | include $(APPSDIR)/codecs/libffmpegFLAC/libffmpegFLAC.make | ||
27 | include $(APPSDIR)/codecs/libm4a/libm4a.make | ||
28 | include $(APPSDIR)/codecs/libmad/libmad.make | ||
29 | include $(APPSDIR)/codecs/libmusepack/libmusepack.make | ||
30 | include $(APPSDIR)/codecs/libspc/libspc.make | ||
31 | include $(APPSDIR)/codecs/libspeex/libspeex.make | ||
32 | include $(APPSDIR)/codecs/libtremor/libtremor.make | ||
33 | include $(APPSDIR)/codecs/libwavpack/libwavpack.make | ||
34 | include $(APPSDIR)/codecs/libwma/libwma.make | ||
35 | |||
36 | # compile flags for codecs | ||
37 | CODECFLAGS = $(CFLAGS) -I$(APPSDIR)/codecs -I$(APPSDIR)/codecs/lib \ | ||
38 | -DCODEC | ||
39 | |||
40 | CODEC_LDS := $(APPSDIR)/plugins/plugin.lds # codecs and plugins use same file | ||
41 | CODECLINK_LDS := $(CODECDIR)/codec.link | ||
42 | CODEC_CRT0 := $(CODECDIR)/codec_crt0.o | ||
43 | |||
44 | CODECLIBS := $(DEMACLIB) $(A52LIB) $(ALACLIB) $(ASAPLIB) \ | ||
45 | $(FAADLIB) $(FFMPEGFLACLIB) $(M4ALIB) $(MADLIB) $(MUSEPACKLIB) \ | ||
46 | $(SPCLIB) $(SPEEXLIB) $(TREMORLIB) $(WAVPACKLIB) $(WMALIB) \ | ||
47 | $(CODECLIB) | ||
48 | |||
49 | $(CODECS): $(CODEC_CRT0) $(CODECLINK_LDS) | ||
50 | |||
51 | $(CODECLINK_LDS): $(CODEC_LDS) | ||
52 | $(call PRINTS,PP $(@F)) | ||
53 | $(call preprocess2file, $<, $@) | ||
54 | |||
55 | # codec/library dependencies | ||
56 | $(CODECDIR)/spc.codec : $(CODECDIR)/libspc.a | ||
57 | $(CODECDIR)/mpa.codec : $(CODECDIR)/libmad.a | ||
58 | $(CODECDIR)/a52.codec : $(CODECDIR)/liba52.a | ||
59 | $(CODECDIR)/flac.codec : $(CODECDIR)/libffmpegFLAC.a | ||
60 | $(CODECDIR)/vorbis.codec : $(CODECDIR)/libtremor.a | ||
61 | $(CODECDIR)/speex.codec : $(CODECDIR)/libspeex.a | ||
62 | $(CODECDIR)/mpc.codec : $(CODECDIR)/libmusepack.a | ||
63 | $(CODECDIR)/wavpack.codec : $(CODECDIR)/libwavpack.a | ||
64 | $(CODECDIR)/alac.codec : $(CODECDIR)/libalac.a $(CODECDIR)/libm4a.a | ||
65 | $(CODECDIR)/aac.codec : $(CODECDIR)/libfaad.a $(CODECDIR)/libm4a.a | ||
66 | $(CODECDIR)/shorten.codec : $(CODECDIR)/libffmpegFLAC.a | ||
67 | $(CODECDIR)/ape.codec : $(CODECDIR)/libdemac.a | ||
68 | $(CODECDIR)/wma.codec : $(CODECDIR)/libwma.a | ||
69 | $(CODECDIR)/wavpack_enc.codec: $(CODECDIR)/libwavpack.a | ||
70 | $(CODECDIR)/asap.codec : $(CODECDIR)/libasap.a | ||
71 | |||
72 | $(CODECS): $(CODECLIB) # this must be last in codec dependency list | ||
73 | |||
74 | # libfaad and libmusepack both contain a huffman.h file, with different | ||
75 | # content. So we compile them with special command lines: | ||
76 | |||
77 | # pattern rule for compiling codecs | ||
78 | $(CODECDIR)/%.o: $(ROOTDIR)/apps/codecs/%.c | ||
79 | $(SILENT)mkdir -p $(dir $@) | ||
80 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \ | ||
81 | -I$(dir $<) $(CODECFLAGS) -c $< -o $@ | ||
82 | |||
83 | # pattern rule for compiling codecs | ||
84 | $(CODECDIR)/%.o: $(ROOTDIR)/apps/codecs/%.S | ||
85 | $(SILENT)mkdir -p $(dir $@) | ||
86 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \ | ||
87 | -I$(dir $<) $(CODECFLAGS) -c $< -o $@ | ||
88 | |||
89 | ifdef SIMVER | ||
90 | CODECLDFLAGS = $(SHARED_FLAG) # <-- from Makefile | ||
91 | else | ||
92 | CODECLDFLAGS = -T$(CODECLINK_LDS) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map | ||
93 | CODECFLAGS += -UDEBUG -DNDEBUG | ||
94 | endif | ||
95 | |||
96 | $(CODECDIR)/%.codec: $(CODECDIR)/%.o | ||
97 | $(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/$*.elf \ | ||
98 | $(filter %.o, $^) \ | ||
99 | $(filter %.a, $^) \ | ||
100 | -lgcc $(CODECLDFLAGS) | ||
101 | $(call PRINTS,OC $(@F))$(OC) -O binary $(CODECDIR)/$*.elf $@ | ||
102 | |||
103 | |||
diff --git a/apps/codecs/demac/libdemac.make b/apps/codecs/demac/libdemac.make new file mode 100644 index 0000000000..ba764f897e --- /dev/null +++ b/apps/codecs/demac/libdemac.make | |||
@@ -0,0 +1,24 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | # libdemac | ||
11 | DEMACLIB := $(CODECDIR)/libdemac.a | ||
12 | DEMACLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/demac/libdemac/SOURCES) | ||
13 | DEMACLIB_OBJ := $(call c2obj, $(DEMACLIB_SRC)) | ||
14 | OTHER_SRC += $(DEMACLIB_SRC) | ||
15 | |||
16 | $(DEMACLIB): $(DEMACLIB_OBJ) | ||
17 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
18 | |||
19 | DEMACFLAGS = $(filter-out -O%,$(CODECFLAGS)) | ||
20 | DEMACFLAGS += -O3 | ||
21 | |||
22 | $(CODECDIR)/demac/%.o: $(ROOTDIR)/apps/codecs/demac/%.c | ||
23 | $(SILENT)mkdir -p $(dir $@) | ||
24 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(DEMACFLAGS) -c $< -o $@ | ||
diff --git a/apps/codecs/demac/libdemac/demac_config.h b/apps/codecs/demac/libdemac/demac_config.h index 86c2d24919..dd3aaa3f9c 100644 --- a/apps/codecs/demac/libdemac/demac_config.h +++ b/apps/codecs/demac/libdemac/demac_config.h | |||
@@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA | |||
33 | #include "config.h" | 33 | #include "config.h" |
34 | 34 | ||
35 | #ifndef __ASSEMBLER__ | 35 | #ifndef __ASSEMBLER__ |
36 | #include "../lib/codeclib.h" | 36 | #include "codeclib.h" |
37 | #include <codecs.h> | 37 | #include <codecs.h> |
38 | #endif | 38 | #endif |
39 | 39 | ||
diff --git a/apps/codecs/lib/Makefile b/apps/codecs/lib/Makefile deleted file mode 100644 index 4a33a58f27..0000000000 --- a/apps/codecs/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 codec.h in the apps dir | ||
11 | # .. for stuff in the codecs dir | ||
12 | # . for stuff in the codeclib dir | ||
13 | INCLUDES=-I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
14 | -I$(FIRMDIR)/common -I$(BUILDDIR) | ||
15 | |||
16 | ifdef APPEXTRA | ||
17 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
18 | endif | ||
19 | |||
20 | CFLAGS = $(INCLUDES) $(GCCOPTS) \ | ||
21 | $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} -DCODEC | ||
22 | |||
23 | # Sectioned compilation for target | ||
24 | ifndef SIMVER | ||
25 | CFLAGS += -ffunction-sections -fdata-sections | ||
26 | endif | ||
27 | |||
28 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
29 | include $(TOOLSDIR)/makesrc.inc | ||
30 | |||
31 | SOURCES = $(SRC) | ||
32 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
33 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
34 | DEPFILE = $(OBJDIR)/dep-codeclib | ||
35 | DIRS = . | ||
36 | |||
37 | OUTPUT = $(BUILDDIR)/libcodec.a | ||
38 | |||
39 | all: $(OUTPUT) | ||
40 | |||
41 | $(OUTPUT): $(OBJS) | ||
42 | $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1 | ||
43 | $(SILENT)$(RANLIB) $@ | ||
44 | |||
45 | include $(TOOLSDIR)/make.inc | ||
46 | |||
47 | clean: | ||
48 | $(call PRINTS,cleaning codecs/lib)rm -f $(OBJS) $(OUTPUT) $(DEPFILE) | ||
49 | |||
50 | -include $(DEPFILE) | ||
diff --git a/apps/codecs/lib/codeclib.c b/apps/codecs/lib/codeclib.c index 6e11eb1aa1..8cc40894e3 100644 --- a/apps/codecs/lib/codeclib.c +++ b/apps/codecs/lib/codeclib.c | |||
@@ -27,8 +27,8 @@ | |||
27 | #include "codeclib.h" | 27 | #include "codeclib.h" |
28 | #include "metadata.h" | 28 | #include "metadata.h" |
29 | 29 | ||
30 | long mem_ptr; | 30 | size_t mem_ptr; |
31 | long bufsize; | 31 | size_t bufsize; |
32 | unsigned char* mp3buf; // The actual MP3 buffer from Rockbox | 32 | unsigned char* mp3buf; // The actual MP3 buffer from Rockbox |
33 | unsigned char* mallocbuf; // 512K from the start of MP3 buffer | 33 | unsigned char* mallocbuf; // 512K from the start of MP3 buffer |
34 | unsigned char* filebuf; // The rest of the MP3 buffer | 34 | unsigned char* filebuf; // The rest of the MP3 buffer |
diff --git a/apps/codecs/lib/codeclib.h b/apps/codecs/lib/codeclib.h index 6e92e29417..1df85d6bee 100644 --- a/apps/codecs/lib/codeclib.h +++ b/apps/codecs/lib/codeclib.h | |||
@@ -25,14 +25,23 @@ | |||
25 | #include <sys/types.h> | 25 | #include <sys/types.h> |
26 | 26 | ||
27 | extern struct codec_api *ci; | 27 | extern struct codec_api *ci; |
28 | extern long mem_ptr; | 28 | extern size_t mem_ptr; |
29 | extern long bufsize; | 29 | extern size_t bufsize; |
30 | extern unsigned char* mp3buf; /* The actual MP3 buffer from Rockbox */ | 30 | extern unsigned char* mp3buf; /* The actual MP3 buffer from Rockbox */ |
31 | extern unsigned char* mallocbuf; /* The free space after the codec in the codec buffer */ | 31 | extern unsigned char* mallocbuf; /* The free space after the codec in the codec buffer */ |
32 | extern unsigned char* filebuf; /* The rest of the MP3 buffer */ | 32 | extern unsigned char* filebuf; /* The rest of the MP3 buffer */ |
33 | 33 | ||
34 | /* Standard library functions that are used by the codecs follow here */ | 34 | /* Standard library functions that are used by the codecs follow here */ |
35 | 35 | ||
36 | /* Get these functions 'out of the way' of the standard functions. Not doing | ||
37 | * so confuses the cygwin linker, and maybe others. These functions need to | ||
38 | * be implemented elsewhere */ | ||
39 | #define malloc(x) codec_malloc(x) | ||
40 | #define calloc(x,y) codec_calloc(x,y) | ||
41 | #define realloc(x,y) codec_realloc(x,y) | ||
42 | #define free(x) codec_free(x) | ||
43 | #define alloca(x) __builtin_alloca(x) | ||
44 | |||
36 | void* codec_malloc(size_t size); | 45 | void* codec_malloc(size_t size); |
37 | void* codec_calloc(size_t nmemb, size_t size); | 46 | void* codec_calloc(size_t nmemb, size_t size); |
38 | void* codec_realloc(void* ptr, size_t size); | 47 | void* codec_realloc(void* ptr, size_t size); |
diff --git a/apps/codecs/lib/libcodec.make b/apps/codecs/lib/libcodec.make new file mode 100644 index 0000000000..5e96f75794 --- /dev/null +++ b/apps/codecs/lib/libcodec.make | |||
@@ -0,0 +1,23 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | CODECLIB := $(CODECDIR)/libcodec.a | ||
11 | CODECLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/lib/SOURCES) | ||
12 | CODECLIB_OBJ := $(call c2obj, $(CODECLIB_SRC)) | ||
13 | OTHER_SRC += $(CODECLIB_SRC) | ||
14 | |||
15 | $(CODECLIB): $(CODECLIB_OBJ) | ||
16 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
17 | |||
18 | CODECLIBFLAGS = $(CODECFLAGS) -ffunction-sections | ||
19 | |||
20 | $(CODECDIR)/lib/%.o: $(ROOTDIR)/apps/codecs/lib/%.c | ||
21 | $(SILENT)mkdir -p $(dir $@) | ||
22 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \ | ||
23 | -I$(dir $<) $(CODECLIBFLAGS) -c $< -o $@ | ||
diff --git a/apps/codecs/liba52/Makefile b/apps/codecs/liba52/Makefile deleted file mode 100644 index 798ebc3434..0000000000 --- a/apps/codecs/liba52/Makefile +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR) | ||
12 | |||
13 | ifdef APPEXTRA | ||
14 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
15 | endif | ||
16 | |||
17 | A52OPTS = -O2 | ||
18 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(A52OPTS) $(TARGET) \ | ||
19 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) | ||
20 | |||
21 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
22 | include $(TOOLSDIR)/makesrc.inc | ||
23 | |||
24 | SOURCES = $(SRC) | ||
25 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
26 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
27 | DEPFILE = $(OBJDIR)/dep-liba52 | ||
28 | DIRS = | ||
29 | |||
30 | all: $(OUTPUT) | ||
31 | |||
32 | $(OUTPUT): $(OBJS) | ||
33 | $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1 | ||
34 | $(SILENT)$(RANLIB) $@ | ||
35 | |||
36 | include $(TOOLSDIR)/make.inc | ||
37 | |||
38 | clean: | ||
39 | $(call PRINTS,cleaning liba52)rm -f $(OBJS) $(OUTPUT) $(DEPFILE) | ||
40 | |||
41 | ifneq ($(MAKECMDGOALS),clean) | ||
42 | -include $(DEPFILE) | ||
43 | endif | ||
diff --git a/apps/codecs/liba52/config-a52.h b/apps/codecs/liba52/config-a52.h index 9e38034783..ade7ecf9b8 100644 --- a/apps/codecs/liba52/config-a52.h +++ b/apps/codecs/liba52/config-a52.h | |||
@@ -1,4 +1,4 @@ | |||
1 | #include "../codec.h" | 1 | #include "codeclib.h" |
2 | 2 | ||
3 | /* a52dec profiling */ | 3 | /* a52dec profiling */ |
4 | /* #undef A52DEC_GPROF */ | 4 | /* #undef A52DEC_GPROF */ |
diff --git a/apps/codecs/liba52/liba52.make b/apps/codecs/liba52/liba52.make new file mode 100644 index 0000000000..4e0353d56d --- /dev/null +++ b/apps/codecs/liba52/liba52.make | |||
@@ -0,0 +1,17 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | # liba52 | ||
11 | A52LIB := $(CODECDIR)/liba52.a | ||
12 | A52LIB_SRC := $(call preprocess, $(APPSDIR)/codecs/liba52/SOURCES) | ||
13 | A52LIB_OBJ := $(call c2obj, $(A52LIB_SRC)) | ||
14 | OTHER_SRC += $(A52LIB_SRC) | ||
15 | |||
16 | $(A52LIB): $(A52LIB_OBJ) | ||
17 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
diff --git a/apps/codecs/libalac/Makefile b/apps/codecs/libalac/Makefile deleted file mode 100644 index 1c526871f3..0000000000 --- a/apps/codecs/libalac/Makefile +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR) | ||
12 | |||
13 | ifdef APPEXTRA | ||
14 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
15 | endif | ||
16 | |||
17 | ALACOPTS = -O3 | ||
18 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(ALACOPTS) $(TARGET) \ | ||
19 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) | ||
20 | |||
21 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
22 | include $(TOOLSDIR)/makesrc.inc | ||
23 | |||
24 | SOURCES = $(SRC) | ||
25 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
26 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
27 | DEPFILE = $(OBJDIR)/dep-libalac | ||
28 | DIRS = | ||
29 | |||
30 | all: $(OUTPUT) | ||
31 | |||
32 | $(OUTPUT): $(OBJS) | ||
33 | $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1 | ||
34 | $(SILENT)$(RANLIB) $@ | ||
35 | |||
36 | include $(TOOLSDIR)/make.inc | ||
37 | |||
38 | clean: | ||
39 | $(call PRINTS,cleaning libalac)rm -f $(OBJS) $(OUTPUT) $(DEPFILE) | ||
40 | |||
41 | ifneq ($(MAKECMDGOALS),clean) | ||
42 | -include $(DEPFILE) | ||
43 | endif | ||
diff --git a/apps/codecs/libalac/alac.c b/apps/codecs/libalac/alac.c index d5d9be17f7..d747caeea7 100644 --- a/apps/codecs/libalac/alac.c +++ b/apps/codecs/libalac/alac.c | |||
@@ -35,7 +35,7 @@ | |||
35 | #include <string.h> | 35 | #include <string.h> |
36 | #include <inttypes.h> | 36 | #include <inttypes.h> |
37 | 37 | ||
38 | #include "../codec.h" | 38 | #include "codeclib.h" |
39 | #include "decomp.h" | 39 | #include "decomp.h" |
40 | 40 | ||
41 | int16_t predictor_coef_table[32] IBSS_ATTR; | 41 | int16_t predictor_coef_table[32] IBSS_ATTR; |
diff --git a/apps/codecs/libalac/libalac.make b/apps/codecs/libalac/libalac.make new file mode 100644 index 0000000000..b6b22d17e1 --- /dev/null +++ b/apps/codecs/libalac/libalac.make | |||
@@ -0,0 +1,24 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | # libalac | ||
11 | ALACLIB := $(CODECDIR)/libalac.a | ||
12 | ALACLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libalac/SOURCES) | ||
13 | ALACLIB_OBJ := $(call c2obj, $(ALACLIB_SRC)) | ||
14 | OTHER_SRC += $(ALACLIB_SRC) | ||
15 | |||
16 | $(ALACLIB): $(ALACLIB_OBJ) | ||
17 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
18 | |||
19 | ALACFLAGS = $(filter-out -O%,$(CODECFLAGS)) | ||
20 | ALACFLAGS += -O3 | ||
21 | |||
22 | $(CODECDIR)/libalac/%.o: $(ROOTDIR)/apps/codecs/libalac/%.c | ||
23 | $(SILENT)mkdir -p $(dir $@) | ||
24 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(ALACFLAGS) -c $< -o $@ | ||
diff --git a/apps/codecs/libasap/Makefile b/apps/codecs/libasap/Makefile deleted file mode 100644 index d20f2393e4..0000000000 --- a/apps/codecs/libasap/Makefile +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 13920 2007-07-16 21:16:52Z jethead71 $ | ||
8 | # | ||
9 | |||
10 | INCLUDES=-I$(APPSDIR) -I.. -I../lib -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR) | ||
12 | |||
13 | ifdef APPEXTRA | ||
14 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
15 | endif | ||
16 | |||
17 | SPCOPTS = -O -DROCKBOX | ||
18 | |||
19 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(SPCOPTS) $(TARGET) \ | ||
20 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) -DCODEC=1 | ||
21 | |||
22 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
23 | include $(TOOLSDIR)/makesrc.inc | ||
24 | |||
25 | SOURCES = $(SRC) | ||
26 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
27 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
28 | DEPFILE = $(OBJDIR)/dep-spc | ||
29 | DIRS = | ||
30 | |||
31 | all: $(OUTPUT) | ||
32 | |||
33 | $(OUTPUT): $(OBJS) | ||
34 | $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1 | ||
35 | $(SILENT)$(RANLIB) $@ | ||
36 | |||
37 | include $(TOOLSDIR)/make.inc | ||
38 | |||
39 | clean: | ||
40 | $(call PRINTS,cleaning spc)rm -f $(OBJS) $(OUTPUT) $(DEPFILE) | ||
41 | |||
42 | ifneq ($(MAKECMDGOALS),clean) | ||
43 | -include $(DEPFILE) | ||
44 | endif | ||
diff --git a/apps/codecs/libasap/libasap.make b/apps/codecs/libasap/libasap.make new file mode 100644 index 0000000000..443dfbe7bc --- /dev/null +++ b/apps/codecs/libasap/libasap.make | |||
@@ -0,0 +1,24 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | # libasap | ||
11 | ASAPLIB := $(CODECDIR)/libasap.a | ||
12 | ASAPLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libasap/SOURCES) | ||
13 | ASAPLIB_OBJ := $(call c2obj, $(ASAPLIB_SRC)) | ||
14 | OTHER_SRC += $(ASAPLIB_SRC) | ||
15 | |||
16 | $(ASAPLIB): $(ASAPLIB_OBJ) | ||
17 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
18 | |||
19 | ASAPFLAGS = $(filter-out -O%,$(CODECFLAGS)) | ||
20 | ASAPFLAGS += -O1 | ||
21 | |||
22 | $(CODECDIR)/libasap/%.o: $(ROOTDIR)/apps/codecs/libasap/%.c | ||
23 | $(SILENT)mkdir -p $(dir $@) | ||
24 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(ASAPFLAGS) -c $< -o $@ | ||
diff --git a/apps/codecs/libfaad/Makefile b/apps/codecs/libfaad/Makefile deleted file mode 100644 index 8288b4ce79..0000000000 --- a/apps/codecs/libfaad/Makefile +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR) | ||
12 | |||
13 | ifdef APPEXTRA | ||
14 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
15 | endif | ||
16 | |||
17 | FAADOPTS = -O2 -Wno-char-subscripts | ||
18 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(FAADOPTS) $(TARGET) \ | ||
19 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) | ||
20 | |||
21 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
22 | include $(TOOLSDIR)/makesrc.inc | ||
23 | |||
24 | SOURCES = $(SRC) | ||
25 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
26 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
27 | DEPFILE = $(OBJDIR)/dep-libfaad | ||
28 | DIRS = | ||
29 | |||
30 | all: $(OUTPUT) | ||
31 | |||
32 | $(OUTPUT): $(OBJS) | ||
33 | $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1 | ||
34 | $(SILENT)$(RANLIB) $@ | ||
35 | |||
36 | include $(TOOLSDIR)/make.inc | ||
37 | |||
38 | clean: | ||
39 | $(call PRINTS,cleaning libfaad)rm -f $(OBJS) $(OUTPUT) $(DEPFILE) | ||
40 | |||
41 | ifneq ($(MAKECMDGOALS),clean) | ||
42 | -include $(DEPFILE) | ||
43 | endif | ||
diff --git a/apps/codecs/libfaad/common.h b/apps/codecs/libfaad/common.h index 59d96252e5..a9c67a5459 100644 --- a/apps/codecs/libfaad/common.h +++ b/apps/codecs/libfaad/common.h | |||
@@ -33,8 +33,7 @@ extern "C" { | |||
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | #include "faad_config.h" | 35 | #include "faad_config.h" |
36 | #include "../codec.h" | 36 | #include "codeclib.h" |
37 | #include "../lib/codeclib.h" | ||
38 | 37 | ||
39 | extern struct codec_api* ci; | 38 | extern struct codec_api* ci; |
40 | 39 | ||
diff --git a/apps/codecs/libfaad/libfaad.make b/apps/codecs/libfaad/libfaad.make new file mode 100644 index 0000000000..0af2cfb1f5 --- /dev/null +++ b/apps/codecs/libfaad/libfaad.make | |||
@@ -0,0 +1,18 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | # libfaad | ||
11 | FAADLIB := $(CODECDIR)/libfaad.a | ||
12 | FAADLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libfaad/SOURCES) | ||
13 | FAADLIB_OBJ := $(call c2obj, $(FAADLIB_SRC)) | ||
14 | OTHER_SRC += $(FAADLIB_SRC) | ||
15 | OTHER_INC += -I$(APPSDIR)/codecs/libfaad | ||
16 | |||
17 | $(FAADLIB): $(FAADLIB_OBJ) | ||
18 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
diff --git a/apps/codecs/libffmpegFLAC/Makefile b/apps/codecs/libffmpegFLAC/Makefile deleted file mode 100644 index 02e91d673c..0000000000 --- a/apps/codecs/libffmpegFLAC/Makefile +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR) | ||
12 | |||
13 | ifdef APPEXTRA | ||
14 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
15 | endif | ||
16 | |||
17 | FLACOPTS = -O2 | ||
18 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(FLACOPTS) $(TARGET) \ | ||
19 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) | ||
20 | |||
21 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
22 | include $(TOOLSDIR)/makesrc.inc | ||
23 | |||
24 | SOURCES = $(SRC) | ||
25 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
26 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
27 | DEPFILE = $(OBJDIR)/dep-libffmpegFLAC | ||
28 | DIRS = | ||
29 | |||
30 | all: $(OUTPUT) | ||
31 | |||
32 | $(OUTPUT): $(OBJS) | ||
33 | $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1 | ||
34 | $(SILENT)$(RANLIB) $@ | ||
35 | |||
36 | include $(TOOLSDIR)/make.inc | ||
37 | |||
38 | clean: | ||
39 | $(call PRINTS,cleaning libffmpegFLAC)rm -f $(OBJS) $(OUTPUT) $(DEPFILE) | ||
40 | |||
41 | ifneq ($(MAKECMDGOALS),clean) | ||
42 | -include $(DEPFILE) | ||
43 | endif | ||
diff --git a/apps/codecs/libffmpegFLAC/decoder.c b/apps/codecs/libffmpegFLAC/decoder.c index aa3ce30b62..ed175548f2 100644 --- a/apps/codecs/libffmpegFLAC/decoder.c +++ b/apps/codecs/libffmpegFLAC/decoder.c | |||
@@ -34,7 +34,7 @@ | |||
34 | #include <inttypes.h> | 34 | #include <inttypes.h> |
35 | #include <stdbool.h> | 35 | #include <stdbool.h> |
36 | #ifndef BUILD_STANDALONE | 36 | #ifndef BUILD_STANDALONE |
37 | #include "../codec.h" | 37 | #include "codeclib.h" |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | #include "bitstream.h" | 40 | #include "bitstream.h" |
diff --git a/apps/codecs/libffmpegFLAC/libffmpegFLAC.make b/apps/codecs/libffmpegFLAC/libffmpegFLAC.make new file mode 100644 index 0000000000..41addbe2b8 --- /dev/null +++ b/apps/codecs/libffmpegFLAC/libffmpegFLAC.make | |||
@@ -0,0 +1,17 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | # libffmpegFLAC | ||
11 | FFMPEGFLACLIB := $(CODECDIR)/libffmpegFLAC.a | ||
12 | FFMPEGFLACLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libffmpegFLAC/SOURCES) | ||
13 | FFMPEGFLACLIB_OBJ := $(call c2obj, $(FFMPEGFLACLIB_SRC)) | ||
14 | OTHER_SRC += $(FFMPEGFLACLIB_SRC) | ||
15 | |||
16 | $(FFMPEGFLACLIB): $(FFMPEGFLACLIB_OBJ) | ||
17 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
diff --git a/apps/codecs/libffmpegFLAC/tables.c b/apps/codecs/libffmpegFLAC/tables.c index 5dbb54e11e..58b1bb68d7 100644 --- a/apps/codecs/libffmpegFLAC/tables.c +++ b/apps/codecs/libffmpegFLAC/tables.c | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifdef BUILD_STANDALONE | 1 | #ifdef BUILD_STANDALONE |
2 | #define ICONST_ATTR | 2 | #define ICONST_ATTR |
3 | #else | 3 | #else |
4 | #include "../codec.h" | 4 | #include "codeclib.h" |
5 | #endif | 5 | #endif |
6 | #include <inttypes.h> | 6 | #include <inttypes.h> |
7 | 7 | ||
diff --git a/apps/codecs/libm4a/Makefile b/apps/codecs/libm4a/Makefile deleted file mode 100644 index 1bc71e50b7..0000000000 --- a/apps/codecs/libm4a/Makefile +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR) | ||
12 | |||
13 | ifdef APPEXTRA | ||
14 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
15 | endif | ||
16 | |||
17 | M4AOPTS = -O3 | ||
18 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(M4AOPTS) $(TARGET) \ | ||
19 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) | ||
20 | |||
21 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
22 | include $(TOOLSDIR)/makesrc.inc | ||
23 | |||
24 | SOURCES = $(SRC) | ||
25 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
26 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
27 | DEPFILE = $(OBJDIR)/dep-libm4a | ||
28 | DIRS = | ||
29 | |||
30 | all: $(OUTPUT) | ||
31 | |||
32 | $(OUTPUT): $(OBJS) | ||
33 | $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1 | ||
34 | $(SILENT)$(RANLIB) $@ | ||
35 | |||
36 | include $(TOOLSDIR)/make.inc | ||
37 | |||
38 | clean: | ||
39 | $(call PRINTS,cleaning libm4a)rm -f $(OBJS) $(OUTPUT) $(DEPFILE) | ||
40 | |||
41 | ifneq ($(MAKECMDGOALS),clean) | ||
42 | -include $(DEPFILE) | ||
43 | endif | ||
diff --git a/apps/codecs/libm4a/demux.c b/apps/codecs/libm4a/demux.c index 912e7327e7..e9b5c2c482 100644 --- a/apps/codecs/libm4a/demux.c +++ b/apps/codecs/libm4a/demux.c | |||
@@ -33,11 +33,14 @@ | |||
33 | #include <inttypes.h> | 33 | #include <inttypes.h> |
34 | #include <stdlib.h> | 34 | #include <stdlib.h> |
35 | 35 | ||
36 | #include "../codec.h" | 36 | #include "codeclib.h" |
37 | 37 | ||
38 | #include "m4a.h" | 38 | #include "m4a.h" |
39 | 39 | ||
40 | #if defined(DEBUG) || defined(SIMULATOR) | 40 | #if defined(DEBUG) || defined(SIMULATOR) |
41 | #ifdef DEBUGF | ||
42 | #undef DEBUGF | ||
43 | #endif | ||
41 | #define DEBUGF qtmovie->stream->ci->debugf | 44 | #define DEBUGF qtmovie->stream->ci->debugf |
42 | #else | 45 | #else |
43 | #define DEBUGF(...) | 46 | #define DEBUGF(...) |
diff --git a/apps/codecs/libm4a/libm4a.make b/apps/codecs/libm4a/libm4a.make new file mode 100644 index 0000000000..6c092bad5e --- /dev/null +++ b/apps/codecs/libm4a/libm4a.make | |||
@@ -0,0 +1,24 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | # libm4a | ||
11 | M4ALIB := $(CODECDIR)/libm4a.a | ||
12 | M4ALIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libm4a/SOURCES) | ||
13 | M4ALIB_OBJ := $(call c2obj, $(M4ALIB_SRC)) | ||
14 | OTHER_SRC += $(M4ALIB_SRC) | ||
15 | |||
16 | $(M4ALIB): $(M4ALIB_OBJ) | ||
17 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
18 | |||
19 | M4AFLAGS = $(filter-out -O%,$(CODECFLAGS)) | ||
20 | M4AFLAGS += -O3 | ||
21 | |||
22 | $(CODECDIR)/libm4a/%.o: $(ROOTDIR)/apps/codecs/libm4a/%.c | ||
23 | $(SILENT)mkdir -p $(dir $@) | ||
24 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(M4AFLAGS) -c $< -o $@ | ||
diff --git a/apps/codecs/libm4a/m4a.c b/apps/codecs/libm4a/m4a.c index da3e912b8a..f0666403ed 100644 --- a/apps/codecs/libm4a/m4a.c +++ b/apps/codecs/libm4a/m4a.c | |||
@@ -23,13 +23,6 @@ | |||
23 | #include <inttypes.h> | 23 | #include <inttypes.h> |
24 | #include "m4a.h" | 24 | #include "m4a.h" |
25 | 25 | ||
26 | #if defined(DEBUG) || defined(SIMULATOR) | ||
27 | extern struct codec_api* rb; | ||
28 | #define DEBUGF rb->debugf | ||
29 | #else | ||
30 | #define DEBUGF(...) | ||
31 | #endif | ||
32 | |||
33 | /* Implementation of the stream.h functions used by libalac */ | 26 | /* Implementation of the stream.h functions used by libalac */ |
34 | 27 | ||
35 | #define _Swap32(v) do { \ | 28 | #define _Swap32(v) do { \ |
diff --git a/apps/codecs/libmad/Makefile b/apps/codecs/libmad/Makefile deleted file mode 100644 index 4d838db74f..0000000000 --- a/apps/codecs/libmad/Makefile +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR) | ||
12 | |||
13 | ifdef APPEXTRA | ||
14 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
15 | endif | ||
16 | |||
17 | # NOTE: FPM_ define has been moved to global.h | ||
18 | MADOPTS = -UDEBUG -DNDEBUG -O2 | ||
19 | |||
20 | # We build libmad separately for mpegplayer | ||
21 | ifdef MPEGPLAYER | ||
22 | EXTRA_DEFINES += -DMPEGPLAYER | ||
23 | endif | ||
24 | |||
25 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(MADOPTS) $(TARGET) \ | ||
26 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) | ||
27 | |||
28 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
29 | include $(TOOLSDIR)/makesrc.inc | ||
30 | |||
31 | SOURCES = $(SRC) | ||
32 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
33 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
34 | DEPFILE = $(OBJDIR)/dep-libmad | ||
35 | DIRS = | ||
36 | |||
37 | all: $(OUTPUT) | ||
38 | |||
39 | $(OUTPUT): $(OBJS) | ||
40 | $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1 | ||
41 | $(SILENT)$(RANLIB) $@ | ||
42 | |||
43 | include $(TOOLSDIR)/make.inc | ||
44 | |||
45 | clean: | ||
46 | $(call PRINTS,cleaning libmad)rm -f $(OBJS) $(OUTPUT) $(DEPFILE) | ||
47 | |||
48 | ifneq ($(MAKECMDGOALS),clean) | ||
49 | -include $(DEPFILE) | ||
50 | endif | ||
diff --git a/apps/codecs/libmad/frame.c b/apps/codecs/libmad/frame.c index 2c7fdca199..3fb971d3e1 100644 --- a/apps/codecs/libmad/frame.c +++ b/apps/codecs/libmad/frame.c | |||
@@ -31,7 +31,7 @@ | |||
31 | # include "timer.h" | 31 | # include "timer.h" |
32 | # include "layer12.h" | 32 | # include "layer12.h" |
33 | # include "layer3.h" | 33 | # include "layer3.h" |
34 | # include "../lib/codeclib.h" | 34 | # include "codeclib.h" |
35 | 35 | ||
36 | static | 36 | static |
37 | unsigned long const bitrate_table[5][15] = { | 37 | unsigned long const bitrate_table[5][15] = { |
diff --git a/apps/codecs/libmad/global.h b/apps/codecs/libmad/global.h index 1dad4d5583..93dfd0a13f 100644 --- a/apps/codecs/libmad/global.h +++ b/apps/codecs/libmad/global.h | |||
@@ -19,7 +19,7 @@ | |||
19 | * $Id$ | 19 | * $Id$ |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include "../codec.h" | 22 | #include "codeclib.h" |
23 | 23 | ||
24 | # ifndef LIBMAD_GLOBAL_H | 24 | # ifndef LIBMAD_GLOBAL_H |
25 | # define LIBMAD_GLOBAL_H | 25 | # define LIBMAD_GLOBAL_H |
diff --git a/apps/codecs/libmad/libmad.make b/apps/codecs/libmad/libmad.make new file mode 100644 index 0000000000..f0334956c1 --- /dev/null +++ b/apps/codecs/libmad/libmad.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 | |||
10 | # we need to build two different mad libraries | ||
11 | # (one for codec, one for mpegplayer) | ||
12 | # so a little trickery is necessary | ||
13 | |||
14 | MADFLAGS = $(CODECFLAGS) -UDEBUG -DNDEBUG -I$(APPSDIR)/codecs/libmad | ||
15 | MPEGMADFLAGS = $(MADFLAGS) -DMPEGPLAYER | ||
16 | |||
17 | # libmad | ||
18 | MADLIB := $(CODECDIR)/libmad.a | ||
19 | MADLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libmad/SOURCES) | ||
20 | MADLIB_OBJ := $(call c2obj, $(MADLIB_SRC)) | ||
21 | OTHER_SRC += $(MADLIB_SRC) | ||
22 | |||
23 | $(MADLIB): $(MADLIB_OBJ) | ||
24 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
25 | |||
26 | # libmad-mpeg | ||
27 | MPEGMADLIB := $(CODECDIR)/libmad-mpeg.a | ||
28 | MPEGMADLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libmad/SOURCES) | ||
29 | MPEGMADLIB_OBJ := $(subst .c,.o,$(subst .S,.o,$(subst $(ROOTDIR)/apps/codecs/libmad,$(BUILDDIR)/apps/codecs/libmad-mpeg,$(MPEGMADLIB_SRC)))) | ||
30 | |||
31 | $(MPEGMADLIB): $(MPEGMADLIB_OBJ) | ||
32 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
33 | |||
34 | # pattern rules | ||
35 | |||
36 | $(CODECDIR)/libmad-mpeg/%.o : $(ROOTDIR)/apps/codecs/libmad/%.c | ||
37 | $(SILENT)mkdir -p $(dir $@) | ||
38 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<)) \ | ||
39 | $(CC) $(MPEGMADFLAGS) -c $< -o $@ | ||
40 | |||
41 | $(CODECDIR)/libmad-mpeg/%.o : $(ROOTDIR)/apps/codecs/libmad/%.S | ||
42 | $(SILENT)mkdir -p $(dir $@) | ||
43 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<)) \ | ||
44 | $(CC) $(MPEGMADFLAGS) -c $< -o $@ | ||
45 | |||
46 | $(CODECDIR)/libmad/%.o: $(ROOTDIR)/apps/codecs/libmad/%.c | ||
47 | $(SILENT)mkdir -p $(dir $@) | ||
48 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<)) \ | ||
49 | $(CC) $(MADFLAGS) -c $< -o $@ | ||
50 | |||
51 | $(CODECDIR)/libmad/%.o: $(ROOTDIR)/apps/codecs/libmad/%.S | ||
52 | $(SILENT)mkdir -p $(dir $@) | ||
53 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<)) \ | ||
54 | $(CC) $(MADFLAGS) -c $< -o $@ | ||
diff --git a/apps/codecs/libmusepack/Makefile b/apps/codecs/libmusepack/Makefile deleted file mode 100644 index a70d33644a..0000000000 --- a/apps/codecs/libmusepack/Makefile +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR) | ||
12 | |||
13 | ifdef APPEXTRA | ||
14 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
15 | endif | ||
16 | |||
17 | # libmusepack is faster on ARM-targets with -O1 instead of -O2 | ||
18 | ifeq ($(CPU),arm) | ||
19 | MUSEPACKOPTS += -O1 | ||
20 | else | ||
21 | MUSEPACKOPTS += -O2 | ||
22 | endif | ||
23 | |||
24 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(MUSEPACKOPTS) $(TARGET) \ | ||
25 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) | ||
26 | |||
27 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
28 | include $(TOOLSDIR)/makesrc.inc | ||
29 | |||
30 | SOURCES = $(SRC) | ||
31 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
32 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
33 | DEPFILE = $(OBJDIR)/dep-libmusepack | ||
34 | DIRS = | ||
35 | |||
36 | all: $(OUTPUT) | ||
37 | |||
38 | $(OUTPUT): $(OBJS) | ||
39 | $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1 | ||
40 | $(SILENT)$(RANLIB) $@ | ||
41 | |||
42 | include $(TOOLSDIR)/make.inc | ||
43 | |||
44 | clean: | ||
45 | $(call PRINTS,cleaning libmusepack)rm -f $(OBJS) $(OUTPUT) $(DEPFILE) | ||
46 | |||
47 | ifneq ($(MAKECMDGOALS),clean) | ||
48 | -include $(DEPFILE) | ||
49 | endif | ||
diff --git a/apps/codecs/libmusepack/huffsv46.c b/apps/codecs/libmusepack/huffsv46.c index 833b64b454..20d754c7bb 100644 --- a/apps/codecs/libmusepack/huffsv46.c +++ b/apps/codecs/libmusepack/huffsv46.c | |||
@@ -35,9 +35,9 @@ | |||
35 | /// \file huffsv46.c | 35 | /// \file huffsv46.c |
36 | /// Implementations of huffman decoding for streamversions < 7. | 36 | /// Implementations of huffman decoding for streamversions < 7. |
37 | 37 | ||
38 | #include <musepack.h> | 38 | #include "musepack.h" |
39 | #include <requant.h> | 39 | #include "requant.h" |
40 | #include <huffman.h> | 40 | #include "huffman.h" |
41 | 41 | ||
42 | #ifdef MPC_SUPPORT_SV456 | 42 | #ifdef MPC_SUPPORT_SV456 |
43 | 43 | ||
diff --git a/apps/codecs/libmusepack/huffsv7.c b/apps/codecs/libmusepack/huffsv7.c index ae2b902ea7..9ca77ceaa5 100644 --- a/apps/codecs/libmusepack/huffsv7.c +++ b/apps/codecs/libmusepack/huffsv7.c | |||
@@ -35,9 +35,9 @@ | |||
35 | /// \file huffsv7.c | 35 | /// \file huffsv7.c |
36 | /// Implementations of sv7 huffman decoding functions. | 36 | /// Implementations of sv7 huffman decoding functions. |
37 | 37 | ||
38 | #include <musepack.h> | 38 | #include "musepack.h" |
39 | #include <huffman.h> | 39 | #include "huffman.h" |
40 | #include <requant.h> | 40 | #include "requant.h" |
41 | 41 | ||
42 | const HuffmanTyp mpc_table_HuffHdr [10] ICONST_ATTR = | 42 | const HuffmanTyp mpc_table_HuffHdr [10] ICONST_ATTR = |
43 | {{2147483648u,1,0},{1610612736u,3,1},{1577058304u,7,-4},{1568669696u,9,3},{1560281088u,9,4},{1543503872u,8,-5},{1476395008u,6,2},{1342177280u,5,-3},{1073741824u,4,-2},{0u,2,-1},}; | 43 | {{2147483648u,1,0},{1610612736u,3,1},{1577058304u,7,-4},{1568669696u,9,3},{1560281088u,9,4},{1543503872u,8,-5},{1476395008u,6,2},{1342177280u,5,-3},{1073741824u,4,-2},{0u,2,-1},}; |
diff --git a/apps/codecs/libmusepack/libmusepack.make b/apps/codecs/libmusepack/libmusepack.make new file mode 100644 index 0000000000..736f58bc72 --- /dev/null +++ b/apps/codecs/libmusepack/libmusepack.make | |||
@@ -0,0 +1,29 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | # libmusepack | ||
11 | MUSEPACKLIB := $(CODECDIR)/libmusepack.a | ||
12 | MUSEPACKLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libmusepack/SOURCES) | ||
13 | MUSEPACKLIB_OBJ := $(call c2obj, $(MUSEPACKLIB_SRC)) | ||
14 | OTHER_SRC += $(MUSEPACKLIB_SRC) | ||
15 | |||
16 | $(MUSEPACKLIB): $(MUSEPACKLIB_OBJ) | ||
17 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
18 | |||
19 | # libmusepack is faster on ARM-targets with -O1 than -O2 | ||
20 | MUSEPACKFLAGS = $(filter-out -O%,$(CODECFLAGS)) -I$(APPSDIR)/codecs/libmusepack | ||
21 | ifeq ($(CPU),arm) | ||
22 | MUSEPACKFLAGS += -O1 | ||
23 | else | ||
24 | MUSEPACKFLAGS += -O2 | ||
25 | endif | ||
26 | |||
27 | $(CODECDIR)/libmusepack/%.o: $(ROOTDIR)/apps/codecs/libmusepack/%.c | ||
28 | $(SILENT)mkdir -p $(dir $@) | ||
29 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(MUSEPACKFLAGS) -c $< -o $@ | ||
diff --git a/apps/codecs/libmusepack/musepack.h b/apps/codecs/libmusepack/musepack.h index b9aff48427..1c98de654b 100644 --- a/apps/codecs/libmusepack/musepack.h +++ b/apps/codecs/libmusepack/musepack.h | |||
@@ -45,7 +45,9 @@ extern "C" { | |||
45 | //#include <stdlib.h> | 45 | //#include <stdlib.h> |
46 | #include <string.h> | 46 | #include <string.h> |
47 | 47 | ||
48 | #include "../codec.h" | 48 | #ifndef SIMULATOR |
49 | #include "codecs.h" | ||
50 | #endif | ||
49 | #include "config_types.h" | 51 | #include "config_types.h" |
50 | #include "decoder.h" | 52 | #include "decoder.h" |
51 | #include "math.h" | 53 | #include "math.h" |
diff --git a/apps/codecs/libspc/Makefile b/apps/codecs/libspc/Makefile deleted file mode 100644 index 8929149ce2..0000000000 --- a/apps/codecs/libspc/Makefile +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR) | ||
12 | |||
13 | ifdef APPEXTRA | ||
14 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
15 | endif | ||
16 | |||
17 | SPCOPTS = -O -DROCKBOX | ||
18 | |||
19 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(SPCOPTS) $(TARGET) \ | ||
20 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) -DCODEC=1 | ||
21 | |||
22 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
23 | include $(TOOLSDIR)/makesrc.inc | ||
24 | |||
25 | SOURCES = $(SRC) | ||
26 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
27 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
28 | DEPFILE = $(OBJDIR)/dep-spc | ||
29 | DIRS = | ||
30 | |||
31 | all: $(OUTPUT) | ||
32 | |||
33 | $(OUTPUT): $(OBJS) | ||
34 | $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1 | ||
35 | $(SILENT)$(RANLIB) $@ | ||
36 | |||
37 | include $(TOOLSDIR)/make.inc | ||
38 | |||
39 | clean: | ||
40 | $(call PRINTS,cleaning spc)rm -f $(OBJS) $(OUTPUT) $(DEPFILE) | ||
41 | |||
42 | ifneq ($(MAKECMDGOALS),clean) | ||
43 | -include $(DEPFILE) | ||
44 | endif | ||
diff --git a/apps/codecs/libspc/libspc.make b/apps/codecs/libspc/libspc.make new file mode 100644 index 0000000000..62f788be02 --- /dev/null +++ b/apps/codecs/libspc/libspc.make | |||
@@ -0,0 +1,24 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | # libspc | ||
11 | SPCLIB := $(CODECDIR)/libspc.a | ||
12 | SPCLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libspc/SOURCES) | ||
13 | SPCLIB_OBJ := $(call c2obj, $(SPCLIB_SRC)) | ||
14 | OTHER_SRC += $(SPCLIB_SRC) | ||
15 | |||
16 | $(SPCLIB): $(SPCLIB_OBJ) | ||
17 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
18 | |||
19 | SPCFLAGS = $(filter-out -O%,$(CODECFLAGS)) | ||
20 | SPCFLAGS += -O1 | ||
21 | |||
22 | $(CODECDIR)/libspc/%.o: $(ROOTDIR)/apps/codecs/libspc/%.c | ||
23 | $(SILENT)mkdir -p $(dir $@) | ||
24 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SPCFLAGS) -c $< -o $@ | ||
diff --git a/apps/codecs/libspc/spc_codec.h b/apps/codecs/libspc/spc_codec.h index 33e566aea2..a6dcd0a8bc 100644 --- a/apps/codecs/libspc/spc_codec.h +++ b/apps/codecs/libspc/spc_codec.h | |||
@@ -30,7 +30,9 @@ | |||
30 | #define _SPC_CODEC_H_ | 30 | #define _SPC_CODEC_H_ |
31 | 31 | ||
32 | /* rather than comment out asserts, just define NDEBUG */ | 32 | /* rather than comment out asserts, just define NDEBUG */ |
33 | #ifndef NDEBUG | ||
33 | #define NDEBUG | 34 | #define NDEBUG |
35 | #endif | ||
34 | #include <assert.h> | 36 | #include <assert.h> |
35 | 37 | ||
36 | /** Basic configuration options **/ | 38 | /** Basic configuration options **/ |
diff --git a/apps/codecs/libspc/spc_cpu.c b/apps/codecs/libspc/spc_cpu.c index 6aa9499d1e..d308e6e27c 100644 --- a/apps/codecs/libspc/spc_cpu.c +++ b/apps/codecs/libspc/spc_cpu.c | |||
@@ -22,8 +22,7 @@ | |||
22 | ****************************************************************************/ | 22 | ****************************************************************************/ |
23 | 23 | ||
24 | /* The CPU portion (shock!) */ | 24 | /* The CPU portion (shock!) */ |
25 | #include "codec.h" | 25 | #include "codeclib.h" |
26 | #include "codecs.h" | ||
27 | #include "spc_codec.h" | 26 | #include "spc_codec.h" |
28 | #include "spc_profiler.h" | 27 | #include "spc_profiler.h" |
29 | 28 | ||
diff --git a/apps/codecs/libspc/spc_dsp.c b/apps/codecs/libspc/spc_dsp.c index 153950ca75..d1facf89a2 100644 --- a/apps/codecs/libspc/spc_dsp.c +++ b/apps/codecs/libspc/spc_dsp.c | |||
@@ -23,8 +23,7 @@ | |||
23 | ****************************************************************************/ | 23 | ****************************************************************************/ |
24 | 24 | ||
25 | /* The DSP portion (awe!) */ | 25 | /* The DSP portion (awe!) */ |
26 | #include "codec.h" | 26 | #include "codeclib.h" |
27 | #include "codecs.h" | ||
28 | #include "spc_codec.h" | 27 | #include "spc_codec.h" |
29 | #include "spc_profiler.h" | 28 | #include "spc_profiler.h" |
30 | 29 | ||
diff --git a/apps/codecs/libspc/spc_emu.c b/apps/codecs/libspc/spc_emu.c index e646e08ae6..1bebc86d9a 100644 --- a/apps/codecs/libspc/spc_emu.c +++ b/apps/codecs/libspc/spc_emu.c | |||
@@ -20,8 +20,7 @@ | |||
20 | * KIND, either express or implied. | 20 | * KIND, either express or implied. |
21 | * | 21 | * |
22 | ****************************************************************************/ | 22 | ****************************************************************************/ |
23 | #include "codec.h" | 23 | #include "codeclib.h" |
24 | #include "codecs.h" | ||
25 | #include "spc_codec.h" | 24 | #include "spc_codec.h" |
26 | #include "spc_profiler.h" | 25 | #include "spc_profiler.h" |
27 | 26 | ||
diff --git a/apps/codecs/libspc/spc_profiler.c b/apps/codecs/libspc/spc_profiler.c index 5dc516258f..3184ad7b52 100644 --- a/apps/codecs/libspc/spc_profiler.c +++ b/apps/codecs/libspc/spc_profiler.c | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | #if defined(SPC_PROFILE) && defined(USEC_TIMER) | 26 | #if defined(SPC_PROFILE) && defined(USEC_TIMER) |
27 | 27 | ||
28 | #include "codec.h" | 28 | #include "codeclib.h" |
29 | #include "spc_codec.h" | 29 | #include "spc_codec.h" |
30 | #define SPC_DEFINE_PROFILER_TIMERS | 30 | #define SPC_DEFINE_PROFILER_TIMERS |
31 | #include "spc_profiler.h" | 31 | #include "spc_profiler.h" |
diff --git a/apps/codecs/libspeex/Makefile b/apps/codecs/libspeex/Makefile deleted file mode 100644 index 3bda53dca7..0000000000 --- a/apps/codecs/libspeex/Makefile +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile,v 1.16 2006-09-02 22:34:13 bagder Exp $ | ||
8 | # | ||
9 | |||
10 | INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR) | ||
12 | |||
13 | ifdef APPEXTRA | ||
14 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
15 | endif | ||
16 | |||
17 | SPEEXOPTS = -DHAVE_CONFIG_H -DSPEEX_DISABLE_ENCODER -DROCKBOX | ||
18 | |||
19 | # We're faster on ARM-targets with -O1 instead of -O2 | ||
20 | ifeq ($(CPU),arm) | ||
21 | SPEEXOPTS += -O | ||
22 | else | ||
23 | SPEEXOPTS += -O2 | ||
24 | endif | ||
25 | |||
26 | # We build Speex separately for use as a voice codec | ||
27 | ifdef ROCKBOX_VOICE_CODEC | ||
28 | EXTRA_DEFINES += -DROCKBOX_VOICE_CODEC | ||
29 | endif | ||
30 | |||
31 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(SPEEXOPTS) $(TARGET) \ | ||
32 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} ${PROFILE_OPTS} -Wno-unused-parameter | ||
33 | |||
34 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
35 | include $(TOOLSDIR)/makesrc.inc | ||
36 | |||
37 | SOURCES = $(SRC) | ||
38 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
39 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
40 | DEPFILE = $(OBJDIR)/dep-Speex | ||
41 | DIRS = | ||
42 | |||
43 | all: $(OUTPUT) | ||
44 | |||
45 | $(OUTPUT): $(OBJS) | ||
46 | @echo "AR+RANLIB $(notdir $@)" | ||
47 | @$(AR) ruv $@ $+ >/dev/null 2>&1 | ||
48 | |||
49 | include $(TOOLSDIR)/make.inc | ||
50 | |||
51 | clean: | ||
52 | @echo "cleaning Speex" | ||
53 | @rm -f $(OBJS) $(OUTPUT) $(DEPFILE) | ||
54 | |||
55 | ifneq ($(MAKECMDGOALS),clean) | ||
56 | -include $(DEPFILE) | ||
57 | endif | ||
diff --git a/apps/codecs/libspeex/bits.c b/apps/codecs/libspeex/bits.c index 78b38db44e..9d6cad8886 100644 --- a/apps/codecs/libspeex/bits.c +++ b/apps/codecs/libspeex/bits.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #include "config-speex.h" | 36 | #include "config-speex.h" |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | #include <speex/speex_bits.h> | 39 | #include "speex/speex_bits.h" |
40 | #include "arch.h" | 40 | #include "arch.h" |
41 | #include "os_support.h" | 41 | #include "os_support.h" |
42 | 42 | ||
diff --git a/apps/codecs/libspeex/cb_search.c b/apps/codecs/libspeex/cb_search.c index d280757e59..8a190e535d 100644 --- a/apps/codecs/libspeex/cb_search.c +++ b/apps/codecs/libspeex/cb_search.c | |||
@@ -522,6 +522,9 @@ char *stack, | |||
522 | spx_int32_t *seed | 522 | spx_int32_t *seed |
523 | ) | 523 | ) |
524 | { | 524 | { |
525 | (void)nsf; | ||
526 | (void)stack; | ||
527 | (void)seed; | ||
525 | int i,j; | 528 | int i,j; |
526 | VARDECL(int *ind); | 529 | VARDECL(int *ind); |
527 | VARDECL(int *signs); | 530 | VARDECL(int *signs); |
@@ -609,6 +612,9 @@ char *stack, | |||
609 | spx_int32_t *seed | 612 | spx_int32_t *seed |
610 | ) | 613 | ) |
611 | { | 614 | { |
615 | (void)par; | ||
616 | (void)bits; | ||
617 | (void)stack; | ||
612 | int i; | 618 | int i; |
613 | /* FIXME: This is bad, but I don't think the function ever gets called anyway */ | 619 | /* FIXME: This is bad, but I don't think the function ever gets called anyway */ |
614 | for (i=0;i<nsf;i++) | 620 | for (i=0;i<nsf;i++) |
diff --git a/apps/codecs/libspeex/cb_search.h b/apps/codecs/libspeex/cb_search.h index 7687b453fd..50b530a725 100644 --- a/apps/codecs/libspeex/cb_search.h +++ b/apps/codecs/libspeex/cb_search.h | |||
@@ -35,7 +35,7 @@ | |||
35 | #ifndef CB_SEARCH_H | 35 | #ifndef CB_SEARCH_H |
36 | #define CB_SEARCH_H | 36 | #define CB_SEARCH_H |
37 | 37 | ||
38 | #include <speex/speex_bits.h> | 38 | #include "speex/speex_bits.h" |
39 | #include "arch.h" | 39 | #include "arch.h" |
40 | 40 | ||
41 | /** Split codebook parameters. */ | 41 | /** Split codebook parameters. */ |
diff --git a/apps/codecs/libspeex/config-speex.h b/apps/codecs/libspeex/config-speex.h index 5241b4ecd8..f3b397f541 100644 --- a/apps/codecs/libspeex/config-speex.h +++ b/apps/codecs/libspeex/config-speex.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef ROCKBOX_VOICE_ENCODER | 1 | #ifndef ROCKBOX_VOICE_ENCODER |
2 | #include "../codec.h" | 2 | #include "codeclib.h" |
3 | #include "autoconf.h" | 3 | #include "autoconf.h" |
4 | #else | 4 | #else |
5 | #define ICODE_ATTR | 5 | #define ICODE_ATTR |
diff --git a/apps/codecs/libspeex/filters.c b/apps/codecs/libspeex/filters.c index 44addc2406..09f93c2a59 100644 --- a/apps/codecs/libspeex/filters.c +++ b/apps/codecs/libspeex/filters.c | |||
@@ -353,6 +353,7 @@ void filter_mem16(const spx_word16_t *x, const spx_coef_t *num, const spx_coef_t | |||
353 | #ifndef OVERRIDE_IIR_MEM16 | 353 | #ifndef OVERRIDE_IIR_MEM16 |
354 | void iir_mem16(const spx_word16_t *x, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack) | 354 | void iir_mem16(const spx_word16_t *x, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack) |
355 | { | 355 | { |
356 | (void)stack; | ||
356 | int i,j; | 357 | int i,j; |
357 | spx_word16_t yi,nyi; | 358 | spx_word16_t yi,nyi; |
358 | 359 | ||
@@ -497,6 +498,7 @@ void qmf_synth(const spx_word16_t *x1, const spx_word16_t *x2, const spx_word16_ | |||
497 | all odd x[i] are zero -- well, actually they are left out of the array now | 498 | all odd x[i] are zero -- well, actually they are left out of the array now |
498 | N and M are multiples of 4 */ | 499 | N and M are multiples of 4 */ |
499 | { | 500 | { |
501 | (void)stack; | ||
500 | int i, j; | 502 | int i, j; |
501 | int M2, N2; | 503 | int M2, N2; |
502 | VARDECL(spx_word16_t *xx1); | 504 | VARDECL(spx_word16_t *xx1); |
@@ -681,6 +683,9 @@ spx_word16_t comb_gain, /*gain of comb filter*/ | |||
681 | char *stack | 683 | char *stack |
682 | ) | 684 | ) |
683 | { | 685 | { |
686 | (void)ak; | ||
687 | (void)p; | ||
688 | (void)stack; | ||
684 | int i; | 689 | int i; |
685 | VARDECL(spx_word16_t *iexc); | 690 | VARDECL(spx_word16_t *iexc); |
686 | spx_word16_t old_ener, new_ener; | 691 | spx_word16_t old_ener, new_ener; |
diff --git a/apps/codecs/libspeex/jitter.c b/apps/codecs/libspeex/jitter.c index 61bca75ce8..d9f6c67b86 100644 --- a/apps/codecs/libspeex/jitter.c +++ b/apps/codecs/libspeex/jitter.c | |||
@@ -55,9 +55,9 @@ TODO: | |||
55 | 55 | ||
56 | 56 | ||
57 | #include "arch.h" | 57 | #include "arch.h" |
58 | #include <speex/speex.h> | 58 | #include "speex/speex.h" |
59 | #include <speex/speex_bits.h> | 59 | #include "speex/speex_bits.h" |
60 | #include <speex/speex_jitter.h> | 60 | #include "speex/speex_jitter.h" |
61 | #include "os_support.h" | 61 | #include "os_support.h" |
62 | 62 | ||
63 | #ifndef NULL | 63 | #ifndef NULL |
diff --git a/apps/codecs/libspeex/libspeex.make b/apps/codecs/libspeex/libspeex.make new file mode 100644 index 0000000000..a27d559a06 --- /dev/null +++ b/apps/codecs/libspeex/libspeex.make | |||
@@ -0,0 +1,60 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | # we need to build two different speex libraries | ||
11 | # (one for codec, one for core voice) | ||
12 | # so a little trickery is necessary | ||
13 | |||
14 | SPEEXFLAGS = $(filter-out -O%,$(CODECFLAGS)) \ | ||
15 | -DHAVE_CONFIG_H -DSPEEX_DISABLE_ENCODER \ | ||
16 | -I$(APPSDIR)/codecs/libspeex | ||
17 | |||
18 | # libspeex is faster on ARM-targets with -O1 instead of -O2 | ||
19 | ifeq ($(CPU),arm) | ||
20 | SPEEXFLAGS += -O1 | ||
21 | else | ||
22 | SPEEXFLAGS += -O2 | ||
23 | endif | ||
24 | |||
25 | VOICESPEEXFLAGS = $(filter-out -ffunction-sections, $(filter-out -DCODEC,$(SPEEXFLAGS))) -DROCKBOX_VOICE_CODEC | ||
26 | |||
27 | # libspeex | ||
28 | SPEEXLIB := $(CODECDIR)/libspeex.a | ||
29 | SPEEXLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libspeex/SOURCES) | ||
30 | SPEEXLIB_OBJ := $(call c2obj, $(SPEEXLIB_SRC)) | ||
31 | OTHER_SRC += $(SPEEXLIB_SRC) | ||
32 | |||
33 | $(SPEEXLIB): $(SPEEXLIB_OBJ) | ||
34 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
35 | |||
36 | # libspeex-voice | ||
37 | VOICESPEEXLIB := $(CODECDIR)/libspeex-voice.a | ||
38 | VOICESPEEXLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libspeex/SOURCES) | ||
39 | VOICESPEEXLIB_OBJ := $(subst .c,.o,$(subst .S,.o,$(subst $(ROOTDIR)/apps/codecs/libspeex,$(BUILDDIR)/apps/codecs/libspeex-voice,$(VOICESPEEXLIB_SRC)))) | ||
40 | |||
41 | $(VOICESPEEXLIB): $(VOICESPEEXLIB_OBJ) | ||
42 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
43 | |||
44 | # pattern rules | ||
45 | |||
46 | $(CODECDIR)/libspeex-voice/%.o : $(ROOTDIR)/apps/codecs/libspeex/%.c | ||
47 | $(SILENT)mkdir -p $(dir $@) | ||
48 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(VOICESPEEXFLAGS) -c $< -o $@ | ||
49 | |||
50 | $(CODECDIR)/libspeex-voice/%.o : $(ROOTDIR)/apps/codecs/libspeex/%.S | ||
51 | $(SILENT)mkdir -p $(dir $@) | ||
52 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(VOICESPEEXFLAGS) -c $< -o $@ | ||
53 | |||
54 | $(CODECDIR)/libspeex/%.o: $(ROOTDIR)/apps/codecs/libspeex/%.c | ||
55 | $(SILENT)mkdir -p $(dir $@) | ||
56 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SPEEXFLAGS) -c $< -o $@ | ||
57 | |||
58 | $(CODECDIR)/libspeex/%.o: $(ROOTDIR)/apps/codecs/libspeex/%.S | ||
59 | $(SILENT)mkdir -p $(dir $@) | ||
60 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SPEEXFLAGS) -c $< -o $@ | ||
diff --git a/apps/codecs/libspeex/lsp.c b/apps/codecs/libspeex/lsp.c index 3973554cfb..edf480e8bc 100644 --- a/apps/codecs/libspeex/lsp.c +++ b/apps/codecs/libspeex/lsp.c | |||
@@ -409,6 +409,7 @@ void lsp_to_lpc(spx_lsp_t *freq,spx_coef_t *ak,int lpcrdr, char *stack) | |||
409 | /* float *ak array of LPC coefficients */ | 409 | /* float *ak array of LPC coefficients */ |
410 | /* int lpcrdr order of LPC coefficients */ | 410 | /* int lpcrdr order of LPC coefficients */ |
411 | { | 411 | { |
412 | (void)stack; | ||
412 | int i,j; | 413 | int i,j; |
413 | spx_word32_t xout1,xout2,xin; | 414 | spx_word32_t xout1,xout2,xin; |
414 | spx_word32_t mult, a; | 415 | spx_word32_t mult, a; |
diff --git a/apps/codecs/libspeex/ltp.c b/apps/codecs/libspeex/ltp.c index 04c1115b3f..9f10bc09d8 100644 --- a/apps/codecs/libspeex/ltp.c +++ b/apps/codecs/libspeex/ltp.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #include "ltp.h" | 38 | #include "ltp.h" |
39 | #include "stack_alloc.h" | 39 | #include "stack_alloc.h" |
40 | #include "filters.h" | 40 | #include "filters.h" |
41 | #include <speex/speex_bits.h> | 41 | #include "speex/speex_bits.h" |
42 | #include "math_approx.h" | 42 | #include "math_approx.h" |
43 | #include "os_support.h" | 43 | #include "os_support.h" |
44 | 44 | ||
@@ -674,6 +674,9 @@ spx_word16_t last_pitch_gain, | |||
674 | int cdbk_offset | 674 | int cdbk_offset |
675 | ) | 675 | ) |
676 | { | 676 | { |
677 | (void)end; | ||
678 | (void)pitch_coef; | ||
679 | (void)stack; | ||
677 | int i; | 680 | int i; |
678 | int pitch; | 681 | int pitch; |
679 | int gain_index; | 682 | int gain_index; |
@@ -826,6 +829,14 @@ spx_word16_t last_pitch_gain, | |||
826 | int cdbk_offset | 829 | int cdbk_offset |
827 | ) | 830 | ) |
828 | { | 831 | { |
832 | (void)end; | ||
833 | (void)par; | ||
834 | (void)bits; | ||
835 | (void)stack; | ||
836 | (void)count_lost; | ||
837 | (void)subframe_offset; | ||
838 | (void)last_pitch_gain; | ||
839 | (void)cdbk_offset; | ||
829 | int i; | 840 | int i; |
830 | #ifdef FIXED_POINT | 841 | #ifdef FIXED_POINT |
831 | if (pitch_coef>63) | 842 | if (pitch_coef>63) |
diff --git a/apps/codecs/libspeex/ltp.h b/apps/codecs/libspeex/ltp.h index 1e435bc36e..872f072e4e 100644 --- a/apps/codecs/libspeex/ltp.h +++ b/apps/codecs/libspeex/ltp.h | |||
@@ -32,7 +32,7 @@ | |||
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include <speex/speex_bits.h> | 35 | #include "speex/speex_bits.h" |
36 | #include "arch.h" | 36 | #include "arch.h" |
37 | 37 | ||
38 | /** LTP parameters. */ | 38 | /** LTP parameters. */ |
diff --git a/apps/codecs/libspeex/ltp_arm4.h b/apps/codecs/libspeex/ltp_arm4.h index cdb94e603a..e1c60ad7d5 100644 --- a/apps/codecs/libspeex/ltp_arm4.h +++ b/apps/codecs/libspeex/ltp_arm4.h | |||
@@ -87,6 +87,7 @@ spx_word32_t inner_prod(const spx_word16_t *x, const spx_word16_t *y, int len) | |||
87 | #define OVERRIDE_PITCH_XCORR | 87 | #define OVERRIDE_PITCH_XCORR |
88 | void pitch_xcorr(const spx_word16_t *_x, const spx_word16_t *_y, spx_word32_t *corr, int len, int nb_pitch, char *stack) | 88 | void pitch_xcorr(const spx_word16_t *_x, const spx_word16_t *_y, spx_word32_t *corr, int len, int nb_pitch, char *stack) |
89 | { | 89 | { |
90 | (void)stack; | ||
90 | int i,j; | 91 | int i,j; |
91 | for (i=0;i<nb_pitch;i+=4) | 92 | for (i=0;i<nb_pitch;i+=4) |
92 | { | 93 | { |
diff --git a/apps/codecs/libspeex/modes.h b/apps/codecs/libspeex/modes.h index 26e2d86180..0fa1c3460e 100644 --- a/apps/codecs/libspeex/modes.h +++ b/apps/codecs/libspeex/modes.h | |||
@@ -36,8 +36,8 @@ | |||
36 | #ifndef MODES_H | 36 | #ifndef MODES_H |
37 | #define MODES_H | 37 | #define MODES_H |
38 | 38 | ||
39 | #include <speex/speex.h> | 39 | #include "speex/speex.h" |
40 | #include <speex/speex_bits.h> | 40 | #include "speex/speex_bits.h" |
41 | #include "arch.h" | 41 | #include "arch.h" |
42 | 42 | ||
43 | #define NB_SUBMODES 16 | 43 | #define NB_SUBMODES 16 |
diff --git a/apps/codecs/libspeex/nb_celp.c b/apps/codecs/libspeex/nb_celp.c index d29b9ae540..31eaa06b6b 100644 --- a/apps/codecs/libspeex/nb_celp.c +++ b/apps/codecs/libspeex/nb_celp.c | |||
@@ -43,12 +43,12 @@ | |||
43 | #include "filters.h" | 43 | #include "filters.h" |
44 | #include "stack_alloc.h" | 44 | #include "stack_alloc.h" |
45 | #include "vq.h" | 45 | #include "vq.h" |
46 | #include <speex/speex_bits.h> | 46 | #include "speex/speex_bits.h" |
47 | #include "vbr.h" | 47 | #include "vbr.h" |
48 | #include "arch.h" | 48 | #include "arch.h" |
49 | #include "math_approx.h" | 49 | #include "math_approx.h" |
50 | #include "os_support.h" | 50 | #include "os_support.h" |
51 | #include <speex/speex_callbacks.h> | 51 | #include "speex/speex_callbacks.h" |
52 | 52 | ||
53 | #ifdef VORBIS_PSYCHO | 53 | #ifdef VORBIS_PSYCHO |
54 | #include "vorbis_psy.h" | 54 | #include "vorbis_psy.h" |
diff --git a/apps/codecs/libspeex/nb_celp.h b/apps/codecs/libspeex/nb_celp.h index 30abdee842..30edbefaeb 100644 --- a/apps/codecs/libspeex/nb_celp.h +++ b/apps/codecs/libspeex/nb_celp.h | |||
@@ -37,8 +37,8 @@ | |||
37 | #define NB_CELP_H | 37 | #define NB_CELP_H |
38 | 38 | ||
39 | #include "modes.h" | 39 | #include "modes.h" |
40 | #include <speex/speex_bits.h> | 40 | #include "speex/speex_bits.h" |
41 | #include <speex/speex_callbacks.h> | 41 | #include "speex/speex_callbacks.h" |
42 | #include "vbr.h" | 42 | #include "vbr.h" |
43 | #include "filters.h" | 43 | #include "filters.h" |
44 | 44 | ||
diff --git a/apps/codecs/libspeex/quant_lsp.h b/apps/codecs/libspeex/quant_lsp.h index 3bf4d4021c..0fc206be6f 100644 --- a/apps/codecs/libspeex/quant_lsp.h +++ b/apps/codecs/libspeex/quant_lsp.h | |||
@@ -35,7 +35,7 @@ | |||
35 | #ifndef QUANT_LSP_H | 35 | #ifndef QUANT_LSP_H |
36 | #define QUANT_LSP_H | 36 | #define QUANT_LSP_H |
37 | 37 | ||
38 | #include <speex/speex_bits.h> | 38 | #include "speex/speex_bits.h" |
39 | #include "arch.h" | 39 | #include "arch.h" |
40 | 40 | ||
41 | #define MAX_LSP_SIZE 20 | 41 | #define MAX_LSP_SIZE 20 |
diff --git a/apps/codecs/libspeex/rockbox.h b/apps/codecs/libspeex/rockbox.h index 073bad5d98..459c8b532f 100644 --- a/apps/codecs/libspeex/rockbox.h +++ b/apps/codecs/libspeex/rockbox.h | |||
@@ -24,8 +24,7 @@ | |||
24 | /* We don't want all this stuff if we're building encoder */ | 24 | /* We don't want all this stuff if we're building encoder */ |
25 | #ifndef ROCKBOX_VOICE_ENCODER | 25 | #ifndef ROCKBOX_VOICE_ENCODER |
26 | 26 | ||
27 | #include "../codec.h" | 27 | #include "codeclib.h" |
28 | #include "../lib/codeclib.h" | ||
29 | #include "debug.h" | 28 | #include "debug.h" |
30 | 29 | ||
31 | #if !defined(ROCKBOX_VOICE_CODEC) | 30 | #if !defined(ROCKBOX_VOICE_CODEC) |
@@ -35,6 +34,7 @@ | |||
35 | #define DEBUGF ci->debugf | 34 | #define DEBUGF ci->debugf |
36 | #endif | 35 | #endif |
37 | 36 | ||
37 | |||
38 | #ifdef ROCKBOX_HAS_LOGF | 38 | #ifdef ROCKBOX_HAS_LOGF |
39 | #undef LOGF | 39 | #undef LOGF |
40 | #define LOGF ci->logf | 40 | #define LOGF ci->logf |
@@ -75,6 +75,9 @@ static inline void speex_free_scratch (void *ptr) | |||
75 | #define OVERRIDE_SPEEX_FATAL 1 | 75 | #define OVERRIDE_SPEEX_FATAL 1 |
76 | static inline void _speex_fatal(const char *str, const char *file, int line) | 76 | static inline void _speex_fatal(const char *str, const char *file, int line) |
77 | { | 77 | { |
78 | (void)str; | ||
79 | (void)file; | ||
80 | (void)line; | ||
78 | DEBUGF("Fatal error: %s\n", str); | 81 | DEBUGF("Fatal error: %s\n", str); |
79 | //exit(1); | 82 | //exit(1); |
80 | } | 83 | } |
@@ -82,24 +85,30 @@ static inline void _speex_fatal(const char *str, const char *file, int line) | |||
82 | #define OVERRIDE_SPEEX_WARNING 1 | 85 | #define OVERRIDE_SPEEX_WARNING 1 |
83 | static inline void speex_warning(const char *str) | 86 | static inline void speex_warning(const char *str) |
84 | { | 87 | { |
88 | (void)str; | ||
85 | DEBUGF("warning: %s\n", str); | 89 | DEBUGF("warning: %s\n", str); |
86 | } | 90 | } |
87 | 91 | ||
88 | #define OVERRIDE_SPEEX_WARNING_INT 1 | 92 | #define OVERRIDE_SPEEX_WARNING_INT 1 |
89 | static inline void speex_warning_int(const char *str, int val) | 93 | static inline void speex_warning_int(const char *str, int val) |
90 | { | 94 | { |
95 | (void)str; | ||
96 | (void)val; | ||
91 | DEBUGF("warning: %s %d\n", str, val); | 97 | DEBUGF("warning: %s %d\n", str, val); |
92 | } | 98 | } |
93 | 99 | ||
94 | #define OVERRIDE_SPEEX_NOTIFY 1 | 100 | #define OVERRIDE_SPEEX_NOTIFY 1 |
95 | static inline void speex_notify(const char *str) | 101 | static inline void speex_notify(const char *str) |
96 | { | 102 | { |
103 | (void)str; | ||
97 | DEBUGF("notice: %s\n", str); | 104 | DEBUGF("notice: %s\n", str); |
98 | } | 105 | } |
99 | 106 | ||
100 | #define OVERRIDE_SPEEX_PUTC 1 | 107 | #define OVERRIDE_SPEEX_PUTC 1 |
101 | static inline void _speex_putc(int ch, void *file) | 108 | static inline void _speex_putc(int ch, void *file) |
102 | { | 109 | { |
110 | (void)ch; | ||
111 | (void)file; | ||
103 | //FILE *f = (FILE *)file; | 112 | //FILE *f = (FILE *)file; |
104 | //printf("%c", ch); | 113 | //printf("%c", ch); |
105 | } | 114 | } |
diff --git a/apps/codecs/libspeex/sb_celp.h b/apps/codecs/libspeex/sb_celp.h index 51aa3d0e13..86078ea33e 100644 --- a/apps/codecs/libspeex/sb_celp.h +++ b/apps/codecs/libspeex/sb_celp.h | |||
@@ -37,7 +37,7 @@ | |||
37 | #define SB_CELP_H | 37 | #define SB_CELP_H |
38 | 38 | ||
39 | #include "modes.h" | 39 | #include "modes.h" |
40 | #include <speex/speex_bits.h> | 40 | #include "speex/speex_bits.h" |
41 | #include "nb_celp.h" | 41 | #include "nb_celp.h" |
42 | 42 | ||
43 | /**Structure representing the full state of the sub-band encoder*/ | 43 | /**Structure representing the full state of the sub-band encoder*/ |
diff --git a/apps/codecs/libspeex/speex/ogg.h b/apps/codecs/libspeex/speex/ogg.h index dce8f96b42..d42851f10c 100644 --- a/apps/codecs/libspeex/speex/ogg.h +++ b/apps/codecs/libspeex/speex/ogg.h | |||
@@ -21,7 +21,7 @@ | |||
21 | extern "C" { | 21 | extern "C" { |
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | #include "../../codec.h" | 24 | #include "codeclib.h" |
25 | 25 | ||
26 | typedef short spx_ogg_int16_t; | 26 | typedef short spx_ogg_int16_t; |
27 | typedef unsigned short spx_ogg_uint16_t; | 27 | typedef unsigned short spx_ogg_uint16_t; |
diff --git a/apps/codecs/libspeex/speex_callbacks.c b/apps/codecs/libspeex/speex_callbacks.c index 58d7b7b92a..9ffe5245f1 100644 --- a/apps/codecs/libspeex/speex_callbacks.c +++ b/apps/codecs/libspeex/speex_callbacks.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #include "config-speex.h" | 36 | #include "config-speex.h" |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | #include <speex/speex_callbacks.h> | 39 | #include "speex/speex_callbacks.h" |
40 | #include "arch.h" | 40 | #include "arch.h" |
41 | #include "os_support.h" | 41 | #include "os_support.h" |
42 | 42 | ||
@@ -74,6 +74,7 @@ int speex_inband_handler(SpeexBits *bits, SpeexCallback *callback_list, void *st | |||
74 | 74 | ||
75 | int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data) | 75 | int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data) |
76 | { | 76 | { |
77 | (void)state; | ||
77 | spx_int32_t m; | 78 | spx_int32_t m; |
78 | m = speex_bits_unpack_unsigned(bits, 4); | 79 | m = speex_bits_unpack_unsigned(bits, 4); |
79 | speex_encoder_ctl(data, SPEEX_SET_MODE, &m); | 80 | speex_encoder_ctl(data, SPEEX_SET_MODE, &m); |
@@ -82,6 +83,7 @@ int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data) | |||
82 | 83 | ||
83 | int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void *data) | 84 | int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void *data) |
84 | { | 85 | { |
86 | (void)state; | ||
85 | spx_int32_t m; | 87 | spx_int32_t m; |
86 | m = speex_bits_unpack_unsigned(bits, 4); | 88 | m = speex_bits_unpack_unsigned(bits, 4); |
87 | speex_encoder_ctl(data, SPEEX_SET_LOW_MODE, &m); | 89 | speex_encoder_ctl(data, SPEEX_SET_LOW_MODE, &m); |
@@ -90,6 +92,7 @@ int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void *data) | |||
90 | 92 | ||
91 | int speex_std_high_mode_request_handler(SpeexBits *bits, void *state, void *data) | 93 | int speex_std_high_mode_request_handler(SpeexBits *bits, void *state, void *data) |
92 | { | 94 | { |
95 | (void)state; | ||
93 | spx_int32_t m; | 96 | spx_int32_t m; |
94 | m = speex_bits_unpack_unsigned(bits, 4); | 97 | m = speex_bits_unpack_unsigned(bits, 4); |
95 | speex_encoder_ctl(data, SPEEX_SET_HIGH_MODE, &m); | 98 | speex_encoder_ctl(data, SPEEX_SET_HIGH_MODE, &m); |
@@ -99,6 +102,7 @@ int speex_std_high_mode_request_handler(SpeexBits *bits, void *state, void *data | |||
99 | #ifndef DISABLE_VBR | 102 | #ifndef DISABLE_VBR |
100 | int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data) | 103 | int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data) |
101 | { | 104 | { |
105 | (void)state; | ||
102 | spx_int32_t vbr; | 106 | spx_int32_t vbr; |
103 | vbr = speex_bits_unpack_unsigned(bits, 1); | 107 | vbr = speex_bits_unpack_unsigned(bits, 1); |
104 | speex_encoder_ctl(data, SPEEX_SET_VBR, &vbr); | 108 | speex_encoder_ctl(data, SPEEX_SET_VBR, &vbr); |
@@ -108,6 +112,7 @@ int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data) | |||
108 | 112 | ||
109 | int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data) | 113 | int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data) |
110 | { | 114 | { |
115 | (void)state; | ||
111 | spx_int32_t enh; | 116 | spx_int32_t enh; |
112 | enh = speex_bits_unpack_unsigned(bits, 1); | 117 | enh = speex_bits_unpack_unsigned(bits, 1); |
113 | speex_decoder_ctl(data, SPEEX_SET_ENH, &enh); | 118 | speex_decoder_ctl(data, SPEEX_SET_ENH, &enh); |
@@ -117,6 +122,7 @@ int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data) | |||
117 | #ifndef DISABLE_VBR | 122 | #ifndef DISABLE_VBR |
118 | int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *data) | 123 | int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *data) |
119 | { | 124 | { |
125 | (void)state; | ||
120 | float qual; | 126 | float qual; |
121 | qual = speex_bits_unpack_unsigned(bits, 4); | 127 | qual = speex_bits_unpack_unsigned(bits, 4); |
122 | speex_encoder_ctl(data, SPEEX_SET_VBR_QUALITY, &qual); | 128 | speex_encoder_ctl(data, SPEEX_SET_VBR_QUALITY, &qual); |
@@ -126,6 +132,7 @@ int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *da | |||
126 | 132 | ||
127 | int speex_std_char_handler(SpeexBits *bits, void *state, void *data) | 133 | int speex_std_char_handler(SpeexBits *bits, void *state, void *data) |
128 | { | 134 | { |
135 | (void)state; | ||
129 | unsigned char ch; | 136 | unsigned char ch; |
130 | ch = speex_bits_unpack_unsigned(bits, 8); | 137 | ch = speex_bits_unpack_unsigned(bits, 8); |
131 | _speex_putc(ch, data); | 138 | _speex_putc(ch, data); |
@@ -133,11 +140,11 @@ int speex_std_char_handler(SpeexBits *bits, void *state, void *data) | |||
133 | return 0; | 140 | return 0; |
134 | } | 141 | } |
135 | 142 | ||
136 | |||
137 | |||
138 | /* Default handler for user callbacks: skip it */ | 143 | /* Default handler for user callbacks: skip it */ |
139 | int speex_default_user_handler(SpeexBits *bits, void *state, void *data) | 144 | int speex_default_user_handler(SpeexBits *bits, void *state, void *data) |
140 | { | 145 | { |
146 | (void)state; | ||
147 | (void)data; | ||
141 | int req_size = speex_bits_unpack_unsigned(bits, 4); | 148 | int req_size = speex_bits_unpack_unsigned(bits, 4); |
142 | speex_bits_advance(bits, 5+8*req_size); | 149 | speex_bits_advance(bits, 5+8*req_size); |
143 | return 0; | 150 | return 0; |
diff --git a/apps/codecs/libspeex/speex_header.c b/apps/codecs/libspeex/speex_header.c index 1d1d07731c..b0e98b7c9c 100644 --- a/apps/codecs/libspeex/speex_header.c +++ b/apps/codecs/libspeex/speex_header.c | |||
@@ -36,8 +36,8 @@ | |||
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | #include "arch.h" | 38 | #include "arch.h" |
39 | #include <speex/speex_header.h> | 39 | #include "speex/speex_header.h" |
40 | #include <speex/speex.h> | 40 | #include "speex/speex.h" |
41 | #include "os_support.h" | 41 | #include "os_support.h" |
42 | 42 | ||
43 | #ifndef NULL | 43 | #ifndef NULL |
diff --git a/apps/codecs/libspeex/stereo.c b/apps/codecs/libspeex/stereo.c index 2dce283ac3..652d2a6e90 100644 --- a/apps/codecs/libspeex/stereo.c +++ b/apps/codecs/libspeex/stereo.c | |||
@@ -33,8 +33,8 @@ | |||
33 | #include "config-speex.h" | 33 | #include "config-speex.h" |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | #include <speex/speex_stereo.h> | 36 | #include "speex/speex_stereo.h" |
37 | #include <speex/speex_callbacks.h> | 37 | #include "speex/speex_callbacks.h" |
38 | #include "math_approx.h" | 38 | #include "math_approx.h" |
39 | #include "vq.h" | 39 | #include "vq.h" |
40 | #include <math.h> | 40 | #include <math.h> |
@@ -278,6 +278,7 @@ void speex_decode_stereo_int(spx_int16_t *data, int frame_size, SpeexStereoState | |||
278 | 278 | ||
279 | int speex_std_stereo_request_handler(SpeexBits *bits, void *state, void *data) | 279 | int speex_std_stereo_request_handler(SpeexBits *bits, void *state, void *data) |
280 | { | 280 | { |
281 | (void)state; | ||
281 | RealSpeexStereoState *stereo; | 282 | RealSpeexStereoState *stereo; |
282 | spx_word16_t sign=1, dexp; | 283 | spx_word16_t sign=1, dexp; |
283 | int tmp; | 284 | int tmp; |
diff --git a/apps/codecs/libtremor/Makefile b/apps/codecs/libtremor/Makefile deleted file mode 100644 index 674d2ae64c..0000000000 --- a/apps/codecs/libtremor/Makefile +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR) | ||
12 | |||
13 | ifdef APPEXTRA | ||
14 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
15 | endif | ||
16 | |||
17 | # Tremor is slightly faster on coldfire with -O3 | ||
18 | ifeq ($(CPU),coldfire) | ||
19 | TREMOROPTS = -O3 | ||
20 | else | ||
21 | TREMOROPTS = -O2 | ||
22 | endif | ||
23 | |||
24 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(TREMOROPTS) $(TARGET) \ | ||
25 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} ${PROFILE_OPTS} | ||
26 | |||
27 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
28 | include $(TOOLSDIR)/makesrc.inc | ||
29 | |||
30 | SOURCES = $(SRC) | ||
31 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
32 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
33 | DEPFILE = $(OBJDIR)/dep-libtremor | ||
34 | DIRS = | ||
35 | |||
36 | all: $(OUTPUT) | ||
37 | |||
38 | $(OUTPUT): $(OBJS) | ||
39 | $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1 | ||
40 | $(SILENT)$(RANLIB) $@ | ||
41 | |||
42 | include $(TOOLSDIR)/make.inc | ||
43 | |||
44 | clean: | ||
45 | $(call PRINTS,cleaning libtremor)rm -f $(OBJS) $(OUTPUT) $(DEPFILE) | ||
46 | |||
47 | ifneq ($(MAKECMDGOALS),clean) | ||
48 | -include $(DEPFILE) | ||
49 | endif | ||
diff --git a/apps/codecs/libtremor/config-tremor.h b/apps/codecs/libtremor/config-tremor.h index e1ade700e5..7cfcb7e35d 100644 --- a/apps/codecs/libtremor/config-tremor.h +++ b/apps/codecs/libtremor/config-tremor.h | |||
@@ -1,4 +1,4 @@ | |||
1 | #include "../codec.h" | 1 | #include "codeclib.h" |
2 | #ifdef CPU_ARM | 2 | #ifdef CPU_ARM |
3 | #define _ARM_ASSEM_ | 3 | #define _ARM_ASSEM_ |
4 | #endif | 4 | #endif |
diff --git a/apps/codecs/libtremor/ctype.c b/apps/codecs/libtremor/ctype.c index 9eb6eef80a..10468bc27d 100644 --- a/apps/codecs/libtremor/ctype.c +++ b/apps/codecs/libtremor/ctype.c | |||
@@ -1 +1 @@ | |||
#include "../../../firmware/common/ctype.c" | #include "common/ctype.c" | ||
diff --git a/apps/codecs/libtremor/libtremor.make b/apps/codecs/libtremor/libtremor.make new file mode 100644 index 0000000000..6f500ea7ac --- /dev/null +++ b/apps/codecs/libtremor/libtremor.make | |||
@@ -0,0 +1,36 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | # libtremor | ||
11 | TREMORLIB := $(CODECDIR)/libtremor.a | ||
12 | TREMORLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libtremor/SOURCES) | ||
13 | TREMORLIB_OBJ := $(call c2obj, $(TREMORLIB_SRC)) | ||
14 | OTHER_SRC += $(TREMORLIB_SRC) | ||
15 | |||
16 | $(TREMORLIB): $(TREMORLIB_OBJ) | ||
17 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
18 | |||
19 | $(CODECDIR)/libtremor/%.o: $(ROOTDIR)/apps/codecs/libtremor/%.c | ||
20 | $(SILENT)mkdir -p $(dir $@) | ||
21 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \ | ||
22 | -I$(APPSDIR)/codecs/libtremor \ | ||
23 | $(CODECFLAGS) $(CFLAGS) -c $< -o $@ | ||
24 | |||
25 | TREMORFLAGS = -I$(APPSDIR)/codecs/libtremor $(filter-out -O%,$(CODECFLAGS)) | ||
26 | |||
27 | # Tremor is slightly faster on coldfire with -O3 | ||
28 | ifeq ($(CPU),coldfire) | ||
29 | TREMORFLAGS += -O3 | ||
30 | else | ||
31 | TREMORFLAGS += -O2 | ||
32 | endif | ||
33 | |||
34 | $(CODECDIR)/libtremor/%.o: $(ROOTDIR)/apps/codecs/libtremor/%.c | ||
35 | $(SILENT)mkdir -p $(dir $@) | ||
36 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(TREMORFLAGS) -c $< -o $@ | ||
diff --git a/apps/codecs/libtremor/mapping0.c b/apps/codecs/libtremor/mapping0.c index 6bcc717d86..2bb7a46d79 100644 --- a/apps/codecs/libtremor/mapping0.c +++ b/apps/codecs/libtremor/mapping0.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <math.h> | 21 | #include <math.h> |
22 | #include "ogg.h" | 22 | #include "ogg.h" |
23 | #include "ivorbiscodec.h" | 23 | #include "ivorbiscodec.h" |
24 | #include <codecs/lib/codeclib.h> | 24 | #include "codeclib.h" |
25 | #include "codec_internal.h" | 25 | #include "codec_internal.h" |
26 | #include "codebook.h" | 26 | #include "codebook.h" |
27 | #include "window.h" | 27 | #include "window.h" |
diff --git a/apps/codecs/libtremor/oggmalloc.c b/apps/codecs/libtremor/oggmalloc.c index b11eaa54f5..ca917ff397 100644 --- a/apps/codecs/libtremor/oggmalloc.c +++ b/apps/codecs/libtremor/oggmalloc.c | |||
@@ -1,7 +1,6 @@ | |||
1 | #include <os_types.h> | 1 | #include "os_types.h" |
2 | 2 | ||
3 | static unsigned char *mallocbuf; | 3 | static size_t tmp_ptr; |
4 | static size_t bufsize, tmp_ptr, mem_ptr; | ||
5 | 4 | ||
6 | void ogg_malloc_init(void) | 5 | void ogg_malloc_init(void) |
7 | { | 6 | { |
diff --git a/apps/codecs/libwavpack/Makefile b/apps/codecs/libwavpack/Makefile deleted file mode 100644 index 20daeb3411..0000000000 --- a/apps/codecs/libwavpack/Makefile +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR) | ||
12 | |||
13 | ifdef APPEXTRA | ||
14 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
15 | endif | ||
16 | |||
17 | WAVPACKOPTS = -O2 | ||
18 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(WAVPACKOPTS) $(TARGET) \ | ||
19 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) | ||
20 | |||
21 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
22 | include $(TOOLSDIR)/makesrc.inc | ||
23 | |||
24 | SOURCES = $(SRC) | ||
25 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
26 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
27 | DEPFILE = $(OBJDIR)/dep-libwavpack | ||
28 | DIRS = | ||
29 | |||
30 | all: $(OUTPUT) | ||
31 | |||
32 | $(OUTPUT): $(OBJS) | ||
33 | $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1 | ||
34 | $(SILENT)$(RANLIB) $@ | ||
35 | |||
36 | include $(TOOLSDIR)/make.inc | ||
37 | |||
38 | clean: | ||
39 | $(call PRINTS,cleaning libwavpack)rm -f $(OBJS) $(OUTPUT) $(DEPFILE) | ||
40 | |||
41 | ifneq ($(MAKECMDGOALS),clean) | ||
42 | -include $(DEPFILE) | ||
43 | endif | ||
diff --git a/apps/codecs/libwavpack/libwavpack.make b/apps/codecs/libwavpack/libwavpack.make new file mode 100644 index 0000000000..0237d39668 --- /dev/null +++ b/apps/codecs/libwavpack/libwavpack.make | |||
@@ -0,0 +1,17 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | # libwavpack | ||
11 | WAVPACKLIB := $(CODECDIR)/libwavpack.a | ||
12 | WAVPACKLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libwavpack/SOURCES) | ||
13 | WAVPACKLIB_OBJ := $(call c2obj, $(WAVPACKLIB_SRC)) | ||
14 | OTHER_SRC += $(WAVPACKLIB_SRC) | ||
15 | |||
16 | $(WAVPACKLIB): $(WAVPACKLIB_OBJ) | ||
17 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
diff --git a/apps/codecs/libwavpack/wavpack.h b/apps/codecs/libwavpack/wavpack.h index e2952115e1..5b5385a521 100644 --- a/apps/codecs/libwavpack/wavpack.h +++ b/apps/codecs/libwavpack/wavpack.h | |||
@@ -7,9 +7,9 @@ | |||
7 | //////////////////////////////////////////////////////////////////////////// | 7 | //////////////////////////////////////////////////////////////////////////// |
8 | 8 | ||
9 | // wavpack.h | 9 | // wavpack.h |
10 | 10 | #ifdef CODEC | |
11 | #include "../codec.h" | 11 | #include "codeclib.h" |
12 | 12 | #endif | |
13 | #include <inttypes.h> | 13 | #include <inttypes.h> |
14 | 14 | ||
15 | // This header file contains all the definitions required by WavPack. | 15 | // This header file contains all the definitions required by WavPack. |
diff --git a/apps/codecs/libwma/Makefile b/apps/codecs/libwma/Makefile deleted file mode 100644 index 91ea49b1fb..0000000000 --- a/apps/codecs/libwma/Makefile +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR) | ||
12 | |||
13 | ifdef APPEXTRA | ||
14 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
15 | endif | ||
16 | |||
17 | WMAOPTS = -O2 -DROCKBOX | ||
18 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(WMAOPTS) $(TARGET) \ | ||
19 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) -DCODEC=1 | ||
20 | |||
21 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
22 | include $(TOOLSDIR)/makesrc.inc | ||
23 | |||
24 | SOURCES = $(SRC) | ||
25 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
26 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
27 | DEPFILE = $(OBJDIR)/dep-libwma | ||
28 | DIRS = | ||
29 | |||
30 | all: $(OUTPUT) | ||
31 | |||
32 | $(OUTPUT): $(OBJS) | ||
33 | $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1 | ||
34 | $(SILENT)$(RANLIB) $@ | ||
35 | |||
36 | include $(TOOLSDIR)/make.inc | ||
37 | |||
38 | clean: | ||
39 | $(call PRINTS,cleaning libwma)rm -f $(OBJS) $(OUTPUT) $(DEPFILE) | ||
40 | |||
41 | ifneq ($(MAKECMDGOALS),clean) | ||
42 | -include $(DEPFILE) | ||
43 | endif | ||
diff --git a/apps/codecs/libwma/libwma.make b/apps/codecs/libwma/libwma.make new file mode 100644 index 0000000000..d40d62eb7b --- /dev/null +++ b/apps/codecs/libwma/libwma.make | |||
@@ -0,0 +1,17 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | # libwma | ||
11 | WMALIB := $(CODECDIR)/libwma.a | ||
12 | WMALIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libwma/SOURCES) | ||
13 | WMALIB_OBJ := $(call c2obj, $(WMALIB_SRC)) | ||
14 | OTHER_SRC += $(WMALIB_SRC) | ||
15 | |||
16 | $(WMALIB): $(WMALIB_OBJ) | ||
17 | $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1 | ||
diff --git a/apps/codecs/wma.c b/apps/codecs/wma.c index a7548ceac4..93f4e27136 100644 --- a/apps/codecs/wma.c +++ b/apps/codecs/wma.c | |||
@@ -464,7 +464,7 @@ enum codec_status codec_main(void) | |||
464 | int wmares, res; | 464 | int wmares, res; |
465 | uint8_t* audiobuf; | 465 | uint8_t* audiobuf; |
466 | int audiobufsize; | 466 | int audiobufsize; |
467 | int packetlength; | 467 | int packetlength = 0; |
468 | int errcount = 0; | 468 | int errcount = 0; |
469 | 469 | ||
470 | /* Generic codec initialisation */ | 470 | /* Generic codec initialisation */ |
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index ca5b37db4c..0db0e5a471 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -114,7 +114,7 @@ | |||
114 | #include "usb_core.h" | 114 | #include "usb_core.h" |
115 | #endif | 115 | #endif |
116 | #ifdef USB_STORAGE | 116 | #ifdef USB_STORAGE |
117 | #include "../firmware/usbstack/usb_storage.h" | 117 | #include "usbstack/usb_storage.h" |
118 | #endif | 118 | #endif |
119 | 119 | ||
120 | /*---------------------------------------------------*/ | 120 | /*---------------------------------------------------*/ |
diff --git a/apps/lang/Makefile b/apps/lang/Makefile deleted file mode 100644 index 15e9f49605..0000000000 --- a/apps/lang/Makefile +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES= $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I. -I$(BUILDDIR) -I$(OBJDIR) | ||
12 | |||
13 | # the header we generate | ||
14 | HEADER = $(BUILDDIR)/max_language_size.h | ||
15 | |||
16 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
17 | include $(TOOLSDIR)/makesrc.inc | ||
18 | SOURCES=$(SRC) | ||
19 | |||
20 | # OUTP is the list of files to depend upon | ||
21 | OUTP = $(patsubst %.lang,$(OBJDIR)/%.lng, $(SOURCES)) | ||
22 | |||
23 | # the generated file with features specified genlang-style | ||
24 | FEATS=$(BUILDDIR)/apps/genlang-features | ||
25 | |||
26 | ifndef V | ||
27 | SILENT=@ | ||
28 | endif | ||
29 | PRINTS=$(SILENT)$(call info,$(1)) | ||
30 | |||
31 | all: $(HEADER) | ||
32 | |||
33 | # generic rule for creating .lng from .lang | ||
34 | $(OBJDIR)/%.lng : %.lang $(FEATS) | ||
35 | $(call PRINTS,GENLANG $<) | ||
36 | $(SILENT)$(TOOLSDIR)/genlang -e=$(APPSDIR)/lang/english.lang -t=$(MODELNAME)`cat $(FEATS)` -i=$(TARGET_ID) -b=$@ $< | ||
37 | |||
38 | $(HEADER): $(OUTP) | ||
39 | $(call PRINTS,Make $(HEADER)) | ||
40 | $(SILENT)echo "#define MAX_LANGUAGE_SIZE `ls -ln $(OBJDIR)/* | awk '{print $$5}' | sort -n | tail -1`" > $(HEADER) | ||
diff --git a/apps/lang/lang.make b/apps/lang/lang.make new file mode 100644 index 0000000000..416b2b4504 --- /dev/null +++ b/apps/lang/lang.make | |||
@@ -0,0 +1,34 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | LANGS := $(call preprocess, $(APPSDIR)/lang/SOURCES) | ||
11 | LANGOBJ := $(LANGS:$(ROOTDIR)/%.lang=$(BUILDDIR)/%.lng) | ||
12 | |||
13 | SRC += $(ROOTDIR)/lang.o # yes ROOTDIR. root.make will subst it to BUILDDIR. | ||
14 | |||
15 | CLEANOBJS += $(BUILDDIR)/max_language_size.h $(BUILDDIR)/lang.* | ||
16 | |||
17 | # $(BUILDDIR)/apps/lang must exist before we create dependencies on it, | ||
18 | # otherwise make will simply ignore those dependencies. | ||
19 | # Therefore we create it here. | ||
20 | #DUMMY := $(shell mkdir -p $(BUILDDIR)/apps/lang) | ||
21 | |||
22 | $(BUILDDIR)/max_language_size.h: $(LANGOBJ) | ||
23 | $(call PRINTS,Create $(notdir $@)) | ||
24 | $(SILENT)echo "#define MAX_LANGUAGE_SIZE `ls -ln $(BUILDDIR)/apps/lang/* | awk '{print $$5}' | sort -n | tail -1`" > $@ | ||
25 | |||
26 | $(BUILDDIR)/lang.o: $(APPSDIR)/lang/$(LANGUAGE).lang $(BUILDDIR)/apps/features | ||
27 | $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \ | ||
28 | perl -s $(TOOLSDIR)/genlang -p=$(BUILDDIR)/lang -t=$(MODELNAME)$$feat $< | ||
29 | $(call PRINTS,CC lang.c)$(CC) $(CFLAGS) -c $(BUILDDIR)/lang.c -o $@ | ||
30 | |||
31 | $(BUILDDIR)/%.lng : $(ROOTDIR)/%.lang $(BUILDDIR)/apps/genlang-features | ||
32 | $(call PRINTS,GENLANG $(subst $(ROOTDIR)/,,$<)) | ||
33 | $(SILENT)mkdir -p $(dir $@) | ||
34 | $(SILENT)$(TOOLSDIR)/genlang -e=$(APPSDIR)/lang/english.lang -t=$(MODELNAME)`cat $(BUILDDIR)/apps/genlang-features` -i=$(TARGET_ID) -b=$@ $< | ||
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 | |||
10 | INCLUDES = $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/common \ | ||
11 | -I$(FIRMDIR)/drivers -I$(APPSDIR) -Ilib -I$(BUILDDIR) | ||
12 | |||
13 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ | ||
14 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN | ||
15 | |||
16 | ifdef APPEXTRA | ||
17 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
18 | endif | ||
19 | |||
20 | ifdef SOFTWARECODECS | ||
21 | CODECLIBS = -lmad -la52 -lffmpegFLAC -ltremor -lwavpack -lmusepack | ||
22 | endif | ||
23 | |||
24 | # Set up the bitmap libraries | ||
25 | BITMAPLIBS = | ||
26 | LINKBITMAPS = | ||
27 | ifneq ($(strip $(BMP2RB_MONO)),) | ||
28 | BITMAPLIBS += pluginbitmapsmono | ||
29 | LINKBITMAPS += -lpluginbitmapsmono | ||
30 | endif | ||
31 | ifneq ($(strip $(BMP2RB_NATIVE)),) | ||
32 | BITMAPLIBS += pluginbitmapsnative | ||
33 | LINKBITMAPS += -lpluginbitmapsnative | ||
34 | endif | ||
35 | ifneq ($(strip $(BMP2RB_REMOTEMONO)),) | ||
36 | BITMAPLIBS += pluginbitmapsremotemono | ||
37 | LINKBITMAPS += -lpluginbitmapsremotemono | ||
38 | endif | ||
39 | ifneq ($(strip $(BMP2RB_REMOTENATIVE)),) | ||
40 | BITMAPLIBS += pluginbitmapsremotenative | ||
41 | LINKBITMAPS += -lpluginbitmapsremotenative | ||
42 | endif | ||
43 | |||
44 | LDS := plugin.lds | ||
45 | LINKFILE := $(OBJDIR)/pluginlink.lds | ||
46 | DEPFILE = $(OBJDIR)/dep-plugins | ||
47 | |||
48 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
49 | include $(TOOLSDIR)/makesrc.inc | ||
50 | |||
51 | # This sets up 'SUBDIRS' based on the directories mentioned in SUBDIRS | ||
52 | include $(TOOLSDIR)/makesubdirs.inc | ||
53 | |||
54 | ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock) | ||
55 | SOURCES = $(SRC) | ||
56 | ELFS := $(SRC:%.c=$(OBJDIR)/%.elf) | ||
57 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
58 | # as created by the cross-compiler for win32: | ||
59 | DEFS := $(SRC:%.c=$(OBJDIR)/%.def) | ||
60 | DIRS = . | ||
61 | |||
62 | .PHONY: $(SUBDIRS) | ||
63 | all: build | ||
64 | |||
65 | dep: $(DEPFILE) | ||
66 | |||
67 | build: $(DEPFILE) $(BITMAPLIBS) | ||
68 | $(call PRINTS,MAKE rocks)$(MAKE) rocks | ||
69 | $(call PRINTS,MAKE subdirs)$(MAKE) subdirs | ||
70 | |||
71 | rocks: $(ROCKS) | ||
72 | |||
73 | subdirs: $(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 | |||
82 | pluginbitmapsmono: | ||
83 | $(call PRINTS,MAKE in plugins/bitmaps/mono)$(MAKE) -C bitmaps/mono OBJDIR=$(OBJDIR)/bitmaps/mono | ||
84 | |||
85 | pluginbitmapsnative: | ||
86 | $(call PRINTS,MAKE in plugins/bitmaps/native)$(MAKE) -C bitmaps/native OBJDIR=$(OBJDIR)/bitmaps/native | ||
87 | |||
88 | pluginbitmapsremotemono: | ||
89 | $(call PRINTS,MAKE in plugins/bitmaps/remote_mono)$(MAKE) -C bitmaps/remote_mono OBJDIR=$(OBJDIR)/bitmaps/remote_mono | ||
90 | |||
91 | pluginbitmapsremotenative: | ||
92 | $(call PRINTS,MAKE in plugins/bitmaps/remote_native)$(MAKE) -C bitmaps/remote_native OBJDIR=$(OBJDIR)/bitmaps/remote_native | ||
93 | |||
94 | ifndef 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 | |||
101 | else | ||
102 | |||
103 | ifeq ($(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 $@ | ||
109 | ifeq ($(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 | ||
113 | else | ||
114 | $(SILENT)chmod -x $@ | ||
115 | endif | ||
116 | |||
117 | else # end of x11-simulator | ||
118 | ifeq ($(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 $@ | ||
124 | ifeq ($(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 | ||
128 | else | ||
129 | $(SILENT)chmod -x $@ | ||
130 | endif | ||
131 | |||
132 | else # end of sdl-simulator | ||
133 | ################################################### | ||
134 | # This is the win32 simulator version | ||
135 | DLLTOOLFLAGS = --export-all | ||
136 | DLLWRAPFLAGS = -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 $@ | ||
142 | ifeq ($(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 | ||
146 | else | ||
147 | $(SILENT)chmod -x $@ | ||
148 | endif | ||
149 | endif # end of win32-simulator | ||
150 | endif | ||
151 | |||
152 | endif # end of simulator section | ||
153 | |||
154 | include $(TOOLSDIR)/make.inc | ||
155 | |||
156 | pluginlib: | ||
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 | |||
168 | clean: | ||
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 | |||
10 | INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) | ||
12 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ | ||
13 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN -O3 | ||
14 | |||
15 | ifdef APPEXTRA | ||
16 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
17 | endif | ||
18 | |||
19 | LINKFILE := $(OBJDIR)/link.lds | ||
20 | DEPFILE = $(OBJDIR)/dep-beatbox | ||
21 | |||
22 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
23 | include $(TOOLSDIR)/makesrc.inc | ||
24 | |||
25 | SOURCES = $(SRC) | ||
26 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
27 | DIRS = . | ||
28 | |||
29 | ifndef SIMVER | ||
30 | LDS := ../plugin.lds | ||
31 | OUTPUT = $(OUTDIR)/beatbox.rock | ||
32 | else ## simulators | ||
33 | OUTPUT = $(OUTDIR)/beatbox.rock | ||
34 | endif | ||
35 | |||
36 | all: $(OUTPUT) | ||
37 | |||
38 | ifndef 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 $< $@ | ||
45 | else | ||
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 $@ | ||
52 | ifeq ($(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 | ||
56 | else | ||
57 | @chmod -x $@ | ||
58 | endif | ||
59 | |||
60 | endif # end of simulator section | ||
61 | |||
62 | include $(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 | |||
70 | clean: | ||
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 | |||
10 | INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \ | ||
11 | -I$(OBJDIR) | ||
12 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) | ||
13 | |||
14 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
15 | include $(TOOLSDIR)/makesrc.inc | ||
16 | |||
17 | SOURCES = $(SRC) | ||
18 | CSRC := $(SRC:%.bmp=$(OBJDIR)/%.c) | ||
19 | OBJS := $(CSRC:%.c=%.o) | ||
20 | DEPFILE = $(OBJDIR)/dep-bitmaps-mono | ||
21 | |||
22 | BMP2RB = $(BMP2RB_MONO) | ||
23 | OUTPUT = $(BUILDDIR)/libpluginbitmapsmono.a | ||
24 | BMPINCDIR = $(BUILDDIR)/pluginbitmaps | ||
25 | |||
26 | include $(TOOLSDIR)/makebmp.inc | ||
27 | |||
28 | clean: | ||
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 | |||
10 | INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \ | ||
11 | -I$(OBJDIR) | ||
12 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) | ||
13 | |||
14 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
15 | include $(TOOLSDIR)/makesrc.inc | ||
16 | |||
17 | SOURCES = $(SRC) | ||
18 | CSRC := $(SRC:%.bmp=$(OBJDIR)/%.c) | ||
19 | OBJS := $(CSRC:%.c=%.o) | ||
20 | DEPFILE = $(OBJDIR)/dep-bitmaps-native | ||
21 | |||
22 | BMP2RB = $(BMP2RB_NATIVE) | ||
23 | OUTPUT = $(BUILDDIR)/libpluginbitmapsnative.a | ||
24 | BMPINCDIR = $(BUILDDIR)/pluginbitmaps | ||
25 | |||
26 | include $(TOOLSDIR)/makebmp.inc | ||
27 | |||
28 | clean: | ||
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 |
577 | star_tiles.10x10.grey.bmp | 577 | star_tiles.10x10x2.bmp |
578 | #elif LCD_WIDTH >= 128 && LCD_HEIGHT >= 80 | 578 | #elif LCD_WIDTH >= 128 && LCD_HEIGHT >= 80 |
579 | star_tiles.8x8.grey.bmp | 579 | star_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 |
583 | star_tiles.6x7.mono.bmp | 583 | star_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 | 672 | pictureflow_logo.100x18x16.bmp |
673 | #else | 673 | #else |
674 | pictureflow_logo.193x34x16.bmp | 674 | pictureflow_logo.193x34x16.bmp |
675 | #endif | 675 | #endif |
676 | #if (LCD_HEIGHT < 100 ) | 676 | #if (LCD_HEIGHT < 100 ) |
677 | pictureflow_emptyslide.50x50x16.bmp | 677 | pictureflow_emptyslide.50x50x16.bmp |
678 | #else | 678 | #else |
679 | pictureflow_emptyslide.100x100x16.bmp | 679 | pictureflow_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 | 692 | sliding_puzzle.80x80x16.bmp |
693 | #elif SMALLER_DIMENSION <= 108 | 693 | #elif SMALLER_DIMENSION <= 108 |
694 | sliding_puzzle.108x108x16.bmp | 694 | sliding_puzzle.108x108x16.bmp |
695 | #elif SMALLER_DIMENSION <= 128 | 695 | #elif SMALLER_DIMENSION <= 128 |
696 | sliding_puzzle.128x128x16.bmp | 696 | sliding_puzzle.128x128x16.bmp |
697 | #elif SMALLER_DIMENSION <= 132 | 697 | #elif SMALLER_DIMENSION <= 132 |
698 | sliding_puzzle.132x132x16.bmp | 698 | sliding_puzzle.132x132x16.bmp |
699 | #elif SMALLER_DIMENSION <= 176 | 699 | #elif SMALLER_DIMENSION <= 176 |
700 | sliding_puzzle.176x176x16.bmp | 700 | sliding_puzzle.176x176x16.bmp |
701 | #elif SMALLER_DIMENSION <= 240 | 701 | #elif SMALLER_DIMENSION <= 240 |
702 | sliding_puzzle.240x240x16.bmp | 702 | sliding_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 | 706 | sliding_puzzle.96x96x2.bmp |
707 | #elif SMALLER_DIMENSION <= 110 | 707 | #elif SMALLER_DIMENSION <= 110 |
708 | sliding_puzzle.108x108x2.bmp | 708 | sliding_puzzle.108x108x2.bmp |
709 | #elif SMALLER_DIMENSION <= 128 | 709 | #elif SMALLER_DIMENSION <= 128 |
710 | sliding_puzzle.128x128x2.bmp | 710 | sliding_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 | 713 | sliding_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 | 719 | rockboxlogo.220x68x16.bmp |
720 | #elif (LCD_WIDTH > 160) | 720 | #elif (LCD_WIDTH > 160) |
721 | rockboxlogo.128x40x16.bmp | 721 | rockboxlogo.128x40x16.bmp |
722 | #else | 722 | #else |
723 | rockboxlogo.90x28x16.bmp | 723 | rockboxlogo.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 | 728 | rockboxlogo.138x46x2.bmp |
729 | #else | 729 | #else |
730 | rockboxlogo.91x32x2.bmp | 730 | rockboxlogo.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 | 736 | rockboxlogo.112x30x1.bmp |
737 | #else | 737 | #else |
738 | rockboxlogo.91x32x1.bmp | 738 | rockboxlogo.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 | |||
10 | PBMPINCDIR = $(BUILDDIR)/pluginbitmaps | ||
11 | |||
12 | PFLAGS += -I$(PBMPINCDIR) | ||
13 | |||
14 | ifneq ($(strip $(BMP2RB_MONO)),) | ||
15 | PBMP = $(call preprocess, $(APPSDIR)/plugins/bitmaps/mono/SOURCES) | ||
16 | endif | ||
17 | ifneq ($(strip $(BMP2RB_NATIVE)),) | ||
18 | PBMP += $(call preprocess, $(APPSDIR)/plugins/bitmaps/native/SOURCES) | ||
19 | endif | ||
20 | ifneq ($(strip $(BMP2RB_REMOTEMONO)),) | ||
21 | PBMP += $(call preprocess, $(APPSDIR)/plugins/bitmaps/remote_mono/SOURCES) | ||
22 | endif | ||
23 | ifneq ($(strip $(BMP2RB_REMOTENATIVE)),) | ||
24 | PBMP += $(call preprocess, $(APPSDIR)/plugins/bitmaps/remote_native/SOURCES) | ||
25 | endif | ||
26 | |||
27 | ifdef PBMP # does player use bitmaps? | ||
28 | |||
29 | PLUGIN_BITMAPS := $(PBMP:$(ROOTDIR)/%.bmp=$(BUILDDIR)/%.o) | ||
30 | |||
31 | PLUGINBITMAPLIB := $(BUILDDIR)/apps/plugins/bitmaps/libpluginbitmaps.a | ||
32 | PLUGINBITMAPDIR := $(dir $(PLUGINBITMAPLIB)) | ||
33 | |||
34 | PBMPHFILES := $(subst $(ROOTDIR),$(BUILDDIR),$(PBMP)) | ||
35 | PBMPHFILES := $(shell echo $(PBMPHFILES) | sed -e 's/\.[0-9x]\+\.bmp/.h/g' -e 's/\.bmp/.h/g' -e 's/apps\/plugins\/bitmaps\/\(mono\|native\|remote_mono\|remote_native\)/pluginbitmaps/g') | ||
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 | |||
59 | endif | ||
diff --git a/apps/plugins/bitmaps/remote_mono/Makefile b/apps/plugins/bitmaps/remote_mono/Makefile deleted file mode 100644 index d3858fa46a..0000000000 --- a/apps/plugins/bitmaps/remote_mono/Makefile +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \ | ||
11 | -I$(OBJDIR) | ||
12 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) | ||
13 | |||
14 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
15 | include $(TOOLSDIR)/makesrc.inc | ||
16 | |||
17 | SOURCES = $(SRC) | ||
18 | CSRC := $(SRC:%.bmp=$(OBJDIR)/%.c) | ||
19 | OBJS := $(CSRC:%.c=%.o) | ||
20 | DEPFILE = $(OBJDIR)/dep-bitmaps-remotemono | ||
21 | |||
22 | BMP2RB = $(BMP2RB_REMOTEMONO) | ||
23 | OUTPUT = $(BUILDDIR)/libpluginbitmapsremotemono.a | ||
24 | BMPINCDIR = $(BUILDDIR)/pluginbitmaps | ||
25 | |||
26 | include $(TOOLSDIR)/makebmp.inc | ||
27 | |||
28 | clean: | ||
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 | |||
10 | INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \ | ||
11 | -I$(OBJDIR) | ||
12 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) | ||
13 | |||
14 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
15 | include $(TOOLSDIR)/makesrc.inc | ||
16 | |||
17 | SOURCES = $(SRC) | ||
18 | CSRC := $(SRC:%.bmp=$(OBJDIR)/%.c) | ||
19 | OBJS := $(CSRC:%.c=%.o) | ||
20 | DEPFILE = $(OBJDIR)/dep-bitmaps-remotenative | ||
21 | |||
22 | BMP2RB = $(BMP2RB_REMOTENATIVE) | ||
23 | OUTPUT = $(BUILDDIR)/libpluginbitmapsremotenative.a | ||
24 | BMPINCDIR = $(BUILDDIR)/pluginbitmaps | ||
25 | |||
26 | include $(TOOLSDIR)/makebmp.inc | ||
27 | |||
28 | clean: | ||
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 | 21 | remote_rockboxlogo.91x32x1.bmp |
22 | #elif (LCD_REMOTE_DEPTH == 2) | 22 | #elif (LCD_REMOTE_DEPTH == 2) |
23 | remote_rockboxlogo.91x32x2.bmp | 23 | remote_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 | ||
25 | PLUGIN_HEADER | 25 | PLUGIN_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 | ||
26 | PLUGIN_HEADER | 26 | PLUGIN_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 | ||
32 | PLUGIN_HEADER | 32 | PLUGIN_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 | ||
29 | PLUGIN_HEADER | 29 | PLUGIN_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 | |||
10 | INCLUDES = -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) | ||
13 | CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \ | ||
14 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN | ||
15 | |||
16 | ifdef APPEXTRA | ||
17 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
18 | endif | ||
19 | |||
20 | LINKFILE := $(OBJDIR)/link.lds | ||
21 | DEPFILE = $(OBJDIR)/dep-chessbox | ||
22 | SRC = chessbox.c gnuchess.c opening.c chessbox_pgn.c | ||
23 | |||
24 | SOURCES = $(SRC) | ||
25 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
26 | DIRS = . | ||
27 | |||
28 | ifndef SIMVER | ||
29 | ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET))))) | ||
30 | LDS := archos.lds | ||
31 | OUTPUT = $(OUTDIR)/chessbox.ovl | ||
32 | else ## iRiver target | ||
33 | LDS := ../plugin.lds | ||
34 | OUTPUT = $(OUTDIR)/chessbox.rock | ||
35 | endif | ||
36 | else ## simulators | ||
37 | OUTPUT = $(OUTDIR)/chessbox.rock | ||
38 | endif | ||
39 | |||
40 | all: $(OUTPUT) | ||
41 | |||
42 | ifndef 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 $< $@ | ||
49 | else | ||
50 | |||
51 | ifeq ($(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 $@ | ||
57 | ifeq ($(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 | ||
61 | else | ||
62 | @chmod -x $@ | ||
63 | endif | ||
64 | |||
65 | else # end of x11-simulator | ||
66 | ifeq ($(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 $@ | ||
72 | ifeq ($(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 | ||
76 | else | ||
77 | @chmod -x $@ | ||
78 | endif | ||
79 | |||
80 | else # end of sdl-simulator | ||
81 | ################################################### | ||
82 | # This is the win32 simulator version | ||
83 | DLLTOOLFLAGS = --export-all | ||
84 | DLLWRAPFLAGS = -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 $@ | ||
90 | ifeq ($(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 | ||
94 | else | ||
95 | @chmod -x $@ | ||
96 | endif | ||
97 | endif # end of win32-simulator | ||
98 | endif | ||
99 | endif # end of simulator section | ||
100 | |||
101 | |||
102 | include $(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 | |||
110 | clean: | ||
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 @@ | |||
1 | chessbox.c | ||
2 | gnuchess.c | ||
3 | opening.c | ||
4 | chessbox_pgn.c | ||
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c index f34bdbf24a..f8db7d9b7f 100644 --- a/apps/plugins/chessbox/chessbox.c +++ b/apps/plugins/chessbox/chessbox.c | |||
@@ -43,7 +43,7 @@ extern const fb_data chessbox_pieces[]; | |||
43 | PLUGIN_HEADER | 43 | PLUGIN_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 | |||
10 | CHESSBOX_SRCDIR = $(APPSDIR)/plugins/chessbox | ||
11 | CHESSBOX_OBJDIR = $(BUILDDIR)/apps/plugins/chessbox | ||
12 | |||
13 | CHESSBOX_SRC := $(call preprocess, $(CHESSBOX_SRCDIR)/SOURCES) | ||
14 | CHESSBOX_OBJ := $(call c2obj, $(CHESSBOX_SRC)) | ||
15 | |||
16 | OTHER_SRC += $(CHESSBOX_SRC) | ||
17 | |||
18 | ifndef SIMVER | ||
19 | ifneq (,$(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 | ||
23 | else | ||
24 | ### all other targets | ||
25 | CHESSBOX_INLDS := $(APPSDIR)/plugins/plugin.lds | ||
26 | ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock | ||
27 | endif | ||
28 | CHESSBOX_OVLFLAGS = -T$(CHESSBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$*.map | ||
29 | CHESSBOX_OUTLDS = $(CHESSBOX_OBJDIR)/chessbox.lds | ||
30 | else | ||
31 | ### simulator | ||
32 | ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock | ||
33 | CHESSBOX_OVLFLAGS = $(SHARED_FLAG) # <-- from Makefile | ||
34 | endif | ||
35 | |||
36 | ifeq ($(CPU),sh) | ||
37 | # sh need to retain its' -Os | ||
38 | CHESSBOXFLAGS = $(PLUGINFLAGS) | ||
39 | else | ||
40 | CHESSBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O2 | ||
41 | endif | ||
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 | ||
28 | PLUGIN_HEADER | 28 | PLUGIN_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 | |||
10 | INCLUDES = -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 | ||
14 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ | ||
15 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN | ||
16 | |||
17 | ifdef APPEXTRA | ||
18 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
19 | endif | ||
20 | |||
21 | LINKFILE := $(OBJDIR)/link.lds | ||
22 | DEPFILE = $(OBJDIR)/dep-clock | ||
23 | |||
24 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
25 | include $(TOOLSDIR)/makesrc.inc | ||
26 | |||
27 | SOURCES = $(SRC) | ||
28 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
29 | DIRS = . | ||
30 | |||
31 | ifndef SIMVER | ||
32 | LDS := ../plugin.lds | ||
33 | OUTPUT = $(OUTDIR)/clock.rock | ||
34 | else ## simulators | ||
35 | OUTPUT = $(OUTDIR)/clock.rock | ||
36 | endif | ||
37 | |||
38 | all: $(OUTPUT) | ||
39 | |||
40 | ifndef 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 $< $@ | ||
47 | else | ||
48 | |||
49 | ifeq ($(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 $@ | ||
55 | ifeq ($(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 | ||
59 | else | ||
60 | @chmod -x $@ | ||
61 | endif | ||
62 | |||
63 | else # end of x11-simulator | ||
64 | ifeq ($(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 $@ | ||
70 | ifeq ($(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 | ||
74 | else | ||
75 | @chmod -x $@ | ||
76 | endif | ||
77 | |||
78 | else # end of sdl-simulator | ||
79 | ################################################### | ||
80 | # This is the win32 simulator version | ||
81 | DLLTOOLFLAGS = --export-all | ||
82 | DLLWRAPFLAGS = -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 $@ | ||
88 | ifeq ($(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 | ||
92 | else | ||
93 | @chmod -x $@ | ||
94 | endif | ||
95 | endif # end of win32-simulator | ||
96 | endif | ||
97 | endif # end of simulator section | ||
98 | |||
99 | |||
100 | include $(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 | |||
108 | clean: | ||
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 | |||
10 | CLOCKSRCDIR := $(APPSDIR)/plugins/clock | ||
11 | CLOCKBUILDDIR := $(BUILDDIR)/apps/plugins/clock | ||
12 | |||
13 | ROCKS += $(CLOCKBUILDDIR)/clock.rock | ||
14 | |||
15 | CLOCK_SRC := $(call preprocess, $(CLOCKSRCDIR)/SOURCES) | ||
16 | CLOCK_OBJ := $(call c2obj, $(CLOCK_SRC)) | ||
17 | |||
18 | # add source files to OTHER_SRC to get automatic dependencies | ||
19 | OTHER_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 | ||
28 | void draw_string(struct screen* display, const struct picture* bitmaps, | 28 | void 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 | ||
26 | extern const struct picture logos[]; | 26 | extern const struct picture logos[]; |
27 | extern const struct picture messages[]; | 27 | extern const struct picture messages[]; |
diff --git a/apps/plugins/clock/clock_counter.h b/apps/plugins/clock/clock_counter.h index 25523d45f6..46563e9eb7 100644 --- a/apps/plugins/clock/clock_counter.h +++ b/apps/plugins/clock/clock_counter.h | |||
@@ -2,7 +2,7 @@ | |||
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 | ||
7 | struct counter{ | 7 | struct 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 | ||
26 | const struct picture* binary_skin[]={binary,digits,segments}; | 26 | const 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 | ||
28 | const struct picture* digits_skin[]={digits,segments}; | 28 | const struct picture* digits_skin[]={digits,segments}; |
29 | const struct picture* smalldigits_skin[]={smalldigits,smallsegments}; | 29 | const struct picture* smalldigits_skin[]={smalldigits,smallsegments}; |
diff --git a/apps/plugins/clock/clock_settings.c b/apps/plugins/clock/clock_settings.c index 1147055ce5..1d78c4705e 100644 --- a/apps/plugins/clock/clock_settings.c +++ b/apps/plugins/clock/clock_settings.c | |||
@@ -23,7 +23,7 @@ | |||
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 | ||
28 | static int max_skin[]={ | 28 | static 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 | ||
24 | PLUGIN_HEADER | 24 | PLUGIN_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 | ||
29 | PLUGIN_HEADER | 29 | PLUGIN_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" |
29 | PLUGIN_HEADER | 29 | PLUGIN_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 | |||
47 | INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
48 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) | ||
49 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ | ||
50 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \ | ||
51 | -Wno-strict-prototypes $(PROFILE_OPTS) | ||
52 | |||
53 | ifdef APPEXTRA | ||
54 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
55 | endif | ||
56 | |||
57 | # The arm code compiles too large for the plugin buffer when set to optimize for speed | ||
58 | ifeq ($(CPU), arm) | ||
59 | CFLAGS += -Os | ||
60 | ifndef SIMVER | ||
61 | ifeq ($(TARGET), IRIVER_H100) | ||
62 | CFLAGS += -mstructure-size-boundary=8 | ||
63 | endif | ||
64 | endif | ||
65 | else | ||
66 | CFLAGS += -O2 | ||
67 | endif | ||
68 | |||
69 | LINKFILE := $(OBJDIR)/link.lds | ||
70 | DEPFILE = $(OBJDIR)/dep-doom | ||
71 | SRC = 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 | |||
85 | SOURCES = $(SRC) | ||
86 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
87 | #OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
88 | #OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
89 | DIRS = . | ||
90 | |||
91 | |||
92 | ifndef SIMVER | ||
93 | LDS := ../plugin.lds | ||
94 | OUTPUT = $(OUTDIR)/doom.rock | ||
95 | else ## simulators | ||
96 | OUTPUT = $(OUTDIR)/doom.rock | ||
97 | endif | ||
98 | |||
99 | all: $(OUTPUT) | ||
100 | |||
101 | ifndef 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 $< $@ | ||
108 | else | ||
109 | |||
110 | ifeq ($(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 $@ | ||
116 | ifeq ($(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 | ||
120 | else | ||
121 | @chmod -x $@ | ||
122 | endif | ||
123 | |||
124 | else # end of x11-simulator | ||
125 | ifeq ($(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 $@ | ||
131 | ifeq ($(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 | ||
135 | else | ||
136 | @chmod -x $@ | ||
137 | endif | ||
138 | |||
139 | else # end of sdl-simulator | ||
140 | ################################################### | ||
141 | # This is the win32 simulator version | ||
142 | DLLTOOLFLAGS = --export-all | ||
143 | DLLWRAPFLAGS = -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 $@ | ||
149 | ifeq ($(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 | ||
153 | else | ||
154 | @chmod -x $@ | ||
155 | endif | ||
156 | endif # end of win32-simulator | ||
157 | endif | ||
158 | endif # end of simulator section | ||
159 | |||
160 | |||
161 | include $(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 | |||
169 | clean: | ||
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 @@ | |||
1 | info.c | ||
2 | doomdef.c | ||
3 | doomstat.c | ||
4 | dstrings.c | ||
5 | tables.c | ||
6 | f_finale.c | ||
7 | f_wipe.c | ||
8 | d_net.c | ||
9 | d_items.c | ||
10 | g_game.c | ||
11 | m_menu.c | ||
12 | m_argv.c | ||
13 | m_cheat.c | ||
14 | m_random.c | ||
15 | am_map.c | ||
16 | p_ceilng.c | ||
17 | p_doors.c | ||
18 | p_genlin.c | ||
19 | p_enemy.c | ||
20 | p_floor.c | ||
21 | p_inter.c | ||
22 | p_lights.c | ||
23 | p_map.c | ||
24 | p_maputl.c | ||
25 | p_plats.c | ||
26 | p_pspr.c | ||
27 | p_setup.c | ||
28 | p_sight.c | ||
29 | p_spec.c | ||
30 | p_switch.c | ||
31 | p_mobj.c | ||
32 | p_telept.c | ||
33 | p_tick.c | ||
34 | p_saveg.c | ||
35 | p_user.c | ||
36 | r_bsp.c | ||
37 | r_data.c | ||
38 | r_draw.c | ||
39 | r_main.c | ||
40 | r_plane.c | ||
41 | r_segs.c | ||
42 | r_sky.c | ||
43 | r_things.c | ||
44 | wi_stuff.c | ||
45 | v_video.c | ||
46 | st_lib.c | ||
47 | st_stuff.c | ||
48 | hu_stuff.c | ||
49 | hu_lib.c | ||
50 | s_sound.c | ||
51 | z_zone.c | ||
52 | z_bmalloc.c | ||
53 | sounds.c | ||
54 | d_main.c | ||
55 | m_misc.c | ||
56 | m_bbox.c | ||
57 | i_system.c | ||
58 | i_sound.c | ||
59 | i_video.c | ||
60 | w_wad.c | ||
61 | rockdoom.c | ||
62 | d_deh.c | ||
diff --git a/apps/plugins/doom/doom.make b/apps/plugins/doom/doom.make new file mode 100644 index 0000000000..d566f5307b --- /dev/null +++ b/apps/plugins/doom/doom.make | |||
@@ -0,0 +1,54 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | DOOMSRCDIR := $(APPSDIR)/plugins/doom | ||
11 | DOOMBUILDDIR := $(BUILDDIR)/apps/plugins/doom | ||
12 | |||
13 | ROCKS += $(DOOMBUILDDIR)/doom.rock | ||
14 | |||
15 | DOOM_SRC := $(call preprocess, $(DOOMSRCDIR)/SOURCES) | ||
16 | DOOM_OBJ := $(call c2obj, $(DOOM_SRC)) | ||
17 | DOOM_OBJ += $(DOOMBUILDDIR)/sscanf.o | ||
18 | |||
19 | # add source files to OTHER_SRC to get automatic dependencies | ||
20 | OTHER_SRC += $(DOOM_SRC) | ||
21 | |||
22 | DOOMCFLAGS = $(PLUGINFLAGS) -Wno-strict-prototypes | ||
23 | |||
24 | # The arm code compiles too large for the plugin buffer when set to optimize for speed | ||
25 | ifeq ($(CPU), arm) | ||
26 | DOOMCFLAGS += -Os | ||
27 | ifndef SIMVER | ||
28 | ifeq ($(TARGET), IRIVER_H100) | ||
29 | DOOMCCFLAGS += -mstructure-size-boundary=8 | ||
30 | endif | ||
31 | endif | ||
32 | else | ||
33 | DOOMCFLAGS += -O2 | ||
34 | endif | ||
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" |
121 | GREY_INFO_STRUCT_IRAM | 121 | GREY_INFO_STRUCT_IRAM |
122 | static unsigned char greybuffer[LCD_WIDTH] IBSS_ATTR; /* off screen buffer */ | 122 | static unsigned char greybuffer[LCD_WIDTH] IBSS_ATTR; /* off screen buffer */ |
123 | static unsigned char *gbuf; | 123 | static unsigned char *gbuf; |
diff --git a/apps/plugins/euroconverter.c b/apps/plugins/euroconverter.c index e982af9f24..02617abc39 100644 --- a/apps/plugins/euroconverter.c +++ b/apps/plugins/euroconverter.c | |||
@@ -19,7 +19,7 @@ | |||
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 | ||
25 | PLUGIN_HEADER | 25 | PLUGIN_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 | ||
30 | PLUGIN_HEADER | 30 | PLUGIN_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 | ||
32 | PLUGIN_HEADER | 32 | PLUGIN_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 | ||
26 | PLUGIN_HEADER | 26 | PLUGIN_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 | |||
10 | INCLUDES = -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 | ||
13 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ | ||
14 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN | ||
15 | |||
16 | ifdef APPEXTRA | ||
17 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
18 | endif | ||
19 | |||
20 | LINKFILE := $(OBJDIR)/link.lds | ||
21 | DEPFILE = $(OBJDIR)/dep-jpeg | ||
22 | |||
23 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
24 | include $(TOOLSDIR)/makesrc.inc | ||
25 | |||
26 | SOURCES = $(SRC) | ||
27 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
28 | DIRS = . | ||
29 | |||
30 | ifndef SIMVER | ||
31 | LDS := ../plugin.lds | ||
32 | OUTPUT = $(OUTDIR)/jpeg.rock | ||
33 | else ## simulators | ||
34 | OUTPUT = $(OUTDIR)/jpeg.rock | ||
35 | endif | ||
36 | |||
37 | all: $(OUTPUT) | ||
38 | |||
39 | ifndef 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 $< $@ | ||
46 | else | ||
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 $@ | ||
52 | ifeq ($(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 | ||
56 | else | ||
57 | @chmod -x $@ | ||
58 | endif | ||
59 | |||
60 | endif # end of simulator section | ||
61 | |||
62 | |||
63 | include $(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 | |||
71 | clean: | ||
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 | |||
10 | JPEGSRCDIR := $(APPSDIR)/plugins/jpeg | ||
11 | JPEGBUILDDIR := $(BUILDDIR)/apps/plugins/jpeg | ||
12 | |||
13 | ROCKS += $(JPEGBUILDDIR)/jpeg.rock | ||
14 | |||
15 | JPEG_SRC := $(call preprocess, $(JPEGSRCDIR)/SOURCES) | ||
16 | JPEG_OBJ := $(call c2obj, $(JPEG_SRC)) | ||
17 | |||
18 | # add source files to OTHER_SRC to get automatic dependencies | ||
19 | OTHER_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" |
23 | PLUGIN_HEADER | 23 | PLUGIN_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 | ||
28 | PLUGIN_HEADER | 28 | PLUGIN_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 | ||
13 | INCLUDES=-I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
14 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR) | ||
15 | |||
16 | ifdef APPEXTRA | ||
17 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
18 | endif | ||
19 | |||
20 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ | ||
21 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN | ||
22 | |||
23 | # Sectioned compilation for target | ||
24 | ifndef SIMVER | ||
25 | CFLAGS += -ffunction-sections -fdata-sections | ||
26 | endif | ||
27 | |||
28 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
29 | include $(TOOLSDIR)/makesrc.inc | ||
30 | |||
31 | SOURCES = $(SRC) | ||
32 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
33 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
34 | DEPFILE = $(OBJDIR)/dep-pluginlib | ||
35 | DIRS = . | ||
36 | |||
37 | OUTPUT = $(BUILDDIR)/libplugin.a | ||
38 | |||
39 | all: $(OUTPUT) | ||
40 | |||
41 | $(OUTPUT): $(OBJS) | ||
42 | $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1 | ||
43 | $(SILENT)$(RANLIB) $@ | ||
44 | |||
45 | include $(TOOLSDIR)/make.inc | ||
46 | |||
47 | clean: | ||
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 | ||
24 | PLUGIN_HEADER | 24 | PLUGIN_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 | ||
29 | PLUGIN_HEADER | 29 | PLUGIN_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 | ||
36 | PLUGIN_HEADER | 36 | PLUGIN_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 */ |
29 | PLUGIN_HEADER | 29 | PLUGIN_HEADER |
diff --git a/apps/plugins/metronome.c b/apps/plugins/metronome.c index 1841860144..58abbcaa6c 100644 --- a/apps/plugins/metronome.c +++ b/apps/plugins/metronome.c | |||
@@ -19,7 +19,7 @@ | |||
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 | ||
24 | PLUGIN_HEADER | 24 | PLUGIN_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 | |||
10 | INCLUDES = -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 | |||
15 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) $(MIDIOPTS) \ | ||
16 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN | ||
17 | |||
18 | ifdef APPEXTRA | ||
19 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
20 | endif | ||
21 | |||
22 | LINKFILE := $(OBJDIR)/link.lds | ||
23 | DEPFILE = $(OBJDIR)/dep-midiplay | ||
24 | |||
25 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
26 | include $(TOOLSDIR)/makesrc.inc | ||
27 | |||
28 | SOURCES = $(SRC) | ||
29 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
30 | DIRS = . | ||
31 | |||
32 | ifndef SIMVER | ||
33 | LDS := ../plugin.lds | ||
34 | OUTPUT = $(OUTDIR)/midiplay.rock | ||
35 | else ## simulators | ||
36 | OUTPUT = $(OUTDIR)/midiplay.rock | ||
37 | endif | ||
38 | |||
39 | all: $(OUTPUT) | ||
40 | |||
41 | ifndef 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 $< $@ | ||
48 | else | ||
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 $@ | ||
55 | ifeq ($(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 | ||
59 | else | ||
60 | @chmod -x $@ | ||
61 | endif | ||
62 | |||
63 | endif # end of simulator section | ||
64 | |||
65 | include $(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 | |||
73 | clean: | ||
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 | |||
10 | MIDISRCDIR := $(APPSDIR)/plugins/midi | ||
11 | MIDIBUILDDIR := $(BUILDDIR)/apps/plugins/midi | ||
12 | |||
13 | ROCKS += $(MIDIBUILDDIR)/midi.rock | ||
14 | |||
15 | MIDI_SRC := $(call preprocess, $(MIDISRCDIR)/SOURCES) | ||
16 | MIDI_OBJ := $(call c2obj, $(MIDI_SRC)) | ||
17 | |||
18 | # add source files to OTHER_SRC to get automatic dependencies | ||
19 | OTHER_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 | ||
24 | PLUGIN_HEADER | 24 | PLUGIN_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 | |||
10 | INCLUDES = -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) | ||
12 | CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \ | ||
13 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN -DMPEGPLAYER | ||
14 | |||
15 | ifdef APPEXTRA | ||
16 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
17 | endif | ||
18 | |||
19 | LINKFILE := $(OBJDIR)/link.lds | ||
20 | DEPFILE = $(OBJDIR)/dep-mpegplayer | ||
21 | |||
22 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
23 | include $(TOOLSDIR)/makesrc.inc | ||
24 | |||
25 | SOURCES = $(SRC) | ||
26 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
27 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
28 | DIRS = . | ||
29 | |||
30 | LDS := ../plugin.lds | ||
31 | OUTPUT = $(OUTDIR)/mpegplayer.rock | ||
32 | |||
33 | all: $(OUTPUT) | ||
34 | |||
35 | .PHONY: libmad-mpegplayer | ||
36 | |||
37 | $(BUILDDIR)/libmad-mpegplayer.a: libmad-mpegplayer | ||
38 | |||
39 | libmad-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 | |||
43 | ifndef 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 $< $@ | ||
50 | else | ||
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 $@ | ||
55 | ifeq ($(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 | ||
59 | else | ||
60 | @chmod -x $@ | ||
61 | endif | ||
62 | |||
63 | endif # end of sdl-simulator | ||
64 | |||
65 | include $(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 | |||
73 | clean: | ||
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 **/ |
29 | struct pts_queue_slot; | 29 | struct pts_queue_slot; |
diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c index 14863c943d..0c66f3ff32 100644 --- a/apps/plugins/mpegplayer/mpeg_settings.c +++ b/apps/plugins/mpegplayer/mpeg_settings.c | |||
@@ -1,5 +1,5 @@ | |||
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 | |||
10 | MPEGSRCDIR := $(APPSDIR)/plugins/mpegplayer | ||
11 | MPEGBUILDDIR := $(BUILDDIR)/apps/plugins/mpegplayer | ||
12 | |||
13 | ROCKS += $(MPEGBUILDDIR)/mpegplayer.rock | ||
14 | |||
15 | MPEG_SRC := $(call preprocess, $(MPEGSRCDIR)/SOURCES) | ||
16 | MPEG_OBJ := $(call c2obj, $(MPEG_SRC)) | ||
17 | |||
18 | # add source files to OTHER_SRC to get automatic dependencies | ||
19 | OTHER_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 | ||
31 | PLUGIN_HEADER | 31 | PLUGIN_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 | |||
10 | INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) | ||
12 | CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \ | ||
13 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN | ||
14 | |||
15 | ifdef APPEXTRA | ||
16 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
17 | endif | ||
18 | |||
19 | LINKFILE := $(OBJDIR)/link.lds | ||
20 | DEPFILE = $(OBJDIR)/dep-pacbox | ||
21 | |||
22 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
23 | include $(TOOLSDIR)/makesrc.inc | ||
24 | |||
25 | SOURCES = $(SRC) | ||
26 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
27 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
28 | DIRS = . | ||
29 | |||
30 | LDS := ../plugin.lds | ||
31 | OUTPUT = $(OUTDIR)/pacbox.rock | ||
32 | |||
33 | all: $(OUTPUT) | ||
34 | |||
35 | ifndef 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 $< $@ | ||
42 | else | ||
43 | |||
44 | ifeq ($(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 $@ | ||
50 | ifeq ($(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 | ||
54 | else | ||
55 | @chmod -x $@ | ||
56 | endif | ||
57 | |||
58 | else # end of x11-simulator | ||
59 | ifeq ($(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 $@ | ||
65 | ifeq ($(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 | ||
69 | else | ||
70 | @chmod -x $@ | ||
71 | endif | ||
72 | |||
73 | else # end of sdl-simulator | ||
74 | ################################################### | ||
75 | # This is the win32 simulator version | ||
76 | DLLTOOLFLAGS = --export-all | ||
77 | DLLWRAPFLAGS = -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 $@ | ||
83 | ifeq ($(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 | ||
87 | else | ||
88 | @chmod -x $@ | ||
89 | endif | ||
90 | endif # end of win32-simulator | ||
91 | endif | ||
92 | endif # end of simulator section | ||
93 | |||
94 | |||
95 | include $(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 | |||
103 | clean: | ||
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 | |||
10 | PACBOXSRCDIR := $(APPSDIR)/plugins/pacbox | ||
11 | PACBOXBUILDDIR := $(BUILDDIR)/apps/plugins/pacbox | ||
12 | |||
13 | ROCKS += $(PACBOXBUILDDIR)/pacbox.rock | ||
14 | |||
15 | PACBOX_SRC := $(call preprocess, $(PACBOXSRCDIR)/SOURCES) | ||
16 | PACBOX_OBJ := $(call c2obj, $(PACBOX_SRC)) | ||
17 | |||
18 | # add source files to OTHER_SRC to get automatic dependencies | ||
19 | OTHER_SRC += $(PACBOX_SRC) | ||
20 | |||
21 | PACBOXFLAGS = $(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 | ||
37 | PLUGIN_HEADER | 37 | PLUGIN_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: | ||
11 | PLUGINS_SRC = $(call preprocess, $(APPSDIR)/plugins/SOURCES) | ||
12 | OTHER_SRC += $(PLUGINS_SRC) | ||
13 | ROCKS := $(PLUGINS_SRC:.c=.rock) | ||
14 | ROCKS := $(subst $(ROOTDIR),$(BUILDDIR),$(ROCKS)) | ||
15 | |||
16 | # libplugin.a | ||
17 | PLUGINLIB := $(BUILDDIR)/apps/plugins/libplugin.a | ||
18 | PLUGINLIB_SRC = $(call preprocess, $(APPSDIR)/plugins/lib/SOURCES) | ||
19 | OTHER_SRC += $(PLUGINLIB_SRC) | ||
20 | |||
21 | PLUGINLIB_OBJ := $(PLUGINLIB_SRC:.c=.o) | ||
22 | PLUGINLIB_OBJ := $(PLUGINLIB_OBJ:.S=.o) | ||
23 | PLUGINLIB_OBJ := $(subst $(ROOTDIR),$(BUILDDIR),$(PLUGINLIB_OBJ)) | ||
24 | |||
25 | # multifile plugins (subdirs): | ||
26 | PLUGINSUBDIRS := $(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 | ||
32 | PLUGIN_LDS := $(APPSDIR)/plugins/plugin.lds | ||
33 | PLUGINLINK_LDS := $(BUILDDIR)/apps/plugins/plugin.link | ||
34 | |||
35 | OTHER_INC += -I$(APPSDIR)/plugins | ||
36 | |||
37 | # special compile flags for plugins: | ||
38 | PLUGINFLAGS = -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 | |||
65 | ifdef SIMVER | ||
66 | PLUGINLDFLAGS = $(SHARED_FLAG) # <-- from Makefile | ||
67 | else | ||
68 | PLUGINLDFLAGS = -T$(PLUGINLINK_LDS) -Wl,--gc-sections -Wl,-Map,$*.map | ||
69 | endif | ||
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 | ||
24 | PLUGIN_HEADER | 24 | PLUGIN_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 | |||
10 | INCLUDES = -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 | ||
13 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ | ||
14 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN | ||
15 | |||
16 | ifdef APPEXTRA | ||
17 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
18 | endif | ||
19 | |||
20 | LINKFILE := $(OBJDIR)/link.lds | ||
21 | DEPFILE = $(OBJDIR)/dep-reversi | ||
22 | |||
23 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
24 | include $(TOOLSDIR)/makesrc.inc | ||
25 | |||
26 | SOURCES = $(SRC) | ||
27 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
28 | DIRS = . | ||
29 | |||
30 | ifndef SIMVER | ||
31 | LDS := ../plugin.lds | ||
32 | OUTPUT = $(OUTDIR)/reversi.rock | ||
33 | else ## simulators | ||
34 | OUTPUT = $(OUTDIR)/reversi.rock | ||
35 | endif | ||
36 | |||
37 | all: $(OUTPUT) | ||
38 | |||
39 | ifndef 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 $< $@ | ||
46 | else | ||
47 | |||
48 | ifeq ($(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 $@ | ||
54 | ifeq ($(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 | ||
58 | else | ||
59 | @chmod -x $@ | ||
60 | endif | ||
61 | |||
62 | else # end of x11-simulator | ||
63 | ifeq ($(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 $@ | ||
69 | ifeq ($(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 | ||
73 | else | ||
74 | @chmod -x $@ | ||
75 | endif | ||
76 | |||
77 | else # end of sdl-simulator | ||
78 | ################################################### | ||
79 | # This is the win32 simulator version | ||
80 | DLLTOOLFLAGS = --export-all | ||
81 | DLLWRAPFLAGS = -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 $@ | ||
87 | ifeq ($(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 | ||
91 | else | ||
92 | @chmod -x $@ | ||
93 | endif | ||
94 | endif # end of win32-simulator | ||
95 | endif | ||
96 | endif # end of simulator section | ||
97 | |||
98 | |||
99 | include $(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 | |||
107 | clean: | ||
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 | ||
52 | PLUGIN_HEADER | 52 | PLUGIN_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 | |||
10 | REVERSISRCDIR := $(APPSDIR)/plugins/reversi | ||
11 | REVERSIBUILDDIR := $(BUILDDIR)/apps/plugins/reversi | ||
12 | |||
13 | ROCKS += $(REVERSIBUILDDIR)/reversi.rock | ||
14 | |||
15 | REVERSI_SRC := $(call preprocess, $(REVERSISRCDIR)/SOURCES) | ||
16 | REVERSI_OBJ := $(call c2obj, $(REVERSI_SRC)) | ||
17 | |||
18 | # add source files to OTHER_SRC to get automatic dependencies | ||
19 | OTHER_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 | ||
28 | PLUGIN_HEADER | 28 | PLUGIN_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 | ||
29 | PLUGIN_HEADER | 29 | PLUGIN_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 | |||
10 | INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) | ||
12 | CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \ | ||
13 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN -finline-functions | ||
14 | |||
15 | ifdef APPEXTRA | ||
16 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
17 | endif | ||
18 | |||
19 | LINKFILE := $(OBJDIR)/link.lds | ||
20 | DEPFILE = $(OBJDIR)/dep-rockboy | ||
21 | SRC = 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 | |||
28 | SOURCES = $(SRC) | ||
29 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
30 | DIRS = . | ||
31 | |||
32 | ifndef SIMVER | ||
33 | ifneq (,$(findstring RECORDER,$(TARGET))) ## Archos recorder targets | ||
34 | LDS := archos.lds | ||
35 | OUTPUT = $(OUTDIR)/rockboy.ovl | ||
36 | else ## iRiver target | ||
37 | LDS := ../plugin.lds | ||
38 | OUTPUT = $(OUTDIR)/rockboy.rock | ||
39 | endif | ||
40 | else ## simulators | ||
41 | OUTPUT = $(OUTDIR)/rockboy.rock | ||
42 | endif | ||
43 | |||
44 | all: $(OUTPUT) | ||
45 | |||
46 | ifndef 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 $< $@ | ||
53 | else | ||
54 | |||
55 | ifeq ($(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 $@ | ||
61 | ifeq ($(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 | ||
65 | else | ||
66 | @chmod -x $@ | ||
67 | endif | ||
68 | |||
69 | else # end of x11-simulator | ||
70 | ifeq ($(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 $@ | ||
76 | ifeq ($(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 | ||
80 | else | ||
81 | @chmod -x $@ | ||
82 | endif | ||
83 | |||
84 | else # end of sdl-simulator | ||
85 | ################################################### | ||
86 | # This is the win32 simulator version | ||
87 | DLLTOOLFLAGS = --export-all | ||
88 | DLLWRAPFLAGS = -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 $@ | ||
94 | ifeq ($(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 | ||
98 | else | ||
99 | @chmod -x $@ | ||
100 | endif | ||
101 | endif # end of win32-simulator | ||
102 | endif | ||
103 | endif # end of simulator section | ||
104 | |||
105 | |||
106 | include $(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 | |||
114 | clean: | ||
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 @@ | |||
1 | cpu.c | ||
2 | emu.c | ||
3 | events.c | ||
4 | fastmem.c | ||
5 | hw.c | ||
6 | lcd.c | ||
7 | lcdc.c | ||
8 | loader.c | ||
9 | mem.c | ||
10 | menu.c | ||
11 | rbsound.c | ||
12 | rockboy.c | ||
13 | rtc.c | ||
14 | save.c | ||
15 | sound.c | ||
16 | sys_rockbox.c | ||
diff --git a/apps/plugins/rockboy/rockboy.make b/apps/plugins/rockboy/rockboy.make new file mode 100644 index 0000000000..62196cf0b7 --- /dev/null +++ b/apps/plugins/rockboy/rockboy.make | |||
@@ -0,0 +1,53 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | ROCKBOY_SRCDIR = $(APPSDIR)/plugins/rockboy | ||
11 | ROCKBOY_OBJDIR = $(BUILDDIR)/apps/plugins/rockboy | ||
12 | |||
13 | ROCKBOY_SRC := $(call preprocess, $(ROCKBOY_SRCDIR)/SOURCES) | ||
14 | ROCKBOY_OBJ := $(call c2obj, $(ROCKBOY_SRC)) | ||
15 | ROCKBOY_OBJ += $(ROCKBOY_OBJDIR)/sscanf.o | ||
16 | |||
17 | OTHER_SRC += $(ROCKBOY_SRC) | ||
18 | |||
19 | ifndef SIMVER | ||
20 | ifneq (,$(findstring RECORDER,$(TARGET))) | ||
21 | ## archos recorder targets | ||
22 | ROCKBOY_INLDS := $(ROCKBOY_SRCDIR)/archos.lds | ||
23 | ROCKS += $(ROCKBOY_OBJDIR)/rockboy.ovl | ||
24 | else | ||
25 | ### all other targets | ||
26 | ROCKBOY_INLDS := $(APPSDIR)/plugins/plugin.lds | ||
27 | ROCKS += $(ROCKBOY_OBJDIR)/rockboy.rock | ||
28 | endif | ||
29 | ROCKBOY_OVLFLAGS = -T$(ROCKBOY_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(ROCKBOY_OBJDIR)/$*.map | ||
30 | ROCKBOY_OUTLDS = $(ROCKBOY_OBJDIR)/rockboy.lds | ||
31 | else | ||
32 | ### simulator | ||
33 | ROCKS += $(ROCKBOY_OBJDIR)/rockboy.rock | ||
34 | ROCKBOY_OVLFLAGS = $(SHARED_FLAG) # <-- from Makefile | ||
35 | endif | ||
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 | ||
67 | PLUGIN_HEADER | 67 | PLUGIN_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 | |||
10 | INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) | ||
12 | CFLAGS = $(INCLUDES) $(GCCOPTS) -O3 $(TARGET) $(EXTRA_DEFINES) \ | ||
13 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN | ||
14 | |||
15 | ifdef APPEXTRA | ||
16 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
17 | endif | ||
18 | |||
19 | LINKFILE := $(OBJDIR)/link.lds | ||
20 | DEPFILE = $(OBJDIR)/dep-searchengine | ||
21 | SRC = searchengine.c parser.c token.c dbinterface.c | ||
22 | |||
23 | SOURCES = $(SRC) | ||
24 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
25 | DIRS = . | ||
26 | |||
27 | LDS := ../plugin.lds | ||
28 | OUTPUT = $(OUTDIR)/searchengine.rock | ||
29 | |||
30 | all: $(OUTPUT) | ||
31 | |||
32 | ifndef 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 $< $@ | ||
39 | else | ||
40 | |||
41 | ifeq ($(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 $@ | ||
47 | ifeq ($(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 | ||
51 | else | ||
52 | @chmod -x $@ | ||
53 | endif | ||
54 | |||
55 | else # end of x11-simulator | ||
56 | ifeq ($(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 $@ | ||
62 | ifeq ($(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 | ||
66 | else | ||
67 | @chmod -x $@ | ||
68 | endif | ||
69 | |||
70 | else # end of sdl-simulator | ||
71 | ################################################### | ||
72 | # This is the win32 simulator version | ||
73 | DLLTOOLFLAGS = --export-all | ||
74 | DLLWRAPFLAGS = -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 $@ | ||
80 | ifeq ($(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 | ||
84 | else | ||
85 | @chmod -x $@ | ||
86 | endif | ||
87 | endif # end of win32-simulator | ||
88 | endif | ||
89 | endif # end of simulator section | ||
90 | |||
91 | |||
92 | include $(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 | |||
100 | clean: | ||
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 | |||
10 | INCLUDES = -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 | ||
13 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ | ||
14 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN | ||
15 | |||
16 | ifdef APPEXTRA | ||
17 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
18 | endif | ||
19 | |||
20 | LINKFILE := $(OBJDIR)/link.lds | ||
21 | DEPFILE = $(OBJDIR)/dep-shortcuts | ||
22 | |||
23 | SOURCES := shortcuts_common.c shortcuts_view.c shortcuts_append.c | ||
24 | VIEW_OBJS := $(OBJDIR)/shortcuts_common.o $(OBJDIR)/shortcuts_view.o | ||
25 | APPEND_OBJS := $(OBJDIR)/shortcuts_common.o $(OBJDIR)/shortcuts_append.o | ||
26 | DIRS = . | ||
27 | |||
28 | ifndef SIMVER | ||
29 | LDS := ../plugin.lds | ||
30 | endif | ||
31 | |||
32 | OUTPUT = $(OUTDIR)/shortcuts_view.rock $(OUTDIR)/shortcuts_append.rock | ||
33 | |||
34 | all: $(OUTPUT) | ||
35 | |||
36 | ifndef 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 $< $@ | ||
50 | else | ||
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 $@ | ||
57 | ifeq ($(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 | ||
61 | else | ||
62 | @chmod -x $@ | ||
63 | endif | ||
64 | |||
65 | $(OUTDIR)/shortcuts_append.rock: $(APPEND_OBJS) | ||
66 | $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(APPEND_OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@ | ||
67 | ifeq ($(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 | ||
71 | else | ||
72 | @chmod -x $@ | ||
73 | endif | ||
74 | |||
75 | endif # end of simulator section | ||
76 | |||
77 | |||
78 | include $(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 | |||
86 | clean: | ||
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 | |||
10 | SHCUTSRCDIR := $(APPSDIR)/plugins/shortcuts | ||
11 | SHCUTBUILDDIR := $(BUILDDIR)/apps/plugins/shortcuts | ||
12 | |||
13 | ROCKS += $(SHCUTBUILDDIR)/shortcuts_view.rock | ||
14 | ROCKS += $(SHCUTBUILDDIR)/shortcuts_append.rock | ||
15 | |||
16 | # add source files to OTHER_SRC to get automatic dependencies | ||
17 | OTHER_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 |
25 | PLUGIN_HEADER | 25 | PLUGIN_HEADER |
diff --git a/apps/plugins/snow.c b/apps/plugins/snow.c index 056ab7818b..28315cc34f 100644 --- a/apps/plugins/snow.c +++ b/apps/plugins/snow.c | |||
@@ -19,7 +19,7 @@ | |||
19 | * | 19 | * |
20 | **************************************************************************/ | 20 | **************************************************************************/ |
21 | #include "plugin.h" | 21 | #include "plugin.h" |
22 | #include "playergfx.h" | 22 | #include "lib/playergfx.h" |
23 | 23 | ||
24 | PLUGIN_HEADER | 24 | PLUGIN_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 | ||
27 | PLUGIN_HEADER | 25 | PLUGIN_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 | |||
10 | INCLUDES = -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 | ||
13 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ | ||
14 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN | ||
15 | |||
16 | ifdef APPEXTRA | ||
17 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
18 | endif | ||
19 | |||
20 | LINKFILE := $(OBJDIR)/link.lds | ||
21 | DEPFILE = $(OBJDIR)/dep-sudoku | ||
22 | |||
23 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
24 | include $(TOOLSDIR)/makesrc.inc | ||
25 | |||
26 | SOURCES = $(SRC) | ||
27 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
28 | DIRS = . | ||
29 | |||
30 | ifndef SIMVER | ||
31 | LDS := ../plugin.lds | ||
32 | OUTPUT = $(OUTDIR)/sudoku.rock | ||
33 | else ## simulators | ||
34 | OUTPUT = $(OUTDIR)/sudoku.rock | ||
35 | endif | ||
36 | |||
37 | all: $(OUTPUT) | ||
38 | |||
39 | ifndef 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 $< $@ | ||
46 | else | ||
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 $@ | ||
52 | ifeq ($(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 | ||
56 | else | ||
57 | @chmod -x $@ | ||
58 | endif | ||
59 | |||
60 | endif # end of simulator section | ||
61 | |||
62 | |||
63 | include $(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 | |||
71 | clean: | ||
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 | |||
10 | SUDOKUSRCDIR := $(APPSDIR)/plugins/sudoku | ||
11 | SUDOKUBUILDDIR := $(BUILDDIR)/apps/plugins/sudoku | ||
12 | |||
13 | ROCKS += $(SUDOKUBUILDDIR)/sudoku.rock | ||
14 | |||
15 | SUDOKU_SRC := $(call preprocess, $(SUDOKUSRCDIR)/SOURCES) | ||
16 | SUDOKU_OBJ := $(call c2obj, $(SUDOKU_SRC)) | ||
17 | |||
18 | # add source files to OTHER_SRC to get automatic dependencies | ||
19 | OTHER_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 | ||
26 | PLUGIN_HEADER | 26 | PLUGIN_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 | ||
31 | PLUGIN_HEADER | 31 | PLUGIN_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 | ||
24 | PLUGIN_HEADER | 24 | PLUGIN_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 | ||
27 | PLUGIN_HEADER | 27 | PLUGIN_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 | ||
24 | PLUGIN_HEADER | 24 | PLUGIN_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 | ||
25 | PLUGIN_HEADER | 25 | PLUGIN_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 | ||
26 | PLUGIN_HEADER | 26 | PLUGIN_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 | ||
26 | PLUGIN_HEADER | 26 | PLUGIN_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 | # | ||
8 | OPT_FLAGS=-O3 -funroll-loops | ||
9 | |||
10 | INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) -I. $(TARGET_INC) | ||
12 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ | ||
13 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN $(OPT_FLAGS) $(PROFILE_OPTS) | ||
14 | |||
15 | ifdef APPEXTRA | ||
16 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
17 | endif | ||
18 | |||
19 | LINKFILE := $(OBJDIR)/link.lds | ||
20 | DEPFILE = $(OBJDIR)/dep-zxbox | ||
21 | |||
22 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
23 | include $(TOOLSDIR)/makesrc.inc | ||
24 | |||
25 | SOURCES = $(SRC) | ||
26 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
27 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
28 | DIRS = . | ||
29 | |||
30 | ifndef SIMVER | ||
31 | ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET))))) | ||
32 | LDS := archos.lds | ||
33 | OUTPUT = $(OUTDIR)/zxbox.ovl | ||
34 | else ## iRiver/iPod/... targets | ||
35 | LDS := ../plugin.lds | ||
36 | OUTPUT = $(OUTDIR)/zxbox.rock | ||
37 | endif | ||
38 | else ## simulators | ||
39 | OUTPUT = $(OUTDIR)/zxbox.rock | ||
40 | endif | ||
41 | |||
42 | all: $(OUTPUT) | ||
43 | |||
44 | ifndef 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 $< $@ | ||
51 | else | ||
52 | |||
53 | ifeq ($(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 $@ | ||
59 | ifeq ($(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 | ||
63 | else | ||
64 | @chmod -x $@ | ||
65 | endif | ||
66 | |||
67 | endif | ||
68 | endif # end of simulator section | ||
69 | |||
70 | |||
71 | include $(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 | |||
79 | clean: | ||
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 | |||
10 | ZXBOX_SRCDIR = $(APPSDIR)/plugins/zxbox | ||
11 | ZXBOX_OBJDIR = $(BUILDDIR)/apps/plugins/zxbox | ||
12 | |||
13 | ZXBOX_SRC := $(call preprocess, $(ZXBOX_SRCDIR)/SOURCES) | ||
14 | ZXBOX_OBJ := $(call c2obj, $(ZXBOX_SRC)) | ||
15 | |||
16 | OTHER_SRC += $(ZXBOX_SRC) | ||
17 | |||
18 | ifndef SIMVER | ||
19 | ifneq (,$(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 | ||
23 | else | ||
24 | ### all other targets | ||
25 | ZXBOX_INLDS := $(APPSDIR)/plugins/plugin.lds | ||
26 | ROCKS += $(ZXBOX_OBJDIR)/zxbox.rock | ||
27 | endif | ||
28 | else | ||
29 | ### simulator | ||
30 | ROCKS += $(ZXBOX_OBJDIR)/zxbox.rock | ||
31 | endif | ||
32 | |||
33 | ZXBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O3 -funroll-loops | ||
34 | |||
35 | ifdef SIMVER | ||
36 | ZXBOX_LDFLAGS = $(SHARED_FLAG) # <-- from Makefile | ||
37 | else | ||
38 | ZXBOX_OUTLDS = $(ZXBOX_OBJDIR)/zxbox.lds | ||
39 | ZXBOX_LDFLAGS = -T$(ZXBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(BUILDDIR)/$*.map | ||
40 | endif | ||
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" |