build.sh: improve build process

This commit is contained in:
Lightos1
2026-05-10 01:51:22 +02:00
parent 12f12c6b1e
commit badf182529
2 changed files with 40 additions and 10 deletions

View File

@@ -7,15 +7,41 @@ DEST="build/stratosphere/loader/"
mkdir -p "dist/atmosphere/kips/"
mkdir -p "$DEST"
cp -r "$SRC"/. "$DEST"/
echo
echo "*** Patching loader ***"
cp -vr "$SRC"/. "$DEST"/
echo
echo "*** Patching exosphere ***"
EXO_SRC="Source/Atmosphere-Patches"
EXO_DEST="build/exosphere/program/source/smc"
LIBEXO_DEST="build/libraries/libexosphere/include/exosphere/secmon"
cp -v "$EXO_SRC/secmon_emc_access_table_data.inc" "$EXO_DEST/"
cp -v "$EXO_SRC/secmon_define_emc_access_table.inc" "$EXO_DEST/"
cp -v "$EXO_SRC/secmon_rtc_pmc_access_table_data.inc" "$EXO_DEST/"
cp -v "$EXO_SRC/secmon_define_rtc_pmc_access_table.inc" "$EXO_DEST/"
cp -v "$EXO_SRC/secmon_smc_register_access.cpp" "$EXO_DEST/"
cp -v "$EXO_SRC/secmon_smc_handler.cpp" "$EXO_DEST/"
cp -v "$EXO_SRC/secmon_memory_layout.hpp" "$LIBEXO_DEST/"
echo
echo "CORES: $CORES"
echo
echo "*** Compiling loader ***"
cd build/stratosphere/loader || exit 1
make -j$CORES
hactool -t kip1 out/nintendo_nx_arm64_armv8a/release/loader.kip --uncompress=hoc.kip
cd ../../../ # exit
cp build/stratosphere/loader/hoc.kip dist/atmosphere/kips/hoc.kip
cp -v build/stratosphere/loader/hoc.kip dist/atmosphere/kips/hoc.kip
echo
echo "*** Compiling exosphere ***"
cd build/exosphere
make -j$CORES
cd ../../
cp -v build/exosphere/out/nintendo_nx_arm64_armv8a/release/exosphere.bin dist/atmosphere/exosphere.bin
cd Source/hoc-clk/
./build.sh
@@ -23,6 +49,7 @@ cp -r dist/ ../../
cd ../../
echo "*** Compiling horizon-oc-monitor ***"
cd Source/Horizon-OC-Monitor/
make -j$CORES
cp Horizon-OC-Monitor.ovl ../../dist/switch/.overlays/Horizon-OC-Monitor.ovl
cp -v Horizon-OC-Monitor.ovl ../../dist/switch/.overlays/Horizon-OC-Monitor.ovl