man: fix manpage build instructions
[profile/ivi/libdrm.git] / man / Makefile.am
1 #
2 # This generates man-pages out of the Docbook XML files. Simply add your files
3 # to the $MANPAGES array. If aliases are created, please add them to the
4 # MANPAGES_ALIASES array so they get installed correctly.
5 #
6
7 MANPAGES = \
8         drm.7 \
9         drm-kms.7 \
10         drm-memory.7 \
11         drmAvailable.3 \
12         drmHandleEvent.3 \
13         drmModeGetResources.3
14 MANPAGES_ALIASES = \
15         drm-mm.7 \
16         drm-gem.7 \
17         drm-ttm.7
18
19 XML_FILES = \
20         ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubs %.7,%.xml,$(MANPAGES)}}}}
21 EXTRA_DIST = $(XML_FILES)
22 CLEANFILES = $(MANPAGES) $(MANPAGES_ALIASES) .man_fixup
23 man_MANS =
24
25 if BUILD_MANPAGES
26 if HAVE_MANPAGES_STYLESHEET
27
28 man_MANS += $(MANPAGES) $(MANPAGES_ALIASES)
29
30 XSLTPROC_FLAGS = \
31         --stringparam man.authors.section.enabled 0 \
32         --stringparam man.copyright.section.enabled 0 \
33         --stringparam funcsynopsis.style ansi \
34         --stringparam man.output.quietly 1 \
35         --nonet
36
37 XSLTPROC_PROCESS_MAN = \
38         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
39         $(XSLTPROC) -o "$@" $(XSLTPROC_FLAGS) $(MANPAGES_STYLESHEET) "$<" && \
40         touch .man_fixup
41
42 # Force .man_fixup if $(MANPAGES) are not built
43 .man_fixup: | $(MANPAGES)
44         @touch .man_fixup
45
46 $(MANPAGES_ALIASES): $(MANPAGES) .man_fixup
47         $(AM_V_GEN)if test -n "$@" ; then $(SED) -i -e 's/^\.so \([a-z_]\+\)\.\([0-9]\)$$/\.so man\2\/\1\.\2/' "$@" ; fi
48
49 %.1: $(top_srcdir)/man/%.xml
50         $(XSLTPROC_PROCESS_MAN)
51
52 %.3: $(top_srcdir)/man/%.xml
53         $(XSLTPROC_PROCESS_MAN)
54
55 %.5: $(top_srcdir)/man/%.xml
56         $(XSLTPROC_PROCESS_MAN)
57
58 %.7: $(top_srcdir)/man/%.xml
59         $(XSLTPROC_PROCESS_MAN)
60
61 endif # HAVE_MANPAGES_STYLESHEET
62 endif # BUILD_MANPAGES