docs: Honour --{en, dis}able-xend when building docs
PATCH v2 1/2 docs: Honour --{en, dis}able-xend when building docs
If a user has specified --disable-xend, they wont want the manpages either.
Propagating this parameters requires reorganising the way in which the makefile chooses which documents to build.
There is now a split of {MAN1,MAN5,MARKDOWN,TXT}SRC-y to select which documentation to build, which is separate from the patsubst section which generates appropriate paths to trigger the later rules.
The manpages are quite easy to split between xend, xl and xenstore, and have been. Items from misc/ are much harder and been left.
---
Changes in v2:
* Correct markdown typo
The configure scripts should be regenerated as part of applying this patch.
--- config/Docs.mk.in | 3 +++ docs/Makefile | 38 ++++++++++++++++++++++++-------------- docs/configure.ac | 4 ++++ 3 files changed, 31 insertions(+), 14 deletions(-)
config/Docs.mk.in +3 -0
@@ -12,3 +12,6 @@ POD2HTML := @POD2HTML@ POD2TEXT := @POD2TEXT@ MARKDOWN := @MARKDOWN@ PERL := @PERL@ + +# Subsets of documentation to build +CONFIG_XEND := @xend@
docs/Makefile +24 -14
@@ -6,20 +6,30 @@ VERSION := $(shell $(MAKE) -C $(XEN_ROOT)/xen --no-print-directory xenversion) DOC_ARCHES := arm x86_32 x86_64 -DOC_MAN5SRC := $(wildcard man/*.pod.5) -DOC_MAN1SRC := $(wildcard man/*.pod.1) -DOC_MAN1 := $(patsubst man/%.pod.1,man1/%.1,$(DOC_MAN1SRC)) -DOC_MAN5 := $(patsubst man/%.pod.5,man5/%.5,$(DOC_MAN5SRC)) -DOC_MARKDOWN := $(wildcard misc/*.markdown) -DOC_HTML := $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \ - $(patsubst man/%.pod.1,html/man/%.1.html,$(DOC_MAN1SRC)) \ - $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC)) \ - $(patsubst %.txt,html/%.txt,$(wildcard misc/*.txt)) \ - $(patsubst %,html/hypercall/%/index.html,$(DOC_ARCHES)) -DOC_TXT := $(patsubst %.txt,txt/%.txt,$(wildcard misc/*.txt)) \ - $(patsubst %.markdown,txt/%.txt,$(DOC_MARKDOWN)) \ - $(patsubst man/%.pod.1,txt/man/%.1.txt,$(DOC_MAN1SRC)) \ - $(patsubst man/%.pod.5,txt/man/%.5.txt,$(DOC_MAN5SRC)) +# Documentation sources to build +MAN1SRC-y := $(wildcard man/xl*.pod.1) +MAN1SRC-y += $(wildcard man/xenstore*.pod.1) +MAN1SRC-$(CONFIG_XEND) += man/xm.pod.1 + +MAN5SRC-y := $(wildcard man/xl*.pod.5) +MAN5SRC-$(CONFIG_XEND) += man/xend-config.sxp.pod.5 man/xmdomain.cfg.pod.5 + +MARKDOWNSRC-y := $(wildcard misc/*.markdown) + +TXTSRC-y := $(wildcard misc/*.txt) + + +DOC_MAN1 := $(patsubst man/%.pod.1,man1/%.1,$(MAN1SRC-y)) +DOC_MAN5 := $(patsubst man/%.pod.5,man5/%.5,$(MAN5SRC-y)) +DOC_HTML := $(patsubst %.markdown,html/%.html,$(MARKDOWNSRC-y)) \ + $(patsubst man/%.pod.1,html/man/%.1.html,$(MAN1SRC-y)) \ + $(patsubst man/%.pod.5,html/man/%.5.html,$(MAN5SRC-y)) \ + $(patsubst %.txt,html/%.txt,$(TXTSRC-y)) \ + $(patsubst %,html/hypercall/%/index.html,$(DOC_ARCHES)) +DOC_TXT := $(patsubst %.txt,txt/%.txt,$(TXTSRC-y)) \ + $(patsubst %.markdown,txt/%.txt,$(MARKDOWNSRC-y)) \ + $(patsubst man/%.pod.1,txt/man/%.1.txt,$(MAN1SRC-y)) \ + $(patsubst man/%.pod.5,txt/man/%.5.txt,$(MAN5SRC-y)) .PHONY: all all: build
docs/configure.ac +4 -0
@@ -11,6 +11,7 @@ AC_CONFIG_AUX_DIR([../]) # M4 Macro includes m4_include([../m4/docs_tool.m4]) m4_include([../m4/path_or_fail.m4]) +m4_include([../m4/features.m4]) AX_DOCS_TOOL_PROG([FIG2DEV], [fig2dev]) AX_DOCS_TOOL_PROG([POD2MAN], [pod2man])
@@ -18,6 +19,9 @@ AX_DOCS_TOOL_PROG([POD2HTML], [pod2html]) AX_DOCS_TOOL_PROG([POD2TEXT], [pod2text]) AX_DOCS_TOOL_PROGS([MARKDOWN], [markdown], [markdown markdown_py]) +# Enable/disable options +AX_ARG_DEFAULT_DISABLE([xend], [Enable xend toolstack documentation]) + AC_ARG_VAR([PERL], [Path to Perl parser]) AX_PATH_PROG_OR_FAIL([PERL], [perl])
Signature · 1 line
1.7.10.4
PATCH v2 2/2 docs/Makefile: Split the install target
Split the current install target into two subtargets, install-man-pages and install-html, with the main install target depending on both.
This helps packagers who want the man pages to put in appropriate rpms/debs, but don't want to build the html developer docs.
---
v2: Don't rm -rf destdir in install rule
--- docs/Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
docs/Makefile +9 -5
@@ -88,16 +88,20 @@ distclean: clean rm -rf $(XEN_ROOT)/config/Docs.mk config.log config.status config.cache \ autom4te.cache -.PHONY: install -install: all - rm -rf $(DESTDIR)$(DOCDIR) - $(INSTALL_DIR) $(DESTDIR)$(DOCDIR) - +.PHONY: install-man-pages +install-man-pages: man-pages $(INSTALL_DIR) $(DESTDIR)$(MANDIR) cp -R man1 $(DESTDIR)$(MANDIR) cp -R man5 $(DESTDIR)$(MANDIR) + +.PHONY: install-html +install-html: html txt figs + $(INSTALL_DIR) $(DESTDIR)$(DOCDIR) [ ! -d html ] || cp -R html $(DESTDIR)$(DOCDIR) +.PHONY: install +install: install-man-pages install-html + html/index.html: $(DOC_HTML) $(CURDIR)/gen-html-index INDEX $(PERL) -w -- $(CURDIR)/gen-html-index -i INDEX html $(DOC_HTML)
Signature · 1 line
1.7.10.4
Quoted 5 lines · Andrew Cooper
If a user has specified --disable-xend, they wont want the manpages either.
Propagating this parameters requires reorganising the way in which the makefile chooses which documents to build.
Quoted 8 lines
There is now a split of {MAN1,MAN5,MARKDOWN,TXT}SRC-y to select which documentation to build, which is separate from the patsubst section which generates appropriate paths to trigger the later rules.
The manpages are quite easy to split between xend, xl and xenstore, and have been. Items from misc/ are much harder and been left.
Signed-off-by Andrew Cooper <[email protected]>
It's a little bit pointless given that xend is hopefully going away very shortly, but regardless:
and applied.