set -euo pipefail
cd "$(dirname "$")"
BUILD_DIR="build/client"
echo "============================================================"
echo " Building DEXT Contiguous Allocation Client"
echo "============================================================"
# โโ Build with cargo โโ
echo ""
echo "--- Building Rust client ---"
cd client
cargo build --release 2>&1
cd ..
# โโ Copy binary โโ
mkdir -p "${BUILD_DIR}"
cp client/target/release/dext_contiguous_client "${BUILD_DIR}/"
echo ""
echo "--- Build complete ---"
echo " Binary: ${BUILD_DIR}/dext_contiguous_client"
echo ""
echo " To run (no special entitlements needed for standalone mode):"
echo " ${BUILD_DIR}/dext_contiguous_client"
echo ""
echo " For DEXT mode, first install the DEXT (see build_dext.sh)."
echo ""