.. _bootstrap:
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 :ref:`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
`__:
.. code-block:: shell
git clone https://git.sr.ht/~sircmpwn/harec && cd harec
2. :code:`cp configs/$platform.mk config.mk` (e.g. configs/linux.mk), and edit
as necessary.
3. :code:`make`
Optionally run :code:`make check` to run the test suite, then run :code:`make
install` as root. The default config installs to :code:`/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
`__:
.. code-block:: shell
git clone https://git.sr.ht/~sircmpwn/hare && cd hare
2. :code:`cp configs/$platform.mk config.mk` (e.g. configs/linux.mk), and edit
as necessary.
3. :code:`make`
Optionally run :code:`make check` to run the test suite, then run :code:`make
install` as root. Like harec, the default prefix is :code:`/usr/local`, which
can be customized by editing config.mk.