make: allow building flat binary plugins on USE_ELF targets

From what I can see the Creative Zen Vision ports, which
were the only ones to set USE_ELF prior to the Echo R1 port,
do not work except for a bootloader and never even got to
the point of booting Rockbox. This explains why they build
codecs and plugins as ELF binaries, yet there is no code to
load ELF format codecs or plugins.

Anyhow, add a new setting, PLUGIN_USE_ELF, which controls
whether plugins & codecs are left as ELF or converted to
flat binaries. This makes it possible for the Echo R1 to
use the flat binary .rock format, and makes it possible to
have ELF plugins/codecs on targets with non-ELF main binaries.

Seeing as nothing needs ELF plugins/codecs right now, the
new default is to generate them as flat binaries unless
the target requests otherwise.

Change-Id: I9ffae669978de5cc7ad214cd50d97ad6e8938394
This commit is contained in:
Aidan MacDonald 2026-02-04 10:49:09 +00:00 committed by Solomon Peachy
parent 0484b46165
commit 91ec6f1e1e
13 changed files with 20 additions and 13 deletions

View file

@ -169,7 +169,7 @@ $(BUILDDIR)/%.rock:
$(filter %.o, $^) \
$(filter %.a, $+) \
-lgcc $(PLUGINLDFLAGS)
$(SILENT)$(call objcopy,$(BUILDDIR)/$*.elf,$@)
$(SILENT)$(call objcopy_plugin,$(BUILDDIR)/$*.elf,$@)
$(BUILDDIR)/apps/plugins/%.lua: $(ROOTDIR)/apps/plugins/%.lua
$(call PRINTS,CP $(subst $(ROOTDIR)/,,$<))cp $< $(BUILDDIR)/apps/plugins/