# Makefile - Don Yang (uguu.org)
#
# 2014-10-15


width1 = 220
height1 = `perl -e 'print int($(width1) * 0.40)'`
width2 = 90
height2 = `perl -e 'print int($(width2) * 0.50)'`

targets = sinon.txt sino.txt

all: $(targets)
	@echo -n "sinon.txt: "
	@perl freq.pl sinon.txt
	@echo -n "sino.txt: "
	@perl freq.pl sino.txt

sinon.txt: sinon.png Makefile
	perl anytotxt.pl $< $(width1) $(height1) | perl downsample.pl | perl trim_space.pl > $@

sino.txt: sino.png Makefile
	perl anytotxt.pl $< $(width2) $(height2) | perl downsample.pl | perl trim_space.pl > $@

clean:
	-rm -f $(targets)

backup:
	-rm -f backup.tar.xz
	tar cf backup.tar *.pl *.cdr Makefile
	xz -9 backup.tar
