diff --git a/build b/build index 71b49cf828..c10c2fc9d8 100755 --- a/build +++ b/build @@ -4,10 +4,39 @@ set -eu TARGET="$1" # Example: riscv64-linux-gnu MCPU="$2" # Examples: `baseline`, `native`, `generic+v7a`, or `arm1176jzf_s` +BUILDMODE="$3" # Examples below ROOTDIR="$(pwd)" ZIG_VERSION="0.11.0-dev.2680+a1aa55ebe" +case "$BUILDMODE" in + ReleaseSafeDbgSym) + OPTIMIZE=ReleaseSafe + DBGSYM=Yes + ZIG_STRIP= + ;; + ReleaseFastStrip) + OPTIMIZE=ReleaseFast + DBGSYM=No + ZIG_STRIP=-D + ;; + *) + >&2 printf "Unsupported build mode %s. Expecting %s or %s\n" \ + "$BUILDMODE" ReleaseSafeDbgSym ReleaseFastStrip + exit 1 + ;; +esac + +cat <