blob: 96bd99dc977a52f0c2a9ebbaa7a5f6b99477153b [file] [log] [blame]
Finn Behrensc25ce582020-11-23 15:15:33 +01001#!/usr/bin/env perl
Matthew Wilcox5b229fb2018-02-13 13:15:35 -08002# SPDX-License-Identifier: GPL-2.0
3#
Mauro Carvalho Chehab32590812018-04-25 05:34:48 -04004# Author: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Matthew Wilcox5b229fb2018-02-13 13:15:35 -08005#
6# Produce manpages from kernel-doc.
7# See Documentation/doc-guide/kernel-doc.rst for instructions
8
9if ($#ARGV < 0) {
10 die "where do I put the results?\n";
11}
12
13mkdir $ARGV[0],0777;
14$state = 0;
15while (<STDIN>) {
16 if (/^\.TH \"[^\"]*\" 9 \"([^\"]*)\"/) {
17 if ($state == 1) { close OUT }
18 $state = 1;
19 $fn = "$ARGV[0]/$1.9";
20 print STDERR "Creating $fn\n";
21 open OUT, ">$fn" or die "can't open $fn: $!\n";
22 print OUT $_;
23 } elsif ($state != 0) {
24 print OUT $_;
25 }
26}
27
28close OUT;