[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 6/7] docs/build: Move install checks into individual build targets
For top-level targets which use more than a single program to produce content (txt already, pdf once pandoc is supported), these current checks are unsuitable. By moving the the install checks to the rules which actually use the programs, it is now possible to build a subset of a top-level target depending on the installed programs. As a bonus, it removes the need to recurse for txt, man-pages and pdf targets. A side effect of this is that every individual source which cannot be generated will have a specific message logged, giving the file and program. As such, these message are updated to consistently report the target file which was not generated. Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> CC: Ian Campbell <Ian.Campbell@xxxxxxxxxx> CC: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> CC: Wei Liu <wei.liu2@xxxxxxxxxx> --- docs/Makefile | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index 6de05e4..487f7a6 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -41,12 +41,7 @@ build: html txt pdf man-pages figs html: $(DOC_HTML) html/index.html .PHONY: txt -txt: -ifdef POD2TEXT - $(MAKE) $(DOC_TXT) -else - @echo "pod2text not installed; skipping text outputs." -endif +txt: $(DOC_TXT) .PHONY: figs figs: @@ -57,20 +52,10 @@ else endif .PHONY: man-pages -man-pages: -ifdef POD2MAN - $(MAKE) $(DOC_MAN1) $(DOC_MAN5) -else - @echo "pod2man not installed; skipping man-pages." -endif +man-pages: $(DOC_MAN1) $(DOC_MAN5) .PHONY: pdf -pdf: -ifdef PANDOC - $(MAKE) $(DOC_PDF) -else - @echo "pandoc not installed; skipping pdfs." -endif +pdf: $(DOC_PDF) .PHONY: clean clean: @@ -103,12 +88,20 @@ install: install-man-pages install-html # Individual file build targets man1/%.1: man/%.pod.1 Makefile +ifdef POD2MAN @$(INSTALL_DIR) $(@D) $(POD2MAN) --release=$(VERSION) --name=$* -s 1 -c "Xen" $< $@ +else + @echo "pod2man not installed; skipping $(@F)" +endif man5/%.5: man/%.pod.5 Makefile +ifdef POD2MAN @$(INSTALL_DIR) $(@D) $(POD2MAN) --release=$(VERSION) --name=$* -s 5 -c "Xen" $< $@ +else + @echo "pod2man not installed; skipping $(@F)" +endif html/index.html: $(DOC_HTML) $(CURDIR)/gen-html-index INDEX $(PERL) -w -- $(CURDIR)/gen-html-index -i INDEX html $(DOC_HTML) @@ -118,7 +111,7 @@ ifdef MARKDOWN @$(INSTALL_DIR) $(@D) $(MARKDOWN) $< > $@ else - @echo "markdown not installed; skipping $*.html." + @echo "markdown not installed; skipping $(@F)" endif html/%.txt: %.txt @@ -130,7 +123,7 @@ ifdef POD2HTML @$(INSTALL_DIR) $(@D) $(POD2HTML) --infile=$< --outfile=$@ else - @echo "pod2html not installed; skipping $<." + @echo "pod2html not installed; skipping $(@F)" endif html/man/%.5.html: man/%.pod.5 Makefile @@ -138,7 +131,7 @@ ifdef POD2HTML @$(INSTALL_DIR) $(@D) $(POD2HTML) --infile=$< --outfile=$@ else - @echo "pod2html not installed; skipping $<." + @echo "pod2html not installed; skipping $(@F)" endif # For non-x86 arches exclude the subarch whole x86 arch. @@ -169,7 +162,7 @@ ifdef POD2TEXT @$(INSTALL_DIR) $(@D) $(POD2TEXT) $< $@ else - @echo "pod2text not installed; skipping $<." + @echo "pod2text not installed; skipping $(@F)" endif txt/man/%.5.txt: man/%.pod.5 Makefile @@ -177,12 +170,16 @@ ifdef POD2TEXT @$(INSTALL_DIR) $(@D) $(POD2TEXT) $< $@ else - @echo "pod2text not installed; skipping $<." + @echo "pod2text not installed; skipping $(@F)" endif pdf/%.pdf: %.markdown +ifdef PANDOC @$(INSTALL_DIR) $(@D) $(PANDOC) --number-sections --toc --standalone $< --output $@ +else + @echo "pandoc not installed; skipping $(@F)" +endif ifeq (,$(findstring clean,$(MAKECMDGOALS))) $(XEN_ROOT)/config/Docs.mk: -- 1.7.10.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |