From 3e45412327a2654a77944249962b3652e6142299 Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Mon, 17 Jan 2011 12:40:45 +0100 Subject: Imported Upstream version 2011.01.12 --- src/clean.bash | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/clean.bash') diff --git a/src/clean.bash b/src/clean.bash index 567e6e319..d96eb52df 100755 --- a/src/clean.bash +++ b/src/clean.bash @@ -5,16 +5,21 @@ set -e -if [ -z "$GOROOT" ] ; then - echo '$GOROOT not set' +if [ ! -f env.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 -GOBIN="${GOBIN:-$HOME/bin}" - -rm -rf "$GOROOT"/pkg/${GOOS}_$GOARCH +if [ "$1" != "--nopkg" ]; then + rm -rf "$GOROOT"/pkg/${GOOS}_$GOARCH +fi rm -f "$GOROOT"/lib/*.a -for i in lib9 libbio libcgo libmach cmd pkg \ +for i in lib9 libbio libmach cmd pkg \ ../misc/cgo/gmp ../misc/cgo/stdio \ ../test/bench ../test/garbage do( @@ -22,6 +27,6 @@ do( if test -f clean.bash; then bash clean.bash else - "$GOBIN"/gomake clean + gomake clean fi )done -- cgit v1.2.3