aboutsummaryrefslogtreecommitdiff
path: root/src/make.bat
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2017-10-23 21:57:54 -0400
committerRuss Cox <rsc@golang.org>2017-10-25 01:13:01 +0000
commitaedb79f092be44f13faa7a40ed195b1bf0d27855 (patch)
tree703d112495666708114e4f29e3760992d033c173 /src/make.bat
parentd92aaa970791472a1657e878bf686fe802943ebe (diff)
downloadgo-aedb79f092be44f13faa7a40ed195b1bf0d27855.tar.xz
build: move final steps of make.bash, make.bat, make.rc into cmd/dist
This CL expands the job of "dist bootstrap" to be "finish make.bash". I need to change that logic in upcoming CLs related to cmd/go changes, and I'd rather not change it in three places in three different shell script languages. Change-Id: I545dc215e408289e4d0b28f7c2ffcd849d89ad3b Reviewed-on: https://go-review.googlesource.com/72870 Reviewed-by: David Crawshaw <crawshaw@golang.org>
Diffstat (limited to 'src/make.bat')
-rw-r--r--src/make.bat48
1 files changed, 14 insertions, 34 deletions
diff --git a/src/make.bat b/src/make.bat
index bf25b95ca5..101fc4bb1a 100644
--- a/src/make.bat
+++ b/src/make.bat
@@ -83,44 +83,24 @@ if x%2==x--dist-tool goto copydist
set buildall=-a
if x%1==x--no-clean set buildall=
-.\cmd\dist\dist bootstrap %buildall% -v
-if errorlevel 1 goto fail
-:: Delay move of dist tool to now, because bootstrap cleared tool directory.
-move .\cmd\dist\dist.exe "%GOTOOLDIR%\dist.exe"
-echo.
-
-if not %GOHOSTARCH% == %GOARCH% goto localbuild
-if not %GOHOSTOS% == %GOOS% goto localbuild
-goto mainbuild
-
-:localbuild
-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.
-setlocal
-set GOOS=%GOHOSTOS%
-set GOARCH=%GOHOSTARCH%
-"%GOTOOLDIR%\go_bootstrap" install -gcflags "%GO_GCFLAGS%" -ldflags "%GO_LDFLAGS%" -v std cmd
-endlocal
-if errorlevel 1 goto fail
-echo.
+if x%2==x--no-clean set buildall=
+if x%1==x--no-banner set buildall=%buildall% --no-banner
+if x%2==x--no-banner set buildall=%buildall% --no-banner
-:mainbuild
-echo ##### Building packages and commands for %GOOS%/%GOARCH%.
-setlocal
-set CC=%CC_FOR_TARGET%
-"%GOTOOLDIR%\go_bootstrap" install -gcflags "%GO_GCFLAGS%" -ldflags "%GO_LDFLAGS%" -a -v std cmd
-endlocal
+:: 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
if errorlevel 1 goto fail
-del "%GOTOOLDIR%\go_bootstrap.exe"
-echo.
-
-if x%1==x--no-banner goto nobanner
-"%GOTOOLDIR%\dist" banner
-:nobanner
-
+del .\cmd\dist\dist.exe
goto end
+:: DO NOT ADD ANY NEW CODE HERE.
+:: The bootstrap+del above are the final step of make.bat.
+:: 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).
+
:copydist
mkdir "%GOTOOLDIR%" 2>NUL
copy cmd\dist\dist.exe "%GOTOOLDIR%\"