From 2cd4ff3a5ff52d89b6b992d158f389b757f4faf4 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 31 Aug 2015 23:12:43 -0700 Subject: build: correct man-page generation rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PATH was set incorrectly, so that the diff used by help2man was the one from $PATH, rather than the just-built one. * man/Makefile.am (bin_dir): New variable, to... (dist_man1_MANS): ...prepend ../src to PATH, not just "..". Also, add a test to ensure that each $(bin_dir)/$$base is executable, so this doesn't happen again. In http://debbugs.gnu.org/21023, Rodrigo Valiña Gutiérrez reported that diff.1 from the diffutils-3.3 tarball contained no description of the then-new --no-dereference option. --- man/Makefile.am | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'man') diff --git a/man/Makefile.am b/man/Makefile.am index fd136d2..de55e00 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -25,10 +25,15 @@ diff.1: $S/diff.c diff.x diff3.1: $S/diff3.c diff3.x sdiff.1: $S/sdiff.c sdiff.x +# Directory in which just-built programs reside. It is used +# to ensure help2man invokes them via the use of PATH below. +bin_dir = ../src + # Depend on the former to get version number changes. $(dist_man1_MANS): $(SRC_VERSION_C) help2man $(AM_V_GEN)base=`expr $@ : '\(.*\).1'` \ + && test -x $(bin_dir)/$$base \ && (echo '[NAME]' && sed 's@/\* *@@; s/-/\\-/; q' $S/$$base.c) \ - | PATH="..$(PATH_SEPARATOR)$$PATH" \ + | PATH="$(bin_dir)$(PATH_SEPARATOR)$$PATH" \ $(srcdir)/help2man -i - -i $(srcdir)/$$base.x \ -S '$(PACKAGE) $(VERSION)' $$base > $@-t && mv $@-t $@ -- cgit v1.2.1