               Building GNU Go on Windows Platforms

==========================


             BUILDING WITH OLDER VISUAL STUDIO

The distribution directories contain some .dsp and .dsw files with
GNU Go. These have been brought up to date in the sense that they
should work if you have the older VC++ with Visual Studio 6
but the distributed .dsp and .dsw files will only be of use with 
older version of Visual Studio.

In most cases (unless you are building in Cygwin) the preferred way 
to build GNU Go on Windows platforms is to use CMake. CMake
understands about many versions of Visual C/Visual Studio, and will
generate project/solution files for the tools installed on your
system. So even if you have Visual Studio 6 you may use CMake
and dispense with the distributed .dsp and .dsw files.

==========================

         BUILDING WITH VISUAL STUDIO PROJECT FILES

Before you compile the GNU Go source, you need to run CMake first, to 
generate the build files you'll give to Visual Studio.

From the cmd.exe command prompt, CD into the GNU Go source directory. 
To confirm you're in the right place, you should see the file 
'CMakeLists.txt' in the top-level directory of the GNU Go code (as well 
as others in lower subdirectories).

Direct CMake to generate the new Visual Studio build files by typing:

    cmake CMakeLists.txt

Compile the code by invoking the newly-created Solution file:

    vcbuild GNUGo.sln

This will take a few moments, as CMake generates 4 debug/retail targets:

    debug
    release
    minsizerel
    relwithdebinfo

For each of these targets, Visual Studio is generating a version of 
gnugo.exe:

    interface\debug\gnugo.exe
    interface\release\gnugo.exe
    interface\minsizerel\gnugo.exe
    interface\relwithdebinfo\gnugo.exe

Additionally, there is an 'Install' target available, that will copy the 
the gnugo.exe into the %ProgramFiles% directory. To do this, type:

    vcbuild INSTALL.vcproj

This should result in copying GNU/Go into:

    "%ProgramFiles%\GNUGo\bin\gnugo.exe" --options

In addition to command line use, CMake also has a GUI version. Users of 
the Visual Studio GUI might prefer to use that.

==========================

              BUILDING WITH NMAKE MAKEFILES

GNU Go will also build using NMake makefiles. Optionally, instead of 
Visual Studio project/solution files, you may direct CMake to generate 
NMake makefiles. To generate the makefiles:

    cmake -G "NMake Makefiles" CMakeLists.txt

The default rule for the makefile is 'all'. Use the 'help' rule to show 
a list of available targets.

    nmake -f Makefile help

To compile GNU Go:

    nmake -f Makefile all

On some systems, GNU GO may fail to build when using NMake makefiles. It 
only fails the first time run, run NMake again with the 'clean all' 
targets, and it will compile the second and subsequent times.

    nmake -f Makefile clean all

Which will successfully generate a gnugo.exe.

    interface\gnugo.exe --options

==========================

                 BUILDING WITH MINGW MAKEFILES:

GNU Go can be built on Windows systems using MinGW.

This development environment uses: the GCC compiler (gcc.exe, not 
cl.exe), the Microsoft C runtime libraries (MSCRT, not GLibC), the GNU 
Make build tool (mingw32-make.exe, not NMake), all from the Windows 
shell (cmd.exe, not sh/bash).

For CMake to work, in addition to the base MinGW installation, the C++ 
compiler (g++.exe) and GNU Make (mingw32-make.exe) need to be installed. 
This was tested using GCC v3, not the experimental v4. To debug, use 
GDB, as the GCC-generated symbols won't work with NTSD/Windbg/Visual Studio.

To create the makfiles, run CMake with the MinGW generator option:

    cmake -G "MinGW Makefiles" CMakeLists.txt

To build GNU Go, from a cmd.exe shell, run GNU Make (against the 
newly-created 'Makefile' and it's default 'all' target):

    mingw32-make
    ..\interface\gnugo.exe --options

==========================

               BUILDING WITH MSYS MAKEFILES (MinGW)

GNU Go can be built on Windows systems using MSYS.

This development environment uses: the GCC compiler (gcc.exe, not 
cl.exe), the Microsoft C runtime libraries (MSCRT, not GLibC), the GNU 
Make build tool (make, not NMake), all from the GNU Bash (sh.exe, not 
cmd.exe).

To create the makfiles, run CMake with the MSYS generator option:

    cmake -G "MSYS Makefiles" CMakeLists.txt

Start MSYS's Bash shell, either clicking on a shortcut on from the 
command line:

    cd /d c:\msys\1.0
    msys.bat

To build GNU Go, from a Bash shell, run GNU Make (against the 
newly-created 'Makefile' and it's default 'all' target):

    make
    ../interface/gnugo.exe --options

To debug, use GDB, as the GCC-generated symbols won't work with 
NTSD/Windbg/Visual Studio.

==========================

                      BUILDING ON CYGWIN

With Cygwin, you should be able to 

  tar zxvf gnugo-3.8.tar.gz
  cd gnugo-3.8
  env CC='gcc -mno-cygwin' ./configure
  make

==========================

Testing on Windows:

Regress.cmd is a simplified cmd.exe-centric port of the main gnugo Unix 
shell script regress.sh. It can be used to help verify that the 
generated binary might be operational. Read the script's comment header 
for more information. For access to the full GNU Go tests, use Unix, not 
Windows.

To test:

    cd regression
    regress.cmd ..\interface\gnugo.exe

==========================




