aboutsummaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash46
1 files changed, 11 insertions, 35 deletions
diff --git a/src/make.bash b/src/make.bash
index 3804b46b03..4e1b7b6bd8 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -50,6 +50,7 @@
# PKG_CONFIG: Path to pkg-config tool. Default is "pkg-config".
#
# GO_DISTFLAGS: extra flags to provide to "dist bootstrap".
+# (Or just pass them to the make.bash command line.)
set -e
@@ -164,40 +165,15 @@ if [ "$1" = "--no-clean" ]; then
buildall=""
shift
fi
-./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
-# Delay move of dist tool to now, because bootstrap may clear tool directory.
-mv cmd/dist/dist "$GOTOOLDIR"/dist
-echo
-
-if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
- echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
- # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
- # use the host compiler, CC, from `cmd/dist/dist env` instead.
- CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \
- "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
- echo
-fi
-
-echo "##### Building packages and commands for $GOOS/$GOARCH."
-
-old_bin_files=$(cd $GOROOT/bin && echo *)
-
-CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
+# Run dist bootstrap to complete make.bash.
+# Bootstrap installs a proper cmd/dist, built with the new toolchain.
+# Throw ours, built with Go 1.4, away after bootstrap.
+./cmd/dist/dist bootstrap $buildall -v $GO_DISTFLAGS "$@"
+rm -f ./cmd/dist/dist
-# Check that there are no new files in $GOROOT/bin other than go and gofmt
-# and $GOOS_$GOARCH (a directory used when cross-compiling).
-(cd $GOROOT/bin && for f in *; do
- if ! expr " $old_bin_files go gofmt ${GOOS}_${GOARCH} " : ".* $f " >/dev/null 2>/dev/null; then
- echo 1>&2 "ERROR: unexpected new file in $GOROOT/bin: $f"
- exit 1
- fi
-done)
-
-echo
-
-rm -f "$GOTOOLDIR"/go_bootstrap
-
-if [ "$1" != "--no-banner" ]; then
- "$GOTOOLDIR"/dist banner
-fi
+# DO NOT ADD ANY NEW CODE HERE.
+# The bootstrap+rm above are the final step of make.bash.
+# If something must be added, add it to cmd/dist's cmdbootstrap,
+# to avoid needing three copies in three different shell languages
+# (make.bash, make.bat, make.rc).