width1 = 73
height1 = `perl -e 'print int($(width1) * 0.49)'`
width2 = 92
height2 = `perl -e 'print int($(width2) * 0.45)'`

targets = maple.txt syrup.txt

all: $(targets)
	@perl freq.pl maple.txt
	@perl freq.pl syrup.txt

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

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

clean:
	-rm -f $(targets)

backup:
	-rm -f backup.tar.gz
	tar czf backup.tar.gz *.pl *.svg Makefile
