summaryrefslogtreecommitdiff
path: root/Makefile.maint
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-04-09 11:33:53 +0000
committerJim Meyering <jim@meyering.net>2004-04-09 11:33:53 +0000
commitd840a53e906477b332b888f967e7505a2f2fdf16 (patch)
tree7de1d42a58e47e027da439d9edb94919707b683b /Makefile.maint
parent6a5c240b9df0abbfc0532fe6ba4d32e5ae6c3a5f (diff)
downloadcoreutils-d840a53e906477b332b888f967e7505a2f2fdf16.tar.xz
(.re-list): New rule/file, to replace hard-coded list of header file names.
(sc_system_h_headers): Use the new file.
Diffstat (limited to 'Makefile.maint')
-rw-r--r--Makefile.maint41
1 files changed, 13 insertions, 28 deletions
diff --git a/Makefile.maint b/Makefile.maint
index 198584c48..97e84d4c6 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -165,40 +165,25 @@ sc_dd_max_sym_length:
exit 1; \
fi
-header_regexp = \
- alloca\
- |closeout\
- |ctype\
- |dirent\
- |errno\
- |exitfail\
- |fcntl\
- |file-type\
- |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 ' ')
+# Create a list of regular expressions matching the names
+# of files included from system.h. Exclude a couple.
+.re-list:
+ @sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
+ | grep -Ev 'sys/(param|file)\.h' \
+ | sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
+ > $@-t
+ @mv $@-t $@
# 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/system.h|sed 's/.*include //'|sort -
-sc_system_h_headers:
+sc_system_h_headers: .re-list
@if test -f $(srcdir)/src/system.h; then \
- ( cvsu --list ) > /dev/null 2>&1 || : && \
- grep -E '^# *include ["<]($(h_re))\.h[">]' \
+ ( cvsu --list ) > /dev/null 2>&1 || exit 0; \
+ trap 'rm -f .re-list' 0 1 2 3 15; \
+ grep -E -f .re-list \
$$(cvsu --list src | grep -Ev 'system\.h$$') \
&& { echo '$(ME): the above are already included via system.h'\
- 1>&2; exit 1; } || :; \
+ 1>&2; exit 1; } || :; \
fi
sc_sun_os_names: