]> Cypherpunks.ru repositories - gostls13.git/blob - src/clean.bash
misc/builder: support for uploading tarballs to googlecode
[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 if [ -z "$GOOS" ] ; then
13         echo '$GOOS not set'
14         exit 1
15 fi
16 if [ -z "$GOARCH" ] ; then
17         echo '$GOARCH not set'
18         exit 1
19 fi
20
21 GOBIN="${GOBIN:-$HOME/bin}"
22
23 if [ "$1" != "--nopkg" ]; then
24         rm -rf "$GOROOT"/pkg/${GOOS}_$GOARCH
25 fi
26 rm -f "$GOROOT"/lib/*.a
27 for i in lib9 libbio libcgo libmach cmd pkg \
28         ../misc/cgo/gmp ../misc/cgo/stdio \
29         ../test/bench ../test/garbage
30 do(
31         cd "$GOROOT"/src/$i || exit 1
32         if test -f clean.bash; then
33                 bash clean.bash
34         else
35                 "$GOBIN"/gomake clean
36         fi
37 )done