Building RGBDS from source
Foreword: building RGBDS is largely dependent on your system, so the instructions provided here are somewhat generic. Windows works largely differently from everything else, so some expertise is expected if attempting this on Windows.
RGBDS does not require more than a regular environment, except RGBGFX that relies on
libpng; if you wish to use RGBGFX, you should install
1. Get sources
You first need to get the sources to be compiled, using one of the methods below.
First, clone the repository. Then, run
git checkout <version> (e.g.
git checkout v0.4.1), and you’re set.
Downloading source snapshots
Go to your desired release’s release page. Near the bottom of the page is a list of assets; grab either of the last three (
rgbds-<version>.tar.gz, “Source code (
zip)”, or “Source code (
tar.gz)”), and extract it.
The following are required to build RGBDS; it’s possible that some are already installed on your system.
cmake, depending on what method you choose below
- a C compiler, typically
libpng’s development headers. The package is typically called
libpng-devel, or sometimes plainly
libpng. Additionally, a
1.6may be present after
Two build systems are supported: plain old
cmake. Both can be used on most systems, but Windows users will almost certainly be unable to use
Make sure to run all of the following commands from the root directory!
Simply run the following two commands:
The second command is optional if you don’t want to install RGBDS system-wide.
The following variables can be defined to control installation, like so:
sudo make install PREFIX=~/.local/bin
PREFIX: Location where RGBDS will be installed. Defaults to
bindir: Location where the binaries will be installed. Defaults to
mandir: Location where the manpages will be installed. Defaults to
DESTDIR: This is prepended to all paths during the installation. It is mainly used for packaging.
Q: Whether to quiet the build or not. To make the build more verbose, clear this variable. Defaults to
STRIP: Whether to strip the installed binaries of debug symbols or not. Defaults to
BINMODE: Permissions of the installed binaries. Defaults to
MANMODE: Permissions of the installed man pages. Defaults to
CHECKPATCH: Path of the script checkpatch.pl of the Linux kernel. Defaults to
../linux/scripts/checkpatch.pl. You can retrieve that script from here.
First, run CMake on the project.
cmake 3.13 and later:
cmake 3.12.4 and earlier:
Then, build RGBDS.
Finally, you may install RGBDS. You are not required to, you can do whatever with the four binaries in
build/src at this point.
cmake 3.15 and later:
cmake 3.14 and earlier: