# Makefile - Don Yang (uguu.org)
#
# 2013-09-02

width1 = 108
height1 = `perl -e 'print int($(width1) * 0.45)'`
width2 = 110
height2 = `perl -e 'print int($(width2) * 0.45)'`

all: misaka.txt longcat.txt

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

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

clean:
	-rm -f misaka.txt longcat.txt

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