diff --git a/build-exosphere.sh b/build-exosphere.sh index 1a2f557d..c7d6340f 100755 --- a/build-exosphere.sh +++ b/build-exosphere.sh @@ -41,9 +41,25 @@ cp -v "$EXO_SRC/secmon_memory_layout.hpp" "$LIBEXO_DEST/" echo echo "*** Compiling exosphere ***" cd "$ATMOSPHERE_DIR/exosphere" || exit 1 -make -j"$CORES" + +# .d files store absolute source paths. If this checkout moved (e.g. renamed +# Horizon-OC -> Horizon-OC-pro), those deps point at a dead tree and make fails. +if grep -Rql --include='*.d' '/Desktop/Horizon-OC/' "$ATMOSPHERE_DIR" 2>/dev/null; then + echo "*** Cleaning stale build deps (old Horizon-OC absolute paths) ***" + make clean || true +fi + +make -j"$CORES" || { + echo "*** Build failed ***" >&2 + exit 1 +} cd "$ROOT_DIR" || exit 1 +if [ ! -f "$EXO_OUT" ]; then + echo "*** Missing output: $EXO_OUT ***" >&2 + exit 1 +fi + mkdir -p "$DIST_DIR/atmosphere" cp -v "$EXO_OUT" "$DIST_DIR/atmosphere/exosphere.bin"