#Number of entries to cat
NELEMS=7

dot-plan: monolithic test-plan
	cat test-plan > ~/dot-plan

monolithic: Makefile ^* [0-9]* $$*
	echo > $@
	-ls ^* | \
	    while read; do cat $$REPLY >> $@; echo >> $@; done
	-ls -r [0-9]* | \
	    while read; do cat $$REPLY >> $@; echo -en "\n\n" >> $@; done
	-ls \$$* | \
	    while read; do cat $$REPLY >> $@; echo >> $@; done

test-plan: Makefile ^* [0-9]* $$*
	echo > $@
	-ls ^* | \
	    while read; do cat $$REPLY >> $@; echo >> $@; done
	-ls -r [0-9]* | head -$(NELEMS) | \
	    while read; do cat $$REPLY >> $@; echo -en "\n\n" >> $@; done
	-ls \$$* | \
	    while read; do cat $$REPLY >> $@; echo >> $@; done
