]> Cypherpunks.ru repositories - gostls13.git/blob - src/clean.bash
test/garbage: move to test/bench/garbage
[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 [ ! -f env.bash ]; then
9         echo 'clean.bash must be run from $GOROOT/src' 1>&2
10         exit 1
11 fi
12 . ./env.bash
13 if [ ! -f Make.inc ] ; then
14     GOROOT_FINAL=${GOROOT_FINAL:-$GOROOT}
15     sed 's!@@GOROOT@@!'"$GOROOT_FINAL"'!' Make.inc.in >Make.inc
16 fi
17
18 if [ "$1" != "--nopkg" ]; then
19         rm -rf "$GOROOT"/pkg/${GOOS}_$GOARCH
20 fi
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\
26         ../doc/codelab/wiki\
27         ../test/bench/shootout ../test/bench/garbage
28 do
29         # Do not use gomake here. It may not be available.
30         $MAKE -C "$GOROOT/src/$i" clean
31 done