#--*- Makefile -*--

# Convert all .txt files to PDF using 'pandoc'

TXT_FILES = $(wildcard *.txt)
PDF_FILES = ${TXT_FILES:%.txt=%.pdf}

.PHONY: all clean distclean spell

all: ${PDF_FILES}

%.pdf: %.txt
	pandoc -V fontenc:L7x $< -o $@

spell:
	for FILE in ${TXT_FILES}; do \
		if [ $$FILE = 'data-integrity-checks.txt' ]; then \
			WORDS=words.lst; \
		else \
			WORDS=žodžiai.lst; \
		fi; \
		aspell -x -p ./$${WORDS} -l lt -c $${FILE}; \
	done

clean:
	rm -f ${PDF_FILES}

distclean: clean
