summaryrefslogtreecommitdiff
path: root/Makefile.maint
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-07-26 06:35:51 +0000
committerJim Meyering <jim@meyering.net>2003-07-26 06:35:51 +0000
commit97d00fe836c794ec0ff67b98e1635c5f594f3052 (patch)
tree9c2fd0edb3ebec2feeb869a1e627e679a2c297b7 /Makefile.maint
parentbf7cca9996978d64b2827cab8dbbffde9ac509d4 (diff)
downloadcoreutils-97d00fe836c794ec0ff67b98e1635c5f594f3052.tar.xz
(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.
Diffstat (limited to 'Makefile.maint')
-rw-r--r--Makefile.maint38
1 files changed, 36 insertions, 2 deletions
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.