aboutsummaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-03-31 19:48:33 -0700
committerRuss Cox <rsc@golang.org>2010-03-31 19:48:33 -0700
commit69fd2a4ab74f1e11111f67a04ebd9cd4b31ea6d8 (patch)
treeee9b37268ce809b3c0d6e1ef6276d0b0649e91ac /src/make.bash
parentb12007c4ed6c5617a0d77db5be0bcf7fbba7a1b9 (diff)
downloadgo-69fd2a4ab74f1e11111f67a04ebd9cd4b31ea6d8.tar.xz
build script tweaks
factor out environment variable checks. infer $GOROOT etc during build if not set. it's still necessary to set them for yourself to use the standard Makefiles. when running all.bash, don't recompile all the go packages in run.bash, since make.bash already did. R=r CC=golang-dev https://golang.org/cl/609042
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash39
1 files changed, 1 insertions, 38 deletions
diff --git a/src/make.bash b/src/make.bash
index c2a350af7f..d8638145ea 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -4,48 +4,11 @@
# license that can be found in the LICENSE file.
set -e
+. ./env.bash
-if test -z "$GOBIN"; then
- if ! test -d "$HOME"/bin; then
- echo '$GOBIN is not set and $HOME/bin is not a directory or does not exist.' 1>&2
- echo 'mkdir $HOME/bin or set $GOBIN to a directory where binaries should' 1>&2
- echo 'be installed.' 1>&2
- exit 1
- fi
- GOBIN="$HOME/bin"
-elif ! test -d "$GOBIN"; then
- echo '$GOBIN is not a directory or does not exist' 1>&2
- echo 'create it or set $GOBIN differently' 1>&2
- exit 1
-fi
-
-GOBIN="${GOBIN:-$HOME/bin}"
export MAKEFLAGS=-j4
-
unset CDPATH # in case user has it set
-if ! test -f "$GOROOT"/include/u.h
-then
- echo '$GOROOT is not set correctly or not exported' 1>&2
- exit 1
-fi
-
-case "$GOARCH" in
-amd64 | 386 | arm)
- ;;
-*)
- echo '$GOARCH is set to <'$GOARCH'>, must be amd64, 386, or arm' 1>&2
- exit 1
-esac
-
-case "$GOOS" in
-darwin | freebsd | linux | mingw | nacl)
- ;;
-*)
- echo '$GOOS is set to <'$GOOS'>, must be darwin, freebsd, linux, mingw, or nacl' 1>&2
- exit 1
-esac
-
rm -f "$GOBIN"/quietgcc
CC=${CC:-gcc}
sed -e "s|@CC@|$CC|" < "$GOROOT"/src/quietgcc.bash > "$GOBIN"/quietgcc