blob: dd827d6d3f4c6bf3e0d91e62c15b22f269d0510f [file] [log] [blame]
Björn Stenbergc6b3d382008-11-20 11:27:31 +00001# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
Björn Stenberga091d202008-11-25 19:54:23 +00007# $Id$
Björn Stenbergc6b3d382008-11-20 11:27:31 +00008#
9
10include $(TOOLSDIR)/functions.make
11
Andree Buschmann5d849a92011-02-02 17:43:32 +000012DEFINES = -DROCKBOX -DMEMORYSIZE=$(MEMORYSIZE) $(TARGET) \
Rafaël Carré5d236b22010-05-27 09:41:46 +000013 -DTARGET_ID=$(TARGET_ID) -DTARGET_NAME=\"$(MODELNAME)\" $(BUILDDATE) \
Björn Stenbergc6b3d382008-11-20 11:27:31 +000014 $(EXTRA_DEFINES) # <-- -DSIMULATOR or not
Tom Ross4fb58642009-03-02 06:13:18 +000015INCLUDES = -I$(BUILDDIR) -I$(BUILDDIR)/lang $(TARGET_INC)
Björn Stenbergc6b3d382008-11-20 11:27:31 +000016
17CFLAGS = $(INCLUDES) $(DEFINES) $(GCCOPTS)
Jens Arnoldeef14e32010-03-20 08:53:27 +000018PPCFLAGS = $(filter-out -g -Dmain=SDL_main,$(CFLAGS)) # cygwin sdl-config fix
Thomas Martitz0bf1bd12010-12-27 17:27:59 +000019ASMFLAGS = -D__ASSEMBLER__ # work around gcc 3.4.x bug with -std=gnu99, only meant for .S files
Björn Stenbergc6b3d382008-11-20 11:27:31 +000020
21TOOLS = $(TOOLSDIR)/rdf2binary $(TOOLSDIR)/convbdf \
22 $(TOOLSDIR)/codepages $(TOOLSDIR)/scramble $(TOOLSDIR)/bmp2rb \
Maurus Cuelenaere19204622010-02-16 21:55:42 +000023 $(TOOLSDIR)/uclpack $(TOOLSDIR)/mkboot $(TOOLSDIR)/iaudio_bl_flash.c \
Frank Gevaerts36d98fa2011-03-09 21:50:43 +000024 $(TOOLSDIR)/iaudio_bl_flash.h
Björn Stenbergc6b3d382008-11-20 11:27:31 +000025
Thomas Martitz7ed1a5f2009-04-12 01:28:33 +000026
27ifeq (,$(PREFIX))
Thomas Martitz9c0b2472010-08-01 16:15:27 +000028ifdef APP_TYPE
Thomas Martitz7ed1a5f2009-04-12 01:28:33 +000029# for sims, set simdisk/ as default
Thomas Martitz9c0b2472010-08-01 16:15:27 +000030ifeq ($(APP_TYPE),sdl-sim)
31RBPREFIX = simdisk
32else ifeq ($(APP_TYPE),sdl-app)
33RBPREFIX = /usr/local
34endif
35
36INSTALL = --install="$(RBPREFIX)"
Thomas Martitz7ed1a5f2009-04-12 01:28:33 +000037else
38# /dev/null as magic to tell it wasn't set, error out later in buildzip.pl
39INSTALL = --install=/dev/null
40endif
41else
Thomas Martitz9c0b2472010-08-01 16:15:27 +000042RBPREFIX = $(PREFIX)
43INSTALL = --install="$(RBPREFIX)"
Thomas Martitz7ed1a5f2009-04-12 01:28:33 +000044endif
45
Björn Stenberg8a7c4af2008-11-21 13:21:25 +000046RBINFO = $(BUILDDIR)/rockbox-info.txt
47
Björn Stenbergc6b3d382008-11-20 11:27:31 +000048# list suffixes to be understood by $*
49.SUFFIXES: .rock .codec .map .elf .c .S .o .bmp .a
50
51.PHONY: all clean tags zip tools manual bin build info langs
52
Jens Arnold08f51a52009-03-10 19:06:14 +000053ifeq (,$(filter clean veryclean reconf tags voice voicetools manual manual-pdf manual-html manual-zhtml manual-txt manual-ztxt manual-zip help fontzip ,$(MAKECMDGOALS)))
Björn Stenberg34332cf2008-11-26 23:21:30 +000054# none of the above
Björn Stenbergc6b3d382008-11-20 11:27:31 +000055DEPFILE = $(BUILDDIR)/make.dep
56
Björn Stenberg34332cf2008-11-26 23:21:30 +000057endif
58
Björn Stenbergc6b3d382008-11-20 11:27:31 +000059all: $(DEPFILE) build
60
Andrew Mahone668a7692009-07-13 00:40:35 +000061# Subdir makefiles. their primary purpose is to populate SRC, OTHER_SRC &
62# ASMDEFS_SRC but they also define special dependencies and compile rules
Björn Stenbergc6b3d382008-11-20 11:27:31 +000063include $(TOOLSDIR)/tools.make
Björn Stenbergffaf2462009-09-01 14:53:37 +000064
65ifeq (,$(findstring checkwps,$(APPSDIR)))
Yoshihisa Uchidaec39c052010-02-25 12:28:30 +000066 ifeq (,$(findstring database,$(APPSDIR)))
Rafaël Carréa2029a72010-07-25 15:22:47 +000067 include $(FIRMDIR)/firmware.make
Björn Stenbergccaec762010-06-17 11:10:00 +000068 include $(ROOTDIR)/lib/skin_parser/skin_parser.make
Yoshihisa Uchidaec39c052010-02-25 12:28:30 +000069 include $(ROOTDIR)/apps/bitmaps/bitmaps.make
70 endif
Björn Stenbergffaf2462009-09-01 14:53:37 +000071endif
Björn Stenbergc6b3d382008-11-20 11:27:31 +000072
Thomas Martitz46454ac2010-08-24 12:38:42 +000073#included before codecs.make and plugins.make so they see $(LIBSETJMP)
74ifndef APP_TYPE
75 include $(ROOTDIR)/lib/libsetjmp/libsetjmp.make
76endif
77
Björn Stenbergc6b3d382008-11-20 11:27:31 +000078ifneq (,$(findstring bootloader,$(APPSDIR)))
79 include $(APPSDIR)/bootloader.make
80else ifneq (,$(findstring bootbox,$(APPSDIR)))
Björn Stenbergd834a0c2008-11-20 16:17:22 +000081 BOOTBOXLDOPTS = -Wl,--gc-sections
Björn Stenbergc6b3d382008-11-20 11:27:31 +000082 include $(APPSDIR)/bootbox.make
Maurus Cuelenaere8bff5642009-08-21 20:28:26 +000083else ifneq (,$(findstring checkwps,$(APPSDIR)))
84 include $(APPSDIR)/checkwps.make
Jonathan Gordon2d31d772010-07-29 12:37:48 +000085 include $(ROOTDIR)/lib/skin_parser/skin_parser.make
Frank Gevaerts6e115722009-10-07 16:54:15 +000086else ifneq (,$(findstring database,$(APPSDIR)))
87 include $(APPSDIR)/database.make
Björn Stenbergc6b3d382008-11-20 11:27:31 +000088else
89 include $(APPSDIR)/apps.make
90 include $(APPSDIR)/lang/lang.make
91
92 ifdef SOFTWARECODECS
93 include $(APPSDIR)/codecs/codecs.make
94 endif
95
96 ifdef ENABLEDPLUGINS
97 include $(APPSDIR)/plugins/bitmaps/pluginbitmaps.make
98 include $(APPSDIR)/plugins/plugins.make
99 endif
100
Thomas Martitzf8381d92010-09-02 00:24:40 +0000101 ifneq (,$(findstring sdl,$(APP_TYPE)))
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000102 include $(ROOTDIR)/uisimulator/uisimulator.make
103 endif
Thomas Martitzf8381d92010-09-02 00:24:40 +0000104
Thomas Martitz249bba02011-12-24 11:56:46 +0000105 ifneq (,$(findstring ypr0,$(APP_TYPE)))
106 include $(ROOTDIR)/firmware/target/hosted/ypr0/ypr0.make
107 endif
108
Thomas Martitzf8381d92010-09-02 00:24:40 +0000109 ifneq (,$(findstring android, $(APP_TYPE)))
110 include $(ROOTDIR)/android/android.make
111 endif
Thomas Jarosch986a92f2011-06-09 20:58:03 +0000112
113 ifneq (,$(findstring pandora, $(MODELNAME)))
114 include $(ROOTDIR)/packaging/pandora/pandora.make
115 endif
116
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000117endif # bootloader
118
119OBJ := $(SRC:.c=.o)
120OBJ := $(OBJ:.S=.o)
121OBJ += $(BMP:.bmp=.o)
Jonas Häggqvista2008f92009-04-11 23:20:09 +0000122OBJ := $(subst $(ROOTDIR),$(BUILDDIR),$(OBJ))
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000123
Björn Stenberg8a7c4af2008-11-21 13:21:25 +0000124build: $(TOOLS) $(BUILDDIR)/$(BINARY) $(CODECS) $(ROCKS) $(ARCHOSROM) $(RBINFO)
125
126$(RBINFO): $(BUILDDIR)/$(BINARY)
127 $(SILENT)echo Creating $(@F)
128 $(SILENT)$(TOOLSDIR)/mkinfo.pl $@
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000129
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000130$(DEPFILE) dep:
131 $(call PRINTS,Generating dependencies)
Rafaël Carré27c509f2010-08-21 18:07:12 +0000132 $(call mkdepfile,$(DEPFILE)_,$(SRC))
133 $(call mkdepfile,$(DEPFILE)_,$(OTHER_SRC:%.lua=))
134 $(call mkdepfile,$(DEPFILE)_,$(ASMDEFS_SRC))
135 $(call bmpdepfile,$(DEPFILE)_,$(BMP) $(PBMP))
Maurus Cuelenaeree8da4472009-02-04 20:59:27 +0000136 @mv $(DEPFILE)_ $(DEPFILE)
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000137
Thomas Martitz64f4b872009-04-03 13:44:47 +0000138bin: $(DEPFILE) $(TOOLS) $(BUILDDIR)/$(BINARY) $(RBINFO)
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000139rocks: $(DEPFILE) $(TOOLS) $(ROCKS)
140codecs: $(DEPFILE) $(TOOLS) $(CODECS)
Maurus Cuelenaerecf313862009-03-11 16:13:46 +0000141tools: $(TOOLS)
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000142
143-include $(DEPFILE)
144
145veryclean: clean
146 $(SILENT)rm -rf $(TOOLS)
147
Thomas Martitza9944012010-09-12 16:35:02 +0000148clean::
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000149 $(SILENT)echo Cleaning build directory
Björn Stenberg046776c2008-11-22 23:34:24 +0000150 $(SILENT)rm -rf rockbox.zip rockbox.7z rockbox.tar rockbox.tar.gz \
Rafaël Carré1da9b712010-06-19 06:11:22 +0000151 rockbox.tar.bz2 TAGS apps firmware tools comsim sim lang lib \
Björn Stenberg046776c2008-11-22 23:34:24 +0000152 manual *.pdf *.a credits.raw rockbox.ipod bitmaps \
153 pluginbitmaps UI256.bmp rockbox-full.zip html txt \
154 rockbox-manual*.zip sysfont.h rockbox-info.txt voicefontids \
Tom Ross4fb58642009-03-02 06:13:18 +0000155 *.wav *.mp3 *.voice $(CLEANOBJS) \
Björn Stenberg046776c2008-11-22 23:34:24 +0000156 $(LINKRAM) $(LINKROM) rockbox.elf rockbox.map rockbox.bin \
Jens Arnold89b41572008-11-28 22:22:47 +0000157 make.dep rombox.elf rombox.map rombox.bin rombox.ucl romstart.txt \
Maurus Cuelenaere0b92c0f2011-03-11 15:45:49 +0000158 $(BINARY) $(FLASHFILE) uisimulator bootloader flash $(BOOTLINK) \
Dominik Riebelingfc68a0d2011-05-29 18:44:42 +0000159 rockbox.apk
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000160
161#### linking the binaries: ####
162
163.SECONDEXPANSION:
164
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000165ifeq (,$(findstring bootloader,$(APPSDIR)))
166# not bootloader
167
Björn Stenberg6b962702008-11-21 15:27:16 +0000168OBJ += $(LANG_O)
169
Thomas Martitz57613ea2010-07-10 13:49:49 +0000170ifndef APP_TYPE
Björn Stenberg6b962702008-11-21 15:27:16 +0000171
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000172## target build
Rafaël Carréa9e2a712010-01-24 15:32:23 +0000173CONFIGFILE := $(FIRMDIR)/export/config/$(MODELNAME).h
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000174RAMLDS := $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/app.lds
175LINKRAM := $(BUILDDIR)/ram.link
176ROMLDS := $(FIRMDIR)/rom.lds
177LINKROM := $(BUILDDIR)/rom.link
178
Björn Stenberg66409782008-11-21 15:07:15 +0000179
Rafaël Carréa9e2a712010-01-24 15:32:23 +0000180$(LINKRAM): $(RAMLDS) $(CONFIGFILE)
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000181 $(call PRINTS,PP $(@F))
182 $(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS))
183
184$(LINKROM): $(ROMLDS)
185 $(call PRINTS,PP $(@F))
186 $(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS))
187
Björn Stenbergccaec762010-06-17 11:10:00 +0000188$(BUILDDIR)/rockbox.elf : $$(OBJ) $$(FIRMLIB) $$(VOICESPEEXLIB) $$(SKINLIB) $$(LINKRAM)
Björn Stenberga3864b02008-11-20 15:04:30 +0000189 $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \
190 -L$(BUILDDIR)/firmware -lfirmware \
Björn Stenberg936e6732010-06-24 11:47:37 +0000191 -L$(BUILDDIR)/lib -lskin_parser \
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000192 -L$(BUILDDIR)/apps/codecs $(VOICESPEEXLIB:lib%.a=-l%) \
Frank Gevaertsb8286d42010-07-03 20:58:22 +0000193 -lgcc $(BOOTBOXLDOPTS) $(GLOBAL_LDOPTS) \
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000194 -T$(LINKRAM) -Wl,-Map,$(BUILDDIR)/rockbox.map
195
Björn Stenbergccaec762010-06-17 11:10:00 +0000196$(BUILDDIR)/rombox.elf : $$(OBJ) $$(FIRMLIB) $$(VOICESPEEXLIB) $$(SKINLIB) $$(LINKROM)
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000197 $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \
Frank Gevaertsb8286d42010-07-03 20:58:22 +0000198 $(VOICESPEEXLIB) $(FIRMLIB) -lgcc $(GLOBAL_LDOPTS) \
Jonathan Gordon2d31d772010-07-29 12:37:48 +0000199 -L$(BUILDDIR)/lib -lskin_parser \
200 -L$(BUILDDIR)/firmware -T$(LINKROM) -Wl,-Map,$(BUILDDIR)/rombox.map
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000201
202$(BUILDDIR)/rockbox.bin : $(BUILDDIR)/rockbox.elf
203 $(call PRINTS,OC $(@F))$(OC) $(if $(filter yes, $(USE_ELF)), -S -x, -O binary) $< $@
204
205$(BUILDDIR)/rombox.bin : $(BUILDDIR)/rombox.elf
206 $(call PRINTS,OC $(@F))$(OC) -O binary $< $@
207
208#
209# If there's a flashfile defined for this target (rockbox.ucl for Archos
210# models) Then check if the mkfirmware script fails, as then it is (likely)
211# because the image is too big and we need to create a compressed image
212# instead.
213#
214$(BUILDDIR)/$(BINARY) : $(BUILDDIR)/rockbox.bin $(FLASHFILE)
215 $(call PRINTS,SCRAMBLE $(notdir $@))($(MKFIRMWARE) $< $@; \
216 stat=$$?; \
217 if test -n "$(FLASHFILE)"; then \
218 if test "$$stat" -ne 0; then \
219 echo "Image too big, making a compressed version!"; \
220 $(MAKE) -C $(FIRMDIR)/decompressor OBJDIR=$(BUILDDIR)/firmware/decompressor; \
221 $(MKFIRMWARE) $(BUILDDIR)/firmware/decompressor/compressed.bin $@; \
222 fi \
223 fi )
224
225# archos
226$(BUILDDIR)/rockbox.ucl: $(BUILDDIR)/rockbox.bin
Daniel Stenberg2e6d6042009-02-23 08:45:16 +0000227 $(call PRINTS,UCLPACK $(@F))$(TOOLSDIR)/uclpack --best --2e -b1048576 $< $@ >/dev/null
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000228
229MAXINFILE = $(BUILDDIR)/temp.txt
230MAXOUTFILE = $(BUILDDIR)/romstart.txt
231
232$(BUILDDIR)/rombox.ucl: $(BUILDDIR)/rombox.bin $(MAXOUTFILE)
233 $(call PRINTS,UCLPACK $(@F))$(TOOLSDIR)/uclpack --none $< $@ >/dev/null; \
234 perl $(TOOLSDIR)/romsizetest.pl `cat $(MAXOUTFILE)` $<; \
235 if test $$? -ne 0; then \
236 echo "removing UCL file again, making it a fake one"; \
237 echo "fake" > $@; \
238 fi
239
240$(MAXOUTFILE):
241 $(call PRINTS,Creating $(@F))
Rafaël Carré27c509f2010-08-21 18:07:12 +0000242 $(SILENT)echo '#include "config.h"' > $(MAXINFILE)
243 $(SILENT)echo "ROM_START" >> $(MAXINFILE)
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000244 $(call preprocess2file,$(MAXINFILE),$(MAXOUTFILE))
245 $(SILENT)rm $(MAXINFILE)
246
247# iriver
248$(BUILDDIR)/rombox.iriver: $(BUILDDIR)/rombox.bin
249 $(call PRINTS,Build ROM file)$(MKFIRMWARE) $< $@
250
Thomas Martitz57613ea2010-07-10 13:49:49 +0000251endif # !APP_TYPE
Björn Stenberg6b962702008-11-21 15:27:16 +0000252endif # !bootloader
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000253
254
255voicetools:
256 $(SILENT)$(MAKE) -C $(TOOLSDIR) CC=$(HOSTCC) AR=$(HOSTAR) rbspeexenc voicefont wavtrim
257
258tags:
259 $(SILENT)rm -f TAGS
260 $(SILENT)etags -o $(BUILDDIR)/TAGS $(filter-out %.o,$(SRC) $(OTHER_SRC))
261
262fontzip:
Dave Chapman376c9f32011-02-27 11:37:39 +0000263 $(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) --app=$(APPLICATION) -m \"$(MODELNAME)\" -r "$(ROOTDIR)" --rbdir="$(RBDIR)" -f 1 -o rockbox-fonts.zip $(TARGET) $(BINARY)
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000264
Björn Stenbergc3cf8bc2011-06-06 22:00:44 +0000265zip: $(BUILDDIR)/rockbox.zip
266
Björn Stenberg35cd4082011-06-22 14:14:49 +0000267ifdef NODEPS
268$(BUILDDIR)/rockbox.zip:
269else
Björn Stenbergc3cf8bc2011-06-06 22:00:44 +0000270$(BUILDDIR)/rockbox.zip: build
Björn Stenberg35cd4082011-06-22 14:14:49 +0000271endif
Dave Chapman376c9f32011-02-27 11:37:39 +0000272 $(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) --app=$(APPLICATION) -m \"$(MODELNAME)\" -i \"$(TARGET_ID)\" -r "$(ROOTDIR)" --rbdir="$(RBDIR)" $(TARGET) $(BINARY)
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000273
274mapzip:
275 $(SILENT)find . -name "*.map" | xargs zip rockbox-maps.zip
276
Alex Parker745406a2011-02-20 19:56:53 +0000277elfzip:
278 $(SILENT)find . -name "*.elf" | xargs zip rockbox-elfs.zip
279
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000280fullzip:
Dave Chapman376c9f32011-02-27 11:37:39 +0000281 $(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) --app=$(APPLICATION) -m \"$(MODELNAME)\" -i \"$(TARGET_ID)\" -r "$(ROOTDIR)" --rbdir="$(RBDIR)" -f 2 -o rockbox-full.zip $(TARGET) $(BINARY)
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000282
2837zip:
Dave Chapman376c9f32011-02-27 11:37:39 +0000284 $(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) --app=$(APPLICATION) -m \"$(MODELNAME)\" -i \"$(TARGET_ID)\" -o "rockbox.7z" -z "7za a -mx=9" -r "$(ROOTDIR)" --rbdir="$(RBDIR)" $(TARGET) $(BINARY)
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000285
286tar:
287 $(SILENT)rm -f rockbox.tar
Dave Chapman376c9f32011-02-27 11:37:39 +0000288 $(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) --app=$(APPLICATION) -m \"$(MODELNAME)\" -i \"$(TARGET_ID)\" -o "rockbox.tar" -z "tar -cf" -r "$(ROOTDIR)" --rbdir="$(RBDIR)" $(TARGET) $(BINARY)
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000289
290bzip2: tar
291 $(SILENT)bzip2 -f9 rockbox.tar
292
293gzip: tar
294 $(SILENT)gzip -f9 rockbox.tar
295
296manual manual-pdf:
297 $(SILENT)$(MAKE) -C $(MANUALDIR) OBJDIR=$(BUILDDIR)/manual manual-pdf
298manual-html:
299 $(SILENT)$(MAKE) -C $(MANUALDIR) OBJDIR=$(BUILDDIR)/manual manual-html
300manual-zhtml: manual-zip
301manual-txt:
302 $(SILENT)$(MAKE) -C $(MANUALDIR) OBJDIR=$(BUILDDIR)/manual manual-txt
303manual-ztxt:
304 $(SILENT)$(MAKE) -C $(MANUALDIR) OBJDIR=$(BUILDDIR)/manual manual-txt-zip
305manual-zip:
306 $(SILENT)$(MAKE) -C $(MANUALDIR) OBJDIR=$(BUILDDIR)/manual manual-zip
307
308ifdef TTS_ENGINE
309
Frank Gevaerts94aa0d72010-06-30 16:29:55 +0000310voice: voicetools $(BUILDDIR)/apps/features
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000311 $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done ; \
312 for lang in `echo $(VOICELANGUAGE) |sed "s/,/ /g"`; do $(TOOLSDIR)/voice.pl -V -l=$$lang -t=$(MODELNAME)$$feat -i=$(TARGET_ID) -e="$(ENCODER)" -E="$(ENC_OPTS)" -s=$(TTS_ENGINE) -S="$(TTS_OPTS)"; done \
313
314endif
315
Antoine Celleriera448d8b2011-01-24 17:06:04 +0000316ifeq (,$(findstring android, $(APP_TYPE)))
Rafaël Carré89eb19d2010-06-19 08:46:18 +0000317bininstall: $(BUILDDIR)/$(BINARY)
Thomas Martitz9c0b2472010-08-01 16:15:27 +0000318 @echo "Installing your rockbox binary in your '$(RBPREFIX)' dir"
319 $(SILENT)cp $(BINARY) "$(RBPREFIX)/.rockbox/"
Rafaël Carré53367ba2010-06-19 08:43:53 +0000320
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000321install:
Michael Chicoinec6bcd912010-08-08 00:03:08 +0000322 @echo "Installing your build in your '$(RBPREFIX)' dir"
Dave Chapman376c9f32011-02-27 11:37:39 +0000323 $(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) --app=$(APPLICATION) -m "$(MODELNAME)" -i "$(TARGET_ID)" $(INSTALL) -z "zip -r0" -r "$(ROOTDIR)" --rbdir="$(RBDIR)" -f 0 $(TARGET) $(BINARY)
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000324
325fullinstall:
Michael Chicoinec6bcd912010-08-08 00:03:08 +0000326 @echo "Installing a full setup in your '$(RBPREFIX)' dir"
Dave Chapman376c9f32011-02-27 11:37:39 +0000327 $(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) --app=$(APPLICATION) -m "$(MODELNAME)" -i "$(TARGET_ID)" $(INSTALL) -z "zip -r0" -r "$(ROOTDIR)" --rbdir="$(RBDIR)" -f 2 $(TARGET) $(BINARY)
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000328
Michael Stummvoll1f06ca42010-12-28 10:30:46 +0000329symlinkinstall:
330 @echo "Installing a full setup with links in your '$(RBPREFIX)' dir"
Dave Chapman376c9f32011-02-27 11:37:39 +0000331 $(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) --app=$(APPLICATION) -m "$(MODELNAME)" -i "$(TARGET_ID)" $(INSTALL) -z "zip -r0" -r "$(ROOTDIR)" --rbdir="$(RBDIR)" -f 2 $(TARGET) $(BINARY) -l
Antoine Celleriera448d8b2011-01-24 17:06:04 +0000332endif
Michael Stummvoll1f06ca42010-12-28 10:30:46 +0000333
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000334help:
335 @echo "A few helpful make targets"
336 @echo ""
Michael Stummvoll1f06ca42010-12-28 10:30:46 +0000337 @echo "all - builds a full Rockbox (default), including tools"
338 @echo "bin - builds only the Rockbox.<target name> file"
339 @echo "rocks - builds only plugins"
340 @echo "codecs - builds only codecs"
341 @echo "dep - regenerates make dependency database"
342 @echo "clean - cleans a build directory (not tools)"
343 @echo "veryclean - cleans the build and tools directories"
344 @echo "manual - builds a manual (pdf)"
345 @echo "manual-html - HTML manual"
346 @echo "manual-zip - HTML manual (zipped)"
347 @echo "manual-txt - txt manual"
348 @echo "fullzip - creates a rockbox.zip of your build with fonts"
349 @echo "zip - creates a rockbox.zip of your build (no fonts)"
350 @echo "gzip - creates a rockbox.tar.gz of your build (no fonts)"
351 @echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)"
352 @echo "7zip - creates a rockbox.7z of your build (no fonts)"
353 @echo "fontzip - creates rockbox-fonts.zip"
354 @echo "mapzip - creates rockbox-maps.zip with all .map files"
Alex Parkerd0a0d022011-02-26 20:50:12 +0000355 @echo "elfzip - creates rockbox-elfs.zip with all .elf files"
Thomas Jarosch986a92f2011-06-09 20:58:03 +0000356 @echo "pnd - creates rockbox.pnd archive (Pandora builds only)"
Michael Stummvoll1f06ca42010-12-28 10:30:46 +0000357 @echo "tools - builds the tools only"
358 @echo "voice - creates the voice clips (voice builds only)"
359 @echo "voicetools - builds the voice tools only"
360 @echo "install - installs your build (at PREFIX, defaults to simdisk/ for simulators (no fonts))"
361 @echo "fullinstall - installs your build (like install, but with fonts)"
362 @echo "symlinkinstall - like fullinstall, but with links instead of copying files. (Good for developing on simulator)"
363 @echo "reconf - rerun configure with the same selection"
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000364
365### general compile rules:
366
367# when source and object are in different locations (normal):
368$(BUILDDIR)/%.o: $(ROOTDIR)/%.c
369 $(SILENT)mkdir -p $(dir $@)
370 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) -c $< -o $@
371
372$(BUILDDIR)/%.o: $(ROOTDIR)/%.S
373 $(SILENT)mkdir -p $(dir $@)
Thomas Martitz0bf1bd12010-12-27 17:27:59 +0000374 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) $(ASMFLAGS) -c $< -o $@
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000375
Andrew Mahone668a7692009-07-13 00:40:35 +0000376# generated definitions for use in .S files
377$(BUILDDIR)/%_asmdefs.h: $(ROOTDIR)/%_asmdefs.c
378 $(call PRINTS,ASMDEFS $(@F))
379 $(SILENT)mkdir -p $(dir $@)
380 $(call asmdefs2file,$<,$@)
381
Björn Stenbergc6b3d382008-11-20 11:27:31 +0000382# when source and object are both in BUILDDIR (generated code):
383%.o: %.c
384 $(SILENT)mkdir -p $(dir $@)
385 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) -c $< -o $@
386
387%.o: %.S
388 $(SILENT)mkdir -p $(dir $@)
Thomas Martitz0bf1bd12010-12-27 17:27:59 +0000389 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) $(ASMFLAGS) -c $< -o $@
Daniel Stenberg4ef890e2009-01-09 23:15:27 +0000390
Björn Stenbergfc537252009-01-10 22:23:27 +0000391Makefile: $(TOOLSDIR)/configure
Antoine Cellerieref0c9da2009-08-02 09:45:51 +0000392ifneq (reconf,$(MAKECMDGOALS))
Björn Stenberg6d871d52009-01-10 22:36:41 +0000393 $(SILENT)echo "*** tools/configure is newer than Makefile. You should run 'make reconf'."
Antoine Cellerieref0c9da2009-08-02 09:45:51 +0000394endif
Björn Stenberg6d871d52009-01-10 22:36:41 +0000395
396reconf:
Thomas Martitz9c0b2472010-08-01 16:15:27 +0000397 $(SILENT$)$(TOOLSDIR)/configure $(CONFIGURE_OPTIONS)