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)
This commit is contained in:
fincs 2018-05-09 17:55:00 +02:00
parent adad6f1c0c
commit 45c1dab733

View File

@ -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 $@)