2009-11-14 15:29:09 -08:00
|
|
|
#!/usr/bin/env bash
|
2008-06-12 13:26:16 -07:00
|
|
|
# Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
|
# Use of this source code is governed by a BSD-style
|
|
|
|
|
# license that can be found in the LICENSE file.
|
|
|
|
|
|
2009-12-13 12:27:19 -08:00
|
|
|
set -e
|
|
|
|
|
|
2010-08-19 00:09:11 -04:00
|
|
|
if [ ! -f env.bash ]; then
|
|
|
|
|
echo 'clean.bash must be run from $GOROOT/src' 1>&2
|
2009-12-13 12:27:19 -08:00
|
|
|
exit 1
|
|
|
|
|
fi
|
2010-08-19 00:09:11 -04:00
|
|
|
. ./env.bash
|
|
|
|
|
if [ ! -f Make.inc ] ; then
|
|
|
|
|
GOROOT_FINAL=${GOROOT_FINAL:-$GOROOT}
|
|
|
|
|
sed 's!@@GOROOT@@!'"$GOROOT_FINAL"'!' Make.inc.in >Make.inc
|
2010-07-22 10:15:36 +10:00
|
|
|
fi
|
2009-12-13 12:27:19 -08:00
|
|
|
|
2010-07-30 14:00:59 +10:00
|
|
|
if [ "$1" != "--nopkg" ]; then
|
|
|
|
|
rm -rf "$GOROOT"/pkg/${GOOS}_$GOARCH
|
|
|
|
|
fi
|
2009-11-23 17:32:51 -08:00
|
|
|
rm -f "$GOROOT"/lib/*.a
|
2010-12-08 14:36:45 -05:00
|
|
|
for i in lib9 libbio libmach cmd pkg \
|
2009-10-03 10:38:03 -07:00
|
|
|
../misc/cgo/gmp ../misc/cgo/stdio \
|
2010-02-09 13:33:00 -08:00
|
|
|
../test/bench ../test/garbage
|
2009-10-03 10:38:03 -07:00
|
|
|
do(
|
2009-12-11 15:14:09 -08:00
|
|
|
cd "$GOROOT"/src/$i || exit 1
|
2009-10-03 10:38:03 -07:00
|
|
|
if test -f clean.bash; then
|
2011-02-04 14:33:08 -05:00
|
|
|
bash clean.bash --gomake $MAKE
|
2009-10-03 10:38:03 -07:00
|
|
|
else
|
2011-02-04 14:33:08 -05:00
|
|
|
$MAKE clean
|
2009-10-03 10:38:03 -07:00
|
|
|
fi
|
|
|
|
|
)done
|