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
diff --git a/src/run.bash b/src/run.bash
index 35d499f..85dd59a 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 @@
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 @@
# 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 $?