From 99f11b10baba7e457c202fff9b142f7af99e6ea0 Mon Sep 17 00:00:00 2001 From: Jon Masters Date: Thu, 2 Jun 2011 13:29:27 -0400 Subject: [PATCH] doc: properly fix documentation generation The docbook2man package does not allow output to be written to standard out, nor does the SGML allow for more than one file to be created. A previous hack was to use symlinks and hope for the best. Rather than doing this, retain the symlinks, but explicitly match on them during build and create symlinks to the output files. Furthermore, clean up the documentation source files to remove invalid multiple outputs. Signed-off-by: Jon Masters --- Makefile.am | 11 +++++++---- doc/depmod.conf.sgml | 2 -- doc/modules.dep.sgml | 2 -- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Makefile.am b/Makefile.am index d4ef32e..3e699e5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,7 +36,8 @@ depmod_LDADD = $(LDADD) libmodtools.a modinfo_LDADD = $(LDADD) libmodtools.a modindex_LDADD = $(LDADD) libmodtools.a -MAN5 = modprobe.conf.5 modules.dep.5 depmod.conf.5 modprobe.d.5 +MAN5 = depmod.conf.5 depmod.d.5 modprobe.conf.5 modprobe.d.5 \ + modules.dep.5 modules.dep.bin.5 MAN8 = depmod.8 insmod.8 lsmod.8 rmmod.8 modprobe.8 modinfo.8 SGML = $(addprefix doc/, $(MAN5:%.5=%.sgml) $(MAN8:%.8=%.sgml)) dist_man_MANS = $(MAN5) $(MAN8) @@ -68,14 +69,16 @@ MAINTAINERCLEANFILES := $(man_MANS) # docbook2man writes file itself, doesn't do stdout. %.8: doc/%.sgml if [ "$(DOCBOOKTOMAN)" = "docbook2man" ]; then \ - $(DOCBOOKTOMAN) $< > /dev/null 2>&1; \ + $(DOCBOOKTOMAN) $< > /dev/null 2>&1; \ else \ $(DOCBOOKTOMAN) $< 2>&1 > $@ | sed 's/^[^:]*://'; \ fi %.5: doc/%.sgml - if [ "$(DOCBOOKTOMAN)" = "docbook2man" ]; then \ - $(DOCBOOKTOMAN) $< > /dev/null 2>&1; \ + if [ -h $< ]; then \ + ln -s $$(basename $$(readlink $<) .sgml).5 $@; \ + elif [ "$(DOCBOOKTOMAN)" = "docbook2man" ]; then \ + $(DOCBOOKTOMAN) $< > /dev/null 2>&1; \ else \ $(DOCBOOKTOMAN) $< 2>&1 > $@ | sed 's/^[^:]*://'; \ fi diff --git a/doc/depmod.conf.sgml b/doc/depmod.conf.sgml index 4bc399b..d055db1 100644 --- a/doc/depmod.conf.sgml +++ b/doc/depmod.conf.sgml @@ -21,8 +21,6 @@ 2010-03-01 - depmod.d - 5 depmod.conf 5 diff --git a/doc/modules.dep.sgml b/doc/modules.dep.sgml index 6aa4607..a0b68ed 100644 --- a/doc/modules.dep.sgml +++ b/doc/modules.dep.sgml @@ -21,8 +21,6 @@ 2010-03-01 - modules.dep.bin - 5 modules.dep 5 -- 2.11.4.GIT