From 68a46f88defd013f7213a56a7325665ce5dd9036 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Fri, 3 Nov 2023 14:06:25 -0700
Subject: [PATCH v1 4/5] docs: meson: Add documentation for important build
 targets

Author:
Reviewed-by:
Discussion: https://postgr.es/m/20231103163848.26egkh5qdgw3vmil@awork3.anarazel.de
Backpatch:
---
 doc/src/sgml/installation.sgml | 224 +++++++++++++++++++++++++++++++++
 1 file changed, 224 insertions(+)

diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index e1c03e21414..6050c38be25 100644
--- a/doc/src/sgml/installation.sgml
+++ b/doc/src/sgml/installation.sgml
@@ -3211,6 +3211,230 @@ ninja install
     </variablelist>
    </sect3>
   </sect2>
+
+  <sect2 id="meson-targets">
+   <title><literal>meson</literal> Build Targets</title>
+
+   <para>
+    Individual build targets can be built using <command>ninja</command> <replaceable>target</replaceable>.
+
+    When no target is specified, everything except documentation is
+    built. Individual build products can be built using the path/filename as
+    <replaceable>target</replaceable>.
+   </para>
+
+   <sect3 id="meson-targets-install">
+    <title>Install Targets</title>
+
+    <variablelist>
+
+     <varlistentry id="meson-target-install">
+       <term><option>install</option></term>
+       <listitem>
+        <para>
+         Install postgres, excluding documentation
+        </para>
+       </listitem>
+     </varlistentry>
+
+     <varlistentry id="meson-target-install-quiet">
+       <term><option>install-quiet</option></term>
+       <listitem>
+        <para>
+         Like <xref linkend="meson-target-install"/>, but installed
+         files are not displayed
+        </para>
+       </listitem>
+     </varlistentry>
+
+     <varlistentry id="meson-target-install-world">
+       <term><option>install-install-world</option></term>
+       <listitem>
+        <para>
+         Install postgres, including multi-page HTML and man page
+         documentation.
+        </para>
+       </listitem>
+     </varlistentry>
+
+     <varlistentry id="meson-target-install-docs">
+       <term><option>install-docs</option></term>
+       <listitem>
+        <para>
+         Install documentation in multi-page HTML and man page formats. See
+         also <xref linkend="meson-target-install-doc-html"/>, <xref
+         linkend="meson-target-install-doc-man"/>.
+        </para>
+       </listitem>
+     </varlistentry>
+
+     <varlistentry id="meson-target-install-doc-html">
+       <term><option>install-doc-html</option></term>
+       <listitem>
+        <para>
+         Install documentation in multi-page HTML format.
+        </para>
+       </listitem>
+     </varlistentry>
+
+     <varlistentry id="meson-target-install-doc-man">
+       <term><option>install-doc-html</option></term>
+       <listitem>
+        <para>
+         Install documentation in man page format.
+        </para>
+       </listitem>
+     </varlistentry>
+
+     <varlistentry id="meson-target-uninstall">
+       <term><option>uninstall</option></term>
+       <listitem>
+        <para>
+         Remove installed files.
+        </para>
+       </listitem>
+     </varlistentry>
+
+    </variablelist>
+   </sect3>
+
+   <sect3 id="meson-targets-docs">
+    <title>Documentation Targets</title>
+
+    <variablelist>
+
+     <varlistentry id="meson-target-docs">
+       <term><option>docs</option></term>
+       <term><option>doc-html</option></term>
+       <listitem>
+        <para>
+         Build documentation in multi-page HTML format.  Note that
+         <option>docs</option> does <emphasis>not</emphasis> include building
+         man page documentation, as man page generation seldom fails when
+         building HTML documentation succeeds.
+        </para>
+       </listitem>
+     </varlistentry>
+
+     <varlistentry id="meson-target-doc-man">
+       <term><option>doc-man</option></term>
+       <listitem>
+        <para>
+         Build documentation in man page format.
+        </para>
+       </listitem>
+     </varlistentry>
+
+     <varlistentry id="meson-target-html-single-page">
+      <term><option>doc/src/sgml/postgres.html</option></term>
+       <listitem>
+        <para>
+         Build documentation in single-page HTML format.
+        </para>
+       </listitem>
+     </varlistentry>
+
+     <varlistentry id="meson-target-pdf">
+      <term><option>doc/src/sgml/postgres-A4.pdf</option></term>
+      <term><option>doc/src/sgml/postgres-US.pdf</option></term>
+       <listitem>
+        <para>
+         Build documentation in PDF format, using A4 and U.S. letter format
+         respectively.
+        </para>
+       </listitem>
+     </varlistentry>
+
+     <varlistentry id="meson-target-alldocs">
+       <term><option>alldocs</option></term>
+       <listitem>
+        <para>
+         Build documentation in all supported formats. Primarily useful when
+         testing larger documentation changes.
+        </para>
+       </listitem>
+     </varlistentry>
+
+    </variablelist>
+
+   </sect3>
+
+   <sect3 id="meson-targets-code">
+    <title>Code Targets</title>
+
+    <variablelist>
+
+     <varlistentry id="meson-target-backend">
+       <term><option>backend</option></term>
+       <listitem>
+        <para>
+         Build backend and related modules.
+        </para>
+       </listitem>
+     </varlistentry>
+
+     <varlistentry id="meson-target-bin">
+       <term><option>bin</option></term>
+       <listitem>
+        <para>
+         Build frontend binaries
+        </para>
+       </listitem>
+     </varlistentry>
+
+     <varlistentry id="meson-target-contrib">
+       <term><option>contrib</option></term>
+       <listitem>
+        <para>
+         Build contrib modules
+        </para>
+       </listitem>
+     </varlistentry>
+
+     <varlistentry id="meson-target-pl">
+       <term><option>pl</option></term>
+       <listitem>
+        <para>
+         Build procedual languages
+        </para>
+       </listitem>
+     </varlistentry>
+
+    </variablelist>
+
+   </sect3>
+
+   <sect3 id="meson-targets-other">
+    <title>Other Targets</title>
+
+    <variablelist>
+
+     <varlistentry id="meson-target-clean">
+       <term><option>clean</option></term>
+       <listitem>
+        <para>
+         Remove all build products
+        </para>
+       </listitem>
+     </varlistentry>
+
+     <varlistentry id="meson-target-test">
+       <term><option>test</option></term>
+       <listitem>
+        <para>
+         Remove all enabled tests. Support for some classes of tests can be
+         enabled / disabled with <xref linkend="configure-tap-tests-meson"/>
+         and <xref linkend="configure-pg-test-extra-meson"/>.
+        </para>
+       </listitem>
+     </varlistentry>
+
+    </variablelist>
+
+   </sect3>
+
+  </sect2>
+
  </sect1>
 
  <sect1 id="install-post">
-- 
2.38.0

