# Makefile for building and installing the perl-PlexTree package
# Markus Kuhn -- https://www.cl.cam.ac.uk/~mgk25/

.SUFFIXES: .pm .3 .ps .pdf $(SUFFIXES)

.ps.pdf:
	distill < $< > $@

.3.ps:
	groff -man $< > $@

.pm.3:
	pod2man $< > $@

all: PlexTree.pdf

MODULES=PlexTree

refman.pdf: $(MODULES:%=%.ps)
	cat $+ | distill > $@

distribution: README Makefile refman.pdf $(MODULES:%=%.pm) $(MODULES:%=%.3)
	tar cvzf \
	$(HOME)/public_html/download/perl-PlexTree-`date +%Y%m%d`.tar.gz $+

test:
	@echo "# tests without 'use utf8' (byte-string source) ..."
	prove -I. t/
	@echo "# tests with 'use utf8' (character-string source) ..."
	TESTUTF8=1 prove -I. t/

clean:
	rm -f *~ *.3 *.ps *.pdf
