From f9862985bc17837baa3477c13e07602de6d9f20b Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Mon, 19 Dec 2016 16:55:12 +0100 Subject: [PATCH] Revamp the manpage building * Always dist the relevant manpages * Don't build tools manpages is configured with `--disable-tools` (Closes #4643) * Don't remove manpages if they cannot be rebuilt (Closes #3306) --- docs/Makefile.am | 56 +++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 32 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 4fa8256a751de..84faedd2d6545 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,3 +1,4 @@ + MANPAGES_TARGET_AUTH = pdns_server.1 \ pdns_control.1 \ pdnsutil.1 \ @@ -24,38 +25,41 @@ MANPAGES_TARGET_TOOLS += dnsbulktest.1 \ dnstcpbench.1 endif - if HAVE_PROTOBUF if HAVE_PROTOC MANPAGES_TARGET_TOOLS += dnspcap2protobuf.1 endif endif -MANPAGES_TARGET_DNSDIST = dnsdist.1 +EXTRA_DIST = manpages markdown/*.md markdown/appendix markdown/authoritative markdown/common markdown/httpapi markdown/recursor markdown/security markdown/tools $(MANPAGES_TARGET_AUTH) $(MANPAGES_TARGET_TOOLS) -MANPAGES_TARGET_RECURSOR = pdns_recursor.1 \ - rec_control.1 +# Figure out the manpages to build/install +MANPAGES_TARGET_ALL=$(MANPAGES_TARGET_AUTH) +man_MANS = $(MANPAGES_TARGET_AUTH) -MANPAGES_TARGET_ALL=$(MANPAGES_TARGET_AUTH) \ - $(MANPAGES_TARGET_RECURSOR) \ - $(MANPAGES_TARGET_TOOLS) \ - $(MANPAGES_TARGET_DNSDIST) - -# The manpages to distribute and install are only those for the -# auth server and tools. For the recursor and dnsdist tarballs, -# the respective dist- scripts will take care of this -if HAVE_PANDOC -dist_man_MANS = $(MANPAGES_TARGET_AUTH) $(MANPAGES_TARGET_TOOLS) -endif -if HAVE_MANPAGES -dist_man_MANS = $(MANPAGES_TARGET_AUTH) $(MANPAGES_TARGET_TOOLS) +if TOOLS +MANPAGES_TARGET_ALL += $(MANPAGES_TARGET_TOOLS) +man_MANS += $(MANPAGES_TARGET_TOOLS) endif -EXTRA_DIST = manpages markdown/*.md markdown/appendix markdown/authoritative markdown/common markdown/httpapi markdown/recursor markdown/security markdown/tools +all-manpages: $(MANPAGES_TARGET_ALL) +# If we can't rebuild the manpages, don't allow creation or deletion +if HAVE_PANDOC +$(MANPAGES_TARGET_ALL): %: manpages/%.md + $(PANDOC) -s -t man $< -o $@ -.PHONY: html all-manpages +clean: + rm -rf html html.tar.bz2 *.8 *.1 +else +if !HAVE_MANPAGES +$(MANPAGES_TARGET_ALL): + echo "You need pandoc to generate the manpages" + exit 1 +endif +endif +# HTML documentation html: html/index.html if FROM_GIT @@ -82,16 +86,4 @@ html/index.html: @echo "supported from a git checkout" endif -all-manpages: $(MANPAGES_TARGET_ALL) - -if HAVE_PANDOC -$(MANPAGES_TARGET_ALL): %: manpages/%.md - $(PANDOC) -s -t man $< -o $@ -else -$(MANPAGES_TARGET_ALL): - echo "You need pandoc to generate the manpages" - exit 1 -endif - -clean: - rm -rf html html.tar.bz2 *.8 *.1 +.PHONY: html all-manpages