From 6efe91b0832c3823011131bedeba2f848b0828fc Mon Sep 17 00:00:00 2001 From: TuxSH Date: Tue, 15 May 2018 19:38:04 +0200 Subject: [PATCH] boot: build as KIP (thanks @fincs !) --- stratosphere/boot/Makefile | 57 +++++-------------- .../boot/{boot_1.0.0.json => boot_100.json} | 0 .../boot/{boot_2.0.0.json => boot_200.json} | 0 3 files changed, 15 insertions(+), 42 deletions(-) rename stratosphere/boot/{boot_1.0.0.json => boot_100.json} (100%) rename stratosphere/boot/{boot_2.0.0.json => boot_200.json} (100%) diff --git a/stratosphere/boot/Makefile b/stratosphere/boot/Makefile index 74ee33781..b4ff11df6 100644 --- a/stratosphere/boot/Makefile +++ b/stratosphere/boot/Makefile @@ -16,18 +16,6 @@ include $(DEVKITPRO)/libnx/switch_rules # DATA is a list of directories containing data files # INCLUDES is a list of directories containing header files # EXEFS_SRC is the optional input directory containing data copied into exefs, if anything this normally should only contain "main.npdm". -# -# NO_ICON: if set to anything, do not use icon. -# NO_NACP: if set to anything, no .nacp file is generated. -# APP_TITLE is the name of the app stored in the .nacp file (Optional) -# APP_AUTHOR is the author of the app stored in the .nacp file (Optional) -# APP_VERSION is the version of the app stored in the .nacp file (Optional) -# APP_TITLEID is the titleID of the app stored in the .nacp file (Optional) -# ICON is the filename of the icon (.jpg), relative to the project folder. -# If not set, it attempts to use one of the following (in this order): -# - .jpg -# - icon.jpg -# - /default_icon.jpg #--------------------------------------------------------------------------------- TARGET := $(notdir $(CURDIR)) BUILD := build @@ -107,29 +95,17 @@ export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) export BUILD_EXEFS_SRC := $(TOPDIR)/$(EXEFS_SRC) -ifeq ($(strip $(ICON)),) - icons := $(wildcard *.jpg) - ifneq (,$(findstring $(TARGET).jpg,$(icons))) - export APP_ICON := $(TOPDIR)/$(TARGET).jpg +ifeq ($(strip $(CONFIG_JSON)),) + jsons := $(wildcard *.json) + ifneq (,$(findstring $(TARGET).json,$(jsons))) + export APP_JSON := $(TOPDIR)/$(TARGET).json else - ifneq (,$(findstring icon.jpg,$(icons))) - export APP_ICON := $(TOPDIR)/icon.jpg + ifneq (,$(findstring config.json,$(jsons))) + export APP_JSON := $(TOPDIR)/config.json endif endif else - export APP_ICON := $(TOPDIR)/$(ICON) -endif - -ifeq ($(strip $(NO_ICON)),) - export NROFLAGS += --icon=$(APP_ICON) -endif - -ifeq ($(strip $(NO_NACP)),) - export NROFLAGS += --nacp=$(CURDIR)/$(TARGET).nacp -endif - -ifneq ($(APP_TITLEID),) - export NACPFLAGS += --titleid=$(APP_TITLEID) + export APP_JSON := $(TOPDIR)/$(CONFIG_JSON) endif .PHONY: $(BUILD) clean all @@ -144,7 +120,7 @@ $(BUILD): #--------------------------------------------------------------------------------- clean: @echo clean ... - @rm -fr $(BUILD) $(TARGET).pfs0 $(TARGET).nso $(TARGET).nro $(TARGET).nacp $(TARGET).elf + @rm -fr $(BUILD) $(TARGET)_100.kip $(TARGET)_100.elf $(TARGET)_200.kip $(TARGET)_200.elf #--------------------------------------------------------------------------------- @@ -156,19 +132,16 @@ DEPENDS := $(OFILES:.o=.d) #--------------------------------------------------------------------------------- # main targets #--------------------------------------------------------------------------------- -all : $(OUTPUT).pfs0 $(OUTPUT).nro +all : $(OUTPUT)_100.kip $(OUTPUT)_200.kip -$(OUTPUT).pfs0 : $(OUTPUT).nso +$(OUTPUT)_100.kip : $(OUTPUT)_100.elf +$(OUTPUT)_200.kip : $(OUTPUT)_200.elf -$(OUTPUT).nso : $(OUTPUT).elf +$(OUTPUT)_100.kip : APP_JSON = $(TOPDIR)/boot_100.json +$(OUTPUT)_200.kip : APP_JSON = $(TOPDIR)/boot_200.json -ifeq ($(strip $(NO_NACP)),) -$(OUTPUT).nro : $(OUTPUT).elf $(OUTPUT).nacp -else -$(OUTPUT).nro : $(OUTPUT).elf -endif - -$(OUTPUT).elf : $(OFILES) +$(OUTPUT)_100.elf : $(OFILES) +$(OUTPUT)_200.elf : $(OFILES) #--------------------------------------------------------------------------------- # you need a rule like this for each extension you use as binary data diff --git a/stratosphere/boot/boot_1.0.0.json b/stratosphere/boot/boot_100.json similarity index 100% rename from stratosphere/boot/boot_1.0.0.json rename to stratosphere/boot/boot_100.json diff --git a/stratosphere/boot/boot_2.0.0.json b/stratosphere/boot/boot_200.json similarity index 100% rename from stratosphere/boot/boot_2.0.0.json rename to stratosphere/boot/boot_200.json