Makefile buff-ification (#3700)

Remove old go_build_matrix and go_build_slim scripts in favor of full makefile-ification.
This commit is contained in:
Dean Sheather
2022-09-02 22:58:23 +10:00
committed by GitHub
parent 46bf265e9b
commit e1a4f3a16b
16 changed files with 520 additions and 712 deletions

View File

@ -7,17 +7,18 @@ set -euo pipefail
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
# shellcheck disable=SC1091,SC1090
source "${SCRIPT_DIR}/lib.sh"
PROJECT_ROOT=$(cd "$SCRIPT_DIR" && git rev-parse --show-toplevel)
CODER_DEV_DIR="$PROJECT_ROOT/.coderv2/"
CODER_DEV_BIN="${CODER_DEV_DIR}/coder"
if [[ ! -d "${CODER_DEV_DIR}" ]]; then
mkdir -p "${CODER_DEV_DIR}"
fi
GOOS="$(go env GOOS)"
GOARCH="$(go env GOARCH)"
CODER_DEV_BIN="build/coder_${GOOS}_${GOARCH}"
cdroot
mkdir -p ./.coderv2
CODER_DEV_DIR="$(realpath ./.coderv2)"
if [[ ! -x "${CODER_DEV_BIN}" ]]; then
echo "Run this command first:"
echo "go build -o ${CODER_DEV_BIN} ${PROJECT_ROOT}/enterprise/cmd/coder"
echo " make $CODER_DEV_BIN"
exit 1
fi