]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/make.bat
cmd/compile/internal/inline: score call sites exposed by inlines
[gostls13.git] / src / make.bat
index 814d12c3005c9316956d9613ef2d4fdcd03b2e0c..d9f9b6cb6aa252e7d695a9e94c8efd529587641e 100644 (file)
 \r
 :: Keep environment variables within this script\r
 :: unless invoked with --no-local.\r
+if x%1==x-no-local goto nolocal\r
+if x%2==x-no-local goto nolocal\r
+if x%3==x-no-local goto nolocal\r
+if x%4==x-no-local goto nolocal\r
 if x%1==x--no-local goto nolocal\r
 if x%2==x--no-local goto nolocal\r
 if x%3==x--no-local goto nolocal\r
@@ -73,7 +77,10 @@ if not exist ..\bin\tool mkdir ..\bin\tool
 if not "x%GOROOT_BOOTSTRAP%"=="x" goto bootstrapset\r
 for /f "tokens=*" %%g in ('where go 2^>nul') do (\r
        if "x%GOROOT_BOOTSTRAP%"=="x" (\r
+               setlocal\r
+               call :nogoenv\r
                for /f "tokens=*" %%i in ('"%%g" env GOROOT 2^>nul') do (\r
+                       endlocal\r
                        if /I not "%%i"=="%GOROOT_TEMP%" (\r
                                set GOROOT_BOOTSTRAP=%%i\r
                        )\r
@@ -81,7 +88,7 @@ for /f "tokens=*" %%g in ('where go 2^>nul') do (
        )\r
 )\r
 \r
-set bootgo=1.17.13\r
+set bootgo=1.20.6\r
 if "x%GOROOT_BOOTSTRAP%"=="x" if exist "%HOMEDRIVE%%HOMEPATH%\go%bootgo%" set GOROOT_BOOTSTRAP=%HOMEDRIVE%%HOMEPATH%\go%bootgo%\r
 if "x%GOROOT_BOOTSTRAP%"=="x" if exist "%HOMEDRIVE%%HOMEPATH%\sdk\go%bootgo%" set GOROOT_BOOTSTRAP=%HOMEDRIVE%%HOMEPATH%\sdk\go%bootgo%\r
 if "x%GOROOT_BOOTSTRAP%"=="x" set GOROOT_BOOTSTRAP=%HOMEDRIVE%%HOMEPATH%\Go1.4\r
@@ -92,18 +99,13 @@ set GOROOT=%GOROOT_TEMP%
 set GOROOT_TEMP=\r
 \r
 setlocal\r
-set GOOS=\r
-set GOARCH=\r
-set GOEXPERIMENT=\r
+call :nogoenv\r
 for /f "tokens=*" %%g IN ('"%GOROOT_BOOTSTRAP%\bin\go" version') do (set GOROOT_BOOTSTRAP_VERSION=%%g)\r
 set GOROOT_BOOTSTRAP_VERSION=%GOROOT_BOOTSTRAP_VERSION:go version =%\r
 echo Building Go cmd/dist using %GOROOT_BOOTSTRAP%. (%GOROOT_BOOTSTRAP_VERSION%)\r
 if x%vflag==x-v echo cmd/dist\r
 set GOROOT=%GOROOT_BOOTSTRAP%\r
 set GOBIN=\r
-set GO111MODULE=off\r
-set GOENV=off\r
-set GOFLAGS=\r
 "%GOROOT_BOOTSTRAP%\bin\go.exe" build -o cmd\dist\dist.exe .\cmd\dist\r
 endlocal\r
 if errorlevel 1 goto fail\r
@@ -113,20 +115,40 @@ call .\env.bat
 del env.bat\r
 if x%vflag==x-v echo.\r
 \r
+if x%1==x-dist-tool goto copydist\r
+if x%2==x-dist-tool goto copydist\r
+if x%3==x-dist-tool goto copydist\r
+if x%4==x-dist-tool goto copydist\r
 if x%1==x--dist-tool goto copydist\r
 if x%2==x--dist-tool goto copydist\r
 if x%3==x--dist-tool goto copydist\r
 if x%4==x--dist-tool goto copydist\r
 \r
 set bootstrapflags=\r
-if x%1==x--no-clean set bootstrapflags=--no-clean\r
-if x%2==x--no-clean set bootstrapflags=--no-clean\r
-if x%3==x--no-clean set bootstrapflags=--no-clean\r
-if x%4==x--no-clean set bootstrapflags=--no-clean\r
-if x%1==x--no-banner set bootstrapflags=%bootstrapflags% --no-banner\r
-if x%2==x--no-banner set bootstrapflags=%bootstrapflags% --no-banner\r
-if x%3==x--no-banner set bootstrapflags=%bootstrapflags% --no-banner\r
-if x%4==x--no-banner set bootstrapflags=%bootstrapflags% --no-banner\r
+if x%1==x-no-clean set bootstrapflags=-no-clean\r
+if x%2==x-no-clean set bootstrapflags=-no-clean\r
+if x%3==x-no-clean set bootstrapflags=-no-clean\r
+if x%4==x-no-clean set bootstrapflags=-no-clean\r
+if x%1==x--no-clean set bootstrapflags=-no-clean\r
+if x%2==x--no-clean set bootstrapflags=-no-clean\r
+if x%3==x--no-clean set bootstrapflags=-no-clean\r
+if x%4==x--no-clean set bootstrapflags=-no-clean\r
+if x%1==x-no-banner set bootstrapflags=%bootstrapflags% -no-banner\r
+if x%2==x-no-banner set bootstrapflags=%bootstrapflags% -no-banner\r
+if x%3==x-no-banner set bootstrapflags=%bootstrapflags% -no-banner\r
+if x%4==x-no-banner set bootstrapflags=%bootstrapflags% -no-banner\r
+if x%1==x--no-banner set bootstrapflags=%bootstrapflags% -no-banner\r
+if x%2==x--no-banner set bootstrapflags=%bootstrapflags% -no-banner\r
+if x%3==x--no-banner set bootstrapflags=%bootstrapflags% -no-banner\r
+if x%4==x--no-banner set bootstrapflags=%bootstrapflags% -no-banner\r
+if x%1==x-distpack set bootstrapflags=%bootstrapflags% -distpack\r
+if x%2==x-distpack set bootstrapflags=%bootstrapflags% -distpack\r
+if x%3==x-distpack set bootstrapflags=%bootstrapflags% -distpack\r
+if x%4==x-distpack set bootstrapflags=%bootstrapflags% -distpack\r
+if x%1==x--distpack set bootstrapflags=%bootstrapflags% -distpack\r
+if x%2==x--distpack set bootstrapflags=%bootstrapflags% -distpack\r
+if x%3==x--distpack set bootstrapflags=%bootstrapflags% -distpack\r
+if x%4==x--distpack set bootstrapflags=%bootstrapflags% -distpack\r
 \r
 :: Run dist bootstrap to complete make.bash.\r
 :: Bootstrap installs a proper cmd/dist, built with the new toolchain.\r
@@ -134,7 +156,7 @@ if x%4==x--no-banner set bootstrapflags=%bootstrapflags% --no-banner
 .\cmd\dist\dist.exe bootstrap -a %vflag% %bootstrapflags%\r
 if errorlevel 1 goto fail\r
 del .\cmd\dist\dist.exe\r
-goto end\r
+goto :eof\r
 \r
 :: DO NOT ADD ANY NEW CODE HERE.\r
 :: The bootstrap+del above are the final step of make.bat.\r
@@ -145,7 +167,16 @@ goto end
 :copydist\r
 mkdir "%GOTOOLDIR%" 2>NUL\r
 copy cmd\dist\dist.exe "%GOTOOLDIR%\"\r
-goto end\r
+goto :eof\r
+\r
+:nogoenv\r
+set GO111MODULE=off\r
+set GOENV=off\r
+set GOOS=\r
+set GOARCH=\r
+set GOEXPERIMENT=\r
+set GOFLAGS=\r
+goto :eof\r
 \r
 :bootstrapfail\r
 echo ERROR: Cannot find %GOROOT_BOOTSTRAP%\bin\go.exe\r
@@ -154,5 +185,3 @@ echo Set GOROOT_BOOTSTRAP to a working Go tree ^>= Go %bootgo%.
 :fail\r
 set GOBUILDFAIL=1\r
 if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL%\r
-\r
-:end\r