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.

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.

  1. Obtain the source code for the compiler from SourceHut:

git clone https://git.sr.ht/~sircmpwn/harec && cd harec
  1. cp configs/$platform.mk config.mk (e.g. configs/linux.mk), and edit as necessary.

  2. 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”).

  1. Obtain the source code from SourceHut:

git clone https://git.sr.ht/~sircmpwn/hare && cd hare
  1. cp configs/$platform.mk config.mk (e.g. configs/linux.mk), and edit as necessary.

  2. 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.