diff --git a/.gitattributes b/.gitattributes
index 96476bd0a..9b4bbb4f5 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1 +1 @@
-common/defaults/hbl_html/accessible-urls/accessible-urls.txt text eol=lf
+config_templates/hbl_html/accessible-urls/accessible-urls.txt text eol=lf
diff --git a/Makefile b/Makefile
index 5c4d7d446..37b6ed48b 100644
--- a/Makefile
+++ b/Makefile
@@ -34,13 +34,13 @@ clean:
rm -rf out
dist: all
- $(eval MAJORVER = $(shell grep '\ATMOSPHERE_RELEASE_VERSION_MAJOR\b' common/include/atmosphere/version.h \
+ $(eval MAJORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MAJOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
| tr -s [:blank:] \
| cut -d' ' -f3))
- $(eval MINORVER = $(shell grep '\ATMOSPHERE_RELEASE_VERSION_MINOR\b' common/include/atmosphere/version.h \
+ $(eval MINORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MINOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
| tr -s [:blank:] \
| cut -d' ' -f3))
- $(eval MICROVER = $(shell grep '\ATMOSPHERE_RELEASE_VERSION_MICRO\b' common/include/atmosphere/version.h \
+ $(eval MICROVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MICRO\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
| tr -s [:blank:] \
| cut -d' ' -f3))
$(eval AMSVER = $(MAJORVER).$(MINORVER).$(MICROVER)-$(AMSREV))
@@ -67,11 +67,11 @@ dist: all
cp sept/sept-secondary/sept-secondary.bin atmosphere-$(AMSVER)/sept/sept-secondary.bin
cp sept/sept-secondary/sept-secondary_00.enc atmosphere-$(AMSVER)/sept/sept-secondary_00.enc
cp sept/sept-secondary/sept-secondary_01.enc atmosphere-$(AMSVER)/sept/sept-secondary_01.enc
- cp common/defaults/BCT.ini atmosphere-$(AMSVER)/atmosphere/config/BCT.ini
- cp common/defaults/override_config.ini atmosphere-$(AMSVER)/atmosphere/config_templates/override_config.ini
- cp common/defaults/system_settings.ini atmosphere-$(AMSVER)/atmosphere/config_templates/system_settings.ini
- cp -r common/defaults/kip_patches atmosphere-$(AMSVER)/atmosphere/kip_patches
- cp -r common/defaults/hbl_html atmosphere-$(AMSVER)/atmosphere/hbl_html
+ cp config_templates/BCT.ini atmosphere-$(AMSVER)/atmosphere/config/BCT.ini
+ cp config_templates/override_config.ini atmosphere-$(AMSVER)/atmosphere/config_templates/override_config.ini
+ cp config_templates/system_settings.ini atmosphere-$(AMSVER)/atmosphere/config_templates/system_settings.ini
+ cp -r config_templates/kip_patches atmosphere-$(AMSVER)/atmosphere/kip_patches
+ cp -r config_templates/hbl_html atmosphere-$(AMSVER)/atmosphere/hbl_html
cp stratosphere/boot2/boot2.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000008/exefs.nsp
cp stratosphere/dmnt/dmnt.nsp atmosphere-$(AMSVER)/atmosphere/contents/010000000000000D/exefs.nsp
cp stratosphere/eclct.stub/eclct.stub.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000032/exefs.nsp
diff --git a/common/include/atmosphere.h b/common/include/atmosphere.h
deleted file mode 100644
index f2080a76b..000000000
--- a/common/include/atmosphere.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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 .
- */
-
-#ifndef ATMOSPHERE_H
-#define ATMOSPHERE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "atmosphere/version.h"
-#include "atmosphere/target_fw.h"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
\ No newline at end of file
diff --git a/common/include/atmosphere/target_fw.h b/common/include/atmosphere/target_fw.h
deleted file mode 100644
index 8628272b9..000000000
--- a/common/include/atmosphere/target_fw.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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 .
- */
-
-#ifndef ATMOSPHERE_TARGET_FIRMWARE_H
-#define ATMOSPHERE_TARGET_FIRMWARE_H
-
-#define ATMOSPHERE_TARGET_FIRMWARE_100 1
-#define ATMOSPHERE_TARGET_FIRMWARE_200 2
-#define ATMOSPHERE_TARGET_FIRMWARE_300 3
-#define ATMOSPHERE_TARGET_FIRMWARE_400 4
-#define ATMOSPHERE_TARGET_FIRMWARE_500 5
-#define ATMOSPHERE_TARGET_FIRMWARE_600 6
-#define ATMOSPHERE_TARGET_FIRMWARE_620 7
-#define ATMOSPHERE_TARGET_FIRMWARE_700 8
-#define ATMOSPHERE_TARGET_FIRMWARE_800 9
-#define ATMOSPHERE_TARGET_FIRMWARE_810 10
-#define ATMOSPHERE_TARGET_FIRMWARE_900 11
-#define ATMOSPHERE_TARGET_FIRMWARE_910 12
-
-#define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_910
-
-#define ATMOSPHERE_TARGET_FIRMWARE_MIN ATMOSPHERE_TARGET_FIRMWARE_100
-#define ATMOSPHERE_TARGET_FIRMWARE_MAX ATMOSPHERE_TARGET_FIRMWARE_910
-
-/* TODO: What should this be, for release? */
-#define ATMOSPHERE_TARGET_FIRMWARE_DEFAULT_FOR_DEBUG ATMOSPHERE_TARGET_FIRMWARE_CURRENT
-
-#endif
\ No newline at end of file
diff --git a/common/include/atmosphere/version.h b/common/include/atmosphere/version.h
deleted file mode 100644
index 70545ef7e..000000000
--- a/common/include/atmosphere/version.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 .
- */
-
-#ifndef ATMOSPHERE_VERSION_H
-#define ATMOSPHERE_VERSION_H
-
-#define ATMOSPHERE_RELEASE_VERSION_MAJOR 0
-#define ATMOSPHERE_RELEASE_VERSION_MINOR 10
-#define ATMOSPHERE_RELEASE_VERSION_MICRO 0
-
-#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MAJOR 9
-#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR 1
-#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MICRO 0
-
-#endif
\ No newline at end of file
diff --git a/common/defaults/BCT.ini b/config_templates/BCT.ini
similarity index 100%
rename from common/defaults/BCT.ini
rename to config_templates/BCT.ini
diff --git a/common/defaults/hbl_html/accessible-urls/accessible-urls.txt b/config_templates/hbl_html/accessible-urls/accessible-urls.txt
similarity index 100%
rename from common/defaults/hbl_html/accessible-urls/accessible-urls.txt
rename to config_templates/hbl_html/accessible-urls/accessible-urls.txt
diff --git a/common/defaults/kip_patches/default_nogc/02D5ABAAFD20C8B0633AA0DBAEE0377EF526CE6AD2AC6F2CAD7180CE69E74311.ips b/config_templates/kip_patches/default_nogc/02D5ABAAFD20C8B0633AA0DBAEE0377EF526CE6AD2AC6F2CAD7180CE69E74311.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/02D5ABAAFD20C8B0633AA0DBAEE0377EF526CE6AD2AC6F2CAD7180CE69E74311.ips
rename to config_templates/kip_patches/default_nogc/02D5ABAAFD20C8B0633AA0DBAEE0377EF526CE6AD2AC6F2CAD7180CE69E74311.ips
diff --git a/common/defaults/kip_patches/default_nogc/06E90719595A010C6246FF70946F10FB367A00BBD8B7D8D1F25CCE0B458D7E89.ips b/config_templates/kip_patches/default_nogc/06E90719595A010C6246FF70946F10FB367A00BBD8B7D8D1F25CCE0B458D7E89.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/06E90719595A010C6246FF70946F10FB367A00BBD8B7D8D1F25CCE0B458D7E89.ips
rename to config_templates/kip_patches/default_nogc/06E90719595A010C6246FF70946F10FB367A00BBD8B7D8D1F25CCE0B458D7E89.ips
diff --git a/common/defaults/kip_patches/default_nogc/10B2D81605488599DF2242CB6BAC2DF1E2BCAB3BC19DC5CD63DB6FAEC0947097.ips b/config_templates/kip_patches/default_nogc/10B2D81605488599DF2242CB6BAC2DF1E2BCAB3BC19DC5CD63DB6FAEC0947097.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/10B2D81605488599DF2242CB6BAC2DF1E2BCAB3BC19DC5CD63DB6FAEC0947097.ips
rename to config_templates/kip_patches/default_nogc/10B2D81605488599DF2242CB6BAC2DF1E2BCAB3BC19DC5CD63DB6FAEC0947097.ips
diff --git a/common/defaults/kip_patches/default_nogc/2ADBE97E9B5F41779EC95FFE2699C93305D6A69D465CF597D67465CD69BACCE8.ips b/config_templates/kip_patches/default_nogc/2ADBE97E9B5F41779EC95FFE2699C93305D6A69D465CF597D67465CD69BACCE8.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/2ADBE97E9B5F41779EC95FFE2699C93305D6A69D465CF597D67465CD69BACCE8.ips
rename to config_templates/kip_patches/default_nogc/2ADBE97E9B5F41779EC95FFE2699C93305D6A69D465CF597D67465CD69BACCE8.ips
diff --git a/common/defaults/kip_patches/default_nogc/2CCE659CEC536A8E4D91F3BE4B74BED302613F1E442581FD863708E39112DB50.ips b/config_templates/kip_patches/default_nogc/2CCE659CEC536A8E4D91F3BE4B74BED302613F1E442581FD863708E39112DB50.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/2CCE659CEC536A8E4D91F3BE4B74BED302613F1E442581FD863708E39112DB50.ips
rename to config_templates/kip_patches/default_nogc/2CCE659CEC536A8E4D91F3BE4B74BED302613F1E442581FD863708E39112DB50.ips
diff --git a/common/defaults/kip_patches/default_nogc/330553F6B5FB55C4C2D7B736240276B3EAD664DA79826FA936F99803B6C28F3B.ips b/config_templates/kip_patches/default_nogc/330553F6B5FB55C4C2D7B736240276B3EAD664DA79826FA936F99803B6C28F3B.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/330553F6B5FB55C4C2D7B736240276B3EAD664DA79826FA936F99803B6C28F3B.ips
rename to config_templates/kip_patches/default_nogc/330553F6B5FB55C4C2D7B736240276B3EAD664DA79826FA936F99803B6C28F3B.ips
diff --git a/common/defaults/kip_patches/default_nogc/3A574D436186191D1788EB2C0F076B11737132EBB1484CF906B6A8EB3B1BF459.ips b/config_templates/kip_patches/default_nogc/3A574D436186191D1788EB2C0F076B11737132EBB1484CF906B6A8EB3B1BF459.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/3A574D436186191D1788EB2C0F076B11737132EBB1484CF906B6A8EB3B1BF459.ips
rename to config_templates/kip_patches/default_nogc/3A574D436186191D1788EB2C0F076B11737132EBB1484CF906B6A8EB3B1BF459.ips
diff --git a/common/defaults/kip_patches/default_nogc/468740761E193EB758794688F1D9F762CBA1185ADDAD4EC3C479EC8FBFEC31DD.ips b/config_templates/kip_patches/default_nogc/468740761E193EB758794688F1D9F762CBA1185ADDAD4EC3C479EC8FBFEC31DD.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/468740761E193EB758794688F1D9F762CBA1185ADDAD4EC3C479EC8FBFEC31DD.ips
rename to config_templates/kip_patches/default_nogc/468740761E193EB758794688F1D9F762CBA1185ADDAD4EC3C479EC8FBFEC31DD.ips
diff --git a/common/defaults/kip_patches/default_nogc/549B0F8D6F72C4E9F3FD1F19EACE4A5A1DA2D5C393F74224F8BC09DE4AAA4217.ips b/config_templates/kip_patches/default_nogc/549B0F8D6F72C4E9F3FD1F19EACE4A5A1DA2D5C393F74224F8BC09DE4AAA4217.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/549B0F8D6F72C4E9F3FD1F19EACE4A5A1DA2D5C393F74224F8BC09DE4AAA4217.ips
rename to config_templates/kip_patches/default_nogc/549B0F8D6F72C4E9F3FD1F19EACE4A5A1DA2D5C393F74224F8BC09DE4AAA4217.ips
diff --git a/common/defaults/kip_patches/default_nogc/6B09B67B29C020246DC34F5A04F5D3090215C46F37BD079442977A85B8243BA5.ips b/config_templates/kip_patches/default_nogc/6B09B67B29C020246DC34F5A04F5D3090215C46F37BD079442977A85B8243BA5.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/6B09B67B29C020246DC34F5A04F5D3090215C46F37BD079442977A85B8243BA5.ips
rename to config_templates/kip_patches/default_nogc/6B09B67B29C020246DC34F5A04F5D3090215C46F37BD079442977A85B8243BA5.ips
diff --git a/common/defaults/kip_patches/default_nogc/76F87402C9387C0F0A2FAB1B45CEBB93E3E9695C7CFD390F00509B1204101C24.ips b/config_templates/kip_patches/default_nogc/76F87402C9387C0F0A2FAB1B45CEBB93E3E9695C7CFD390F00509B1204101C24.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/76F87402C9387C0F0A2FAB1B45CEBB93E3E9695C7CFD390F00509B1204101C24.ips
rename to config_templates/kip_patches/default_nogc/76F87402C9387C0F0A2FAB1B45CEBB93E3E9695C7CFD390F00509B1204101C24.ips
diff --git a/common/defaults/kip_patches/default_nogc/7C951376E5C12DF85FA6A9F46F6957A4B1271C1F8201B99735D8DF152E7913F1.ips b/config_templates/kip_patches/default_nogc/7C951376E5C12DF85FA6A9F46F6957A4B1271C1F8201B99735D8DF152E7913F1.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/7C951376E5C12DF85FA6A9F46F6957A4B1271C1F8201B99735D8DF152E7913F1.ips
rename to config_templates/kip_patches/default_nogc/7C951376E5C12DF85FA6A9F46F6957A4B1271C1F8201B99735D8DF152E7913F1.ips
diff --git a/common/defaults/kip_patches/default_nogc/8096AF7C6A35AA8271F3916995413B0B64CE03BD9BBFEB26F2B3E01C5427C69E.ips b/config_templates/kip_patches/default_nogc/8096AF7C6A35AA8271F3916995413B0B64CE03BD9BBFEB26F2B3E01C5427C69E.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/8096AF7C6A35AA8271F3916995413B0B64CE03BD9BBFEB26F2B3E01C5427C69E.ips
rename to config_templates/kip_patches/default_nogc/8096AF7C6A35AA8271F3916995413B0B64CE03BD9BBFEB26F2B3E01C5427C69E.ips
diff --git a/common/defaults/kip_patches/default_nogc/A6F27AD9AC7C73AD419B63B23E785A0CD7AA9DC1A63C57D10049423DE7B77E2C.ips b/config_templates/kip_patches/default_nogc/A6F27AD9AC7C73AD419B63B23E785A0CD7AA9DC1A63C57D10049423DE7B77E2C.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/A6F27AD9AC7C73AD419B63B23E785A0CD7AA9DC1A63C57D10049423DE7B77E2C.ips
rename to config_templates/kip_patches/default_nogc/A6F27AD9AC7C73AD419B63B23E785A0CD7AA9DC1A63C57D10049423DE7B77E2C.ips
diff --git a/common/defaults/kip_patches/default_nogc/B2F5176B3548364D079A29B141A23B06AFFF5A98055576D5F337A621C0233CE3.ips b/config_templates/kip_patches/default_nogc/B2F5176B3548364D079A29B141A23B06AFFF5A98055576D5F337A621C0233CE3.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/B2F5176B3548364D079A29B141A23B06AFFF5A98055576D5F337A621C0233CE3.ips
rename to config_templates/kip_patches/default_nogc/B2F5176B3548364D079A29B141A23B06AFFF5A98055576D5F337A621C0233CE3.ips
diff --git a/common/defaults/kip_patches/default_nogc/B4CAE1F24965D92ED24EBE9E97F609C363834471BF18CA375CB6A1DEB77755EA.ips b/config_templates/kip_patches/default_nogc/B4CAE1F24965D92ED24EBE9E97F609C363834471BF18CA375CB6A1DEB77755EA.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/B4CAE1F24965D92ED24EBE9E97F609C363834471BF18CA375CB6A1DEB77755EA.ips
rename to config_templates/kip_patches/default_nogc/B4CAE1F24965D92ED24EBE9E97F609C363834471BF18CA375CB6A1DEB77755EA.ips
diff --git a/common/defaults/kip_patches/default_nogc/B5E7A64C6F5C4FE319C36FD7D642F75B0159771671F73082448ACE30BD6BAE89.ips b/config_templates/kip_patches/default_nogc/B5E7A64C6F5C4FE319C36FD7D642F75B0159771671F73082448ACE30BD6BAE89.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/B5E7A64C6F5C4FE319C36FD7D642F75B0159771671F73082448ACE30BD6BAE89.ips
rename to config_templates/kip_patches/default_nogc/B5E7A64C6F5C4FE319C36FD7D642F75B0159771671F73082448ACE30BD6BAE89.ips
diff --git a/common/defaults/kip_patches/default_nogc/CE3ECBA2F2F062F575F8F360842B32B432340DD2C7590CDEFC03E51B844AE805.ips b/config_templates/kip_patches/default_nogc/CE3ECBA2F2F062F575F8F360842B32B432340DD2C7590CDEFC03E51B844AE805.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/CE3ECBA2F2F062F575F8F360842B32B432340DD2C7590CDEFC03E51B844AE805.ips
rename to config_templates/kip_patches/default_nogc/CE3ECBA2F2F062F575F8F360842B32B432340DD2C7590CDEFC03E51B844AE805.ips
diff --git a/common/defaults/kip_patches/default_nogc/DBD941C0C53C52CCF7202C84D8E0F78013A3684D8AB5D128096674A8F7755B3D.ips b/config_templates/kip_patches/default_nogc/DBD941C0C53C52CCF7202C84D8E0F78013A3684D8AB5D128096674A8F7755B3D.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/DBD941C0C53C52CCF7202C84D8E0F78013A3684D8AB5D128096674A8F7755B3D.ips
rename to config_templates/kip_patches/default_nogc/DBD941C0C53C52CCF7202C84D8E0F78013A3684D8AB5D128096674A8F7755B3D.ips
diff --git a/common/defaults/kip_patches/default_nogc/F196D144D04445B6E7497CB6405B7FC305B54F961024BF432575296E4D52BC99.ips b/config_templates/kip_patches/default_nogc/F196D144D04445B6E7497CB6405B7FC305B54F961024BF432575296E4D52BC99.ips
similarity index 100%
rename from common/defaults/kip_patches/default_nogc/F196D144D04445B6E7497CB6405B7FC305B54F961024BF432575296E4D52BC99.ips
rename to config_templates/kip_patches/default_nogc/F196D144D04445B6E7497CB6405B7FC305B54F961024BF432575296E4D52BC99.ips
diff --git a/common/defaults/override_config.ini b/config_templates/override_config.ini
similarity index 100%
rename from common/defaults/override_config.ini
rename to config_templates/override_config.ini
diff --git a/common/defaults/system_settings.ini b/config_templates/system_settings.ini
similarity index 100%
rename from common/defaults/system_settings.ini
rename to config_templates/system_settings.ini
diff --git a/exosphere/Makefile b/exosphere/Makefile
index 3b9792116..09630e14d 100644
--- a/exosphere/Makefile
+++ b/exosphere/Makefile
@@ -28,7 +28,7 @@ TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := src src/dbg
DATA := data
-INCLUDES := include ../common/include
+INCLUDES := include ../libraries/libvapours/include
#---------------------------------------------------------------------------------
# options for code generation
@@ -48,7 +48,7 @@ CFLAGS := \
-Wall \
$(ARCH) $(DEFINES)
-CFLAGS += $(INCLUDE)
+CFLAGS += $(INCLUDE)
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
diff --git a/exosphere/lp0fw/Makefile b/exosphere/lp0fw/Makefile
index b3b032b84..a1073d35e 100644
--- a/exosphere/lp0fw/Makefile
+++ b/exosphere/lp0fw/Makefile
@@ -20,7 +20,7 @@ TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := src
DATA := data
-INCLUDES := include ../../common/include
+INCLUDES := include ../../libraries/libvapours/include
#---------------------------------------------------------------------------------
# options for code generation
diff --git a/exosphere/lp0fw/src/utils.h b/exosphere/lp0fw/src/utils.h
index 78551d04d..02e6c6fe2 100644
--- a/exosphere/lp0fw/src/utils.h
+++ b/exosphere/lp0fw/src/utils.h
@@ -13,14 +13,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-
+
#ifndef EXOSPHERE_WARMBOOT_BIN_UTILS_H
#define EXOSPHERE_WARMBOOT_BIN_UTILS_H
#include
#include
#include
-#include
+#include
#define BIT(n) (1u << (n))
#define BITL(n) (1ull << (n))
diff --git a/exosphere/src/configitem.c b/exosphere/src/configitem.c
index 84ca86acb..7cdf3ff13 100644
--- a/exosphere/src/configitem.c
+++ b/exosphere/src/configitem.c
@@ -15,7 +15,7 @@
*/
#include
-#include
+#include
#include "bootconfig.h"
#include "configitem.h"
diff --git a/exosphere/src/emummc_cfg.h b/exosphere/src/emummc_cfg.h
index 6a2f6d124..bd5e6a221 100644
--- a/exosphere/src/emummc_cfg.h
+++ b/exosphere/src/emummc_cfg.h
@@ -13,12 +13,12 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-
+
#ifndef EXOSPHERE_EMUMMC_CONFIG_H
#define EXOSPHERE_EMUMMC_CONFIG_H
#include
-#include
+#include
#include "utils.h"
/* "EFS0" */
diff --git a/exosphere/src/exocfg.c b/exosphere/src/exocfg.c
index 00827c69f..7b0f9952d 100644
--- a/exosphere/src/exocfg.c
+++ b/exosphere/src/exocfg.c
@@ -22,7 +22,7 @@
#include "mmu.h"
#include "memory_map.h"
-static exosphere_config_t g_exosphere_cfg = {MAGIC_EXOSPHERE_CONFIG, ATMOSPHERE_TARGET_FIRMWARE_DEFAULT_FOR_DEBUG, EXOSPHERE_FLAGS_DEFAULT};
+static exosphere_config_t g_exosphere_cfg = {MAGIC_EXOSPHERE_CONFIG, ATMOSPHERE_TARGET_FIRMWARE_CURRENT, EXOSPHERE_FLAGS_DEFAULT};
static bool g_has_loaded_config = false;
#define EXOSPHERE_CHECK_FLAG(flag) ((g_exosphere_cfg.flags & flag) != 0)
diff --git a/exosphere/src/exocfg.h b/exosphere/src/exocfg.h
index 902ab02e0..81455415b 100644
--- a/exosphere/src/exocfg.h
+++ b/exosphere/src/exocfg.h
@@ -18,7 +18,7 @@
#define EXOSPHERE_EXOSPHERE_CONFIG_H
#include
-#include
+#include
#include "utils.h"
#include "memory_map.h"
@@ -68,7 +68,7 @@ static inline unsigned int exosphere_get_target_firmware_for_init(void) {
if (magic == MAGIC_EXOSPHERE_CONFIG) {
return MAILBOX_EXOSPHERE_CONFIG_PHYS.target_firmware;
} else {
- return ATMOSPHERE_TARGET_FIRMWARE_DEFAULT_FOR_DEBUG;
+ return ATMOSPHERE_TARGET_FIRMWARE_CURRENT;
}
}
diff --git a/exosphere/src/smc_api.c b/exosphere/src/smc_api.c
index bdf8ff1a0..dbd09ff44 100644
--- a/exosphere/src/smc_api.c
+++ b/exosphere/src/smc_api.c
@@ -318,7 +318,7 @@ void call_smc_handler(uint32_t handler_id, smc_args_t *args) {
#endif
#if DEBUG_PANIC_ON_FAILURE
- if (args->X[0] && (!is_aes_kek || args->X[3] <= ATMOSPHERE_TARGET_FIRMWARE_DEFAULT_FOR_DEBUG))
+ if (args->X[0] && (!is_aes_kek || args->X[3] <= ATMOSPHERE_TARGET_FIRMWARE_CURRENT))
{
MAKE_REG32(get_iram_address_for_debug() + 0x4FF0) = handler_id;
MAKE_REG32(get_iram_address_for_debug() + 0x4FF4) = smc_id;
diff --git a/fusee/fusee-secondary/Makefile b/fusee/fusee-secondary/Makefile
index 64fa59ba3..67110da57 100644
--- a/fusee/fusee-secondary/Makefile
+++ b/fusee/fusee-secondary/Makefile
@@ -38,7 +38,7 @@ TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := src src/sdmmc src/lib src/lib/fatfs src/display
DATA := data
-INCLUDES := include ../../common/include
+INCLUDES := include ../../libraries/libvapours/include
#---------------------------------------------------------------------------------
# options for code generation
diff --git a/fusee/fusee-secondary/src/emummc_cfg.h b/fusee/fusee-secondary/src/emummc_cfg.h
index 3e9f21004..53206d474 100644
--- a/fusee/fusee-secondary/src/emummc_cfg.h
+++ b/fusee/fusee-secondary/src/emummc_cfg.h
@@ -18,7 +18,7 @@
#define EXOSPHERE_EMUMMC_CONFIG_H
#include
-#include
+#include
/* "EFS0" */
#define MAGIC_EMUMMC_CONFIG (0x30534645)
diff --git a/fusee/fusee-secondary/src/exocfg.h b/fusee/fusee-secondary/src/exocfg.h
index 685b15ce8..773c18bf7 100644
--- a/fusee/fusee-secondary/src/exocfg.h
+++ b/fusee/fusee-secondary/src/exocfg.h
@@ -18,7 +18,7 @@
#define FUSEE_EXOSPHERE_CONFIG_H
#include
-#include
+#include
#include "emummc_cfg.h"
/* This serves to set configuration for *exosphere itself*, separate from the SecMon Exosphere mimics. */
diff --git a/fusee/fusee-secondary/src/package2.c b/fusee/fusee-secondary/src/package2.c
index 3ed9e8cc2..d1b1b8a7b 100644
--- a/fusee/fusee-secondary/src/package2.c
+++ b/fusee/fusee-secondary/src/package2.c
@@ -16,7 +16,7 @@
#include
#include
-#include
+#include
#include "utils.h"
#include "masterkey.h"
#include "stratosphere.h"
diff --git a/fusee/fusee-secondary/src/start.s b/fusee/fusee-secondary/src/start.s
index 74185b7a4..556e7bbdb 100644
--- a/fusee/fusee-secondary/src/start.s
+++ b/fusee/fusee-secondary/src/start.s
@@ -13,7 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-#include
+#include
.macro CLEAR_GPR_REG_ITER
mov r\@, #0
diff --git a/stratosphere/Makefile b/stratosphere/Makefile
index 098c001a3..645bc1b7f 100644
--- a/stratosphere/Makefile
+++ b/stratosphere/Makefile
@@ -1,6 +1,6 @@
MODULES := loader pm sm boot ams_mitm spl eclct.stub ro creport fatal dmnt boot2
-SUBFOLDERS := libstratosphere $(MODULES)
+SUBFOLDERS := $(MODULES)
TOPTARGETS := all clean
@@ -9,6 +9,4 @@ $(TOPTARGETS): $(SUBFOLDERS)
$(SUBFOLDERS):
$(MAKE) -C $@ $(MAKECMDGOALS)
-$(MODULES): libstratosphere
-
.PHONY: $(TOPTARGETS) $(SUBFOLDERS)
diff --git a/stratosphere/ams_mitm/Makefile b/stratosphere/ams_mitm/Makefile
index 4bd985667..a92187ef8 100644
--- a/stratosphere/ams_mitm/Makefile
+++ b/stratosphere/ams_mitm/Makefile
@@ -1,76 +1,7 @@
#---------------------------------------------------------------------------------
-.SUFFIXES:
+# pull in common stratosphere sysmodule configuration
#---------------------------------------------------------------------------------
-
-ifeq ($(strip $(DEVKITPRO)),)
-$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=/devkitpro")
-endif
-
-TOPDIR ?= $(CURDIR)
-include $(DEVKITPRO)/libnx/switch_rules
-
-AMSBRANCH := $(shell git symbolic-ref --short HEAD)
-AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD)
-
-ifneq (, $(strip $(shell git status --porcelain 2>/dev/null)))
- AMSREV := $(AMSREV)-dirty
-endif
-
-#---------------------------------------------------------------------------------
-# TARGET is the name of the output
-# BUILD is the directory where object files & intermediate files will be placed
-# SOURCES is a list of directories containing source code
-# 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".
-#---------------------------------------------------------------------------------
-TARGET := $(notdir $(CURDIR))
-BUILD := build
-SOURCES := source source/fs_mitm source/set_mitm source/bpc_mitm source/ns_mitm source/hid_mitm
-DATA := data
-INCLUDES := include ../../common/include
-EXEFS_SRC := exefs_src
-
-DEFINES := -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\"
-
-#---------------------------------------------------------------------------------
-# options for code generation
-#---------------------------------------------------------------------------------
-ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
-
-CFLAGS := -g -Wall -O2 -ffunction-sections \
- $(ARCH) $(DEFINES)
-
-CFLAGS += $(INCLUDE) -D__SWITCH__
-
-CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17
-
-CXXWRAPS := -Wl,--wrap,__cxa_pure_virtual \
- -Wl,--wrap,__cxa_throw \
- -Wl,--wrap,__cxa_rethrow \
- -Wl,--wrap,__cxa_allocate_exception \
- -Wl,--wrap,__cxa_free_exception \
- -Wl,--wrap,__cxa_begin_catch \
- -Wl,--wrap,__cxa_end_catch \
- -Wl,--wrap,__cxa_call_unexpected \
- -Wl,--wrap,__cxa_call_terminate \
- -Wl,--wrap,__gxx_personality_v0 \
- -Wl,--wrap,_Unwind_Resume \
- -Wl,--wrap,_ZSt19__throw_logic_errorPKc \
- -Wl,--wrap,_ZSt20__throw_length_errorPKc \
- -Wl,--wrap,_ZNSt11logic_errorC2EPKc
-
-ASFLAGS := -g $(ARCH)
-LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) $(CXXWRAPS) -Wl,-Map,$(notdir $*.map)
-
-LIBS := -lstratosphere -lnx
-
-#---------------------------------------------------------------------------------
-# list of directories containing libraries, this must be the top level containing
-# include and lib
-#---------------------------------------------------------------------------------
-LIBDIRS := $(PORTLIBS) $(LIBNX) $(CURDIR)/../libstratosphere
-
+include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../../libraries/config/templates/stratosphere.mk
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
@@ -87,9 +18,25 @@ export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
export DEPSDIR := $(CURDIR)/$(BUILD)
-CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
-CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
-SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
+
+CFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.c)) $(notdir $(wildcard $(dir)/*.board.*.c)) $(notdir $(wildcard $(dir)/*.os.*.c)), \
+ $(notdir $(wildcard $(dir)/*.c))))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).c)))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).c)))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).c)))
+
+CPPFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.cpp)) $(notdir $(wildcard $(dir)/*.board.*.cpp)) $(notdir $(wildcard $(dir)/*.os.*.cpp)), \
+ $(notdir $(wildcard $(dir)/*.cpp))))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).cpp)))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).cpp)))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).cpp)))
+
+SFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.s)) $(notdir $(wildcard $(dir)/*.board.*.s)) $(notdir $(wildcard $(dir)/*.os.*.s)), \
+ $(notdir $(wildcard $(dir)/*.s))))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).s)))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).s)))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).s)))
+
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
#---------------------------------------------------------------------------------
diff --git a/stratosphere/boot/Makefile b/stratosphere/boot/Makefile
index f70d9049b..8fa028c65 100644
--- a/stratosphere/boot/Makefile
+++ b/stratosphere/boot/Makefile
@@ -1,83 +1,7 @@
#---------------------------------------------------------------------------------
-.SUFFIXES:
+# pull in common stratosphere sysmodule configuration
#---------------------------------------------------------------------------------
-
-ifeq ($(strip $(DEVKITPRO)),)
-$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=/devkitpro")
-endif
-
-TOPDIR ?= $(CURDIR)
-include $(DEVKITPRO)/libnx/switch_rules
-
-AMSBRANCH := $(shell git symbolic-ref --short HEAD)
-AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD)
-
-ifneq (, $(strip $(shell git status --porcelain 2>/dev/null)))
- AMSREV := $(AMSREV)-dirty
-endif
-
-define _bin2o
- bin2s $< | $(AS) -o $(@)
- echo "extern const u8" `(echo $( `(echo $(> `(echo $(> `(echo $( fusee_primary
+#---------------------------------------------------------------------------------
+define _bin2o
+ bin2s $< | $(AS) -o $(@)
+ echo "extern const u8" `(echo $( `(echo $(> `(echo $(> `(echo $(/devkitpro")
-endif
-
-TOPDIR ?= $(CURDIR)
-include $(DEVKITPRO)/libnx/switch_rules
-
-AMSBRANCH := $(shell git symbolic-ref --short HEAD)
-AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD)
-
-ifneq (, $(strip $(shell git status --porcelain 2>/dev/null)))
- AMSREV := $(AMSREV)-dirty
-endif
-
-#---------------------------------------------------------------------------------
-# TARGET is the name of the output
-# BUILD is the directory where object files & intermediate files will be placed
-# SOURCES is a list of directories containing source code
-# 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".
-#---------------------------------------------------------------------------------
-TARGET := $(notdir $(CURDIR))
-BUILD := build
-SOURCES := source
-DATA := data
-INCLUDES := include ../../common/include
-EXEFS_SRC := exefs_src
-
-DEFINES := -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\" -DINI_MAX_LINE=768
-
-#---------------------------------------------------------------------------------
-# options for code generation
-#---------------------------------------------------------------------------------
-ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
-
-CFLAGS := -g -Wall -O2 -ffunction-sections \
- $(ARCH) $(DEFINES)
-
-CFLAGS += $(INCLUDE) -D__SWITCH__
-
-CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17
-
-CXXWRAPS := -Wl,--wrap,__cxa_pure_virtual \
- -Wl,--wrap,__cxa_throw \
- -Wl,--wrap,__cxa_rethrow \
- -Wl,--wrap,__cxa_allocate_exception \
- -Wl,--wrap,__cxa_free_exception \
- -Wl,--wrap,__cxa_begin_catch \
- -Wl,--wrap,__cxa_end_catch \
- -Wl,--wrap,__cxa_call_unexpected \
- -Wl,--wrap,__cxa_call_terminate \
- -Wl,--wrap,__gxx_personality_v0 \
- -Wl,--wrap,_Unwind_Resume \
- -Wl,--wrap,_ZSt19__throw_logic_errorPKc \
- -Wl,--wrap,_ZSt20__throw_length_errorPKc \
- -Wl,--wrap,_ZNSt11logic_errorC2EPKc
-
-ASFLAGS := -g $(ARCH)
-LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) $(CXXWRAPS) -Wl,-Map,$(notdir $*.map)
-
-LIBS := -lstratosphere -lnx
-
-#---------------------------------------------------------------------------------
-# list of directories containing libraries, this must be the top level containing
-# include and lib
-#---------------------------------------------------------------------------------
-LIBDIRS := $(PORTLIBS) $(LIBNX) $(CURDIR)/../libstratosphere
-
+include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../../libraries/config/templates/stratosphere.mk
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
@@ -87,9 +18,25 @@ export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
export DEPSDIR := $(CURDIR)/$(BUILD)
-CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
-CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
-SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
+
+CFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.c)) $(notdir $(wildcard $(dir)/*.board.*.c)) $(notdir $(wildcard $(dir)/*.os.*.c)), \
+ $(notdir $(wildcard $(dir)/*.c))))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).c)))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).c)))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).c)))
+
+CPPFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.cpp)) $(notdir $(wildcard $(dir)/*.board.*.cpp)) $(notdir $(wildcard $(dir)/*.os.*.cpp)), \
+ $(notdir $(wildcard $(dir)/*.cpp))))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).cpp)))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).cpp)))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).cpp)))
+
+SFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.s)) $(notdir $(wildcard $(dir)/*.board.*.s)) $(notdir $(wildcard $(dir)/*.os.*.s)), \
+ $(notdir $(wildcard $(dir)/*.s))))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).s)))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).s)))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).s)))
+
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
#---------------------------------------------------------------------------------
diff --git a/stratosphere/creport/Makefile b/stratosphere/creport/Makefile
index ab283ad98..7320b9f99 100644
--- a/stratosphere/creport/Makefile
+++ b/stratosphere/creport/Makefile
@@ -1,76 +1,7 @@
#---------------------------------------------------------------------------------
-.SUFFIXES:
+# pull in common stratosphere sysmodule configuration
#---------------------------------------------------------------------------------
-
-ifeq ($(strip $(DEVKITPRO)),)
-$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=/devkitpro")
-endif
-
-TOPDIR ?= $(CURDIR)
-include $(DEVKITPRO)/libnx/switch_rules
-
-AMSBRANCH := $(shell git symbolic-ref --short HEAD)
-AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD)
-
-ifneq (, $(strip $(shell git status --porcelain 2>/dev/null)))
- AMSREV := $(AMSREV)-dirty
-endif
-
-#---------------------------------------------------------------------------------
-# TARGET is the name of the output
-# BUILD is the directory where object files & intermediate files will be placed
-# SOURCES is a list of directories containing source code
-# 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".
-#---------------------------------------------------------------------------------
-TARGET := $(notdir $(CURDIR))
-BUILD := build
-SOURCES := source
-DATA := data
-INCLUDES := include ../../common/include
-EXEFS_SRC := exefs_src
-
-DEFINES := -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\"
-
-#---------------------------------------------------------------------------------
-# options for code generation
-#---------------------------------------------------------------------------------
-ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
-
-CFLAGS := -g -Wall -O2 -ffunction-sections \
- $(ARCH) $(DEFINES)
-
-CFLAGS += $(INCLUDE) -D__SWITCH__
-
-CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17
-
-CXXWRAPS := -Wl,--wrap,__cxa_pure_virtual \
- -Wl,--wrap,__cxa_throw \
- -Wl,--wrap,__cxa_rethrow \
- -Wl,--wrap,__cxa_allocate_exception \
- -Wl,--wrap,__cxa_free_exception \
- -Wl,--wrap,__cxa_begin_catch \
- -Wl,--wrap,__cxa_end_catch \
- -Wl,--wrap,__cxa_call_unexpected \
- -Wl,--wrap,__cxa_call_terminate \
- -Wl,--wrap,__gxx_personality_v0 \
- -Wl,--wrap,_Unwind_Resume \
- -Wl,--wrap,_ZSt19__throw_logic_errorPKc \
- -Wl,--wrap,_ZSt20__throw_length_errorPKc \
- -Wl,--wrap,_ZNSt11logic_errorC2EPKc
-
-ASFLAGS := -g $(ARCH)
-LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) $(CXXWRAPS) -Wl,-Map,$(notdir $*.map)
-
-LIBS := -lstratosphere -lnx
-
-#---------------------------------------------------------------------------------
-# list of directories containing libraries, this must be the top level containing
-# include and lib
-#---------------------------------------------------------------------------------
-LIBDIRS := $(PORTLIBS) $(LIBNX) $(CURDIR)/../libstratosphere
-
+include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../../libraries/config/templates/stratosphere.mk
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
@@ -87,9 +18,25 @@ export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
export DEPSDIR := $(CURDIR)/$(BUILD)
-CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
-CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
-SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
+
+CFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.c)) $(notdir $(wildcard $(dir)/*.board.*.c)) $(notdir $(wildcard $(dir)/*.os.*.c)), \
+ $(notdir $(wildcard $(dir)/*.c))))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).c)))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).c)))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).c)))
+
+CPPFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.cpp)) $(notdir $(wildcard $(dir)/*.board.*.cpp)) $(notdir $(wildcard $(dir)/*.os.*.cpp)), \
+ $(notdir $(wildcard $(dir)/*.cpp))))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).cpp)))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).cpp)))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).cpp)))
+
+SFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.s)) $(notdir $(wildcard $(dir)/*.board.*.s)) $(notdir $(wildcard $(dir)/*.os.*.s)), \
+ $(notdir $(wildcard $(dir)/*.s))))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).s)))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).s)))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).s)))
+
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
#---------------------------------------------------------------------------------
diff --git a/stratosphere/dmnt/Makefile b/stratosphere/dmnt/Makefile
index 9c3e0a2fc..7320b9f99 100644
--- a/stratosphere/dmnt/Makefile
+++ b/stratosphere/dmnt/Makefile
@@ -1,76 +1,7 @@
#---------------------------------------------------------------------------------
-.SUFFIXES:
+# pull in common stratosphere sysmodule configuration
#---------------------------------------------------------------------------------
-
-ifeq ($(strip $(DEVKITPRO)),)
-$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=/devkitpro")
-endif
-
-TOPDIR ?= $(CURDIR)
-include $(DEVKITPRO)/libnx/switch_rules
-
-AMSBRANCH := $(shell git symbolic-ref --short HEAD)
-AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD)
-
-ifneq (, $(strip $(shell git status --porcelain 2>/dev/null)))
- AMSREV := $(AMSREV)-dirty
-endif
-
-#---------------------------------------------------------------------------------
-# TARGET is the name of the output
-# BUILD is the directory where object files & intermediate files will be placed
-# SOURCES is a list of directories containing source code
-# 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".
-#---------------------------------------------------------------------------------
-TARGET := $(notdir $(CURDIR))
-BUILD := build
-SOURCES := source source/cheat source/cheat/impl
-DATA := data
-INCLUDES := include ../../common/include
-EXEFS_SRC := exefs_src
-
-DEFINES := -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\"
-
-#---------------------------------------------------------------------------------
-# options for code generation
-#---------------------------------------------------------------------------------
-ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
-
-CFLAGS := -g -Wall -O2 -ffunction-sections \
- $(ARCH) $(DEFINES)
-
-CFLAGS += $(INCLUDE) -D__SWITCH__
-
-CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17
-
-CXXWRAPS := -Wl,--wrap,__cxa_pure_virtual \
- -Wl,--wrap,__cxa_throw \
- -Wl,--wrap,__cxa_rethrow \
- -Wl,--wrap,__cxa_allocate_exception \
- -Wl,--wrap,__cxa_free_exception \
- -Wl,--wrap,__cxa_begin_catch \
- -Wl,--wrap,__cxa_end_catch \
- -Wl,--wrap,__cxa_call_unexpected \
- -Wl,--wrap,__cxa_call_terminate \
- -Wl,--wrap,__gxx_personality_v0 \
- -Wl,--wrap,_Unwind_Resume \
- -Wl,--wrap,_ZSt19__throw_logic_errorPKc \
- -Wl,--wrap,_ZSt20__throw_length_errorPKc \
- -Wl,--wrap,_ZNSt11logic_errorC2EPKc
-
-ASFLAGS := -g $(ARCH)
-LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) $(CXXWRAPS) -Wl,-Map,$(notdir $*.map)
-
-LIBS := -lstratosphere -lnx
-
-#---------------------------------------------------------------------------------
-# list of directories containing libraries, this must be the top level containing
-# include and lib
-#---------------------------------------------------------------------------------
-LIBDIRS := $(PORTLIBS) $(LIBNX) $(CURDIR)/../libstratosphere
-
+include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../../libraries/config/templates/stratosphere.mk
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
@@ -87,9 +18,25 @@ export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
export DEPSDIR := $(CURDIR)/$(BUILD)
-CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
-CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
-SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
+
+CFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.c)) $(notdir $(wildcard $(dir)/*.board.*.c)) $(notdir $(wildcard $(dir)/*.os.*.c)), \
+ $(notdir $(wildcard $(dir)/*.c))))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).c)))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).c)))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).c)))
+
+CPPFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.cpp)) $(notdir $(wildcard $(dir)/*.board.*.cpp)) $(notdir $(wildcard $(dir)/*.os.*.cpp)), \
+ $(notdir $(wildcard $(dir)/*.cpp))))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).cpp)))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).cpp)))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).cpp)))
+
+SFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.s)) $(notdir $(wildcard $(dir)/*.board.*.s)) $(notdir $(wildcard $(dir)/*.os.*.s)), \
+ $(notdir $(wildcard $(dir)/*.s))))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).s)))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).s)))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).s)))
+
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
#---------------------------------------------------------------------------------
diff --git a/stratosphere/eclct.stub/Makefile b/stratosphere/eclct.stub/Makefile
index cedb94b15..7320b9f99 100644
--- a/stratosphere/eclct.stub/Makefile
+++ b/stratosphere/eclct.stub/Makefile
@@ -1,76 +1,7 @@
#---------------------------------------------------------------------------------
-.SUFFIXES:
+# pull in common stratosphere sysmodule configuration
#---------------------------------------------------------------------------------
-
-ifeq ($(strip $(DEVKITPRO)),)
-$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=/devkitpro")
-endif
-
-TOPDIR ?= $(CURDIR)
-include $(DEVKITPRO)/libnx/switch_rules
-
-AMSBRANCH := $(shell git symbolic-ref --short HEAD)
-AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD)
-
-ifneq (, $(strip $(shell git status --porcelain 2>/dev/null)))
- AMSREV := $(AMSREV)-dirty
-endif
-
-#---------------------------------------------------------------------------------
-# TARGET is the name of the output
-# BUILD is the directory where object files & intermediate files will be placed
-# SOURCES is a list of directories containing source code
-# 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".
-#---------------------------------------------------------------------------------
-TARGET := $(notdir $(CURDIR))
-BUILD := build
-SOURCES := source
-DATA := data
-INCLUDES := include ../../common/include
-EXEFS_SRC := exefs_src
-
-DEFINES := -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\" -DINI_MAX_LINE=768
-
-#---------------------------------------------------------------------------------
-# options for code generation
-#---------------------------------------------------------------------------------
-ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
-
-CFLAGS := -g -Wall -O2 -ffunction-sections \
- $(ARCH) $(DEFINES)
-
-CFLAGS += $(INCLUDE) -D__SWITCH__
-
-CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17
-
-CXXWRAPS := -Wl,--wrap,__cxa_pure_virtual \
- -Wl,--wrap,__cxa_throw \
- -Wl,--wrap,__cxa_rethrow \
- -Wl,--wrap,__cxa_allocate_exception \
- -Wl,--wrap,__cxa_free_exception \
- -Wl,--wrap,__cxa_begin_catch \
- -Wl,--wrap,__cxa_end_catch \
- -Wl,--wrap,__cxa_call_unexpected \
- -Wl,--wrap,__cxa_call_terminate \
- -Wl,--wrap,__gxx_personality_v0 \
- -Wl,--wrap,_Unwind_Resume \
- -Wl,--wrap,_ZSt19__throw_logic_errorPKc \
- -Wl,--wrap,_ZSt20__throw_length_errorPKc \
- -Wl,--wrap,_ZNSt11logic_errorC2EPKc
-
-ASFLAGS := -g $(ARCH)
-LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) $(CXXWRAPS) -Wl,-Map,$(notdir $*.map)
-
-LIBS := -lstratosphere -lnx
-
-#---------------------------------------------------------------------------------
-# list of directories containing libraries, this must be the top level containing
-# include and lib
-#---------------------------------------------------------------------------------
-LIBDIRS := $(PORTLIBS) $(LIBNX) $(CURDIR)/../libstratosphere
-
+include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../../libraries/config/templates/stratosphere.mk
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
@@ -87,9 +18,25 @@ export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
export DEPSDIR := $(CURDIR)/$(BUILD)
-CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
-CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
-SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
+
+CFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.c)) $(notdir $(wildcard $(dir)/*.board.*.c)) $(notdir $(wildcard $(dir)/*.os.*.c)), \
+ $(notdir $(wildcard $(dir)/*.c))))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).c)))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).c)))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).c)))
+
+CPPFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.cpp)) $(notdir $(wildcard $(dir)/*.board.*.cpp)) $(notdir $(wildcard $(dir)/*.os.*.cpp)), \
+ $(notdir $(wildcard $(dir)/*.cpp))))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).cpp)))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).cpp)))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).cpp)))
+
+SFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.s)) $(notdir $(wildcard $(dir)/*.board.*.s)) $(notdir $(wildcard $(dir)/*.os.*.s)), \
+ $(notdir $(wildcard $(dir)/*.s))))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).s)))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).s)))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).s)))
+
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
#---------------------------------------------------------------------------------
diff --git a/stratosphere/fatal/Makefile b/stratosphere/fatal/Makefile
index ec1821d26..8d8e58e5a 100644
--- a/stratosphere/fatal/Makefile
+++ b/stratosphere/fatal/Makefile
@@ -1,76 +1,14 @@
#---------------------------------------------------------------------------------
-.SUFFIXES:
+# pull in common stratosphere sysmodule configuration
#---------------------------------------------------------------------------------
-
-ifeq ($(strip $(DEVKITPRO)),)
-$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=/devkitpro")
-endif
-
-TOPDIR ?= $(CURDIR)
-include $(DEVKITPRO)/libnx/switch_rules
-
-AMSBRANCH := $(shell git symbolic-ref --short HEAD)
-AMSREV := $(AMSBRANCH)-$(shell git rev-parse --short HEAD)
-
-ifneq (, $(strip $(shell git status --porcelain 2>/dev/null)))
- AMSREV := $(AMSREV)-dirty
-endif
+include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../../libraries/config/templates/stratosphere.mk
#---------------------------------------------------------------------------------
-# TARGET is the name of the output
-# BUILD is the directory where object files & intermediate files will be placed
-# SOURCES is a list of directories containing source code
-# 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".
+# atmosphere-fatal needs freetype.
#---------------------------------------------------------------------------------
-TARGET := $(notdir $(CURDIR))
-BUILD := build
-SOURCES := source
-DATA := data
-INCLUDES := include ../../common/include
-EXEFS_SRC := exefs_src
-
-DEFINES := -DATMOSPHERE_GIT_BRANCH=\"$(AMSBRANCH)\" -DATMOSPHERE_GIT_REV=\"$(AMSREV)\"
-
-#---------------------------------------------------------------------------------
-# options for code generation
-#---------------------------------------------------------------------------------
-ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
-
-CFLAGS := -g -Wall -O2 -ffunction-sections \
- $(ARCH) $(DEFINES)
-
-CFLAGS += $(INCLUDE) -D__SWITCH__ `freetype-config --cflags`
-
-CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17
-
-CXXWRAPS := -Wl,--wrap,__cxa_pure_virtual \
- -Wl,--wrap,__cxa_throw \
- -Wl,--wrap,__cxa_rethrow \
- -Wl,--wrap,__cxa_allocate_exception \
- -Wl,--wrap,__cxa_free_exception \
- -Wl,--wrap,__cxa_begin_catch \
- -Wl,--wrap,__cxa_end_catch \
- -Wl,--wrap,__cxa_call_unexpected \
- -Wl,--wrap,__cxa_call_terminate \
- -Wl,--wrap,__gxx_personality_v0 \
- -Wl,--wrap,_Unwind_Resume \
- -Wl,--wrap,_ZSt19__throw_logic_errorPKc \
- -Wl,--wrap,_ZSt20__throw_length_errorPKc \
- -Wl,--wrap,_ZNSt11logic_errorC2EPKc
-
-ASFLAGS := -g $(ARCH)
-LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) $(CXXWRAPS) -Wl,-Map,$(notdir $*.map)
-
-LIBS := `freetype-config --libs` -lstratosphere -lnx
-
-#---------------------------------------------------------------------------------
-# list of directories containing libraries, this must be the top level containing
-# include and lib
-#---------------------------------------------------------------------------------
-LIBDIRS := $(PORTLIBS) $(LIBNX) $(CURDIR)/../libstratosphere
-
+LIBS += `freetype-config --libs`
+CFLAGS += `freetype-config --cflags`
+CXXFLAGS += `freetype-config --cflags`
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
@@ -87,9 +25,25 @@ export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
export DEPSDIR := $(CURDIR)/$(BUILD)
-CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
-CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
-SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
+
+CFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.c)) $(notdir $(wildcard $(dir)/*.board.*.c)) $(notdir $(wildcard $(dir)/*.os.*.c)), \
+ $(notdir $(wildcard $(dir)/*.c))))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).c)))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).c)))
+CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).c)))
+
+CPPFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.cpp)) $(notdir $(wildcard $(dir)/*.board.*.cpp)) $(notdir $(wildcard $(dir)/*.os.*.cpp)), \
+ $(notdir $(wildcard $(dir)/*.cpp))))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).cpp)))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).cpp)))
+CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).cpp)))
+
+SFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.s)) $(notdir $(wildcard $(dir)/*.board.*.s)) $(notdir $(wildcard $(dir)/*.os.*.s)), \
+ $(notdir $(wildcard $(dir)/*.s))))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).s)))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).s)))
+SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).s)))
+
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
#---------------------------------------------------------------------------------
diff --git a/stratosphere/libstratosphere/.gitignore b/stratosphere/libstratosphere/.gitignore
deleted file mode 100644
index f55c55a62..000000000
--- a/stratosphere/libstratosphere/.gitignore
+++ /dev/null
@@ -1,74 +0,0 @@
-# Prerequisites
-*.d
-
-# Object files
-*.o
-*.ko
-*.obj
-*.elf
-
-# Linker output
-*.ilk
-*.map
-*.exp
-*.lst
-
-# Precompiled Headers
-*.gch
-*.pch
-
-# Libraries
-*.lib
-*.a
-*.la
-*.lo
-
-# Shared objects (inc. Windows DLLs)
-*.dll
-*.so
-*.so.*
-*.dylib
-
-# Executables
-*.exe
-*.out
-*.app
-*.i*86
-*.x86_64
-*.hex
-
-# Switch Executables
-*.nso
-*.nro
-*.nacp
-*.npdm
-*.pfs0
-*.nsp
-*.kip
-
-# Debug files
-*.dSYM/
-*.su
-*.idb
-*.pdb
-
-# Kernel Module Compile Results
-*.mod*
-*.cmd
-.tmp_versions/
-modules.order
-Module.symvers
-Mkfile.old
-dkms.conf
-
-# Distribution files
-*.tgz
-*.zip
-
-.**/
-
-# NOTE: make sure to make exceptions to this pattern when needed!
-*.bin
-
-**/out
-**/build
diff --git a/stratosphere/libstratosphere/.gitmodules b/stratosphere/libstratosphere/.gitmodules
deleted file mode 100644
index e69de29bb..000000000
diff --git a/stratosphere/libstratosphere/.gitrepo b/stratosphere/libstratosphere/.gitrepo
deleted file mode 100644
index 247decb03..000000000
--- a/stratosphere/libstratosphere/.gitrepo
+++ /dev/null
@@ -1,12 +0,0 @@
-; DO NOT EDIT (unless you know what you are doing)
-;
-; This subdirectory is a git "subrepo", and this file is maintained by the
-; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
-;
-[subrepo]
- remote = https://github.com/Atmosphere-NX/libstratosphere
- branch = master
- commit = 303fc400dda9e592acbcb405153dd0dbde36281d
- parent = 9d7b52e2d4c0112f0f6d708faa66ea53f53961e4
- method = merge
- cmdver = 0.4.0
diff --git a/stratosphere/libstratosphere/LICENSE b/stratosphere/libstratosphere/LICENSE
deleted file mode 100644
index ecbc05937..000000000
--- a/stratosphere/libstratosphere/LICENSE
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that 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, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
\ No newline at end of file
diff --git a/stratosphere/libstratosphere/Makefile b/stratosphere/libstratosphere/Makefile
deleted file mode 100644
index 08d494fe5..000000000
--- a/stratosphere/libstratosphere/Makefile
+++ /dev/null
@@ -1,142 +0,0 @@
-#---------------------------------------------------------------------------------
-.SUFFIXES:
-#---------------------------------------------------------------------------------
-
-ifeq ($(strip $(DEVKITPRO)),)
-$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=/devkitpro")
-endif
-
-TOPDIR ?= $(CURDIR)
-include $(DEVKITPRO)/libnx/switch_rules
-
-#---------------------------------------------------------------------------------
-# TARGET is the name of the output
-# SOURCES is a list of directories containing source code
-# DATA is a list of directories containing data files
-# INCLUDES is a list of directories containing header files
-#---------------------------------------------------------------------------------
-TARGET := $(notdir $(CURDIR))
-SOURCES ?= $(shell find source -type d)
-DATA := data
-INCLUDES := include
-
-DEFINES :=
-
-#---------------------------------------------------------------------------------
-# options for code generation
-#---------------------------------------------------------------------------------
-ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
-
-CFLAGS := -g -Wall -O2 -ffunction-sections \
- $(ARCH) $(DEFINES)
-
-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
-
-#---------------------------------------------------------------------------------
-# list of directories containing libraries, this must be the top level containing
-# include and lib
-#---------------------------------------------------------------------------------
-LIBDIRS := $(PORTLIBS) $(LIBNX)
-
-#---------------------------------------------------------------------------------
-# no real need to edit anything past this point unless you need to add additional
-# rules for different file extensions
-#---------------------------------------------------------------------------------
-ifneq ($(BUILD),$(notdir $(CURDIR)))
-#---------------------------------------------------------------------------------
-
-export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
- $(foreach dir,$(DATA),$(CURDIR)/$(dir))
-
-CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
-CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
-SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
-BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
-
-#---------------------------------------------------------------------------------
-# use CXX for linking C++ projects, CC for standard C
-#---------------------------------------------------------------------------------
-ifeq ($(strip $(CPPFILES)),)
-#---------------------------------------------------------------------------------
- export LD := $(CC)
-#---------------------------------------------------------------------------------
-else
-#---------------------------------------------------------------------------------
- export LD := $(CXX)
-#---------------------------------------------------------------------------------
-endif
-#---------------------------------------------------------------------------------
-
-export OFILES_BIN := $(addsuffix .o,$(BINFILES))
-export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
-export OFILES := $(OFILES_BIN) $(OFILES_SRC)
-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/
-
-.PHONY: clean all
-
-#---------------------------------------------------------------------------------
-all: lib/$(TARGET).a
-
-lib:
- @[ -d $@ ] || mkdir -p $@
-
-release:
- @[ -d $@ ] || mkdir -p $@
-
-lib/$(TARGET).a : lib release $(SOURCES) $(INCLUDES)
- @$(MAKE) BUILD=release OUTPUT=$(CURDIR)/$@ \
- BUILD_CFLAGS="-DNDEBUG=1 -O2" \
- DEPSDIR=$(CURDIR)/release \
- --no-print-directory -C release \
- -f $(CURDIR)/Makefile
-
-dist-bin: all
- @tar --exclude=*~ -cjf $(TARGET).tar.bz2 include lib
-
-dist-src:
- @tar --exclude=*~ -cjf $(TARGET)-src.tar.bz2 include source Makefile
-
-dist: dist-src dist-bin
-
-#---------------------------------------------------------------------------------
-clean:
- @echo clean ...
- @rm -fr release lib *.bz2
-
-#---------------------------------------------------------------------------------
-else
-
-DEPENDS := $(OFILES:.o=.d)
-
-#---------------------------------------------------------------------------------
-# main targets
-#---------------------------------------------------------------------------------
-$(OUTPUT) : $(OFILES)
-
-$(OFILES_SRC) : $(HFILES)
-
-#---------------------------------------------------------------------------------
-%_bin.h %.bin.o : %.bin
-#---------------------------------------------------------------------------------
- @echo $(notdir $<)
- @$(bin2o)
-
-
--include $(DEPENDS)
-
-#---------------------------------------------------------------------------------------
-endif
-#---------------------------------------------------------------------------------------
-
diff --git a/stratosphere/libstratosphere/README.md b/stratosphere/libstratosphere/README.md
deleted file mode 100644
index 0dc7138b4..000000000
--- a/stratosphere/libstratosphere/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-![License](https://img.shields.io/badge/License-GPLv2-blue.svg)
-
-libstratosphere is a work-in-progress C++ library for development of system modules for the Nintendo Switch.
-
-It is built around extending [libnx](https://github.com/switchbrew/libnx).
-
-It also provides bindings for custom extensions to Horizon OS implemented by [Atmosphère](https://github.com/Atmosphere-NX).
-
-Licensing
-=====
-
-This software is licensed under the terms of the GPLv2, with exemptions for specific projects noted below.
-
-You can find a copy of the license in the [LICENSE file](LICENSE).
-
-Exemptions:
-* The [yuzu emulator project](https://github.com/yuzu-emu/yuzu) is exempt from GPLv2 licensing and may (at its option) instead license any source code authored for the libstratosphere project as GPLv2 or later.
-
-Credits
-=====
-
-libstratosphere is currently being developed and maintained by __SciresM__.
-
-In addition to those credited in [Atmosphère's credits](https://github.com/Atmosphere-NX/Atmosphere/blob/master/README.md#Credits), we would like to thank for contributing to libstratosphere in some significant way:
-
-* __hthh__
-* __fincs__
-* __lioncash__
-* __misson20000__
-* __neobrain__
-* __yellows8__
diff --git a/stratosphere/libstratosphere/include/atmosphere/common.hpp b/stratosphere/libstratosphere/include/atmosphere/common.hpp
deleted file mode 100644
index 6a87be4fe..000000000
--- a/stratosphere/libstratosphere/include/atmosphere/common.hpp
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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 "common_includes.hpp"
-#include "defines.hpp"
-#include "util.hpp"
-#include "results.hpp"
-#include "svc.hpp"
diff --git a/stratosphere/libstratosphere/include/atmosphere/common_includes.hpp b/stratosphere/libstratosphere/include/atmosphere/common_includes.hpp
deleted file mode 100644
index 82887c8aa..000000000
--- a/stratosphere/libstratosphere/include/atmosphere/common_includes.hpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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
-
-/* C headers. */
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/* C++ headers. */
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include