aboutsummaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2012-01-29 09:19:05 -0800
committerRob Pike <r@golang.org>2012-01-29 09:19:05 -0800
commit79dc34413e4ad93cc8c590e9f3cc97538c7f8266 (patch)
tree011b368a62ab84425a66ef28500cfd450664b898 /src/make.bash
parent3d400db5de91ede0fb36c2c045a0572f731a1dc4 (diff)
downloadgo-79dc34413e4ad93cc8c590e9f3cc97538c7f8266.tar.xz
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
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/make.bash b/src/make.bash
index 34708b5063..aeaa181090 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -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"}