ASCIIDOC=asciidoc --verbose --unsafe -d manpage -b docbook
all: conics.1

clean:
	-rm -f *.[0-9] *.xml conics-*.txt

%.1 %.5 %.7: %.xml
	xmlto man "$<"

%.xml: %.txt
	$(ASCIIDOC) -o "$@" "$<"

conics.xml: conics.txt conics-opt.txt conics-subcommands.txt
	$(ASCIIDOC) -o "$@" "$<"

conics-opt.txt: options.py
	./$< > $@

conics-subcommands.txt: subcommands.py
	./$< import > $@
