From 97d00fe836c794ec0ff67b98e1635c5f594f3052 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 26 Jul 2003 06:35:51 +0000 Subject: (ME): Don't use trick suggested in Make manual. It doesn't work for make-3.79.1. Reported by Christian Krackowizer. (sc_system_h_headers): Another syntax check. (syntax-check-rules): Add it to the list. --- Makefile.maint | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'Makefile.maint') diff --git a/Makefile.maint b/Makefile.maint index 8e0dd8f3f..61fadc09d 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -19,7 +19,9 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +# This is reported not to work with make-3.79.1 +# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +ME := Makefile.maint # Do not save the original name or timestamp in the .tar.gz file. GZIP_ENV = '--no-name --best' @@ -67,7 +69,8 @@ syntax-check-rules = \ sc_space_tab \ sc_error_exit_success \ sc_xalloc_h_in_src \ - sc_changelog + sc_changelog \ + sc_system_h_headers syntax-check: $(syntax-check-rules) # @grep -E '# *include <(limits|std(def|arg|bool))\.h>' \ @@ -132,6 +135,37 @@ sc_changelog: { echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \ exit 1; } || : +header_regexp = \ + alloca\ + |closeout\ + |ctype\ + |dirent\ + |errno\ + |fcntl\ + |inttypes\ + |limits\ + |locale\ + |pathmax\ + |std(lib|bool)\ + |string\ + |sys/(stat|dir|time)\ + |time\ + |unistd\ + |utime\ + |version-etc\ + |xalloc +h_re := $(shell echo '$(header_regexp)'|tr -d ' ') + +# Files in src/ should not include directly any of +# the headers already included via system.h. +# Get list of candidates with this: +# grep -h include src/sys*.h|sed 's/.*include //'|sort - +sc_system_h_headers: + @grep -E '^# *include ["<]($(h_re))\.h[">]' \ + $(srcdir)/src/*.c && \ + { echo '$(ME): the above are already included via system.h' 1>&2; \ + exit 1; } || : + # Ensure that date's --help output stays in sync with the info # documentation for GNU strftime. The only exception is %N, # which date accepts but GNU strftime does not. -- cgit v1.2.1