dw_cs_a4_book2up.pdf: dw_cs_a4_book2up.ps
	ps2pdf dw_cs_a4_book2up.ps dw_cs_a4_book2up.pdf.new
	mv dw_cs_a4_book2up.pdf.new dw_cs_a4_book2up.pdf

dw_cs_a4_book2up.ps: dw_cs_a4_book.ps nup
	./nup dw_cs_a4_book.ps dw_cs_a4_book2up.ps.new
	mv dw_cs_a4_book2up.ps.new dw_cs_a4_book2up.ps

dw_cs_a4_book.ps: dw_cs_a4.ps 
	psbook dw_cs_a4.ps dw_cs_a4_book.ps.new
	mv dw_cs_a4_book.ps.new dw_cs_a4_book.ps

dw_cs_a4.ps: dw_cs_a4.pdf
	pdftops dw_cs_a4.pdf dw_cs_a4.ps.new
	mv dw_cs_a4.ps.new dw_cs_a4.ps

dw_cs_a4.pdf: diceware_full.txt txt2pdf.py txt2pdf
	./txt2pdf -o ./dw_cs_a4.pdf diceware_full.txt

diceware_full.txt: diceware_preface.txt diceware_table_nice.txt
	cat diceware_preface.txt diceware_table_nice.txt >diceware_full.txt.new
	mv diceware_full.txt.new diceware_full.txt

diceware_table_nice.txt: diceware_wordlist_cz.txt dw_table.py
	./dw_table.py

.PHONY: clean

clean:
	rm -f *.pdf *.ps diceware_full.txt diceware_table_nice.txt *.new