# Makefile - Don Yang (uguu.org)
#
# 11/22/08

aspect1 = $(shell perl aspect.pl udonge.png)
aspect2 = $(shell perl aspect.pl tewi.png)
width1 = 90
width2 = 80
height1 = $(shell perl -e 'print int($(width1) * 0.5 * $(aspect1))')
height2 = $(shell perl -e 'print int($(width2) * 0.5 * $(aspect2))')

all: udonge.txt tewi.txt

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

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

clean:
	-rm -f udonge.txt tewi.txt

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