#!/usr/bin/perl # # Generate the targets-meson.sgml file from targets-meson.txt # Copyright (c) 2000-2024, PostgreSQL Global Development Group use strict; use warnings FATAL => 'all'; my $targets_meson_file = $ARGV[0]; open my $targets_meson, '<', $targets_meson_file or die; print "\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( $targets Targets ); # 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( ${desc} ); } print qq( ); } } close $targets_meson;