wayland/doc/man/Makefile.am
David Herrmann 49dee9a86c man: add man-page infrastructure
This adds a man-page infrastructure based on Docbook XML files. This
allows us to integrate the man-pages into the publican books later. An
example page for wl_display_connect() (with an alias
wl_display_connect_to_fd()) is also added.

Feel free to add more man-pages. Function calls are put in man3 and
overview pages into man7. All pages (including aliases) have to be added
to the Makefile.

Docbook does generate aliases automatically from the additional names that
were put in the XML file. However, a small SED script is needed to fixup
the include-paths in the generated troff files. If someone knows how to
avoid that (or even install them gzip'ped), please fix it up.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-25 11:02:52 -04:00

46 lines
1.2 KiB
Makefile

#
# This generates man-pages out of the Docbook XML files. Simply add your files
# to the $MANPAGES array. If aliases are created, please add them to the
# MANPAGES_ALIASES array so they get installed correctly.
#
MANPAGES = \
wl_display_connect.3
MANPAGES_ALIASES = \
wl_display_connect_to_fd.3
wl_display_connect_to_fd.3: wl_display_connect.3
XML_FILES = \
${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,$(MANPAGES)}}}}
CLEANFILES = $(MANPAGES) $(MANPAGES_ALIASES)
EXTRA_DIST = $(MANPAGES) $(MANPAGES_ALIASES) $(XML_FILES)
man_MANS = $(MANPAGES) $(MANPAGES_ALIASES)
if HAVE_XSLTPROC
XSLTPROC_FLAGS = \
--stringparam man.authors.section.enabled 0 \
--stringparam man.copyright.section.enabled 0 \
--stringparam funcsynopsis.style ansi \
--stringparam man.output.quietly 1
XSLTPROC_PROCESS_MAN = \
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
$(SED) -i -e 's/^\.so \(.*\)\.\(.\)$$/\.so man\2\/\1\.\2/' $(MANPAGES_ALIASES)
%.1: %.xml
$(XSLTPROC_PROCESS_MAN)
%.3: %.xml
$(XSLTPROC_PROCESS_MAN)
%.5: %.xml
$(XSLTPROC_PROCESS_MAN)
%.7: %.xml
$(XSLTPROC_PROCESS_MAN)
endif # HAVE_XSLTPROC