Bootstrapping Hare from source
Bootstrapping Hare from source is a simple process that only takes a few minutes to complete.
Note
Are you a distribution maintainer packaging Hare for your operating system? If so, please consult the Packaging guidelines as well.
Version
If you are new to Hare, then you probably want to use the latest stable release (so that you can follow along with the tutorials).
At the time of writing: the latest release is 0.25.2, so in the steps below
you might want to use:
version=v0.25.2
Dependencies
Hare depends on the following:
A POSIX-compatible environment with a C11 compiler
QBE (compiler backend)
scdoc (man pages – optional)
Consult the upstream documentation for details regarding the installation of dependencies.
Bootstrap compiler
This step builds and installs the compiler frontend.
Obtain the source code for the compiler from SourceHut:
git clone https://git.sr.ht/~sircmpwn/harec && cd harec
optionally checkout a specific version
git checkout $version
cp configs/$platform.mk config.mk(e.g. configs/linux.mk), and edit as necessary.make
Optionally run make check to run the test suite, then run make
install as root. The default config installs to /usr/local; edit
config.mk as necessary to install to a different prefix.
Standard library & tools
This step builds and installs the standard library and tools, such as the build driver (the “hare” command) and documentation viewer (“haredoc”).
Obtain the source code from SourceHut:
git clone https://git.sr.ht/~sircmpwn/hare && cd hare
optionally checkout a specific version
git checkout $version
cp configs/$platform.mk config.mk(e.g. configs/linux.mk), and edit as necessary.make
Optionally run make check to run the test suite, then run make
install as root. Like harec, the default prefix is /usr/local, which
can be customized by editing config.mk.