Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ben Hutchings and committed by
Jonathan Corbet
68f86662 df5f0b6e

+5 -4
+5 -4
scripts/kernel-doc
··· 2391 2391 my $descr; 2392 2392 my $in_purpose = 0; 2393 2393 my $initial_section_counter = $section_counter; 2394 + my ($orig_file) = @_; 2394 2395 2395 2396 if (defined($ENV{'SRCTREE'})) { 2396 - $file = "$ENV{'SRCTREE'}" . "/" . "@_"; 2397 + $file = "$ENV{'SRCTREE'}" . "/" . $orig_file; 2397 2398 } 2398 2399 else { 2399 - $file = "@_"; 2400 + $file = $orig_file; 2400 2401 } 2401 2402 if (defined($source_map{$file})) { 2402 2403 $file = $source_map{$file}; ··· 2641 2640 print "<refentry>\n"; 2642 2641 print " <refnamediv>\n"; 2643 2642 print " <refname>\n"; 2644 - print " ${file}\n"; 2643 + print " ${orig_file}\n"; 2645 2644 print " </refname>\n"; 2646 2645 print " <refpurpose>\n"; 2647 2646 print " Document generation inconsistency\n"; ··· 2655 2654 print " <para>\n"; 2656 2655 print " The template for this document tried to insert\n"; 2657 2656 print " the structured comment from the file\n"; 2658 - print " <filename>${file}</filename> at this point,\n"; 2657 + print " <filename>${orig_file}</filename> at this point,\n"; 2659 2658 print " but none was found.\n"; 2660 2659 print " This dummy section is inserted to allow\n"; 2661 2660 print " generation to continue.\n";