]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/clean.bash
cmd/compile/internal/inline: score call sites exposed by inlines
[gostls13.git] / src / clean.bash
index 96fcaf795b31ae21e44e8e59f7d96bf5173234fa..decfa462f9807f1d8880d98a82e85e44405dd79e 100755 (executable)
@@ -5,34 +5,18 @@
 
 set -e
 
-if [ ! -f env.bash ]; then
+if [ ! -f run.bash ]; then
        echo 'clean.bash must be run from $GOROOT/src' 1>&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
+export GOROOT="$(cd .. && pwd)"
 
-if [ "$1" != "--nopkg" ]; then
-       rm -rf "$GOROOT"/pkg/${GOOS}_$GOARCH
+gobin="${GOROOT}"/bin
+if ! "$gobin"/go help >/dev/null 2>&1; then
+       echo 'cannot find go command; nothing to clean' >&2
+       exit 1
 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
+"$gobin/go" clean -i std
+"$gobin/go" tool dist clean
+"$gobin/go" clean -i cmd