summaryrefslogtreecommitdiff
path: root/src/clean.bash
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-01-17 12:40:45 +0100
committerOndřej Surý <ondrej@sury.org>2011-01-17 12:40:45 +0100
commit3e45412327a2654a77944249962b3652e6142299 (patch)
treebc3bf69452afa055423cbe0c5cfa8ca357df6ccf /src/clean.bash
parentc533680039762cacbc37db8dc7eed074c3e497be (diff)
downloadgolang-3e45412327a2654a77944249962b3652e6142299.tar.gz
Imported Upstream version 2011.01.12upstream/2011.01.12
Diffstat (limited to 'src/clean.bash')
-rwxr-xr-xsrc/clean.bash19
1 files changed, 12 insertions, 7 deletions
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