Updated README: Equal sign not required with `--mode` flag.
[sgk-go] / WINDOWS
CommitLineData
7eeb782e
AT
1 Building GNU Go on Windows Platforms
2
3==========================
4
5
6 BUILDING WITH OLDER VISUAL STUDIO
7
8The distribution directories contain some .dsp and .dsw files with
9GNU Go. These have been brought up to date in the sense that they
10should work if you have the older VC++ with Visual Studio 6
11but the distributed .dsp and .dsw files will only be of use with
12older version of Visual Studio.
13
14In most cases (unless you are building in Cygwin) the preferred way
15to build GNU Go on Windows platforms is to use CMake. CMake
16understands about many versions of Visual C/Visual Studio, and will
17generate project/solution files for the tools installed on your
18system. So even if you have Visual Studio 6 you may use CMake
19and dispense with the distributed .dsp and .dsw files.
20
21==========================
22
23 BUILDING WITH VISUAL STUDIO PROJECT FILES
24
25Before you compile the GNU Go source, you need to run CMake first, to
26generate the build files you'll give to Visual Studio.
27
28From the cmd.exe command prompt, CD into the GNU Go source directory.
29To confirm you're in the right place, you should see the file
30'CMakeLists.txt' in the top-level directory of the GNU Go code (as well
31as others in lower subdirectories).
32
33Direct CMake to generate the new Visual Studio build files by typing:
34
35 cmake CMakeLists.txt
36
37Compile the code by invoking the newly-created Solution file:
38
39 vcbuild GNUGo.sln
40
41This will take a few moments, as CMake generates 4 debug/retail targets:
42
43 debug
44 release
45 minsizerel
46 relwithdebinfo
47
48For each of these targets, Visual Studio is generating a version of
49gnugo.exe:
50
51 interface\debug\gnugo.exe
52 interface\release\gnugo.exe
53 interface\minsizerel\gnugo.exe
54 interface\relwithdebinfo\gnugo.exe
55
56Additionally, there is an 'Install' target available, that will copy the
57the gnugo.exe into the %ProgramFiles% directory. To do this, type:
58
59 vcbuild INSTALL.vcproj
60
61This should result in copying GNU/Go into:
62
63 "%ProgramFiles%\GNUGo\bin\gnugo.exe" --options
64
65In addition to command line use, CMake also has a GUI version. Users of
66the Visual Studio GUI might prefer to use that.
67
68==========================
69
70 BUILDING WITH NMAKE MAKEFILES
71
72GNU Go will also build using NMake makefiles. Optionally, instead of
73Visual Studio project/solution files, you may direct CMake to generate
74NMake makefiles. To generate the makefiles:
75
76 cmake -G "NMake Makefiles" CMakeLists.txt
77
78The default rule for the makefile is 'all'. Use the 'help' rule to show
79a list of available targets.
80
81 nmake -f Makefile help
82
83To compile GNU Go:
84
85 nmake -f Makefile all
86
87On some systems, GNU GO may fail to build when using NMake makefiles. It
88only fails the first time run, run NMake again with the 'clean all'
89targets, and it will compile the second and subsequent times.
90
91 nmake -f Makefile clean all
92
93Which will successfully generate a gnugo.exe.
94
95 interface\gnugo.exe --options
96
97==========================
98
99 BUILDING WITH MINGW MAKEFILES:
100
101GNU Go can be built on Windows systems using MinGW.
102
103This development environment uses: the GCC compiler (gcc.exe, not
104cl.exe), the Microsoft C runtime libraries (MSCRT, not GLibC), the GNU
105Make build tool (mingw32-make.exe, not NMake), all from the Windows
106shell (cmd.exe, not sh/bash).
107
108For CMake to work, in addition to the base MinGW installation, the C++
109compiler (g++.exe) and GNU Make (mingw32-make.exe) need to be installed.
110This was tested using GCC v3, not the experimental v4. To debug, use
111GDB, as the GCC-generated symbols won't work with NTSD/Windbg/Visual Studio.
112
113To create the makfiles, run CMake with the MinGW generator option:
114
115 cmake -G "MinGW Makefiles" CMakeLists.txt
116
117To build GNU Go, from a cmd.exe shell, run GNU Make (against the
118newly-created 'Makefile' and it's default 'all' target):
119
120 mingw32-make
121 ..\interface\gnugo.exe --options
122
123==========================
124
125 BUILDING WITH MSYS MAKEFILES (MinGW)
126
127GNU Go can be built on Windows systems using MSYS.
128
129This development environment uses: the GCC compiler (gcc.exe, not
130cl.exe), the Microsoft C runtime libraries (MSCRT, not GLibC), the GNU
131Make build tool (make, not NMake), all from the GNU Bash (sh.exe, not
132cmd.exe).
133
134To create the makfiles, run CMake with the MSYS generator option:
135
136 cmake -G "MSYS Makefiles" CMakeLists.txt
137
138Start MSYS's Bash shell, either clicking on a shortcut on from the
139command line:
140
141 cd /d c:\msys\1.0
142 msys.bat
143
144To build GNU Go, from a Bash shell, run GNU Make (against the
145newly-created 'Makefile' and it's default 'all' target):
146
147 make
148 ../interface/gnugo.exe --options
149
150To debug, use GDB, as the GCC-generated symbols won't work with
151NTSD/Windbg/Visual Studio.
152
153==========================
154
155 BUILDING ON CYGWIN
156
157With Cygwin, you should be able to
158
159 tar zxvf gnugo-3.8.tar.gz
160 cd gnugo-3.8
161 env CC='gcc -mno-cygwin' ./configure
162 make
163
164==========================
165
166Testing on Windows:
167
168Regress.cmd is a simplified cmd.exe-centric port of the main gnugo Unix
169shell script regress.sh. It can be used to help verify that the
170generated binary might be operational. Read the script's comment header
171for more information. For access to the full GNU Go tests, use Unix, not
172Windows.
173
174To test:
175
176 cd regression
177 regress.cmd ..\interface\gnugo.exe
178
179==========================
180
181
182
183