cmd/go: first piece of tool rearrangement

1) create go-tool dir in make.bash
2) clean up stale binaries in make.bash
3) add 'tool' command to go
4) convert goyacc->yacc as a first test tool
Since goyacc stands alone, it's a safe trial.

R=rsc
CC=golang-dev
https://golang.org/cl/5576061
This commit is contained in:
Rob Pike 2012-01-29 09:19:05 -08:00
parent 3d400db5de
commit 79dc34413e
26 changed files with 198 additions and 35 deletions

View file

@ -22,11 +22,21 @@ if ld --version 2>&1 | grep 'gold.* 2\.20' >/dev/null; then
fi
# Create target directories
if [ "$GOBIN" = "$GOROOT/bin" ]; then
mkdir -p "$GOROOT/bin"
fi
mkdir -p "$GOROOT/bin/go-tool"
mkdir -p "$GOROOT/pkg"
# Remove old, pre-go-tool binaries.
rm -f "$GOROOT"/bin/[568][acgl]
rm -f "$GOROOT"/bin/{6cov,6nm,cgo,ebnflint,goapi,gofix,goinstall,gomake,gopack,gopprof,gotest,gotype,govet,goyacc,hgpatch,quietgcc}
# If GOBIN is set and it has a Go compiler, it must also be cleaned.
if [ -n "GOBIN" ]; then
if [ -x "$GOBIN"/5g -o -x "$GOBIN"/6g -o -x "$GOBIN"/8g ]; then
rm -f "$GOBIN"/[568][acgl]
rm -f "$GOBIN"/{6cov,6nm,cgo,ebnflint,goapi,gofix,goinstall,gomake,gopack,gopprof,gotest,gotype,govet,goyacc,hgpatch,quietgcc}
fi
fi
GOROOT_FINAL=${GOROOT_FINAL:-$GOROOT}
MAKEFLAGS=${MAKEFLAGS:-"-j4"}