TARGETS = micro-eemameinfo.txt mini-eemameinfo.txt eemameinfo.txt all: $(TARGETS) %.txt: %.dat cat $< | \ awk '/^game \(/ { name=""; desc=""; } \ /^[[:space:]]*name/ { name=$$0 } \ /description/ { desc=$$0 } \ /^\)/ { print name, desc; } ' | \ sed 's,^[[:space:]]name \([^[:space:]]*\)[[:space:]]*description "\([^"]*\).*,\1: \2,' \ > $@ clean: rm -f $(TARGETS)