Skip to content

Commit

Permalink
Revamp the manpage building
Browse files Browse the repository at this point in the history
* Always dist the relevant manpages
* Don't build tools manpages is configured with `--disable-tools`
  (Closes PowerDNS#4643)
* Don't remove manpages if they cannot be rebuilt (Closes PowerDNS#3306)
  • Loading branch information
pieterlexis committed Dec 19, 2016
1 parent e0c49e6 commit f986298
Showing 1 changed file with 24 additions and 32 deletions.
56 changes: 24 additions & 32 deletions docs/Makefile.am
@@ -1,3 +1,4 @@

MANPAGES_TARGET_AUTH = pdns_server.1 \
pdns_control.1 \
pdnsutil.1 \
Expand All @@ -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
Expand All @@ -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

0 comments on commit f986298

Please sign in to comment.