chore: parallel builds with Makefile (#3854)

* Revert "revert: Makefile buff-ification (#3700) (#3848)"

This reverts commit e490bdd531.

* fix: fix slim targets in makefile

* fix: don't clobber slim binaries, make sure they're in the correct location
This commit is contained in:
Dean Sheather
2022-09-07 03:27:06 +10:00
committed by GitHub
parent 4f0105ef7e
commit 419d701927
18 changed files with 530 additions and 716 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