diff options
author | Russ Cox <rsc@golang.org> | 2010-03-31 19:48:33 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-03-31 19:48:33 -0700 |
commit | 01adb1764725174c72ecf19623761c0ba03ae29b (patch) | |
tree | 61a7e9808e8c19bf7a3a6e37db25f98da1eef010 /src/make.bash | |
parent | ed3cf90f3df0a181f78da077da6935241846c23e (diff) | |
download | golang-01adb1764725174c72ecf19623761c0ba03ae29b.tar.gz |
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
http://codereview.appspot.com/609042
Diffstat (limited to 'src/make.bash')
-rwxr-xr-x | src/make.bash | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/src/make.bash b/src/make.bash index c2a350af7..d8638145e 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 |