diff options
Diffstat (limited to 'apps/Makefile')
-rw-r--r-- | apps/Makefile | 268 |
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 | |||
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 | ||