From cdcec53a882b0b6fb345eee723d877379653e17f Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Mon, 4 Mar 2019 11:43:14 +0000 Subject: [PATCH] Fix 'make distcheck' by removing the manpage additional generated .3 files Part Three: man/Makefile.am: Determine additional man pages created by a2x with A2X_EXTRA_PAGES. Set EXTRA_PAGES for the hand crafted additional man pages. Clean out the additional installed coap_*.3 man pages using uninstall-man: in man/Makefile.am --- man/Makefile.am | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/man/Makefile.am b/man/Makefile.am index f4695434..24e95128 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -52,7 +52,30 @@ man7_MANS = $(MAN7) $(A2X) --doctype manpage --format manpage $< $(A2X) --doctype manpage --format xhtml $< -# We are limited to 10 names, but synopsis can cover more +# Man pages built byt a2x based on the NAMES section of the .txt file +A2X_EXTRA_PAGES := $(shell for fil in $(TXT3); do sed -ne '/^NAME/,/^SYNOPSIS/p;/^SYNOPSIS/q' $${fil} | \ + sed -ne '/coap_/{ s/ *, */\n/g; p }' | sed -ne 's/^\(coap_[a-zA-Z_]\+\).*$$/\1.3/p' ; done) + +# Extra man pages that need to be installed due to limit of 10 +# names built by a2x +# These files are created in install-man +EXTRA_PAGES = \ + coap_context_set_pki_root_cas.3 \ + coap_add_data_blocked_response.3 \ + coap_encode_var_bytes.3 \ + coap_split_path.3 \ + coap_split_query.3 \ + coap_session_get_app_data.3 \ + coap_session_set_app_data.3 \ + coap_endpoint_str.3 + +# a2x builds alternative .3 files up to a limit of 10 names from the +# NAME section, so that 'man' works against the alternative different +# function names. +# However, if there are more alternative names, they need to be defined +# as per below. +# Then all the alternative names as well as the extras defined below need +# to be cleaned up in a 'make unistall'. install-man: install-man3 install-man5 install-man7 @echo ".so man3/coap_context.3" > coap_context_set_pki_root_cas.3 @echo ".so man3/coap_pdu_setup.3" > coap_add_data_blocked_response.3 @@ -63,7 +86,12 @@ install-man: install-man3 install-man5 install-man7 @echo ".so man3/coap_session.3" > coap_session_set_app_data.3 @echo ".so man3/coap_logging.3" > coap_endpoint_str.3 @echo ".so man3/coap_logging.3" > coap_session_str.3 - $(INSTALL_DATA) *.3 "$(DESTDIR)$(man3dir)" + $(INSTALL_DATA) $(EXTRA_PAGES) $(A2X_EXTRA_PAGES) "$(DESTDIR)$(man3dir)" + +# As well as removing the base 'man' pages, remove other .3 files built by +# a2x, as well as build by install-man specials. +uninstall-man: uninstall-man3 uninstall-man5 uninstall-man7 + -(cd $(DESTDIR)$(man3dir) ; rm -f $(EXTRA_PAGES) $(A2X_EXTRA_PAGES) ) CLEANFILES = *.3 *.5 *.7 *.xml *.html docbook-xsl.css