From 69fd2a4ab74f1e11111f67a04ebd9cd4b31ea6d8 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 31 Mar 2010 19:48:33 -0700 Subject: 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 --- src/run.bash | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'src/run.bash') diff --git a/src/run.bash b/src/run.bash index 35d499f956..85dd59a55e 100755 --- a/src/run.bash +++ b/src/run.bash @@ -4,12 +4,21 @@ # license that can be found in the LICENSE file. set -e +. ./env.bash -GOBIN="${GOBIN:-$HOME/bin}" +export MAKEFLAGS=-j4 +unset CDPATH # in case user has it set # no core files, please ulimit -c 0 +# allow make.bash to avoid double-build of everything +rebuild=true +if [ "$1" = "--no-rebuild" ]; then + rebuild=false + shift +fi + xcd() { echo echo --- cd $1 @@ -21,9 +30,11 @@ maketest() { do ( xcd $i - "$GOBIN"/gomake clean - time "$GOBIN"/gomake - "$GOBIN"/gomake install + if $rebuild; then + "$GOBIN"/gomake clean + time "$GOBIN"/gomake + "$GOBIN"/gomake install + fi "$GOBIN"/gomake test ) || exit $? done @@ -36,20 +47,26 @@ maketest \ # from what maketest does. (xcd pkg/sync; -"$GOBIN"/gomake clean; -time "$GOBIN"/gomake +if $rebuild; then + "$GOBIN"/gomake clean; + time "$GOBIN"/gomake +fi GOMAXPROCS=10 "$GOBIN"/gomake test ) || exit $? (xcd cmd/gofmt -"$GOBIN"/gomake clean -time "$GOBIN"/gomake +if $rebuild; then + "$GOBIN"/gomake clean; + time "$GOBIN"/gomake +fi time "$GOBIN"/gomake smoketest ) || exit $? (xcd cmd/ebnflint -"$GOBIN"/gomake clean -time "$GOBIN"/gomake +if $rebuild; then + "$GOBIN"/gomake clean; + time "$GOBIN"/gomake +fi time "$GOBIN"/gomake test ) || exit $? -- cgit v1.3-5-g9baa