#!/bin/bash

build=build
src=src
outfilebase=punchcard

mkdir -p "$build"
rm -f "$build/"*.class

echo "making $outfilebase.svgz"
javac -Xlint:all -d "$build" "$src/"*.java &&
	java -cp "$build" Main >"$outfilebase.svg" &&
	gzip -9 -c "$outfilebase.svg" >"$outfilebase.svgz" &&
	rm "$outfilebase.svg" ||
	{ echo "error javac/java" >&2; exit 1; }

echo "making $outfilebase.png"
isconv "$outfilebase.svgz" || exit 1


