none:
	@echo "Enter the target explicitely."

author.txt:
	echo "Generated by" > $@
	whoami >> $@

%.rnd.txt:
	for i in {1..10}; do tr -dc a-zA-Z < /dev/urandom | head -c10; echo; done > $@

%.num.txt: %.txt
	cat -n $< > $@

%.upper.txt: %.txt
	tr a-z A-Z < $< > $@

%.lower.txt: %.txt
	tr A-Z a-z < $< > $@

HEADS_FILES=author.txt alpha.rnd.num.txt beta.rnd.upper.txt gamma.rnd.lower.txt

heads.txt: $(HEADS_FILES)
	head -n2 $^ > $@

clean:
	rm -f author.txt *.rnd.txt *.num.txt *.upper.txt *.lower.txt heads.txt *.sum

%.sum: %
	sha256sum $^ > $@

sums: $(patsubst %, %.sum, $(wildcard *.txt))

.PHONY: clean sums
.PRECIOUS: %.rnd.txt
