-
Notifications
You must be signed in to change notification settings - Fork 0
Compilation
Binary releases of Gopher2600 are prepared periodically, once enough new features have accumulated to warrant such an action. In between releases users are free to compile the project for themselves.
This page describes the general compilation requirements and procedure. Specific instructions for specific platforms will be available on other pages.
Compilation of Gopher2600 requires the Go compiler to be installed. The compiler can be downloaded for Linux, Windows or MacOS from the Go download page. The latest version of Gopher2600 expects to be compiled with at least version 1.16 of the Go compiler.
The Go package management will handle installation of the few Go packages used by the project. However, there are a some other requirements that cannot be satisfied in that way. The principle requirement is the availability of the GNU development toolchain. In particular, compilers for C and C++ must be available. The minimum version of the GCC compilers that have been tested is version 8.3.0+
The SDL development library must be available. This can be downloaded from the SDL project page or the trusted management system provided by your operating system. The minimum version tested with Gopher2600 is version 2.0.9.
If compiling with Freetype font rendering (enabled through a Go build tag - see Makefile discussion below) the Freetype development kit should be available. Downloaded from the Freetype Project page or the trusted management system provided by your operation system. The minimum version testing with Gopher2600 is version 2.9.1
The provided Makefile provides several build targets that may be suitable for your needs.
-
build
- This will produce a dynamically linked binary for the host platform. These binaries should only be used for testing. -
release
- This will produce a dynamically linked binary for the host platform. These binaries are release binaries. -
cross_windows
- This target will produce a Windows binary from a suitably prepared Linux operating system. Preparation of the Linux operating system (meaning the availability of a cross-platform C compiler) is beyond the scope of this page and will be dealt with elsewhere.
All these targets will produce binaries with Freetype font rendering enabled.
If none of the Makefile targets are suitable as is for your needs then Gopher2600 can be built very easily for the native platform via the command line. For example, building a release binary without Freetype rendering:
go build -tags="release" .
During development of the emulator itself it is often more convenient to run the project directly, rather than building a binary. This can be done in the usual Go way:
go run .
The "release" Go build tag controls the location of the configuration files to be loaded and saved by the emulator. The distinction is useful because it means a different configuration can be used during development.
For non-release binaries the configuration directory is always the ".gopher2600" folder in the current working directory.
For release binaries the configuration directory depends on the operating system the emulator is running on.
See Configuration Directory for details.