diff mbox series

[nft] doc: Review man page building in Makefile.am

Message ID 20180914090023.27823-1-phil@nwl.cc
State Accepted
Delegated to: Pablo Neira
Headers show
Series [nft] doc: Review man page building in Makefile.am | expand

Commit Message

Phil Sutter Sept. 14, 2018, 9 a.m. UTC
Previously, changes to any of the included adoc snippets in nft.txt were
not detected and hence the man page not updated (unless 'make clean' was
called). It seems like the '.txt.8' target only considers foo.txt when
trying to generate foo.8, so get rid of that and introduce a dedicated
target for nft.8.

While doing so, apply a few other minor changes:

* Although nft.8 target has to list all included adoc snippets as a
  dependency, it is sufficient to call a2x with the main one (i.e.,
  nft.txt) only.

* Keep common a2x parameters in a variable.

* Use ${A2X} everywhere and hide all calls behind ${AM_V_GEN}, not just
  the one for nft.8.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 doc/Makefile.am | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Pablo Neira Ayuso Sept. 17, 2018, 10:20 p.m. UTC | #1
On Fri, Sep 14, 2018 at 11:00:23AM +0200, Phil Sutter wrote:
> Previously, changes to any of the included adoc snippets in nft.txt were
> not detected and hence the man page not updated (unless 'make clean' was
> called). It seems like the '.txt.8' target only considers foo.txt when
> trying to generate foo.8, so get rid of that and introduce a dedicated
> target for nft.8.

Applied, thanks.
diff mbox series

Patch

diff --git a/doc/Makefile.am b/doc/Makefile.am
index e70dfc5e68201..503d6cd80051c 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -2,6 +2,8 @@  if BUILD_MAN
 man_MANS = nft.8 libnftables-json.5 libnftables.3
 endif
 
+A2X_OPTS_MANPAGE = --doctype manpage --format manpage -D ${builddir}
+
 ASCIIDOC_MAIN = nft.txt
 ASCIIDOC_INCLUDES = \
        data-types.txt \
@@ -11,14 +13,14 @@  ASCIIDOC_INCLUDES = \
        statements.txt
 ASCIIDOCS = ${ASCIIDOC_MAIN} ${ASCIIDOC_INCLUDES}
 
-.txt.8: ${ASCIIDOCS}
-	${AM_V_GEN}${A2X} --doctype manpage --format manpage -D ${builddir} $<
+nft.8: ${ASCIIDOCS}
+	${AM_V_GEN}${A2X} ${A2X_OPTS_MANPAGE} nft.txt
 
 .adoc.3:
-	a2x --doctype manpage --format manpage -D ${builddir} $<
+	${AM_V_GEN}${A2X} ${A2X_OPTS_MANPAGE} $<
 
 .adoc.5:
-	a2x --doctype manpage --format manpage -D ${builddir} $<
+	${AM_V_GEN}${A2X} ${A2X_OPTS_MANPAGE} $<
 
 EXTRA_DIST = ${ASCIIDOCS} libnftables-json.adoc libnftables.adoc