[source]
git = "https://gitlab.redox-os.org/redox-os/bootstrap.git"

[build]
template = "custom"
script = """
ARCH="$(echo "${TARGET}" | cut -d - -f1)"
cargo \
    -Zbuild-std=core,alloc,compiler_builtins \
    -Zbuild-std-features=compiler-builtins-mem rustc \
    --target "${TARGET}" \
    --manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \
    --release \
    --target-dir "${COOKBOOK_BUILD}" \
    -- \
    --emit link="${COOKBOOK_BUILD}/${TARGET}/release/libbootstrap.a"
mkdir -v "${COOKBOOK_STAGE}/boot"
"${TARGET}-ld" \
    -o "${COOKBOOK_STAGE}/boot/bootstrap" \
    --gc-sections \
    -T "${COOKBOOK_SOURCE}/src/${ARCH}.ld" \
    -z max-page-size=4096 \
    "${COOKBOOK_BUILD}/${TARGET}/release/libbootstrap.a"
"""
