+# Ensure that there are no undefined references in the document by
+# parsing the log file for said warnings.
+.PHONY: check-undefined
+check-undefined: $(PN).log
+ @! grep -i 'undefined' $<
+
+# Run a suite of checks.
+.PHONY: check
+check: check-boxes check-chktex check-undefined
+
+# Clean up leftover junk. This only looks overcomplicated because
+# the *.{foo,bar} syntax supported by Bash is not POSIX, and Make
+# will execute these commands using /bin/sh (which should be POSIX).
+JUNK_EXTENSIONS = aux bbl bcf bib blg listing lof log nav out pdf
+JUNK_EXTENSIONS += snm spl toc xml