+.PHONY: $(syntax-check-rules)
+syntax-check-rules = \
+ sc_cast_of_argument_to_free \
+ sc_cast_of_x_alloc_return_value \
+ sc_changelog \
+ sc_error_exit_success \
+ sc_space_tab \
+ sc_sun_os_names \
+ sc_system_h_headers \
+ sc_unmarked_diagnostics \
+ sc_xalloc_h_in_src
+
+syntax-check: $(syntax-check-rules)
+# @grep -E '# *include <(limits|std(def|arg|bool))\.h>' \
+# $$(find -type f -name '*.[chly]') && \
+# { echo '$(ME): found conditional include' 1>&2; \
+# exit 1; } || :
+
+# grep -E '^# *include <(string|stdlib)\.h>' \
+# $(srcdir)/{lib,src}/*.[chy] && \
+# { echo '$(ME): FIXME' 1>&2; \
+# exit 1; } || :
+# FIXME: don't allow `#include .strings\.h' anywhere
+
+# Look for diagnostics that aren't marked for translation.
+# This won't find any for which error's format string is on a separate line.
+sc_unmarked_diagnostics:
+ @grep --exclude=$(srcdir)/src/shred.c -E \
+ '\<error \([^"]*"[^"]*[a-z]{3}' $(srcdir)/{lib,src}/*.c \
+ | grep -v '_(' && \
+ { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
+ exit 1; } || :
+
+sc_cast_of_argument_to_free:
+ @grep -E '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] && \
+ { echo '$(ME): don'\''t cast free argument' 1>&2; \
+ exit 1; } || :
+
+sc_cast_of_x_alloc_return_value:
+ @grep -E --exclude=$(srcdir)/lib/regex.c \
+ '\*\) *x(m|c|re)alloc\>' $(srcdir)/{lib,src}/*.[chy] && \
+ { echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \
+ exit 1; } || :
+
+sc_space_tab:
+ @( cvsu --list ) > /dev/null 2>&1 || : && \
+ grep '[ ] ' \
+ $$(cvsu --list | grep -vEf .x-$@ ) && \
+ { echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
+ 1>&2; exit 1; } || :
+
+# Using EXIT_SUCCESS as the first argument to error is misleading,
+# since when that parameter is 0, error does not exit. Use `0' instead.
+sc_error_exit_success:
+ @grep -F 'error (EXIT_SUCCESS,' \
+ $$(find -type f -name '*.[chly]') && \
+ { echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
+ exit 1; } || :
+
+# FIXME: merge this with sc_system_h_headers below.
+# xalloc.h is included via system.h, so should not be included
+# directly by any file in src/.
+sc_xalloc_h_in_src:
+ @if test -f $(srcdir)/src/sys2.h; then \