aboutsummaryrefslogtreecommitdiff
path: root/src/run.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/run.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/run.bash')
-rwxr-xr-xsrc/run.bash37
1 files changed, 27 insertions, 10 deletions
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 $?