# Makefile - Don Yang (uguu.org)
#
# 2014-07-06


width1 = 106
height1 = `perl -e 'print int($(width1) * 0.40)'`
width2 = 112
height2 = `perl -e 'print int($(width2) * 0.58)'`
width3 = 100
height3 = `perl -e 'print int($(width3) * 0.40)'`

targets = yoshino.txt yoshinon.txt zadkiel.txt

all: $(targets)
	@echo -n "yoshino.txt: "
	@perl freq.pl yoshino.txt
	@echo -n "yoshinon.txt: "
	@perl freq.pl yoshinon.txt
	@echo -n "zadkiel.txt: "
	@perl freq.pl zadkiel.txt

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

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

zadkiel.txt: zadkiel.png Makefile
	perl anytotxt.pl $< $(width3) $(height3) | 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
