because the
makefile provided is not suitable for FreeBSD's <command>make</command>.
</para>
</sect2>
<sect2 id="docguide-toolsets-inst-debian">
<title>Debian Packages</title>
<para>
There is a full set of packages of the documentation tools
available for <productname>Debian GNU/Linux</productname>.
To install, simply use:
<programlisting>
apt-get install docbook-xml docbook-xsl libxml2-utils xsltproc fop
</programlisting>
</para>
</sect2>
<sect2 id="docguide-toolsets-inst-macos">
<title>macOS</title>
<para>
If you use MacPorts, the following will get you set up:
<programlisting>
sudo port install docbook-xml docbook-xsl-nons libxslt fop
</programlisting>
If you use Homebrew, use this:
<programlisting>
brew install docbook docbook-xsl libxslt fop
</programlisting>
</para>
<para>
The Homebrew-supplied programs require the following environment variable
to be set. For Intel based machines, use this:
<programlisting>
export XML_CATALOG_FILES=/usr/local/etc/xml/catalog
</programlisting>
On Apple Silicon based machines, use this:
<programlisting>
export XML_CATALOG_FILES=/opt/homebrew/etc/xml/catalog
</programlisting>
Without it, <command>xsltproc</command> will throw errors like this:
<programlisting>
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
postgres.sgml:21: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
...
</programlisting>
</para>
<para>
While it is possible to use the Apple-provided versions
of <command>xmllint</command> and <command>xsltproc</command>
instead of those from MacPorts or Homebrew, you'll still need
to install the DocBook DTD and stylesheets, and set up a catalog
file that points to them.
</para>
</sect2>
<sect2 id="docguide-toolsets-configure">
<title>Detection by <command>configure</command></title>
<para>
Before you can build the documentation you need to run the
<filename>configure</filename> script, as you would when building
the <productname>PostgreSQL</productname> programs themselves.
Check the output near the end of the run; it should look something
like this:
<screen>
checking for xmllint... xmllint
checking for xsltproc... xsltproc
checking for fop... fop
checking for dbtoepub... dbtoepub
</screen>
If <filename>xmllint</filename> or <filename>xsltproc</filename> is not
found, you will not be able to build any of the documentation.
<filename>fop</filename> is only needed to build the documentation in
PDF format.
<filename>dbtoepub</filename> is only needed to build the documentation
in EPUB format.
</para>
<para>
If necessary, you can tell <filename>configure</filename> where to find
these programs, for example
<screen>
./configure ... XMLLINT=/opt/local/bin/xmllint ...
</screen>
</para>
<para>
If you prefer to build <productname>PostgreSQL</productname> using
Meson, instead run <command>meson setup</command> as described in
<xref linkend="install-meson"/>, and then see
<xref linkend="docguide-build-meson"/>.
</para>
</sect2>
</sect1>
<sect1 id="docguide-build">
<title>Building the Documentation with Make</title>
<para>
Once you have everything set up, change to the directory
<filename>doc/src/sgml</filename> and run one of the commands
described in the following subsections to build the
documentation. (Remember to use GNU make.)
</para>
<sect2 id="docguide-build-html">
<title>HTML</title>
<para>
To build the <acronym>HTML</acronym> version of the documentation:
<screen>
<prompt>doc/src/sgml$ </prompt><userinput>make html</userinput>
</screen>
This is also the default target. The output appears in the
subdirectory <filename>html</filename>.
</para>
<para>
To produce HTML documentation with the stylesheet used on <ulink
url="https://www.postgresql.org/docs/current/">postgresql.org</ulink>