]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Documentation: Avoid creating man pages in source tree
authorBen Hutchings <ben@decadent.org.uk>
Tue, 1 Sep 2015 22:48:49 +0000 (23:48 +0100)
committerJonathan Corbet <corbet@lwn.net>
Sun, 13 Sep 2015 20:38:50 +0000 (14:38 -0600)
Currently kernel-doc generates a dummy DocBook file when asked to
convert a C source file with no structured comments.  For an
out-of-tree build (objtree != srctree), the title of the output file
is the absolute path name of the C source file, which later results
in a manual page being created alongside the C source file.

Change the title to be a relative path.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
scripts/kernel-doc

index 532d8cd2543f69343373c4be9749543f5ece446e..61b4aa86fcdfd1a9451ab60f7a084fc890068e87 100755 (executable)
@@ -2391,12 +2391,13 @@ sub process_file($) {
     my $descr;
     my $in_purpose = 0;
     my $initial_section_counter = $section_counter;
+    my ($orig_file) = @_;
 
     if (defined($ENV{'SRCTREE'})) {
-       $file = "$ENV{'SRCTREE'}" . "/" . "@_";
+       $file = "$ENV{'SRCTREE'}" . "/" . $orig_file;
     }
     else {
-       $file = "@_";
+       $file = $orig_file;
     }
     if (defined($source_map{$file})) {
        $file = $source_map{$file};
@@ -2640,7 +2641,7 @@ sub process_file($) {
            print "<refentry>\n";
            print " <refnamediv>\n";
            print "  <refname>\n";
-           print "   ${file}\n";
+           print "   ${orig_file}\n";
            print "  </refname>\n";
            print "  <refpurpose>\n";
            print "   Document generation inconsistency\n";
@@ -2654,7 +2655,7 @@ sub process_file($) {
            print "   <para>\n";
            print "    The template for this document tried to insert\n";
            print "    the structured comment from the file\n";
-           print "    <filename>${file}</filename> at this point,\n";
+           print "    <filename>${orig_file}</filename> at this point,\n";
            print "    but none was found.\n";
            print "    This dummy section is inserted to allow\n";
            print "    generation to continue.\n";