summaryrefslogtreecommitdiff
path: root/apps/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'apps/Makefile')
-rw-r--r--apps/Makefile268
1 files changed, 0 insertions, 268 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
10INCLUDES= $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. \
11 -I$(BUILDDIR) -I$(BUILDDIR)/bitmaps -I$(OBJDIR)
12
13DEPFILE = $(OBJDIR)/dep-apps
14
15LDS := $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/app.lds
16
17ROMLDS := $(FIRMDIR)/rom.lds
18
19ifdef SOFTWARECODECS
20CODECS=build-codecs
21
22# This sets up the parameters for building and linking libspeex for core voice
23VOICE=libspeex-rockbox
24LINKVOICE= -lspeex-rockbox
25
26endif
27
28# Set up the bitmap libraries
29BITMAPLIBS =
30LINKBITMAPS =
31ifneq ($(strip $(BMP2RB_MONO)),)
32 BITMAPLIBS += bitmapsmono
33 LINKBITMAPS += -lbitmapsmono
34endif
35ifneq ($(strip $(BMP2RB_NATIVE)),)
36 BITMAPLIBS += bitmapsnative
37 LINKBITMAPS += -lbitmapsnative
38endif
39ifneq ($(strip $(BMP2RB_REMOTEMONO)),)
40 BITMAPLIBS += bitmapsremotemono
41 LINKBITMAPS += -lbitmapsremotemono
42endif
43ifneq ($(strip $(BMP2RB_REMOTENATIVE)),)
44 BITMAPLIBS += bitmapsremotenative
45 LINKBITMAPS += -lbitmapsremotenative
46endif
47
48# This sets up 'SRC' based on the files mentioned in SOURCES
49include $(TOOLSDIR)/makesrc.inc
50
51DEFINES = $(DEBUG)
52
53DIRS = .
54
55ifdef APPEXTRA
56 DIRS += $(subst :, ,$(APPEXTRA))
57 INCLUDES += $(patsubst %,-I%,$(subst :, ,$(APPEXTRA)))
58endif
59
60CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(BUILDDATE) $(DEFINES) \
61 -DTARGET_ID=$(TARGET_ID) \
62 -DAPPSVERSION=\"$(VERSION)\" $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} \
63 -DTARGET_NAME=\"$(MODELNAME)\"
64
65OBJS2 := $(OBJDIR)/lang.o $(patsubst %.c, $(OBJDIR)/%.o, $(SRC))
66OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
67SOURCES = $(SRC)
68LINKFILE = $(OBJDIR)/linkage.lds
69LINKROM = $(OBJDIR)/linkrom.lds
70MAXINFILE = $(OBJDIR)/romstart.temp
71MAXOUTFILE = $(OBJDIR)/romstart
72
73LIBROCKBOX = $(BUILDDIR)/librockbox.a
74
75ifdef SIMVER
76# this is a sim build
77
78all: simbuild
79
80else
81# regular target build
82
83ifdef DEBUG
84REALBIN = $(OBJDIR)/rockbox.elf
85else
86# this is not needed to get built when doing debug builds
87REALBIN = $(BUILDDIR)/$(BINARY)
88endif
89
90all: build
91
92endif
93
94build: $(DEPFILE) $(BITMAPLIBS) build-codecs build-pluginlib
95ifdef ENABLEDPLUGINS
96 $(call PRINTS,MAKE in plugins)$(MAKE) -C plugins OBJDIR=$(OBJDIR)/plugins
97endif
98 $(call PRINTS,MAKE in apps)$(MAKE) $(REALBIN) $(FLASHFILE) $(ARCHOSROM)
99
100simbuild: $(DEPFILE) $(BITMAPLIBS) build-codecs build-pluginlib
101ifdef ENABLEDPLUGINS
102 $(call PRINTS,MAKE in plugins)$(MAKE) -C plugins OBJDIR=$(OBJDIR)/plugins
103endif
104 $(call PRINTS,MAKE in apps)$(MAKE) $(BUILDDIR)/$(BINARY)
105
106build-codecs:
107ifdef SOFTWARECODECS
108 $(SILENT)$(MAKE) -C codecs/lib OBJDIR=$(OBJDIR)/codecs/lib
109 $(SILENT)$(MAKE) -C codecs OBJDIR=$(OBJDIR)/codecs
110endif
111
112build-pluginlib:
113ifdef ENABLEDPLUGINS
114 $(SILENT)$(MAKE) -C plugins/lib OBJDIR=$(OBJDIR)/plugins/lib
115endif
116
117bitmapsmono:
118 $(call PRINTS,MAKE in bitmaps/mono)$(MAKE) -C bitmaps/mono OBJDIR=$(OBJDIR)/bitmaps/mono
119
120bitmapsnative:
121 $(call PRINTS,MAKE in bitmaps/native)$(MAKE) -C bitmaps/native OBJDIR=$(OBJDIR)/bitmaps/native
122
123bitmapsremotemono:
124 $(call PRINTS,MAKE in bitmaps/remote_mono)$(MAKE) -C bitmaps/remote_mono OBJDIR=$(OBJDIR)/bitmaps/remote_mono
125
126bitmapsremotenative:
127 $(call PRINTS,MAKE in bitmaps/remote_native)$(MAKE) -C bitmaps/remote_native OBJDIR=$(OBJDIR)/bitmaps/remote_native
128
129rocks: build-codecs build-pluginlib
130 $(SILENT)$(MAKE) -C plugins OBJDIR=$(OBJDIR)/plugins
131
132libspeex-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
152objs: $(OBJS)
153
154ifndef 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
186else
187# this is a simulator build
188
189ifeq ($(SIMVER), win32)
190# OK, this is ugly but we need it on the link line to make it do right
191EXTRAOBJ = $(BUILDDIR)/sim/uisw32-res.o
192LDOPTS += -lwinmm
193endif
194
195# OS X's ld does not support -Map
196ifeq ($(UNAME), Darwin)
197SIMULATOR_MAP=
198else
199#SIMULATOR_MAP=-Wl,-Map,$(OBJDIR)/rockbox.map
200endif
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)
206endif
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
223include $(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
231features: $(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
246clean:
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
262ifdef SIMVER
263 $(SILENT)$(MAKE) -C $(SIMDIR) clean
264endif
265
266ifneq ($(MAKECMDGOALS),clean)
267-include $(DEPFILE)
268endif