aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kernel-doc
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2015-09-01 18:48:49 -0400
committerJonathan Corbet <corbet@lwn.net>2015-09-13 16:38:50 -0400
commit68f86662380c343317325c024d6a35221f1908ac (patch)
treec361decb58dded445a6ce5b4a7ca8df26dcd6a1d /scripts/kernel-doc
parentdf5f0b6efb20be669ad356eba675706d4cda2d0b (diff)
Documentation: Avoid creating man pages in source tree
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>
Diffstat (limited to 'scripts/kernel-doc')
-rwxr-xr-xscripts/kernel-doc9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 532d8cd2543f..61b4aa86fcdf 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -2391,12 +2391,13 @@ sub process_file($) {
2391 my $descr; 2391 my $descr;
2392 my $in_purpose = 0; 2392 my $in_purpose = 0;
2393 my $initial_section_counter = $section_counter; 2393 my $initial_section_counter = $section_counter;
2394 my ($orig_file) = @_;
2394 2395
2395 if (defined($ENV{'SRCTREE'})) { 2396 if (defined($ENV{'SRCTREE'})) {
2396 $file = "$ENV{'SRCTREE'}" . "/" . "@_"; 2397 $file = "$ENV{'SRCTREE'}" . "/" . $orig_file;
2397 } 2398 }
2398 else { 2399 else {
2399 $file = "@_"; 2400 $file = $orig_file;
2400 } 2401 }
2401 if (defined($source_map{$file})) { 2402 if (defined($source_map{$file})) {
2402 $file = $source_map{$file}; 2403 $file = $source_map{$file};
@@ -2640,7 +2641,7 @@ sub process_file($) {
2640 print "<refentry>\n"; 2641 print "<refentry>\n";
2641 print " <refnamediv>\n"; 2642 print " <refnamediv>\n";
2642 print " <refname>\n"; 2643 print " <refname>\n";
2643 print " ${file}\n"; 2644 print " ${orig_file}\n";
2644 print " </refname>\n"; 2645 print " </refname>\n";
2645 print " <refpurpose>\n"; 2646 print " <refpurpose>\n";
2646 print " Document generation inconsistency\n"; 2647 print " Document generation inconsistency\n";
@@ -2654,7 +2655,7 @@ sub process_file($) {
2654 print " <para>\n"; 2655 print " <para>\n";
2655 print " The template for this document tried to insert\n"; 2656 print " The template for this document tried to insert\n";
2656 print " the structured comment from the file\n"; 2657 print " the structured comment from the file\n";
2657 print " <filename>${file}</filename> at this point,\n"; 2658 print " <filename>${orig_file}</filename> at this point,\n";
2658 print " but none was found.\n"; 2659 print " but none was found.\n";
2659 print " This dummy section is inserted to allow\n"; 2660 print " This dummy section is inserted to allow\n";
2660 print " generation to continue.\n"; 2661 print " generation to continue.\n";