aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-09-02 14:20:02 -0400
committerRuss Cox <rsc@golang.org>2010-09-02 14:20:02 -0400
commit5bf658cc8f4bab6fa2f7e9e641d6df18db78ab1e (patch)
treeaa4c5b158b81922337c8fad057e992ecf11a22a0 /src
parent4e645558947725b8577f71dbb14d43e5852611cb (diff)
downloadgo-5bf658cc8f4bab6fa2f7e9e641d6df18db78ab1e.tar.xz
build: create bin and pkg directories as needed; drop from hg
R=dsymonds, r CC=golang-dev https://golang.org/cl/2050043
Diffstat (limited to 'src')
-rw-r--r--src/env.bash2
-rwxr-xr-xsrc/make.bash6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/env.bash b/src/env.bash
index b858e069b0..d96d50cb26 100644
--- a/src/env.bash
+++ b/src/env.bash
@@ -22,7 +22,7 @@ if [ "$DIR1" != "$DIR2" ]; then
fi
export GOBIN=${GOBIN:-"$GOROOT/bin"}
-if [ ! -d "$GOBIN" ]; then
+if [ ! -d "$GOBIN" -a "$GOBIN" != "$GOROOT/bin" ]; then
echo '$GOBIN is not a directory or does not exist' 1>&2
echo 'create it or set $GOBIN differently' 1>&2
exit 1
diff --git a/src/make.bash b/src/make.bash
index c778d922af..0a0f49455f 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -10,6 +10,12 @@ if [ ! -f env.bash ]; then
fi
. ./env.bash
+# Create target directories
+if [ "$GOBIN" = "$GOROOT/bin" ]; then
+ mkdir -p "$GOROOT/bin"
+fi
+mkdir -p "$GOROOT/pkg"
+
GOROOT_FINAL=${GOROOT_FINAL:-$GOROOT}
MAKEFLAGS=${MAKEFLAGS:-"-j4"}