summaryrefslogtreecommitdiff
path: root/src/clean.bash
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2012-02-04 00:54:08 -0500
committerRuss Cox <rsc@golang.org>2012-02-04 00:54:08 -0500
commite943b5875300074ee7c0a22a562246cc1641f17a (patch)
tree4d55df98a088acb205f199bfc5474852fd6f227f /src/clean.bash
parentff39c5ed4b452204511fdc623893f5ce2fc56491 (diff)
downloadgo-e943b5875300074ee7c0a22a562246cc1641f17a.tar.gz
build: use cmd/dist
R=bradfitz, ality, r, r, iant, mikioh.mikioh CC=golang-dev http://codereview.appspot.com/5615058
Diffstat (limited to 'src/clean.bash')
-rwxr-xr-xsrc/clean.bash33
1 files changed, 5 insertions, 28 deletions
diff --git a/src/clean.bash b/src/clean.bash
index 96fcaf795..958ff7369 100755
--- a/src/clean.bash
+++ b/src/clean.bash
@@ -5,34 +5,11 @@
set -e
-if [ ! -f env.bash ]; then
- echo 'clean.bash must be run from $GOROOT/src' 1>&2
+if [ ! -x ../bin/tool/dist ]; then
+ echo 'cannot find ../bin/tool/dist; nothing to clean' >&2
exit 1
fi
-. ./env.bash
-if [ ! -f Make.inc ] ; then
- GOROOT_FINAL=${GOROOT_FINAL:-$GOROOT}
- sed 's!@@GOROOT@@!'"$GOROOT_FINAL"'!' Make.inc.in >Make.inc
-fi
-
-if [ "$1" != "--nopkg" ]; then
- rm -rf "$GOROOT"/pkg/${GOOS}_$GOARCH
-fi
-rm -f "$GOROOT"/lib/*.a
-for i in lib9 libbio libmach cmd
-do
- # Do not use gomake here. It may not be available.
- $MAKE -C "$GOROOT/src/$i" clean
-done
-if [ -x "$GOBIN/go" ]; then
- go clean std || true # go command might not know about clean
-
- # TODO: Make clean work in directories outside $GOPATH
- true || go clean \
- ../misc/cgo/gmp ../misc/cgo/stdio \
- ../misc/cgo/life ../misc/cgo/test \
- ../misc/dashboard/builder ../misc/goplay\
- ../doc/codelab/wiki\
- ../test/bench/shootout ../test/bench/garbage ../test/bench/go1
-fi
+eval $(../bin/tool/dist env)
+"$GOBIN/go" clean -i std
+../bin/tool/dist clean