make: allow building flat binary plugins on USE_ELF targets (attempt 2)

Looks like I forgot to test the hosted builds and for some
reason thought that make would expand objcopy recursively...

Change-Id: I61264eadcb1235660566f6a9f19f8718ebe14583
This commit is contained in:
Aidan MacDonald 2026-02-04 15:06:58 +00:00
parent ebd273832d
commit 653bca7ff4
13 changed files with 20 additions and 13 deletions

View file

@ -38,15 +38,20 @@ a2lnk = $(patsubst lib%.a,-l%,$(notdir $(1)))
# handles the $(1) == $(2) case too
ifndef APP_TYPE
objcopy = $(OC) $(if $(filter yes, $(USE_ELF)), -S -x, -O binary) $(1) $(2) # objcopy native
objcopy_plugin = $(OC) $(if $(filter yes, $(PLUGIN_USE_ELF)), -S -x, -O binary) $(1) $(2)
else ifneq (,$(findstring sdl-sim,$(APP_TYPE)))
objcopy = cp $(1) $(1).tmp;mv -f $(1).tmp $(2) # objcopy simulator
objcopy_plugin = $(objcopy)
else ifneq (,$(findstring ctru,$(MODELNAME))) # 3dsxtool requires symbols
objcopy = cp $(1) $(1).tmp;mv -f $(1).tmp $(2)
objcopy_plugin = $(objcopy)
else
ifdef DEBUG
objcopy = cp $(1) $(1).tmp;mv -f $(1).tmp $(2) # objcopy hosted (DEBUG)
objcopy_plugin = $(objcopy)
else
objcopy = $(OC) -S -x $(1) $(2) # objcopy hosted (!DEBUG)
objcopy_plugin = $(objcopy)
endif
endif