+# Run `changelog-check' last, as previous test may reveal problems requiring
+# new ChangeLog entries.
+local-check = \
+ po-check copyright-check writable-files m4-check author_mark_check \
+ changelog-check strftime-check header-check
+.PHONY: $(local-check)
+
+# Make sure C source files in src/ don't include xalloc.h directly,
+# since they all already include it via sys2.h.
+# It's not a big deal -- just aesthetics.
+header-check:
+ if test -f $(srcdir)/src/sys2.h; then \
+ if grep 'xalloc\.h' $(srcdir)/src/*.c; then \
+ exit 1; \
+ fi; \
+ fi
+
+# 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.
+extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
+strftime-check:
+ if test -f $(srcdir)/src/date.c; then \
+ grep '^ %. ' $(srcdir)/src/date.c | sort \
+ | $(extract_char) > $@-src; \
+ { echo N; \
+ info libc date calendar format | grep '^ `%.'\' \
+ | $(extract_char); } | sort > $@-info; \
+ diff -u $@-src $@-info || exit 1; \
+ rm -f $@-src $@-info; \
+ fi