From ef5297acb3d681653e9ed1869c081503d6321fdd Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sun, 8 Dec 2019 19:17:05 -0800 Subject: [PATCH] Improve buildsystem, split out generic code --- Makefile | 10 ++++++ config/arch/arm64/arch.mk | 11 ++++++ config/board/nintendo/switch/board.mk | 5 +++ config/common.mk | 26 ++++++++++++++ libstratosphere/Makefile | 34 ++++++++----------- libstratosphere/include/stratosphere.hpp | 4 +-- .../include/stratosphere/ams/ams_types.hpp | 2 +- .../include/stratosphere/boot2/boot2_api.hpp | 2 +- .../stratosphere/dd/dd_io_mappings.hpp | 2 +- .../stratosphere/dd/dd_process_handle.hpp | 2 +- .../stratosphere/fatal/fatal_types.hpp | 2 +- .../include/stratosphere/fs/fs_common.hpp | 2 +- .../include/stratosphere/hos/hos_types.hpp | 2 +- .../stratosphere/kvdb/kvdb_auto_buffer.hpp | 2 +- .../stratosphere/kvdb/kvdb_bounded_string.hpp | 2 +- .../include/stratosphere/ldr/ldr_types.hpp | 2 +- .../include/stratosphere/map/map_types.hpp | 2 +- .../include/stratosphere/ncm/ncm_types.hpp | 2 +- .../stratosphere/os/os_common_types.hpp | 2 +- .../stratosphere/os/os_memory_common.hpp | 2 +- libstratosphere/include/stratosphere/reg.hpp | 2 +- .../include/stratosphere/rnd/rnd_api.hpp | 2 +- .../include/stratosphere/ro/ro_types.hpp | 2 +- .../settings/settings_fwdbg_api.hpp | 2 +- .../settings/settings_fwdbg_types.hpp | 2 +- .../stratosphere/settings/settings_types.hpp | 2 +- .../include/stratosphere/sf/sf_common.hpp | 2 +- .../include/stratosphere/sm/sm_types.hpp | 2 +- .../include/stratosphere/spl/spl_types.hpp | 2 +- .../stratosphere/updater/updater_types.hpp | 2 +- .../common.hpp => stratosphere/util.hpp} | 8 ++--- .../util/util_compression.hpp | 2 +- .../util/util_ini.hpp | 2 +- .../include/freebsd/sys/tree.h | 0 libvapours/include/vapours.hpp | 23 +++++++++++++ .../include/vapours}/defines.hpp | 2 +- .../include/vapours/includes.hpp | 22 ++++++++++-- .../include/vapours}/results.hpp | 0 .../include/vapours}/results/cal_results.hpp | 0 .../vapours}/results/creport_results.hpp | 0 .../vapours}/results/debug_results.hpp | 0 .../include/vapours}/results/dmnt_results.hpp | 0 .../include/vapours}/results/err_results.hpp | 0 .../vapours}/results/exosphere_results.hpp | 0 .../vapours}/results/fatal_results.hpp | 0 .../include/vapours}/results/fs_results.hpp | 0 .../include/vapours}/results/hipc_results.hpp | 0 .../include/vapours}/results/i2c_results.hpp | 0 .../include/vapours}/results/kvdb_results.hpp | 0 .../vapours}/results/loader_results.hpp | 0 .../include/vapours}/results/lr_results.hpp | 0 .../include/vapours}/results/ncm_results.hpp | 0 .../include/vapours}/results/os_results.hpp | 0 .../include/vapours}/results/pm_results.hpp | 0 .../vapours}/results/results_common.hpp | 0 .../include/vapours}/results/ro_results.hpp | 0 .../vapours}/results/settings_results.hpp | 0 .../include/vapours}/results/sf_results.hpp | 0 .../include/vapours}/results/sm_results.hpp | 0 .../include/vapours}/results/spl_results.hpp | 0 .../include/vapours}/results/svc_results.hpp | 0 .../vapours}/results/updater_results.hpp | 0 .../include/vapours}/results/vi_results.hpp | 0 .../include/vapours}/svc.hpp | 0 .../include/vapours}/svc/svc_types.hpp | 0 .../include/vapours}/util.hpp | 2 -- .../include/vapours}/util/util_alignment.hpp | 0 .../vapours}/util/util_intrusive_list.hpp | 0 .../util/util_intrusive_red_black_tree.hpp | 0 .../vapours}/util/util_parent_of_member.hpp | 0 .../vapours}/util/util_scope_guard.hpp | 0 .../include/vapours}/util/util_size.hpp | 0 .../vapours}/util/util_typed_storage.hpp | 0 73 files changed, 141 insertions(+), 58 deletions(-) create mode 100644 Makefile create mode 100644 config/arch/arm64/arch.mk create mode 100644 config/board/nintendo/switch/board.mk create mode 100644 config/common.mk rename libstratosphere/include/{atmosphere/common.hpp => stratosphere/util.hpp} (85%) rename libstratosphere/include/{atmosphere => stratosphere}/util/util_compression.hpp (97%) rename libstratosphere/include/{atmosphere => stratosphere}/util/util_ini.hpp (97%) rename {libstratosphere => libvapours}/include/freebsd/sys/tree.h (100%) create mode 100644 libvapours/include/vapours.hpp rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/defines.hpp (97%) rename libstratosphere/include/atmosphere/common_includes.hpp => libvapours/include/vapours/includes.hpp (82%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/cal_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/creport_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/debug_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/dmnt_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/err_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/exosphere_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/fatal_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/fs_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/hipc_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/i2c_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/kvdb_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/loader_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/lr_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/ncm_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/os_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/pm_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/results_common.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/ro_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/settings_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/sf_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/sm_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/spl_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/svc_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/updater_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/results/vi_results.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/svc.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/svc/svc_types.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/util.hpp (93%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/util/util_alignment.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/util/util_intrusive_list.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/util/util_intrusive_red_black_tree.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/util/util_parent_of_member.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/util/util_scope_guard.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/util/util_size.hpp (100%) rename {libstratosphere/include/atmosphere => libvapours/include/vapours}/util/util_typed_storage.hpp (100%) diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..05253b1d --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +ATMOSPHERE_LIBRARIES := libstratosphere + +TOPTARGETS := all clean + +$(TOPTARGETS): $(ATMOSPHERE_LIBRARIES) + +$(ATMOSPHERE_LIBRARIES): + $(MAKE) -C $@ $(MAKECMDGOALS) + +.PHONY: $(TOPTARGETS) $(ATMOSPHERE_LIBRARIES) \ No newline at end of file diff --git a/config/arch/arm64/arch.mk b/config/arch/arm64/arch.mk new file mode 100644 index 00000000..191b2fe9 --- /dev/null +++ b/config/arch/arm64/arch.mk @@ -0,0 +1,11 @@ +ifeq ($(strip $(DEVKITPRO)),) +$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=/devkitpro") +endif + +include $(DEVKITPRO)/devkitA64/base_rules + +export ATMOSPHERE_DEFINES += -DATMOSPHERE_ARCH_ARM64 +export ATMOSPHERE_SETTINGS += -march=armv8-a -mtp=soft +export ATMOSPHERE_CFLAGS += +export ATMOSPHERE_CXXFLAGS += +export ATMOSPHERE_ASFLAGS += diff --git a/config/board/nintendo/switch/board.mk b/config/board/nintendo/switch/board.mk new file mode 100644 index 00000000..c3d3d10e --- /dev/null +++ b/config/board/nintendo/switch/board.mk @@ -0,0 +1,5 @@ +export ATMOSPHERE_DEFINES += -DATMOSPHERE_BOARD_NINTENDO_SWITCH -D__SWITCH__ +export ATMOSPHERE_SETTINGS += -mtune=cortex-a57 +export ATMOSPHERE_CFLAGS += +export ATMOSPHERE_CXXFLAGS += +export ATMOSPHERE_ASFLAGS += \ No newline at end of file diff --git a/config/common.mk b/config/common.mk new file mode 100644 index 00000000..037b4c17 --- /dev/null +++ b/config/common.mk @@ -0,0 +1,26 @@ +#--------------------------------------------------------------------------------- +.SUFFIXES: +#--------------------------------------------------------------------------------- + +export ATMOSPHERE_CONFIG_MAKE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +export ATMOSPHERE_LIBRARY_DIR := $(ATMOSPHERE_CONFIG_MAKE_DIR)/.. + +ifeq ($(strip $(ATMOSPHERE_BOARD)),) +export ATMOSPHERE_BOARD := nx-hac-001 +endif + +export ATMOSPHERE_DEFINES := -DATMOSPHERE +export ATMOSPHERE_SETTINGS := -fPIE -g +export ATMOSPHERE_CFLAGS := -Wall -ffunction-sections -fdata-sections -fno-strict-aliasing -fwrapv \ + -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-stack-protector +export ATMOSPHERE_CXXFLAGS := -fno-rtti -fno-exceptions -std=gnu++17 +export ATMOSPHERE_ASFLAGS := + + +ifeq ($(ATMOSPHERE_BOARD),nx-hac-001) +export ATMOSPHERE_ARCH_MAKE_DIR := $(ATMOSPHERE_CONFIG_MAKE_DIR)/arch/arm64 +export ATMOSPHERE_BOARD_MAKE_DIR := $(ATMOSPHERE_CONFIG_MAKE_DIR)/board/nintendo/switch +endif + +include $(ATMOSPHERE_ARCH_MAKE_DIR)/arch.mk +include $(ATMOSPHERE_BOARD_MAKE_DIR)/board.mk diff --git a/libstratosphere/Makefile b/libstratosphere/Makefile index 08d494fe..7efd98a9 100644 --- a/libstratosphere/Makefile +++ b/libstratosphere/Makefile @@ -1,12 +1,15 @@ #--------------------------------------------------------------------------------- -.SUFFIXES: +# pull in common atmosphere configuration #--------------------------------------------------------------------------------- +include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../config/common.mk +#--------------------------------------------------------------------------------- +# pull in switch rules +#--------------------------------------------------------------------------------- ifeq ($(strip $(DEVKITPRO)),) $(error "Please set DEVKITPRO in your environment. export DEVKITPRO=/devkitpro") endif -TOPDIR ?= $(CURDIR) include $(DEVKITPRO)/libnx/switch_rules #--------------------------------------------------------------------------------- @@ -16,34 +19,28 @@ include $(DEVKITPRO)/libnx/switch_rules # INCLUDES is a list of directories containing header files #--------------------------------------------------------------------------------- TARGET := $(notdir $(CURDIR)) -SOURCES ?= $(shell find source -type d) DATA := data INCLUDES := include - -DEFINES := +SOURCES ?= $(shell find source -type d) #--------------------------------------------------------------------------------- # options for code generation #--------------------------------------------------------------------------------- -ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE +DEFINES := $(ATMOSPHERE_DEFINES) -DATMOSPHERE_IS_STRATOSPHERE +SETTINGS := $(ATMOSPHERE_SETTINGS) -O2 +CFLAGS := $(ATMOSPHERE_CFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE) +CXXFLAGS := $(CFLAGS) $(ATMOSPHERE_CXXFLAGS) -flto +ASFLAGS := $(ATMOSPHERE_ASFLAGS) $(SETTINGS) -CFLAGS := -g -Wall -O2 -ffunction-sections \ - $(ARCH) $(DEFINES) +LDFLAGS := -specs=$(DEVKITPRO)/libnx/switch.specs $(SETTINGS) -Wl,-Map,$(notdir $.map) -CFLAGS += $(INCLUDE) -D__SWITCH__ - -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17 -flto - -ASFLAGS := -g $(ARCH) -LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -LIBS := -lnx +LIBS := -lnx #--------------------------------------------------------------------------------- # list of directories containing libraries, this must be the top level containing # include and lib #--------------------------------------------------------------------------------- -LIBDIRS := $(PORTLIBS) $(LIBNX) +LIBDIRS := $(PORTLIBS) $(LIBNX) $(ATMOSPHERE_LIBRARY_DIR)/libvapours #--------------------------------------------------------------------------------- # no real need to edit anything past this point unless you need to add additional @@ -81,8 +78,7 @@ export HFILES := $(addsuffix .h,$(subst .,_,$(BINFILES))) export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ - -I. \ - -iquote $(CURDIR)/include/switch/ + -I. .PHONY: clean all diff --git a/libstratosphere/include/stratosphere.hpp b/libstratosphere/include/stratosphere.hpp index a432ace7..f510abd1 100644 --- a/libstratosphere/include/stratosphere.hpp +++ b/libstratosphere/include/stratosphere.hpp @@ -16,8 +16,8 @@ #pragma once -/* Pulls in util, svc. */ -#include "atmosphere/common.hpp" +/* libvapours (pulls in util, svc, results). */ +#include /* Critical modules with no dependencies. */ #include "stratosphere/ams.hpp" diff --git a/libstratosphere/include/stratosphere/ams/ams_types.hpp b/libstratosphere/include/stratosphere/ams/ams_types.hpp index 75e7adfe..22b170e1 100644 --- a/libstratosphere/include/stratosphere/ams/ams_types.hpp +++ b/libstratosphere/include/stratosphere/ams/ams_types.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include #include "../sf/sf_buffer_tags.hpp" #include "../hos.hpp" diff --git a/libstratosphere/include/stratosphere/boot2/boot2_api.hpp b/libstratosphere/include/stratosphere/boot2/boot2_api.hpp index f2392586..21e77725 100644 --- a/libstratosphere/include/stratosphere/boot2/boot2_api.hpp +++ b/libstratosphere/include/stratosphere/boot2/boot2_api.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include namespace ams::boot2 { diff --git a/libstratosphere/include/stratosphere/dd/dd_io_mappings.hpp b/libstratosphere/include/stratosphere/dd/dd_io_mappings.hpp index 22f3db41..e2d79dd1 100644 --- a/libstratosphere/include/stratosphere/dd/dd_io_mappings.hpp +++ b/libstratosphere/include/stratosphere/dd/dd_io_mappings.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include namespace ams::dd { diff --git a/libstratosphere/include/stratosphere/dd/dd_process_handle.hpp b/libstratosphere/include/stratosphere/dd/dd_process_handle.hpp index a3e7f8c0..8fa37ca6 100644 --- a/libstratosphere/include/stratosphere/dd/dd_process_handle.hpp +++ b/libstratosphere/include/stratosphere/dd/dd_process_handle.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include namespace ams::dd { diff --git a/libstratosphere/include/stratosphere/fatal/fatal_types.hpp b/libstratosphere/include/stratosphere/fatal/fatal_types.hpp index cec496a7..d0740194 100644 --- a/libstratosphere/include/stratosphere/fatal/fatal_types.hpp +++ b/libstratosphere/include/stratosphere/fatal/fatal_types.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include #include "../ncm/ncm_types.hpp" #include "../sf/sf_buffer_tags.hpp" diff --git a/libstratosphere/include/stratosphere/fs/fs_common.hpp b/libstratosphere/include/stratosphere/fs/fs_common.hpp index 7e0eaa65..6869939a 100644 --- a/libstratosphere/include/stratosphere/fs/fs_common.hpp +++ b/libstratosphere/include/stratosphere/fs/fs_common.hpp @@ -14,7 +14,7 @@ * along with this program. If not, see . */ #pragma once -#include +#include #include "../os.hpp" #include "../ncm.hpp" #include "../sf.hpp" diff --git a/libstratosphere/include/stratosphere/hos/hos_types.hpp b/libstratosphere/include/stratosphere/hos/hos_types.hpp index 158310ba..4e87b80c 100644 --- a/libstratosphere/include/stratosphere/hos/hos_types.hpp +++ b/libstratosphere/include/stratosphere/hos/hos_types.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include namespace ams::hos { diff --git a/libstratosphere/include/stratosphere/kvdb/kvdb_auto_buffer.hpp b/libstratosphere/include/stratosphere/kvdb/kvdb_auto_buffer.hpp index 0950c914..e00b79d1 100644 --- a/libstratosphere/include/stratosphere/kvdb/kvdb_auto_buffer.hpp +++ b/libstratosphere/include/stratosphere/kvdb/kvdb_auto_buffer.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include namespace ams::kvdb { diff --git a/libstratosphere/include/stratosphere/kvdb/kvdb_bounded_string.hpp b/libstratosphere/include/stratosphere/kvdb/kvdb_bounded_string.hpp index 16b4b439..aefd3de1 100644 --- a/libstratosphere/include/stratosphere/kvdb/kvdb_bounded_string.hpp +++ b/libstratosphere/include/stratosphere/kvdb/kvdb_bounded_string.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include namespace ams::kvdb { diff --git a/libstratosphere/include/stratosphere/ldr/ldr_types.hpp b/libstratosphere/include/stratosphere/ldr/ldr_types.hpp index 4d7ebe23..6bad2790 100644 --- a/libstratosphere/include/stratosphere/ldr/ldr_types.hpp +++ b/libstratosphere/include/stratosphere/ldr/ldr_types.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include #include "../ncm/ncm_types.hpp" #include "../sf/sf_buffer_tags.hpp" diff --git a/libstratosphere/include/stratosphere/map/map_types.hpp b/libstratosphere/include/stratosphere/map/map_types.hpp index 41127e87..99f4a02e 100644 --- a/libstratosphere/include/stratosphere/map/map_types.hpp +++ b/libstratosphere/include/stratosphere/map/map_types.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include namespace ams::map { diff --git a/libstratosphere/include/stratosphere/ncm/ncm_types.hpp b/libstratosphere/include/stratosphere/ncm/ncm_types.hpp index b21adb94..5f8af79b 100644 --- a/libstratosphere/include/stratosphere/ncm/ncm_types.hpp +++ b/libstratosphere/include/stratosphere/ncm/ncm_types.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include namespace ams::ncm { diff --git a/libstratosphere/include/stratosphere/os/os_common_types.hpp b/libstratosphere/include/stratosphere/os/os_common_types.hpp index dc10018a..a3fba5a9 100644 --- a/libstratosphere/include/stratosphere/os/os_common_types.hpp +++ b/libstratosphere/include/stratosphere/os/os_common_types.hpp @@ -14,7 +14,7 @@ * along with this program. If not, see . */ #pragma once -#include +#include namespace ams::os { diff --git a/libstratosphere/include/stratosphere/os/os_memory_common.hpp b/libstratosphere/include/stratosphere/os/os_memory_common.hpp index d267cbb6..a7da8adf 100644 --- a/libstratosphere/include/stratosphere/os/os_memory_common.hpp +++ b/libstratosphere/include/stratosphere/os/os_memory_common.hpp @@ -14,7 +14,7 @@ * along with this program. If not, see . */ #pragma once -#include +#include namespace ams::os { diff --git a/libstratosphere/include/stratosphere/reg.hpp b/libstratosphere/include/stratosphere/reg.hpp index 001c6282..aa96d917 100644 --- a/libstratosphere/include/stratosphere/reg.hpp +++ b/libstratosphere/include/stratosphere/reg.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include namespace ams::reg { diff --git a/libstratosphere/include/stratosphere/rnd/rnd_api.hpp b/libstratosphere/include/stratosphere/rnd/rnd_api.hpp index dcea365c..bd3e1ef9 100644 --- a/libstratosphere/include/stratosphere/rnd/rnd_api.hpp +++ b/libstratosphere/include/stratosphere/rnd/rnd_api.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include namespace ams::rnd { diff --git a/libstratosphere/include/stratosphere/ro/ro_types.hpp b/libstratosphere/include/stratosphere/ro/ro_types.hpp index 4259585e..15de65d8 100644 --- a/libstratosphere/include/stratosphere/ro/ro_types.hpp +++ b/libstratosphere/include/stratosphere/ro/ro_types.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include #include "../ncm/ncm_types.hpp" namespace ams::ro { diff --git a/libstratosphere/include/stratosphere/settings/settings_fwdbg_api.hpp b/libstratosphere/include/stratosphere/settings/settings_fwdbg_api.hpp index 22f11835..aaa40bf6 100644 --- a/libstratosphere/include/stratosphere/settings/settings_fwdbg_api.hpp +++ b/libstratosphere/include/stratosphere/settings/settings_fwdbg_api.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include #include "settings_fwdbg_types.hpp" namespace ams::settings::fwdbg { diff --git a/libstratosphere/include/stratosphere/settings/settings_fwdbg_types.hpp b/libstratosphere/include/stratosphere/settings/settings_fwdbg_types.hpp index 0440d5a3..5a5c9544 100644 --- a/libstratosphere/include/stratosphere/settings/settings_fwdbg_types.hpp +++ b/libstratosphere/include/stratosphere/settings/settings_fwdbg_types.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include #include "../sf/sf_buffer_tags.hpp" namespace ams::settings::fwdbg { diff --git a/libstratosphere/include/stratosphere/settings/settings_types.hpp b/libstratosphere/include/stratosphere/settings/settings_types.hpp index 155a4ce7..f0d347ab 100644 --- a/libstratosphere/include/stratosphere/settings/settings_types.hpp +++ b/libstratosphere/include/stratosphere/settings/settings_types.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include namespace ams::settings { diff --git a/libstratosphere/include/stratosphere/sf/sf_common.hpp b/libstratosphere/include/stratosphere/sf/sf_common.hpp index 39e0edcf..7e4fc3d5 100644 --- a/libstratosphere/include/stratosphere/sf/sf_common.hpp +++ b/libstratosphere/include/stratosphere/sf/sf_common.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include #include "../ams.hpp" #include "../os.hpp" #include "../sm/sm_types.hpp" \ No newline at end of file diff --git a/libstratosphere/include/stratosphere/sm/sm_types.hpp b/libstratosphere/include/stratosphere/sm/sm_types.hpp index c3a06929..fb4cc589 100644 --- a/libstratosphere/include/stratosphere/sm/sm_types.hpp +++ b/libstratosphere/include/stratosphere/sm/sm_types.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include #include "../ncm/ncm_types.hpp" #include "../cfg/cfg_types.hpp" diff --git a/libstratosphere/include/stratosphere/spl/spl_types.hpp b/libstratosphere/include/stratosphere/spl/spl_types.hpp index 4f1816b5..b0c19605 100644 --- a/libstratosphere/include/stratosphere/spl/spl_types.hpp +++ b/libstratosphere/include/stratosphere/spl/spl_types.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include namespace ams::spl { diff --git a/libstratosphere/include/stratosphere/updater/updater_types.hpp b/libstratosphere/include/stratosphere/updater/updater_types.hpp index 4690369b..7a25e8b3 100644 --- a/libstratosphere/include/stratosphere/updater/updater_types.hpp +++ b/libstratosphere/include/stratosphere/updater/updater_types.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include +#include namespace ams::updater { diff --git a/libstratosphere/include/atmosphere/common.hpp b/libstratosphere/include/stratosphere/util.hpp similarity index 85% rename from libstratosphere/include/atmosphere/common.hpp rename to libstratosphere/include/stratosphere/util.hpp index 6a87be4f..93e0633c 100644 --- a/libstratosphere/include/atmosphere/common.hpp +++ b/libstratosphere/include/stratosphere/util.hpp @@ -15,8 +15,6 @@ */ #pragma once -#include "common_includes.hpp" -#include "defines.hpp" -#include "util.hpp" -#include "results.hpp" -#include "svc.hpp" + +#include "util/util_compression.hpp" +#include "util/util_ini.hpp" diff --git a/libstratosphere/include/atmosphere/util/util_compression.hpp b/libstratosphere/include/stratosphere/util/util_compression.hpp similarity index 97% rename from libstratosphere/include/atmosphere/util/util_compression.hpp rename to libstratosphere/include/stratosphere/util/util_compression.hpp index 3f310ae8..91ba077f 100644 --- a/libstratosphere/include/atmosphere/util/util_compression.hpp +++ b/libstratosphere/include/stratosphere/util/util_compression.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include "../defines.hpp" +#include namespace ams::util { diff --git a/libstratosphere/include/atmosphere/util/util_ini.hpp b/libstratosphere/include/stratosphere/util/util_ini.hpp similarity index 97% rename from libstratosphere/include/atmosphere/util/util_ini.hpp rename to libstratosphere/include/stratosphere/util/util_ini.hpp index 7815820b..ea8f084b 100644 --- a/libstratosphere/include/atmosphere/util/util_ini.hpp +++ b/libstratosphere/include/stratosphere/util/util_ini.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include "../defines.hpp" +#include namespace ams::util::ini { diff --git a/libstratosphere/include/freebsd/sys/tree.h b/libvapours/include/freebsd/sys/tree.h similarity index 100% rename from libstratosphere/include/freebsd/sys/tree.h rename to libvapours/include/freebsd/sys/tree.h diff --git a/libvapours/include/vapours.hpp b/libvapours/include/vapours.hpp new file mode 100644 index 00000000..73bb5b27 --- /dev/null +++ b/libvapours/include/vapours.hpp @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2018-2019 Atmosphère-NX + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +#include "vapours/includes.hpp" +#include "vapours/defines.hpp" + +#include "vapours/util.hpp" +#include "vapours/results.hpp" +#include "vapours/svc.hpp" diff --git a/libstratosphere/include/atmosphere/defines.hpp b/libvapours/include/vapours/defines.hpp similarity index 97% rename from libstratosphere/include/atmosphere/defines.hpp rename to libvapours/include/vapours/defines.hpp index a20d4c76..81e98643 100644 --- a/libstratosphere/include/atmosphere/defines.hpp +++ b/libvapours/include/vapours/defines.hpp @@ -15,7 +15,7 @@ */ #pragma once -#include "common_includes.hpp" +#include "includes.hpp" /* Any broadly useful language defines should go here. */ diff --git a/libstratosphere/include/atmosphere/common_includes.hpp b/libvapours/include/vapours/includes.hpp similarity index 82% rename from libstratosphere/include/atmosphere/common_includes.hpp rename to libvapours/include/vapours/includes.hpp index 82887c8a..80e97a19 100644 --- a/libstratosphere/include/atmosphere/common_includes.hpp +++ b/libvapours/include/vapours/includes.hpp @@ -26,17 +26,23 @@ #include #include -/* C++ headers. */ + #include +#include +#include #include +#include + +/* Stratosphere wants stdlib headers, others do not.. */ +#ifdef ATMOSPHERE_IS_STRATOSPHERE + +/* C++ headers. */ #include #include -#include #include #include #include #include -#include #include #include #include @@ -44,9 +50,19 @@ #include #include +#endif /* ATMOSPHERE_IS_STRATOSPHERE */ + +#ifdef ATMOSPHERE_BOARD_NINTENDO_SWITCH + /* Libnx. */ #include +#else + +#error "Unsupported board" + +#endif /* ATMOSPHERE_BOARD_NINTENDO_SWITCH */ + /* Atmosphere meta. */ #if __has_include() #include diff --git a/libstratosphere/include/atmosphere/results.hpp b/libvapours/include/vapours/results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results.hpp rename to libvapours/include/vapours/results.hpp diff --git a/libstratosphere/include/atmosphere/results/cal_results.hpp b/libvapours/include/vapours/results/cal_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/cal_results.hpp rename to libvapours/include/vapours/results/cal_results.hpp diff --git a/libstratosphere/include/atmosphere/results/creport_results.hpp b/libvapours/include/vapours/results/creport_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/creport_results.hpp rename to libvapours/include/vapours/results/creport_results.hpp diff --git a/libstratosphere/include/atmosphere/results/debug_results.hpp b/libvapours/include/vapours/results/debug_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/debug_results.hpp rename to libvapours/include/vapours/results/debug_results.hpp diff --git a/libstratosphere/include/atmosphere/results/dmnt_results.hpp b/libvapours/include/vapours/results/dmnt_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/dmnt_results.hpp rename to libvapours/include/vapours/results/dmnt_results.hpp diff --git a/libstratosphere/include/atmosphere/results/err_results.hpp b/libvapours/include/vapours/results/err_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/err_results.hpp rename to libvapours/include/vapours/results/err_results.hpp diff --git a/libstratosphere/include/atmosphere/results/exosphere_results.hpp b/libvapours/include/vapours/results/exosphere_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/exosphere_results.hpp rename to libvapours/include/vapours/results/exosphere_results.hpp diff --git a/libstratosphere/include/atmosphere/results/fatal_results.hpp b/libvapours/include/vapours/results/fatal_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/fatal_results.hpp rename to libvapours/include/vapours/results/fatal_results.hpp diff --git a/libstratosphere/include/atmosphere/results/fs_results.hpp b/libvapours/include/vapours/results/fs_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/fs_results.hpp rename to libvapours/include/vapours/results/fs_results.hpp diff --git a/libstratosphere/include/atmosphere/results/hipc_results.hpp b/libvapours/include/vapours/results/hipc_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/hipc_results.hpp rename to libvapours/include/vapours/results/hipc_results.hpp diff --git a/libstratosphere/include/atmosphere/results/i2c_results.hpp b/libvapours/include/vapours/results/i2c_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/i2c_results.hpp rename to libvapours/include/vapours/results/i2c_results.hpp diff --git a/libstratosphere/include/atmosphere/results/kvdb_results.hpp b/libvapours/include/vapours/results/kvdb_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/kvdb_results.hpp rename to libvapours/include/vapours/results/kvdb_results.hpp diff --git a/libstratosphere/include/atmosphere/results/loader_results.hpp b/libvapours/include/vapours/results/loader_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/loader_results.hpp rename to libvapours/include/vapours/results/loader_results.hpp diff --git a/libstratosphere/include/atmosphere/results/lr_results.hpp b/libvapours/include/vapours/results/lr_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/lr_results.hpp rename to libvapours/include/vapours/results/lr_results.hpp diff --git a/libstratosphere/include/atmosphere/results/ncm_results.hpp b/libvapours/include/vapours/results/ncm_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/ncm_results.hpp rename to libvapours/include/vapours/results/ncm_results.hpp diff --git a/libstratosphere/include/atmosphere/results/os_results.hpp b/libvapours/include/vapours/results/os_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/os_results.hpp rename to libvapours/include/vapours/results/os_results.hpp diff --git a/libstratosphere/include/atmosphere/results/pm_results.hpp b/libvapours/include/vapours/results/pm_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/pm_results.hpp rename to libvapours/include/vapours/results/pm_results.hpp diff --git a/libstratosphere/include/atmosphere/results/results_common.hpp b/libvapours/include/vapours/results/results_common.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/results_common.hpp rename to libvapours/include/vapours/results/results_common.hpp diff --git a/libstratosphere/include/atmosphere/results/ro_results.hpp b/libvapours/include/vapours/results/ro_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/ro_results.hpp rename to libvapours/include/vapours/results/ro_results.hpp diff --git a/libstratosphere/include/atmosphere/results/settings_results.hpp b/libvapours/include/vapours/results/settings_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/settings_results.hpp rename to libvapours/include/vapours/results/settings_results.hpp diff --git a/libstratosphere/include/atmosphere/results/sf_results.hpp b/libvapours/include/vapours/results/sf_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/sf_results.hpp rename to libvapours/include/vapours/results/sf_results.hpp diff --git a/libstratosphere/include/atmosphere/results/sm_results.hpp b/libvapours/include/vapours/results/sm_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/sm_results.hpp rename to libvapours/include/vapours/results/sm_results.hpp diff --git a/libstratosphere/include/atmosphere/results/spl_results.hpp b/libvapours/include/vapours/results/spl_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/spl_results.hpp rename to libvapours/include/vapours/results/spl_results.hpp diff --git a/libstratosphere/include/atmosphere/results/svc_results.hpp b/libvapours/include/vapours/results/svc_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/svc_results.hpp rename to libvapours/include/vapours/results/svc_results.hpp diff --git a/libstratosphere/include/atmosphere/results/updater_results.hpp b/libvapours/include/vapours/results/updater_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/updater_results.hpp rename to libvapours/include/vapours/results/updater_results.hpp diff --git a/libstratosphere/include/atmosphere/results/vi_results.hpp b/libvapours/include/vapours/results/vi_results.hpp similarity index 100% rename from libstratosphere/include/atmosphere/results/vi_results.hpp rename to libvapours/include/vapours/results/vi_results.hpp diff --git a/libstratosphere/include/atmosphere/svc.hpp b/libvapours/include/vapours/svc.hpp similarity index 100% rename from libstratosphere/include/atmosphere/svc.hpp rename to libvapours/include/vapours/svc.hpp diff --git a/libstratosphere/include/atmosphere/svc/svc_types.hpp b/libvapours/include/vapours/svc/svc_types.hpp similarity index 100% rename from libstratosphere/include/atmosphere/svc/svc_types.hpp rename to libvapours/include/vapours/svc/svc_types.hpp diff --git a/libstratosphere/include/atmosphere/util.hpp b/libvapours/include/vapours/util.hpp similarity index 93% rename from libstratosphere/include/atmosphere/util.hpp rename to libvapours/include/vapours/util.hpp index c0583621..28cea78c 100644 --- a/libstratosphere/include/atmosphere/util.hpp +++ b/libvapours/include/vapours/util.hpp @@ -23,5 +23,3 @@ #include "util/util_typed_storage.hpp" #include "util/util_intrusive_list.hpp" #include "util/util_intrusive_red_black_tree.hpp" -#include "util/util_compression.hpp" -#include "util/util_ini.hpp" diff --git a/libstratosphere/include/atmosphere/util/util_alignment.hpp b/libvapours/include/vapours/util/util_alignment.hpp similarity index 100% rename from libstratosphere/include/atmosphere/util/util_alignment.hpp rename to libvapours/include/vapours/util/util_alignment.hpp diff --git a/libstratosphere/include/atmosphere/util/util_intrusive_list.hpp b/libvapours/include/vapours/util/util_intrusive_list.hpp similarity index 100% rename from libstratosphere/include/atmosphere/util/util_intrusive_list.hpp rename to libvapours/include/vapours/util/util_intrusive_list.hpp diff --git a/libstratosphere/include/atmosphere/util/util_intrusive_red_black_tree.hpp b/libvapours/include/vapours/util/util_intrusive_red_black_tree.hpp similarity index 100% rename from libstratosphere/include/atmosphere/util/util_intrusive_red_black_tree.hpp rename to libvapours/include/vapours/util/util_intrusive_red_black_tree.hpp diff --git a/libstratosphere/include/atmosphere/util/util_parent_of_member.hpp b/libvapours/include/vapours/util/util_parent_of_member.hpp similarity index 100% rename from libstratosphere/include/atmosphere/util/util_parent_of_member.hpp rename to libvapours/include/vapours/util/util_parent_of_member.hpp diff --git a/libstratosphere/include/atmosphere/util/util_scope_guard.hpp b/libvapours/include/vapours/util/util_scope_guard.hpp similarity index 100% rename from libstratosphere/include/atmosphere/util/util_scope_guard.hpp rename to libvapours/include/vapours/util/util_scope_guard.hpp diff --git a/libstratosphere/include/atmosphere/util/util_size.hpp b/libvapours/include/vapours/util/util_size.hpp similarity index 100% rename from libstratosphere/include/atmosphere/util/util_size.hpp rename to libvapours/include/vapours/util/util_size.hpp diff --git a/libstratosphere/include/atmosphere/util/util_typed_storage.hpp b/libvapours/include/vapours/util/util_typed_storage.hpp similarity index 100% rename from libstratosphere/include/atmosphere/util/util_typed_storage.hpp rename to libvapours/include/vapours/util/util_typed_storage.hpp