From 4e12d55993d9e8a45148290272b5a4769db5b29d Mon Sep 17 00:00:00 2001 From: TuxSH Date: Tue, 15 May 2018 02:28:41 +0200 Subject: [PATCH] loader, pm, sm: build kip as only taget (thanks @fincs !) --- .gitignore | 1 + stratosphere/loader/Makefile | 52 +++++++----------------------------- stratosphere/pm/Makefile | 52 +++++++----------------------------- stratosphere/sm/Makefile | 52 +++++++----------------------------- 4 files changed, 31 insertions(+), 126 deletions(-) diff --git a/.gitignore b/.gitignore index 445b799b9..8a9d5ee58 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,7 @@ *.nro *.nacp *.pfs0 +*.kip # Debug files *.dSYM/ diff --git a/stratosphere/loader/Makefile b/stratosphere/loader/Makefile index 74ee33781..41a6cf79f 100644 --- a/stratosphere/loader/Makefile +++ b/stratosphere/loader/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).kip $(TARGET).elf #--------------------------------------------------------------------------------- @@ -156,17 +132,9 @@ DEPENDS := $(OFILES:.o=.d) #--------------------------------------------------------------------------------- # main targets #--------------------------------------------------------------------------------- -all : $(OUTPUT).pfs0 $(OUTPUT).nro +all : $(OUTPUT).kip -$(OUTPUT).pfs0 : $(OUTPUT).nso - -$(OUTPUT).nso : $(OUTPUT).elf - -ifeq ($(strip $(NO_NACP)),) -$(OUTPUT).nro : $(OUTPUT).elf $(OUTPUT).nacp -else -$(OUTPUT).nro : $(OUTPUT).elf -endif +$(OUTPUT).kip : $(OUTPUT).elf $(OUTPUT).elf : $(OFILES) diff --git a/stratosphere/pm/Makefile b/stratosphere/pm/Makefile index 091a82e19..c819c77fd 100644 --- a/stratosphere/pm/Makefile +++ b/stratosphere/pm/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).kip $(TARGET).elf #--------------------------------------------------------------------------------- @@ -156,17 +132,9 @@ DEPENDS := $(OFILES:.o=.d) #--------------------------------------------------------------------------------- # main targets #--------------------------------------------------------------------------------- -all : $(OUTPUT).pfs0 $(OUTPUT).nro +all : $(OUTPUT).kip -$(OUTPUT).pfs0 : $(OUTPUT).nso - -$(OUTPUT).nso : $(OUTPUT).elf - -ifeq ($(strip $(NO_NACP)),) -$(OUTPUT).nro : $(OUTPUT).elf $(OUTPUT).nacp -else -$(OUTPUT).nro : $(OUTPUT).elf -endif +$(OUTPUT).kip : $(OUTPUT).elf $(OUTPUT).elf : $(OFILES) diff --git a/stratosphere/sm/Makefile b/stratosphere/sm/Makefile index 091a82e19..c819c77fd 100644 --- a/stratosphere/sm/Makefile +++ b/stratosphere/sm/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).kip $(TARGET).elf #--------------------------------------------------------------------------------- @@ -156,17 +132,9 @@ DEPENDS := $(OFILES:.o=.d) #--------------------------------------------------------------------------------- # main targets #--------------------------------------------------------------------------------- -all : $(OUTPUT).pfs0 $(OUTPUT).nro +all : $(OUTPUT).kip -$(OUTPUT).pfs0 : $(OUTPUT).nso - -$(OUTPUT).nso : $(OUTPUT).elf - -ifeq ($(strip $(NO_NACP)),) -$(OUTPUT).nro : $(OUTPUT).elf $(OUTPUT).nacp -else -$(OUTPUT).nro : $(OUTPUT).elf -endif +$(OUTPUT).kip : $(OUTPUT).elf $(OUTPUT).elf : $(OFILES)