diff options
Diffstat (limited to 'src/clean.bash')
-rwxr-xr-x | src/clean.bash | 33 |
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 |