Files
storkit/Makefile
Dave 158550e889 Story 54: add cross-platform binary distribution support
- Add Makefile with build-macos and build-linux targets
  - build-macos: cargo build --release (native macOS binary)
  - build-linux: cross build --release --target x86_64-unknown-linux-musl
    (produces a fully static binary via Docker/cross; zero dynamic deps)
- Document cross-platform build process in README.md including
  how to verify macOS dynamic deps (otool -L) and Linux static
  linking (file + ldd)
- reqwest 0.13 already uses rustls by default (no OpenSSL); verified
  in Cargo.lock – no Cargo.toml changes needed
- Add unit tests to http/assets.rs covering:
  - SPA fallback routing for non-asset paths
  - 404 for missing assets/ paths
  - Panic-free behaviour on empty path
  - rust-embed EmbeddedAssets iter compiles and runs correctly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 17:15:28 +00:00

29 lines
1.2 KiB
Makefile
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
.PHONY: help build-macos build-linux
help:
@echo "Story Kit cross-platform build targets"
@echo ""
@echo " make build-macos Build native macOS release binary"
@echo " make build-linux Build static Linux x86_64 release binary (requires cross + Docker)"
@echo ""
@echo "Prerequisites:"
@echo " build-macos: Rust stable toolchain, pnpm"
@echo " build-linux: cargo install cross AND Docker Desktop running"
@echo ""
@echo "Output:"
@echo " macOS : target/release/story-kit-server"
@echo " Linux : target/x86_64-unknown-linux-musl/release/story-kit-server"
## Build a native macOS release binary.
## The frontend is compiled by build.rs (pnpm build) and embedded via rust-embed.
## Verify dynamic deps afterwards: otool -L target/release/story-kit-server
build-macos:
cargo build --release
## Build a fully static Linux x86_64 binary using the musl libc target.
## cross (https://github.com/cross-rs/cross) handles the Docker-based cross-compilation.
## Install cross: cargo install cross
## The resulting binary has zero dynamic library dependencies (ldd reports "not a dynamic executable").
build-linux:
cross build --release --target x86_64-unknown-linux-musl