Skip to contentSkip to conversation

doc: fix cleaning of man-pages

PATCH In review Jeremy Sowden 2 participants 4 messages Aug 6, 2023 – Aug 10, 2023 netfilter

lore
Share & tools
lore
#0 lore raw

cover doc: fix cleaning of man-pages

Currently, the man-page pages are generated by make dist, but removed by make clean. By constrast, the flex and bison C sources, which are also generated by make dist, are removed by make maintainer-clean. The latter are handled automatically by automake, and in fact a change was committed to src/Makfile.am to remove them from CLEANFILES for this reason:

http://git.netfilter.org/nftables/commit/src/Makefile.am?id=3eaba1125798c7b8f2e8ad3d1a572de6b84f4e5a

However, automake doesn't automatically generate man-pages in make dist: we have to tell it to do so; and thus we also have to tell it when to clean them. This patch-set changes the clean target for the man-pages to follow the pattern automake uses for bison and flex.

Jeremy Sowden (2):
doc: move man-pages to dist_man_MANS
doc: move man-pages to MAINTAINERCLEANFILES

 doc/Makefile.am | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.40.1
#1 lore raw

PATCH 1/2 doc: move man-pages to `dist_man_MANS`

Removes the need to add them to EXTRA_DIST.

---
 doc/Makefile.am | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
doc/Makefile.am +3 -3
index 21482320e418..5a64e39b48cf 100644
@@ -1,5 +1,5 @@
 if BUILD_MAN
-man_MANS = nft.8 libnftables-json.5 libnftables.3
+dist_man_MANS = nft.8 libnftables-json.5 libnftables.3
 
 A2X_OPTS_MANPAGE = -L --doctype manpage --format manpage -D ${builddir}
 
@@ -12,7 +12,7 @@ ASCIIDOC_INCLUDES = \
        statements.txt
 ASCIIDOCS = ${ASCIIDOC_MAIN} ${ASCIIDOC_INCLUDES}
 
-EXTRA_DIST = ${ASCIIDOCS} ${man_MANS} libnftables-json.adoc libnftables.adoc
+EXTRA_DIST = ${ASCIIDOCS} libnftables-json.adoc libnftables.adoc
 
 CLEANFILES = \
 	*~
@@ -26,5 +26,5 @@ nft.8: ${ASCIIDOCS}
 .adoc.5:
 	${AM_V_GEN}${A2X} ${A2X_OPTS_MANPAGE} $<
 
-CLEANFILES += ${man_MANS}
+CLEANFILES += ${dist_man_MANS}
 endif
Signature · 1 line
2.40.1
#2 lore raw

PATCH 2/2 doc: move man-pages to `MAINTAINERCLEANFILES`

In reply to Jeremy Sowden

Since the man-pages are built and included in the distribution tar-balls, the appropriate clean target is maintainer-clean.

---
 doc/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
doc/Makefile.am +1 -1
index 5a64e39b48cf..b43cb08d2d14 100644
@@ -26,5 +26,5 @@ nft.8: ${ASCIIDOCS}
 .adoc.5:
 	${AM_V_GEN}${A2X} ${A2X_OPTS_MANPAGE} $<
 
-CLEANFILES += ${dist_man_MANS}
+MAINTAINERCLEANFILES = ${dist_man_MANS}
 endif
Signature · 1 line
2.40.1
#3 lore raw
In reply to Jeremy Sowden
Quoted 7 lines · Jeremy Sowden

Currently, the man-page pages are generated by make dist, but removed by make clean. By constrast, the flex and bison C sources, which are also generated by make dist, are removed by make maintainer-clean. The latter are handled automatically by automake, and in fact a change was committed to src/Makfile.am to remove them from CLEANFILES for this reason:

Quoted 6 lines

http://git.netfilter.org/nftables/commit/src/Makefile.am?id=3eaba1125798c7b8f2e8ad3d1a572de6b84f4e5a

However, automake doesn't automatically generate man-pages in make dist: we have to tell it to do so; and thus we also have to tell it when to clean them. This patch-set changes the clean target for the man-pages to follow the pattern automake uses for bison and flex.

Series applied, thanks