]> 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 98e1b944af00c48cbb8e5e23f8baa344bd7f0a84..decfa462f9807f1d8880d98a82e85e44405dd79e 100755 (executable)
@@ -5,27 +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 pkg \
-       ../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
-do
-       # Do not use gomake here. It may not be available.
-       $MAKE -C "$GOROOT/src/$i" clean
-done
+
+"$gobin/go" clean -i std
+"$gobin/go" tool dist clean
+"$gobin/go" clean -i cmd