]> Cypherpunks.ru repositories - gostls13.git/blob - src/clean.bash
clean.bash: stop if $GOROOT is not set
[gostls13.git] / src / clean.bash
1 #!/usr/bin/env bash
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.
5
6 set -e
7
8 if [ -z "$GOROOT" ] ; then
9         echo '$GOROOT not set'
10         exit 1
11 fi
12
13 GOBIN="${GOBIN:-$HOME/bin}"
14
15 rm -rf "$GOROOT"/pkg/${GOOS}_$GOARCH
16 rm -f "$GOROOT"/lib/*.a
17 for i in lib9 libbio libcgo libmach cmd pkg \
18         ../misc/cgo/gmp ../misc/cgo/stdio \
19         ../test/bench
20 do(
21         cd "$GOROOT"/src/$i || exit 1
22         if test -f clean.bash; then
23                 bash clean.bash
24         else
25                 "$GOBIN"/gomake clean
26         fi
27 )done