2 # Copyright 2009 The Go Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style
4 # license that can be found in the LICENSE file.
8 if [ ! -f env.bash ]; then
9 echo 'clean.bash must be run from $GOROOT/src' 1>&2
13 if [ ! -f Make.inc ] ; then
14 GOROOT_FINAL=${GOROOT_FINAL:-$GOROOT}
15 sed 's!@@GOROOT@@!'"$GOROOT_FINAL"'!' Make.inc.in >Make.inc
18 if [ "$1" != "--nopkg" ]; then
19 rm -rf "$GOROOT"/pkg/${GOOS}_$GOARCH
21 rm -f "$GOROOT"/lib/*.a
22 for i in lib9 libbio libmach cmd pkg \
23 ../misc/cgo/gmp ../misc/cgo/stdio \
24 ../misc/cgo/life ../misc/cgo/test \
25 ../misc/dashboard/builder ../misc/goplay\
27 ../test/bench/shootout ../test/bench/garbage
29 # Do not use gomake here. It may not be available.
30 $MAKE -C "$GOROOT/src/$i" clean