On 12/02/10 18:11, Jim Meyering wrote:
Pádraig Brady wrote:

I was also wondering about calling "check-programs-vs-x"
from syntax-check instead of dist-check?

Thanks for pointing that out!
I've just looked it up in the automake documentation, and see that a
distcheck-hook rule is recognized only if it's in the top-level directory.

The attached patch now calls these tests as part of syntax-check

cheers,
Pádraig.

>From 6f3103fbf2f390137dcc147e3bd3b322af906073 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?P=C3=A1draig=20Brady?= <p...@draigbrady.com>
Date: Fri, 12 Feb 2010 18:34:33 +0000
Subject: [PATCH] maint: fix the man page correlation tests

These checks were not being run as distcheck-hook targets
are only supported in the top-level Makefile.  Instead
these tests are now run during a syntax-check.

* cfg.mk (sc_man_file_correlation):  A new syntax check to
call the 2 existing tests to check the correlation between
the programs and man/*.[1x].
* man/Makefile.am (sc_man_file_correlation): Call the 2 existing
man page correlation tests.
(check-x-vs-1): Be quiet by not outputting the "GEN" annotation.
(check-programs-vs-x): Likewise.
* src/Makefile.am (all_programs.list): Exclude libstdbuf.so
from the list of programs.  This issue was not noticed as
the checks were not actually being run.
---
 cfg.mk          |    5 +++++
 man/Makefile.am |    7 ++++---
 src/Makefile.am |    1 +
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 9c748e3..b2b1443 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -180,6 +180,11 @@ sc_option_desc_uppercase:
 	@$(MAKE) -s -C src all_programs
 	@$(MAKE) -s -C man $@
 
+# Ensure all man/*.[1x] files are present
+sc_man_file_correlation:
+	@$(MAKE) -s -C src all_programs
+	@$(MAKE) -s -C man $@
+
 # Perl-based tests used to exec perl from a #!/bin/sh script.
 # Now they all start with #!/usr/bin/perl and the portability
 # infrastructure is in tests/Makefile.am.  Make sure no old-style
diff --git a/man/Makefile.am b/man/Makefile.am
index 7cebbf1..c3c3803 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -180,7 +180,8 @@ sc_option_desc_uppercase: $(dist_man1_MANS) $(NO_INSTALL_PROGS_DEFAULT:%=%.1)
 	    { echo 1>&2 '$(ME): found initial capitals in --help';   \
 	      exit 1; } || :;
 
-distcheck-hook: check-x-vs-1 check-programs-vs-x
+.PHONY: sc_man_file_correlation
+sc_man_file_correlation: check-x-vs-1 check-programs-vs-x
 
 # Sort in traditional ASCII order, regardless of the current locale;
 # otherwise we may get into trouble with distinct strings that the
@@ -193,7 +194,7 @@ ASSORT = LC_ALL=C sort
 # add them here manually.
 .PHONY: check-x-vs-1
 check-x-vs-1:
-	$(AM_V_GEN)PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH;	\
+	@PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH;		\
 	t...@-t;								\
 	(cd $(srcdir) && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\
 	(echo $(dist_man1_MANS) $(NO_INSTALL_PROGS_DEFAULT)		\
@@ -207,7 +208,7 @@ all_programs =								\
 
 .PHONY: check-programs-vs-x
 check-programs-vs-x:
-	$(AM_V_GEN)status=0;				\
+	@status=0;					\
 	for p in dummy `$(all_programs)`; do		\
 	  test $$p = dummy && continue;			\
 	  test $$p = ginstall && p=install || : ;	\
diff --git a/src/Makefile.am b/src/Makefile.am
index addc2eb..feb6c22 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -635,6 +635,7 @@ built_programs.list:
 
 all_programs.list:
 	@echo $(all_programs) | tr ' ' '\n' | sed -e 's,$(EXEEXT)$$,,' \
+	  | sed /libstdbuf/d \
 	  | $(ASSORT) -u
 
 # This is required because we have broken inter-directory dependencies:
-- 
1.6.2.5

Reply via email to