Cross targets: auto-build missing cross-Chez kernel instead of erroring
ober
b282b828bec6d00793537fa77a04e3934ef52209
--- a/Makefile +++ b/Makefile @@ -298,10 +298,10 @@ linux-amd64: gen echo "ERROR: x86_64-linux-musl-gcc not found on PATH."; \ echo "Install with: brew install FiloSottile/musl-cross/musl-cross"; \ exit 1; } - @test -d $(JERBOA_HOME)/.chez-cross-ta6le || { \ - echo "ERROR: cross-built Chez not found at $(JERBOA_HOME)/.chez-cross-ta6le"; \ - echo "Build it with: cd $(JERBOA_HOME) && make chez-cross"; \ - exit 1; } + @if test ! -d $(JERBOA_HOME)/.chez-cross-ta6le || test ! -f $(JERBOA_HOME)/build/chez/xc-ta6le/s/xpatch; then \ + echo "=== cross Chez (ta6le) missing — building it in $(JERBOA_HOME) (one-time) ==="; \ + $(MAKE) -C $(JERBOA_HOME) chez-cross CHEZ_TARGET_MACHINE=ta6le CROSS_CC=x86_64-linux-musl-gcc; \ + fi @command -v cargo >/dev/null 2>&1 || { \ echo "ERROR: cargo not found on PATH. Install rustup from rustup.rs"; \ exit 1; } @@ -314,10 +314,10 @@ linux-arm64: gen echo "ERROR: aarch64-linux-musl-gcc not found on PATH."; \ echo "Install with: brew install FiloSottile/musl-cross/musl-cross"; \ exit 1; } - @test -d $(JERBOA_HOME)/.chez-cross-tarm64le || { \ - echo "ERROR: cross-built Chez not found at $(JERBOA_HOME)/.chez-cross-tarm64le"; \ - echo "Build it with: cd $(JERBOA_HOME) && make chez-cross-tarm64le"; \ - exit 1; } + @if test ! -d $(JERBOA_HOME)/.chez-cross-tarm64le || test ! -f $(JERBOA_HOME)/build/chez/xc-tarm64le/s/xpatch; then \ + echo "=== cross Chez (tarm64le) missing — building it in $(JERBOA_HOME) (one-time) ==="; \ + $(MAKE) -C $(JERBOA_HOME) chez-cross CHEZ_TARGET_MACHINE=tarm64le CROSS_CC=aarch64-linux-musl-gcc; \ + fi @command -v cargo >/dev/null 2>&1 || { \ echo "ERROR: cargo not found on PATH. Install rustup from rustup.rs"; \ exit 1; } @@ -351,10 +351,10 @@ freebsd-amd64: gen echo "ERROR: $(FREEBSD_AMD64_CC) not found or not executable" >&2; \ echo " See top of Makefile freebsd-amd64 target for setup notes." >&2; \ exit 1; } - @test -d $(JERBOA_HOME)/.chez-cross-ta6fb || { \ - echo "ERROR: $(JERBOA_HOME)/.chez-cross-ta6fb not found" >&2; \ - echo " cd $(JERBOA_HOME) && make binary" >&2; \ - exit 1; } + @if test ! -d $(JERBOA_HOME)/.chez-cross-ta6fb || test ! -f $(JERBOA_HOME)/build/chez/xc-ta6fb/s/xpatch; then \ + echo "=== cross Chez (ta6fb) missing — building it in $(JERBOA_HOME) (one-time) ==="; \ + $(MAKE) -C $(JERBOA_HOME) chez-cross CHEZ_TARGET_MACHINE=ta6fb CROSS_CC="$(FREEBSD_AMD64_CC)"; \ + fi @command -v cargo >/dev/null 2>&1 || { \ echo "ERROR: cargo not found on PATH. Install rustup from rustup.rs"; \ exit 1; }