A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 530 lines 19 kB view raw
1# __________ __ ___. 2# Open \______ \ ____ ____ | | _\_ |__ _______ ___ 3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 6# \/ \/ \/ \/ \/ 7# $Id$ 8# 9 10include $(TOOLSDIR)/functions.make 11 12DEFINES = -DROCKBOX -DMEMORYSIZE=$(MEMORYSIZE) $(TARGET) \ 13 -DTARGET_ID=$(TARGET_ID) -DTARGET_NAME=\"$(MODELNAME)\" $(BUILDDATE) \ 14 $(EXTRA_DEFINES) # <-- -DSIMULATOR or not 15INCLUDES = -I$(BUILDDIR) -I$(BUILDDIR)/lang $(TARGET_INC) 16 17CFLAGS = $(INCLUDES) $(DEFINES) $(GCCOPTS) 18PPCFLAGS = $(filter-out -g -Dmain=SDL_main,$(CFLAGS)) # cygwin sdl-config fix 19CORE_LDOPTS = $(GLOBAL_LDOPTS) # linker ops specifically for core build 20 21TOOLS = $(TOOLSDIR)/rdf2binary $(TOOLSDIR)/convbdf \ 22 $(TOOLSDIR)/codepages $(TOOLSDIR)/scramble $(TOOLSDIR)/bmp2rb \ 23 $(TOOLSDIR)/uclpack $(TOOLSDIR)/mkboot $(TOOLSDIR)/iaudio_bl_flash.c \ 24 $(TOOLSDIR)/iaudio_bl_flash.h 25TOOLS += $(foreach tool,$(TOOLSET),$(TOOLSDIR)/$(tool)) 26 27ifeq (,$(PREFIX)) 28ifdef APP_TYPE 29# for sims, set simdisk/ as default 30ifeq ($(APP_TYPE),sdl-sim) 31RBPREFIX = simdisk 32else ifeq ($(APP_TYPE),sdl-app) 33RBPREFIX = /usr/local 34endif 35 36INSTALL = --install="$(RBPREFIX)" 37else 38# /dev/null as magic to tell it wasn't set, error out later in buildzip.pl 39INSTALL = --install=/dev/null 40endif 41else 42RBPREFIX = $(PREFIX) 43INSTALL = --install="$(RBPREFIX)" 44endif 45 46RBINFO = $(BUILDDIR)/rockbox-info.txt 47 48# 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 53ifeq (,$(filter clean veryclean reconf tags voice voicetools manual manual-pdf manual-html manual-zhtml manual-txt manual-ztxt manual-zip manual-7zip help fontzip ,$(MAKECMDGOALS))) 54# none of the above 55DEPFILE = $(BUILDDIR)/make.dep 56 57endif 58 59all: $(DEPFILE) build 60 61# Subdir makefiles. their primary purpose is to populate SRC, OTHER_SRC, 62# ASMDEFS_SRC and CORE_LIBS. But they also define special dependencies and 63# compile rules 64include $(TOOLSDIR)/tools.make 65 66ifeq (,$(findstring checkwps,$(APP_TYPE))) 67 ifeq (,$(findstring database,$(APP_TYPE))) 68 ifeq (,$(findstring warble,$(APP_TYPE))) 69 include $(FIRMDIR)/firmware.make 70 include $(ROOTDIR)/apps/bitmaps/bitmaps.make 71 ifeq (arch_arm,$(ARCH)) 72 # some targets don't use the unwarminder because they have the glibc backtrace 73 ifeq (,$(filter sonynwz,$(APP_TYPE))) 74 include $(ROOTDIR)/lib/unwarminder/unwarminder.make 75 endif 76 endif 77 ifeq (arch_mips,$(ARCH)) 78 # mips unwinder is only usable on native ports 79 ifeq (,$(APP_TYPE)) 80 include $(ROOTDIR)/lib/mipsunwinder/mipsunwinder.make 81 endif 82 endif 83 ifeq (,$(findstring bootloader,$(APPSDIR))) 84 include $(ROOTDIR)/lib/skin_parser/skin_parser.make 85 include $(ROOTDIR)/lib/tlsf/libtlsf.make 86 endif 87 endif 88 endif 89endif 90 91#included before codecs.make and plugins.make so they see them) 92ifndef APP_TYPE 93 include $(ROOTDIR)/lib/libsetjmp/libsetjmp.make 94 ifeq (arch_arm,$(ARCH)) 95 include $(ROOTDIR)/lib/arm_support/arm_support.make 96 endif 97endif 98 99ifeq (,$(findstring bootloader,$(APPSDIR))) 100 ifeq (,$(findstring checkwps,$(APP_TYPE))) 101 include $(ROOTDIR)/lib/fixedpoint/fixedpoint.make 102 endif 103endif 104 105ifneq (,$(findstring bootloader,$(APPSDIR))) 106 ifneq (,$(findstring sonynwz,$(APP_TYPE))) 107 include $(ROOTDIR)/firmware/target/hosted/sonynwz/sonynwz.make 108 else ifneq (,$(findstring hibyos,$(APP_TYPE))) 109 include $(ROOTDIR)/firmware/target/hosted/hibyos.make 110 else ifneq (,$(findstring fiio,$(APP_TYPE))) 111 include $(ROOTDIR)/firmware/target/hosted/fiio/fiio.make 112 else ifneq (,$(findstring ingenic_x1000,$(MANUFACTURER))) 113 include $(ROOTDIR)/firmware/target/mips/ingenic_x1000/x1000boot.make 114 else 115 include $(APPSDIR)/bootloader.make 116 endif 117else ifneq (,$(findstring checkwps,$(APP_TYPE))) 118 include $(APPSDIR)/checkwps.make 119 include $(ROOTDIR)/lib/skin_parser/skin_parser.make 120else ifneq (,$(findstring database,$(APP_TYPE))) 121 include $(APPSDIR)/database.make 122else ifneq (,$(findstring warble,$(APP_TYPE))) 123 include $(ROOTDIR)/lib/rbcodec/test/warble.make 124 include $(ROOTDIR)/lib/tlsf/libtlsf.make 125 include $(ROOTDIR)/lib/rbcodec/rbcodec.make 126else # core 127 include $(APPSDIR)/lang/lang.make 128 include $(APPSDIR)/apps.make 129 include $(ROOTDIR)/lib/rbcodec/rbcodec.make 130 131 ifeq ($(ENABLEDPLUGINS),yes) 132 include $(APPSDIR)/plugins/bitmaps/pluginbitmaps.make 133 include $(APPSDIR)/plugins/plugins.make 134 endif 135 136 ifneq (,$(findstring sdl,$(APP_TYPE))) 137 include $(ROOTDIR)/uisimulator/uisimulator.make 138 endif 139 140 ifneq (,$(findstring ypr0,$(APP_TYPE))) 141 include $(ROOTDIR)/firmware/target/hosted/samsungypr/ypr0/ypr0.make 142 endif 143 144 ifneq (,$(findstring ypr1,$(APP_TYPE))) 145 include $(ROOTDIR)/firmware/target/hosted/samsungypr/ypr1/ypr1.make 146 endif 147 148 ifneq (,$(findstring sonynwz,$(APP_TYPE))) 149 include $(ROOTDIR)/firmware/target/hosted/sonynwz/sonynwz.make 150 endif 151 152 ifneq (,$(findstring hibyos,$(APP_TYPE))) 153 include $(ROOTDIR)/firmware/target/hosted/hibyos.make 154 endif 155 156 ifneq (,$(findstring fiio,$(APP_TYPE))) 157 include $(ROOTDIR)/firmware/target/hosted/fiio/fiio.make 158 endif 159 160 ifneq (,$(findstring android_ndk, $(APP_TYPE))) 161 include $(ROOTDIR)/firmware/target/hosted/ibasso/android_ndk.make 162 else 163 ifneq (,$(findstring android, $(APP_TYPE))) 164 include $(ROOTDIR)/android/android.make 165 endif 166 endif 167 168 ifneq (,$(findstring pandora, $(MODELNAME))) 169 include $(ROOTDIR)/packaging/pandora/pandora.make 170 endif 171 ifneq (,$(findstring rgnano, $(MODELNAME))) 172 include $(ROOTDIR)/packaging/rgnano/rgnano.make 173 endif 174 ifneq (,$(findstring ctru, $(APP_TYPE))) 175 include $(ROOTDIR)/packaging/ctru/ctru.make 176 endif 177 178endif # bootloader 179 180# One or more subdir makefiles requested --gc-sections? 181ifdef CORE_GCSECTIONS 182 # Do not use '--gc-sections' when compiling sdl-sim 183 ifneq ($(findstring sdl-sim, $(APP_TYPE)), sdl-sim) 184 CORE_LDOPTS += -Wl,--gc-sections 185 endif 186endif # CORE_GCSECTIONS 187 188OBJ := $(SRC:.c=.o) 189OBJ := $(OBJ:.S=.o) 190OBJ += $(BMP:.bmp=.o) 191OBJ := $(call full_path_subst,$(ROOTDIR)/%,$(BUILDDIR)/%,$(OBJ)) 192 193build: $(TOOLS) $(BUILDDIR)/$(BINARY) $(CODECS) $(ROCKS) $(RBINFO) 194lib: $(DEPFILE) $(ROCKBOXLIB) $(FIRMLIB) $(RBCODECLIB) $(CORE_LIBS) $(VOICESPEEXLIB) $(TOOLS) $(CODECS) $(ROCKS) 195 196$(RBINFO): $(BUILDDIR)/$(BINARY) 197 $(SILENT)echo Creating $(@F) 198 $(SILENT)$(TOOLSDIR)/mkinfo.pl $@ 199 200$(DEPFILE) dep: 201 $(call PRINTS,Generating dependencies) 202 $(call mkdepfile,$(DEPFILE)_,$(SRC)) 203 $(call mkdepfile,$(DEPFILE)_,$(OTHER_SRC:%.lua=)) 204 $(call mkdepfile,$(DEPFILE)_,$(ASMDEFS_SRC)) 205 $(call bmpdepfile,$(DEPFILE)_,$(BMP) $(PBMP)) 206 @mv $(DEPFILE)_ $(DEPFILE) 207 208bin: $(DEPFILE) $(TOOLS) $(BUILDDIR)/$(BINARY) $(RBINFO) 209rocks: $(DEPFILE) $(TOOLS) $(ROCKS) 210codecs: $(DEPFILE) $(TOOLS) $(CODECS) 211tools: $(TOOLS) 212 213-include $(DEPFILE) 214 215veryclean: clean 216 $(SILENT)rm -rf $(TOOLS) 217 218clean:: 219 $(SILENT)echo Cleaning build directory 220 $(SILENT)rm -rf rockbox.zip rockbox.7z rockbox.tar rockbox.tar.gz \ 221 rockbox.tar.xz rockbox-full.* rockbox-fonts.* TAGS apps \ 222 firmware tools comsim sim lang lib manual \ 223 *.pdf *.a credits.raw rockbox.ipod bitmaps \ 224 pluginbitmaps UI256.bmp rockbox-full.zip html txt \ 225 rockbox-manual*.zip sysfont.h rockbox-info.txt voicefontids \ 226 *.wav *.mp3 *.voice *.talk $(CLEANOBJS) \ 227 $(LINKRAM) $(LINKROM) rockbox.elf rockbox.map rockbox.bin \ 228 make.dep rombox.elf rombox.map rombox.bin romstart.txt \ 229 $(BINARY) $(FLASHFILE) uisimulator bootloader flash $(BOOTLINK) \ 230 rockbox.apk lang_enum.h rbversion.h fontbundle.h 231 $(SILENT)rm -rf ../.zig-cache ../zig-out 232 233#### linking the binaries: #### 234 235.SECONDEXPANSION: 236 237ifeq (,$(findstring bootloader,$(APPSDIR))) 238# not bootloader 239 240OBJ += $(LANG_O) 241 242ifndef APP_TYPE 243 244## target build 245CONFIGFILE := $(FIRMDIR)/export/config/$(MODELNAME).h 246ifeq ($(wildcard $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/app.lds),) 247RAMLDS := $(FIRMDIR)/target/$(CPU)/app.lds 248else 249RAMLDS := $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/app.lds 250endif 251LINKRAM := $(BUILDDIR)/ram.link 252ROMLDS := $(FIRMDIR)/rom.lds 253LINKROM := $(BUILDDIR)/rom.link 254 255$(LINKRAM): $(RAMLDS) $(CONFIGFILE) 256 $(call PRINTS,PP $(@F)) 257 $(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS)) 258 259$(LINKROM): $(ROMLDS) 260 $(call PRINTS,PP $(@F)) 261 $(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS)) 262 263# Note: make sure -Wl,--gc-sections comes before -T in the linker options. 264# Having the latter first caused crashes on (at least) mini2g. 265$(BUILDDIR)/rockbox.elf : $$(OBJ) $(FIRMLIB) $(VOICESPEEXLIB) $(CORE_LIBS) $$(LINKRAM) 266 $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -nostdlib -o $@ $(OBJ) \ 267 -L$(BUILDDIR)/firmware \ 268 -L$(RBCODEC_BLD)/codecs $(call a2lnk, $(VOICESPEEXLIB)) \ 269 -L$(BUILDDIR)/lib $(call a2lnk, $(CORE_LIBS)) \ 270 -lgcc $(CORE_LDOPTS) -T$(LINKRAM) \ 271 -Wl,-Map,$(BUILDDIR)/rockbox.map 272 273$(BUILDDIR)/rombox.elf : $$(OBJ) $(FIRMLIB) $(VOICESPEEXLIB) $(CORE_LIBS) $$(LINKROM) 274 $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -nostdlib -o $@ $(OBJ) \ 275 -L$(BUILDDIR)/firmware \ 276 -L$(RBCODEC_BLD)/codecs $(call a2lnk, $(VOICESPEEXLIB)) \ 277 -L$(BUILDDIR)/lib $(call a2lnk, $(CORE_LIBS)) \ 278 -lgcc $(CORE_LDOPTS) -T$(LINKROM) \ 279 -Wl,-Map,$(BUILDDIR)/rombox.map 280 281$(BUILDDIR)/rockbox.bin : $(BUILDDIR)/rockbox.elf 282 $(call PRINTS,OC $(@F))$(call objcopy,$<,$@) 283 284$(BUILDDIR)/rombox.bin : $(BUILDDIR)/rombox.elf 285 $(call PRINTS,OC $(@F))$(call objcopy,$<,$@) 286 287$(BUILDDIR)/$(BINARY) : $(BUILDDIR)/rockbox.bin $(FLASHFILE) 288 $(call PRINTS,SCRAMBLE $(notdir $@)) $(MKFIRMWARE) $< $@ 289 290$(MAXOUTFILE): 291 $(call PRINTS,Creating $(@F)) 292 $(SILENT)echo '#include "config.h"' > $(MAXINFILE) 293 $(SILENT)echo "ROM_START" >> $(MAXINFILE) 294 $(call preprocess2file,$(MAXINFILE),$(MAXOUTFILE)) 295 $(SILENT)rm $(MAXINFILE) 296 297# iriver 298$(BUILDDIR)/rombox.iriver: $(BUILDDIR)/rombox.bin 299 $(call PRINTS,Build ROM file)$(MKFIRMWARE) $< $@ 300 301endif # !APP_TYPE 302endif # !bootloader 303 304 305voicetools: 306 $(SILENT)$(MAKE) -C $(TOOLSDIR) CC=$(HOSTCC) AR=$(HOSTAR) rbspeexenc voicefont wavtrim 307 308tags: 309 $(SILENT)rm -f TAGS 310 $(SILENT)etags -o $(BUILDDIR)/TAGS $(filter-out %.o,$(SRC) $(OTHER_SRC)) 311 312zip: $(BUILDDIR)/rockbox.zip 3137zip: $(BUILDDIR)/rockbox.7z 314tar: $(BUILDDIR)/rockbox.tar 315 316fontzip: BUILDZIPOPTS=-f 1 317fontzip: ZIPFILESUFFIX=-fonts 318fontzip: NODEPS=1 319fontzip: zip 320 321font7zip: BUILDZIPOPTS=-f 1 322font7zip: ZIPFILESUFFIX=-fonts 323font7zip: NODEPS=1 324font7zip: 7zip 325 326fullzip: BUILDZIPOPTS=-f 2 327fullzip: ZIPFILESUFFIX=-full 328fullzip: zip 329 330full7zip: BUILDZIPOPTS=-f 2 331full7zip: ZIPFILESUFFIX=-full 332full7zip: 7zip 333 334fulltar: BUILDZIPOPTS=-f 2 335fulltar: ZIPFILESUFFIX=-full 336fulltar: tar 337 338ifneq ($(NODEPS),) 339$(BUILDDIR)/rockbox.zip: 340else 341$(BUILDDIR)/rockbox.zip: build 342endif 343 $(call PRINTS,ZIP rockbox$(ZIPFILESUFFIX).zip) 344 $(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) --app=$(APPLICATION) -m \"$(MODELNAME)\" -i \"$(TARGET_ID)\" -o $(BUILDDIR)/rockbox$(ZIPFILESUFFIX).zip -r "$(ROOTDIR)" --rbdir="$(RBDIR)" $(BUILDZIPOPTS) $(TARGET) $(BINARY) 345 346mapzip: 347 $(SILENT)find . -name "*.map" | xargs zip rockbox-maps.zip 348 349elfzip: 350 $(SILENT)find . -name "*.elf" | xargs zip rockbox-elfs.zip 351 352ifneq ($(NODEPS),) 353$(BUILDDIR)/rockbox.7z: 354else 355$(BUILDDIR)/rockbox.7z: build 356endif 357 $(call PRINTS,7Z rockbox$(ZIPFILESUFFIX).7z) 358 $(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) --app=$(APPLICATION) -m \"$(MODELNAME)\" -i \"$(TARGET_ID)\" -o $(BUILDDIR)/rockbox$(ZIPFILESUFFIX).7z -z "7za a -mx=9" -r "$(ROOTDIR)" --rbdir="$(RBDIR)" $(BUILDZIPOPTS) $(TARGET) $(BINARY) 359 360ifneq ($(NODEPS),) 361$(BUILDDIR)/rockbox.tar: 362else 363$(BUILDDIR)/rockbox.tar: build 364endif 365 $(SILENT)rm -f rockbox.tar 366 $(call PRINTS,TAR $(notdir $@)) 367 $(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) --app=$(APPLICATION) -m \"$(MODELNAME)\" -i \"$(TARGET_ID)\" -o $(BUILDDIR)/rockbox$(ZIPFILESUFFIX).tar -z "tar -cf" -r "$(ROOTDIR)" --rbdir="$(RBDIR)" $(BUILDZIPOPTS) $(TARGET) $(BINARY) 368 369fullgzip: ZIPFILESUFFIX=-full 370fullgzip: fulltar gzip 371fullxz: ZIPFILESUFFIX=-full 372fullxz: fulltar xz 373 374gzip: tar 375 $(call PRINTS,GZIP rockbox$(ZIPFILESUFFIX).tar.gz) 376 $(SILENT)gzip -f9 rockbox$(ZIPFILESUFFIX).tar 377 378xz: tar 379 $(call PRINTS,XZ rockbox$(ZIPFILESUFFIX).tar.xz) 380 $(SILENT)xz -f rockbox$(ZIPFILESUFFIX).tar 381 382manual manual-pdf: 383 $(SILENT)$(MAKE) -C $(MANUALDIR) OBJDIR=$(BUILDDIR)/manual manual-pdf 384manual-html: 385 $(SILENT)$(MAKE) -C $(MANUALDIR) OBJDIR=$(BUILDDIR)/manual manual-html 386manual-zhtml: manual-zip 387manual-txt: 388 $(SILENT)$(MAKE) -C $(MANUALDIR) OBJDIR=$(BUILDDIR)/manual manual-txt 389manual-ztxt: 390 $(SILENT)$(MAKE) -C $(MANUALDIR) OBJDIR=$(BUILDDIR)/manual manual-txt-zip 391manual-zip: 392 $(SILENT)$(MAKE) -C $(MANUALDIR) OBJDIR=$(BUILDDIR)/manual manual-zip 393manual-7zip: 394 $(SILENT)$(MAKE) -C $(MANUALDIR) OBJDIR=$(BUILDDIR)/manual manual-7zip 395 396ifdef TTS_ENGINE 397 398voice: voicetools $(BUILDDIR)/apps/genlang-features 399 $(SILENT)if [ -z "$$POOL" ] ; then \ 400 export POOL="$(BUILDDIR)/voice-pool" ; \ 401 fi;\ 402 mkdir -p $${POOL} ;\ 403 for lang in `echo $(VOICELANGUAGE) |sed "s/,/ /g"`; do $(TOOLSDIR)/voice.pl -V -l=$$lang -t=$(MODELNAME):`cat $(BUILDDIR)/apps/genlang-features` -i=$(TARGET_ID) -e="$(ENCODER)" -E="$(ENC_OPTS)" -s=$(TTS_ENGINE) -S="$(TTS_OPTS)"; done 404 405talkclips: voicetools 406 $(SILENT)if [ -z '$(TALKDIR)' ] ; then \ 407 echo "Must specify TALKDIR"; \ 408 else \ 409 for lang in `echo $(VOICELANGUAGE) |sed "s/,/ /g"`; do $(TOOLSDIR)/voice.pl -C -l=$$lang -e="$(ENCODER)" -E="$(ENC_OPTS)" -s=$(TTS_ENGINE) -S="$(TTS_OPTS)" $(FORCE) "$(TALKDIR)" ; done \ 410 fi 411 412talkclips-force: FORCE=-F 413talkclips-force: talkclips 414 415endif 416 417ifeq (,$(findstring android, $(APP_TYPE))) 418 419simext1: 420 $(SILENT)mkdir -p $@ 421 422bininstall: $(BUILDDIR)/$(BINARY) 423 @echo "Installing your rockbox binary in your '$(RBPREFIX)' dir" 424 $(SILENT)cp $(BINARY) "$(RBPREFIX)/.rockbox/" 425 426install: simext1 427 @echo "Installing your build in your '$(RBPREFIX)' dir" 428 $(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) --app=$(APPLICATION) -m "$(MODELNAME)" -i "$(TARGET_ID)" $(INSTALL) -z "zip -r0" -r "$(ROOTDIR)" --rbdir="$(RBDIR)" -f 0 $(TARGET) $(BINARY) 429 430fullinstall: simext1 431 @echo "Installing a full setup in your '$(RBPREFIX)' dir" 432 $(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) --app=$(APPLICATION) -m "$(MODELNAME)" -i "$(TARGET_ID)" $(INSTALL) -z "zip -r0" -r "$(ROOTDIR)" --rbdir="$(RBDIR)" -f 2 $(TARGET) $(BINARY) 433 434ziginstall: zig install 435 @echo "Installing your build in your '$(RBPREFIX)' dir" 436 cd .. \ 437 && mkdir -p $(RBPREFIX)/bin $(RBPREFIX)/share/rockbox \ 438 && cp zig/zig-out/bin/rockboxd $(RBPREFIX)/bin \ 439 && cp target/release/rockbox $(RBPREFIX)/bin \ 440 && cp -r assets/* $(RBPREFIX)/share/rockbox 441 442symlinkinstall: simext1 443 @echo "Installing a full setup with links in your '$(RBPREFIX)' dir" 444 $(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 445endif 446 447$(BUILDDIR)/apps/recorder/jpeg_load.o: $(ROOTDIR)/apps/recorder/jpeg_load.c 448 mkdir -p $(BUILDDIR)/apps/recorder 449 $(SILENT)$(CC) $(CFLAGS) -c -o $(BUILDDIR)/apps/recorder/jpeg_load.o $(ROOTDIR)/apps/recorder/jpeg_load.c 450 451zig: lib 452 cd .. \ 453 && cargo build -p rockbox-cli --release \ 454 && cargo build -p rockbox-server --release \ 455 && cargo build -p rockbox --release \ 456 && cd zig && zig build 457help: 458 @echo "A few helpful make targets" 459 @echo "" 460 @echo "all - builds a full Rockbox (default), including tools" 461 @echo "zig - builds Rockbox with Zig" 462 @echo "bin - builds only the Rockbox.<target name> file" 463 @echo "rocks - builds only plugins" 464 @echo "codecs - builds only codecs" 465 @echo "dep - regenerates make dependency database" 466 @echo "clean - cleans a build directory (not tools)" 467 @echo "veryclean - cleans the build and tools directories" 468 @echo "manual - builds a manual (pdf)" 469 @echo "manual-html - HTML manual" 470 @echo "manual-zip - HTML manual (zipped)" 471 @echo "manual-7zip - HTML manual (7zipped)" 472 @echo "manual-txt - txt manual" 473 @echo "zip - creates a rockbox.zip of your build (no fonts)" 474 @echo "gzip - creates a rockbox.tar.gz of your build (no fonts)" 475 @echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)" 476 @echo "xz - creates a rockbox.tar.xz of your build (no fonts)" 477 @echo "7zip - creates a rockbox.7z of your build (no fonts)" 478 @echo "fullzip - creates a rockbox-full.zip of your build (with fonts)" 479 @echo "full7zip - creates a rockbox-full.7z of your build (with fonts)" 480 @echo "fullgzip - creates a rockbox-full.tar.gz of your build (with fonts)" 481 @echo "fullxz - creates a rockbox-full.tar.xz of your build (with fonts)" 482 @echo "fontzip - creates rockbox-fonts.zip" 483 @echo "font7zip - creates rockbox-fonts.7zip" 484 @echo "mapzip - creates rockbox-maps.zip with all .map files" 485 @echo "elfzip - creates rockbox-elfs.zip with all .elf files" 486 @echo "pnd - creates rockbox.pnd archive (Pandora builds only)" 487 @echo "tools - builds the tools only" 488 @echo "voice - creates the voice clips (voice builds only)" 489 @echo "voicetools - builds the voice tools only" 490 @echo "talkclips - builds talkclips for everything under \$TALKDIR, skipping existing clips" 491 @echo "talkclips-force - builds talkclips for everything under \$TALKDIR, overwriting all existing clips" 492 @echo "install - installs your build (at \$PREFIX, defaults to simdisk/ for simulators (no fonts))" 493 @echo "fullinstall - installs your build (like install, but with fonts)" 494 @echo "symlinkinstall - like fullinstall, but with links instead of copying files. (Good for developing on simulator)" 495 @echo "reconf - rerun configure with the same selection" 496 497 498### general compile rules: 499 500# when source and object are in different locations (normal): 501$(BUILDDIR)/%.o: $(ROOTDIR)/%.c 502 $(SILENT)mkdir -p $(dir $@) 503 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) -c $< -o $@ 504 505$(BUILDDIR)/%.o: $(ROOTDIR)/%.S 506 $(SILENT)mkdir -p $(dir $@) 507 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) -c $< -o $@ 508 509# generated definitions for use in .S files 510$(BUILDDIR)/%_asmdefs.h: $(ROOTDIR)/%_asmdefs.c 511 $(call PRINTS,ASMDEFS $(@F)) 512 $(SILENT)mkdir -p $(dir $@) 513 $(call asmdefs2file,$<,$@) 514 515# when source and object are both in BUILDDIR (generated code): 516%.o: %.c 517 $(SILENT)mkdir -p $(dir $@) 518 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) -c $< -o $@ 519 520%.o: %.S 521 $(SILENT)mkdir -p $(dir $@) 522 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) -c $< -o $@ 523 524Makefile: $(TOOLSDIR)/configure 525ifneq (reconf,$(MAKECMDGOALS)) 526 $(SILENT)echo "*** tools/configure is newer than Makefile. You should run 'make reconf'." 527endif 528 529reconf: 530 $(SILENT$)$(TOOLSDIR)/configure $(CONFIGURE_OPTIONS)