Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(235)

Side by Side Diff: src/make.bat

Issue 5847063: code review 5847063: build: do more during windows build (Closed)
Patch Set: diff -r 087c6e15702e https://go.googlecode.com/hg/ Created 13 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/pkg/log/syslog/syslog_windows.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :: Copyright 2012 The Go Authors. All rights reserved. 1 :: Copyright 2012 The Go Authors. All rights reserved.
2 :: Use of this source code is governed by a BSD-style 2 :: Use of this source code is governed by a BSD-style
3 :: license that can be found in the LICENSE file. 3 :: license that can be found in the LICENSE file.
4
5 :: Environment variables that control make.bat:
6 ::
7 :: GOROOT_FINAL: The expected final Go root, baked into binaries.
8 :: The default is the location of the Go tree during the build.
9 ::
10 :: GOHOSTARCH: The architecture for host tools (compilers and
11 :: binaries). Binaries of this type must be executable on the current
12 :: system, so the only common reason to set this is to set
13 :: GOHOSTARCH=386 on an amd64 machine.
14 ::
15 :: GOARCH: The target architecture for installed packages and tools.
16 ::
17 :: GOOS: The target operating system for installed packages and tools.
18 ::
19 :: GO_GCFLAGS: Additional 5g/6g/8g arguments to use when
20 :: building the packages and commands.
21 ::
22 :: GO_LDFLAGS: Additional 5l/6l/8l arguments to use when
23 :: building the commands.
24 ::
25 :: CGO_ENABLED: Setting this to 0 disables the use of cgo
26 :: in the built and installed packages and tools.
r 2012/03/19 20:47:02 s/built/build/ not sure i can parse this sentence
brainman 2012/03/19 23:33:22 Done.
27
4 @echo off 28 @echo off
5 29
6 :: Keep environment variables within this script 30 :: Keep environment variables within this script
7 :: unless invoked with --no-local. 31 :: unless invoked with --no-local.
8 if x%1==x--no-local goto nolocal 32 if x%1==x--no-local goto nolocal
9 if x%2==x--no-local goto nolocal 33 if x%2==x--no-local goto nolocal
10 setlocal 34 setlocal
11 :nolocal 35 :nolocal
12 36
13 set GOBUILDFAIL=0 37 set GOBUILDFAIL=0
14 38
15 if exist make.bat goto ok 39 if exist make.bat goto ok
16 echo Must run make.bat from Go src directory. 40 echo Must run make.bat from Go src directory.
17 goto fail· 41 goto fail·
18 :ok 42 :ok
19 43
44 :: Clean old generated file that will cause problems in the build.
45 del /F ".\pkg\runtime\runtime_defs.go" 2>NUL
46
20 :: Grab default GOROOT_FINAL and set GOROOT for build. 47 :: Grab default GOROOT_FINAL and set GOROOT for build.
21 :: The expression %VAR:\=\\% means to take %VAR% 48 :: The expression %VAR:\=\\% means to take %VAR%
22 :: and apply the substitution \ = \\, escaping the 49 :: and apply the substitution \ = \\, escaping the
23 :: backslashes. Then we wrap that in quotes to create 50 :: backslashes. Then we wrap that in quotes to create
24 :: a C string. 51 :: a C string.
25 cd .. 52 cd ..
26 set GOROOT=%CD% 53 set GOROOT=%CD%
27 cd src 54 cd src
28 if "x%GOROOT_FINAL%"=="x" set GOROOT_FINAL=%GOROOT% 55 if "x%GOROOT_FINAL%"=="x" set GOROOT_FINAL=%GOROOT%
29 set DEFGOROOT=-DGOROOT_FINAL="\"%GOROOT_FINAL:\=\\%\"" 56 set DEFGOROOT=-DGOROOT_FINAL="\"%GOROOT_FINAL:\=\\%\""
30 57
31 :: Clean old generated file that will cause problems in the build.
32 del /F ".\pkg\runtime\runtime_defs.go" 2>NUL
33
34 echo # Building C bootstrap tool. 58 echo # Building C bootstrap tool.
35 echo cmd/dist 59 echo cmd/dist
36 if not exist ..\bin\tool mkdir ..\bin\tool 60 if not exist ..\bin\tool mkdir ..\bin\tool
37 :: Windows has no glob expansion, so spell out cmd/dist/*.c. 61 :: Windows has no glob expansion, so spell out cmd/dist/*.c.
38 gcc -O2 -Wall -Werror -o cmd/dist/dist.exe -Icmd/dist %DEFGOROOT% cmd/dist/buf.c cmd/dist/build.c cmd/dist/buildgc.c cmd/dist/buildruntime.c cmd/dist/goc2c.c cm d/dist/main.c cmd/dist/windows.c 62 gcc -O2 -Wall -Werror -o cmd/dist/dist.exe -Icmd/dist %DEFGOROOT% cmd/dist/buf.c cmd/dist/build.c cmd/dist/buildgc.c cmd/dist/buildruntime.c cmd/dist/goc2c.c cm d/dist/main.c cmd/dist/windows.c
39 if errorlevel 1 goto fail 63 if errorlevel 1 goto fail
40 .\cmd\dist\dist env -wp >env.bat 64 .\cmd\dist\dist env -wp >env.bat
41 if errorlevel 1 goto fail 65 if errorlevel 1 goto fail
42 call env.bat 66 call env.bat
43 del env.bat 67 del env.bat
(...skipping 11 matching lines...) Expand all
55 79
56 if not %GOHOSTARCH% == %GOARCH% goto localbuild 80 if not %GOHOSTARCH% == %GOARCH% goto localbuild
57 if not %GOHOSTOS% == %GOOS% goto localbuild 81 if not %GOHOSTOS% == %GOOS% goto localbuild
58 goto mainbuild 82 goto mainbuild
59 83
60 :localbuild 84 :localbuild
61 echo # Building tools for local system. %GOHOSTOS%/%GOHOSTARCH% 85 echo # Building tools for local system. %GOHOSTOS%/%GOHOSTARCH%
62 setlocal 86 setlocal
63 set GOOS=%GOHOSTOS% 87 set GOOS=%GOHOSTOS%
64 set GOARCH=%GOHOSTARCH% 88 set GOARCH=%GOHOSTARCH%
65 "%GOTOOLDIR%\go_bootstrap" install -v std 89 "%GOTOOLDIR%\go_bootstrap" install -gcflags "%GO_GCFLAGS%" -ldflags "%GO_LDFLAGS %" -v std
66 endlocal 90 endlocal
67 if errorlevel 1 goto fail 91 if errorlevel 1 goto fail
68 echo. 92 echo.
69 93
70 :mainbuild 94 :mainbuild
71 echo # Building packages and commands. 95 echo # Building packages and commands.
72 "%GOTOOLDIR%\go_bootstrap" install -a -v std 96 "%GOTOOLDIR%\go_bootstrap" install -gcflags "%GO_GCFLAGS%" -ldflags "%GO_LDFLAGS %" -a -v std
73 if errorlevel 1 goto fail 97 if errorlevel 1 goto fail
74 del "%GOTOOLDIR%\go_bootstrap.exe" 98 del "%GOTOOLDIR%\go_bootstrap.exe"
75 echo. 99 echo.
76 100
77 if x%1==x--no-banner goto nobanner 101 if x%1==x--no-banner goto nobanner
78 "%GOTOOLDIR%\dist" banner 102 "%GOTOOLDIR%\dist" banner
79 :nobanner 103 :nobanner
80 104
81 goto end 105 goto end
82 106
83 :fail 107 :fail
84 set GOBUILDFAIL=1 108 set GOBUILDFAIL=1
85 109
86 :end 110 :end
OLDNEW
« no previous file with comments | « no previous file | src/pkg/log/syslog/syslog_windows.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b