From 45c1dab7333f3eb72eac2ea8e12a6904a3d1040e Mon Sep 17 00:00:00 2001 From: fincs Date: Wed, 9 May 2018 17:55:00 +0200 Subject: [PATCH] Add rules for building .npdm, .nsp and .kip, see details: - Now building .npdm from .json if specified - .pfs0 now embeds previously built npdm if available - .nsp accepted as an alternative file extension to .pfs0 - .kip can be built from elf and json descriptor (subset of .npdm) --- nx/switch_rules | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/nx/switch_rules b/nx/switch_rules index dd83def4..7dab8d4f 100644 --- a/nx/switch_rules +++ b/nx/switch_rules @@ -31,12 +31,33 @@ endif @echo built ... $(notdir $@) #--------------------------------------------------------------------------------- -%.pfs0: %.nso +%.npdm: $(APP_JSON) + @npdmtool $< $@ + @echo built ... $(notdir $@) + +#--------------------------------------------------------------------------------- +define make_pfs0 @mkdir -p exefs @[ -d $(BUILD_EXEFS_SRC) ] && cp -R $(BUILD_EXEFS_SRC)/* exefs || echo > /dev/null - @cp $< exefs/main + @cp $*.nso exefs/main + @[ $(APP_JSON) ] && cp $*.npdm exefs/main.npdm || echo > /dev/null @build_pfs0 exefs $@ @echo built ... $(notdir $@) +endef + +ifeq ($(strip $(APP_JSON)),) +%.pfs0: %.nso +else +%.pfs0: %.nso %.npdm +endif + $(make_pfs0) + +ifeq ($(strip $(APP_JSON)),) +%.nsp: %.nso +else +%.nsp: %.nso %.npdm +endif + $(make_pfs0) #--------------------------------------------------------------------------------- %.nso: %.elf @@ -47,6 +68,12 @@ endif %.nro: %.elf @elf2nro $< $@ $(NROFLAGS) @echo built ... $(notdir $@) + +#--------------------------------------------------------------------------------- +%.kip: %.elf + @elf2kip $< $(APP_JSON) $@ + @echo built ... $(notdir $@) + #--------------------------------------------------------------------------------- %.elf: @echo linking $(notdir $@)