summaryrefslogtreecommitdiff
path: root/src/clean.bash
diff options
context:
space:
mode:
authorDevon H. O'Dell <devon.odell@gmail.com>2009-12-11 15:14:09 -0800
committerDevon H. O'Dell <devon.odell@gmail.com>2009-12-11 15:14:09 -0800
commitc380899bb1c208294eb7c1fdfeaba25188a5f15b (patch)
tree2983280de546e6fd900fb4e74550f80fe688acaf /src/clean.bash
parent0c97f9574df48f9d8aaf49dd63b237adefed3741 (diff)
downloadgo-c380899bb1c208294eb7c1fdfeaba25188a5f15b.tar.gz
Remove GOBIN in PATH dependency; don't assume cwd is $GOROOT/src
This change removes the necessity to have GOBIN in $PATH, and also doesn't assume that the build is being run from $GOROOT/src. This is a minimal set of necessary changes to get Go to build happily from the FreeBSD ports collection. R=rsc CC=golang-dev http://codereview.appspot.com/171044 Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/clean.bash')
-rwxr-xr-xsrc/clean.bash6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/clean.bash b/src/clean.bash
index f6fc6d1f5..3687244b2 100755
--- a/src/clean.bash
+++ b/src/clean.bash
@@ -3,16 +3,18 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
+GOBIN="${GOBIN:-$HOME/bin}"
+
rm -rf "$GOROOT"/pkg/${GOOS}_$GOARCH
rm -f "$GOROOT"/lib/*.a
for i in lib9 libbio libcgo libmach cmd pkg \
../misc/cgo/gmp ../misc/cgo/stdio \
../test/bench
do(
- cd $i || exit 1
+ cd "$GOROOT"/src/$i || exit 1
if test -f clean.bash; then
bash clean.bash
else
- gomake clean
+ "$GOBIN"/gomake clean
fi
)done