Jim Meyering wrote: > FYI, just pushed: > ... > Subject: [PATCH 2/4] doc: ensure each program has a man/*.x file: add "SEE > ALSO" references > Subject: [PATCH 3/4] build: ccache works better without embedded version > strings > Subject: [PATCH 4/4] doc: do not distribute generated man/*.1 man files > > * man/help2man: New file. > * man/Makefile.am: Use $(srcdir)/help2man. > Convert $(dist_man1_MANS) to $(man1_MANS), to tell automake > not to distribute the generated man/*.1 files. Now they're > generated at build-from-tarball time. > ($(man1_MANS)): Depend on version.c, so that man pages are > regenerated whenever the version string changes. > --- > man/Makefile.am | 20 +- > man/help2man | 667 > +++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 677 insertions(+), 10 deletions(-) > create mode 100755 man/help2man > > diff --git a/man/Makefile.am b/man/Makefile.am > index 1bd5fe7..7c982fe 100644 > --- a/man/Makefile.am > +++ b/man/Makefile.am > @@ -15,10 +15,9 @@ > # You should have received a copy of the GNU General Public License > # along with this program. If not, see <http://www.gnu.org/licenses/>. > > -dist_man1_MANS = cmp.1 diff.1 diff3.1 sdiff.1 > -MAINTAINERCLEANFILES = $(dist_man1_MANS) > - > -EXTRA_DIST = $(dist_man1_MANS:%.1=%.x) > +man1_MANS = cmp.1 diff.1 diff3.1 sdiff.1 > +EXTRA_DIST = $(man1_MANS:%.1=%.x) help2man > +DISTCLEANFILES = $(man1_MANS) > > S = $(top_srcdir)/src > cmp.1: $S/cmp.c cmp.x > @@ -26,9 +25,10 @@ diff.1: $S/diff.c diff.x > diff3.1: $S/diff3.c diff3.x > sdiff.1: $S/sdiff.c sdiff.x > > -# Depend on configure.ac to get version number changes. > -$(dist_man1_MANS): $(top_srcdir)/configure.ac > - $(AM_V_GEN)base=`expr $@ : '\(.*\).1'` && \ > - (echo '[NAME]' && sed 's@/\* *@@; s/-/\\-/; q' $S/$$base.c) | \ > - $(HELP2MAN) -i - -i $(srcdir)/$$base.x -S '$(PACKAGE) $(VERSION)' \ > - ../src/$$base > $@-t && mv $@-t $@ > +# Depend on the former to get version number changes. > +$(man1_MANS): ../src/version.c help2man > + $(AM_V_GEN)base=`expr $@ : '\(.*\).1'` \ > + && (echo '[NAME]' && sed 's@/\* *@@; s/-/\\-/; q' $S/$$base.c) \ > + | PATH=..$(PATH_SEPARATOR)$$PATH \ > + $(srcdir)/help2man -i - -i $(srcdir)/$$base.x \ > + -S '$(PACKAGE) $(VERSION)' $$base > $@-t && mv $@-t $@ > diff --git a/man/help2man b/man/help2man
Note that the above would impose a new requirement when building from a tarball: perl. I don't want to do that after all, so will adjust things one way or another.
