From: Michael Still <mikal@stillhq.com>
To: kernel-janitors@vger.kernel.org
Subject: [Kernel-janitors] [RFT] Update to the mandocs build target
Date: Mon, 19 Apr 2004 00:19:53 +0000 [thread overview]
Message-ID: <40831B29.9010108@stillhq.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 674 bytes --]
Heya,
a while ago I whipped up a mandocs build target for 2.6 which is now
included with the default kernel. The attached patch updates this build
target to more exhaustively identify potential man pages. This makes the
build of this target a little slower than before, but gives you a _lot_
more manpages.
I'm interested in some people applying the patch to the latest kernel,
and letting me know if it works for them before I unleash it upon the
masses.
Thanks,
Mikal
--
Michael Still (mikal@stillhq.com) | "All my life I've had one dream,
http://www.stillhq.com | to achieve my many goals"
UTC + 11 | -- Homer Simpson
[-- Attachment #2: mandocsimp-004 --]
[-- Type: text/plain, Size: 7229 bytes --]
diff -Nur linux-2.6.5-cset-20040404_0407/Documentation/DocBook/Makefile linux-2.6.5-cset-20040404_0407-mandocsimp/Documentation/DocBook/Makefile
--- linux-2.6.5-cset-20040404_0407/Documentation/DocBook/Makefile 2004-04-13 13:39:39.000000000 +1000
+++ linux-2.6.5-cset-20040404_0407-mandocsimp/Documentation/DocBook/Makefile 2004-04-13 13:44:11.000000000 +1000
@@ -24,7 +24,7 @@
###
# The targets that may be used.
-.PHONY: sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs
+.PHONY: sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleanmandocs
BOOKS := $(addprefix $(obj)/,$(DOCBOOKS))
sgmldocs: $(BOOKS)
@@ -38,12 +38,6 @@
HTML := $(patsubst %.sgml, %.html, $(BOOKS))
htmldocs: $(HTML)
-MAN := $(patsubst %.sgml, %.9, $(BOOKS))
-mandocs: $(MAN)
-
-installmandocs: mandocs
- $(MAKEMAN) install Documentation/DocBook/man
-
###
#External programs used
KERNELDOC = scripts/kernel-doc
@@ -139,9 +133,18 @@
###
# Rule to generate man files - output is placed in the man subdirectory
-%.9: %.sgml
- $(SPLITMAN) $< $(objtree)/Documentation/DocBook/man "$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)"
- $(MAKEMAN) convert $(objtree)/Documentation/DocBook/man $<
+mandocs:
+ echo "" > $(obj)/allcomments.sgml
+ find $(objtree) -type f -name "*.[ch]" -exec $(KERNELDOC) -docbook -silentfail {} >> $(obj)/allcomments.sgml \;
+ $(SPLITMAN) $(obj)/allcomments.sgml $(objtree)/Documentation/DocBook/man "$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)"
+ $(MAKEMAN) convert $(objtree)/Documentation/DocBook/man $(obj)/allcomments.sgml
+
+installmandocs: $(objtree)/Documentation/DocBook/allcomments.sgml
+ $(MAKEMAN) install Documentation/DocBook/man
+
+cleanmandocs:
+ find $(objtree)/Documentation/DocBook/man -type f -name "*.sgml" -exec rm -f {} \;
+ find $(objtree)/Documentation/DocBook/man -type f -name "*.9.gz" -exec rm -f {} \;
###
# Rules to generate postscripts and PNG imgages from .fig format files
@@ -196,7 +199,8 @@
$(patsubst %.sgml, %.9, $(DOCBOOKS)) \
$(patsubst %.fig,%.eps, $(IMG-parportbook)) \
$(patsubst %.fig,%.png, $(IMG-parportbook)) \
- $(C-procfs-example)
+ $(C-procfs-example) \
+ allcomments.sgml
ifneq ($(wildcard $(patsubst %.html,%,$(HTML))),)
clean-rule := rm -rf $(wildcard $(patsubst %.html,%,$(HTML)))
diff -Nur linux-2.6.5-cset-20040404_0407/Documentation/DocBook/man/Makefile linux-2.6.5-cset-20040404_0407-mandocsimp/Documentation/DocBook/man/Makefile
--- linux-2.6.5-cset-20040404_0407/Documentation/DocBook/man/Makefile 2004-04-13 13:39:39.000000000 +1000
+++ linux-2.6.5-cset-20040404_0407-mandocsimp/Documentation/DocBook/man/Makefile 2004-04-13 13:45:23.000000000 +1000
@@ -1,3 +1,3 @@
# Rules are put in Documentation/DocBook
-clean-files := *.9.gz *.sgml manpage.links manpage.refs
+clean-files := manpage.links manpage.refs
diff -Nur linux-2.6.5-cset-20040404_0407/Makefile linux-2.6.5-cset-20040404_0407-mandocsimp/Makefile
--- linux-2.6.5-cset-20040404_0407/Makefile 2004-04-13 13:39:55.000000000 +1000
+++ linux-2.6.5-cset-20040404_0407-mandocsimp/Makefile 2004-04-13 13:44:11.000000000 +1000
@@ -799,7 +799,7 @@
quiet_cmd_rmfiles = $(if $(rm-files),CLEAN $(rm-files))
cmd_rmfiles = rm -rf $(rm-files)
-clean: archclean $(clean-dirs)
+clean: archclean $(clean-dirs) cleanmandocs
$(call cmd,rmdirs)
$(call cmd,rmfiles)
@find . $(RCS_FIND_IGNORE) \
diff -Nur linux-2.6.5-cset-20040404_0407/scripts/kernel-doc linux-2.6.5-cset-20040404_0407-mandocsimp/scripts/kernel-doc
--- linux-2.6.5-cset-20040404_0407/scripts/kernel-doc 2004-04-13 13:39:24.000000000 +1000
+++ linux-2.6.5-cset-20040404_0407-mandocsimp/scripts/kernel-doc 2004-04-13 13:44:11.000000000 +1000
@@ -2,12 +2,13 @@
use strict;
-## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
+## Copyright (C) 1998 Michael Zucchi, All Rights Reserved ##
## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ##
-## Copyright (C) 2001 Simon Huggins ##
+## Copyright (C) 2001 Simon Huggins ##
+## Copyright (C) 2004 Michael Still <mikal@stillhq.com> ##
## ##
## #define enhancements by Armin Kuster <akuster@mvista.com> ##
-## Copyright (c) 2000 MontaVista Software, Inc. ##
+## Copyright (C) 2000 MontaVista Software, Inc. ##
## ##
## This software falls under the GNU General Public License. ##
## Please read the COPYING file for more information ##
@@ -36,6 +37,7 @@
# Small fixes (like spaces vs. \s in regex)
# -- Tim Jansen <tim@tjansen.de>
+# 15/03/2004 - Tweaked script to better support mandocs target
#
# This will read a 'c' file and scan for embedded comments in the
@@ -45,7 +47,7 @@
# Note: This only supports 'c'.
# usage:
-# kerneldoc [ -docbook | -html | -text | -man ]
+# kerneldoc [ -docbook [-silentfail] | -html | -text | -man ]
# [ -function funcname [ -function funcname ...] ] c file(s)s > outputfile
# or
# [ -nofunction funcname [ -function funcname ...] ] c file(s)s > outputfile
@@ -206,7 +208,7 @@
sub usage {
- print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man ]\n";
+ print "Usage: $0 [ -v ] [ -docbook [-silentfail] | -html | -text | -man ]\n";
print " [ -function funcname [ -function funcname ...] ]\n";
print " [ -nofunction funcname [ -nofunction funcname ...] ]\n";
print " c source file(s) > outputfile\n";
@@ -283,6 +285,8 @@
my $undescribed = "-- undescribed --";
+my $silentfail = 0;
+
reset_state();
while ($ARGV[0] =~ m/^-(.*)/) {
@@ -322,7 +326,9 @@
} elsif (($cmd eq "-h") || ($cmd eq "--help")) {
usage();
} elsif ($cmd eq '-filelist') {
- $filelist = shift @ARGV;
+ $filelist = shift @ARGV;
+ } elsif ($cmd eq '-silentfail') {
+ $silentfail = 1;
}
}
@@ -1701,8 +1707,10 @@
}
}
if ($initial_section_counter == $section_counter) {
- print STDERR "Warning(${file}): no structured comments found\n";
- if ($output_mode eq "sgml") {
+ if($silentfail == 0){
+ print STDERR "Warning(${file}): no structured comments found\n";
+ }
+ if (($output_mode eq "sgml") && ($silentfail == 0)) {
# The template wants at least one RefEntry here; make one.
print "<refentry>\n";
print " <refnamediv>\n";
diff -Nur linux-2.6.5-cset-20040404_0407/scripts/makeman linux-2.6.5-cset-20040404_0407-mandocsimp/scripts/makeman
--- linux-2.6.5-cset-20040404_0407/scripts/makeman 2004-04-13 13:39:24.000000000 +1000
+++ linux-2.6.5-cset-20040404_0407-mandocsimp/scripts/makeman 2004-04-13 13:44:11.000000000 +1000
@@ -2,7 +2,7 @@
use strict;
-## Copyright (C) Michael Still (mikal@stillhq.com)
+## Copyright (C) 2003, 4 Michael Still (mikal@stillhq.com)
## Released under the terms of the GNU GPL
##
## A script to make or install the manpages extracted by split-man
@@ -176,7 +176,7 @@
}
}
elsif($ARGV[0] eq "install"){
- system("mkdir -p /usr/local/man/man9/; install $ARGV[1]/*.9.gz /usr/local/man/man9/");
+ system("mkdir -p /usr/local/man/man9/; find $ARGV[1] -type f -name '*.9.gz' -exec install {} /usr/local/man/man9/ \\;");
}
else{
die "Usage: makeman [convert | install] <dir> <file>\n";
[-- Attachment #3: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
next reply other threads:[~2004-04-19 0:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-19 0:19 Michael Still [this message]
2004-04-19 22:23 ` [Kernel-janitors] [RFT] Update to the mandocs build target Randy.Dunlap
2004-04-20 7:44 ` Michael Still
2004-04-20 12:09 ` Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40831B29.9010108@stillhq.com \
--to=mikal@stillhq.com \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.