mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
meson: Document build targets, add 'help' target
Currently important build targets are somewhat hard to discover. This commit documents important meson build targets in the sgml documentation. But it's awkward to have to lookup build targets in the docs when hacking, so this also adds a 'help' target, printing out the same information. To avoid having to duplicate information in two places, generate both docbook and interactive docs from a single source. Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Discussion: https://postgr.es/m/20231108232121.ww542mt6lfo6f26f@awork3.anarazel.de
This commit is contained in:
63
doc/src/sgml/generate-targets-meson.pl
Normal file
63
doc/src/sgml/generate-targets-meson.pl
Normal file
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# Generate the targets-meson.sgml file from targets-meson.txt
|
||||
# Copyright (c) 2000-2023, PostgreSQL Global Development Group
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $targets_meson_file = $ARGV[0];
|
||||
open my $targets_meson, '<', $targets_meson_file or die;
|
||||
|
||||
print
|
||||
"<!-- autogenerated from doc/src/sgml/targets-meson.txt, do not edit -->\n";
|
||||
|
||||
# Find the start of each group of targets
|
||||
while (<$targets_meson>)
|
||||
{
|
||||
next if /^#/;
|
||||
|
||||
if (/^(.*) Targets:$/)
|
||||
{
|
||||
my $targets = $1;
|
||||
my $targets_id = lc $targets;
|
||||
|
||||
print qq(
|
||||
<sect3 id="targets-meson-$targets_id">
|
||||
<title>$targets Targets</title>
|
||||
|
||||
<variablelist>
|
||||
);
|
||||
|
||||
# Each target in the group
|
||||
while (<$targets_meson>)
|
||||
{
|
||||
next if /^#/;
|
||||
last if !/^\s+([^ ]+)\s+(.+)/;
|
||||
|
||||
my $target = $1;
|
||||
my $desc = $2;
|
||||
my $target_id = $1;
|
||||
|
||||
$target_id =~ s/\//-/g;
|
||||
|
||||
print qq(
|
||||
<varlistentry id="meson-target-${target_id}">
|
||||
<term><option>${target}</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
${desc}
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
);
|
||||
}
|
||||
|
||||
print qq(
|
||||
</variablelist>
|
||||
</sect3>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
close $targets_meson;
|
Reference in New Issue
Block a user