#--*- Makefile -*--

TEXT_PARTS ?= $(wildcard *.rst *.md)

.PHONY: aspell spell

define aspell
aspell -x -p ./words.lst -l en_GB
endef

aspell:
	for i in ${TEX_FILES} ${LTX_FILES} ${TEXT_PARTS}; do \
		${aspell} check $$i; \
	done

spell:
	for i in ${TEX_FILES} ${LTX_FILES} ${TEXT_PARTS}; do \
		echo "===" $$i; \
		${aspell} list < $$i | sort -u; \
	done
