I have a directory full of YYYY-MM directories with statistics. I want to use a Makefile to only build summaries YYYY-MM.txt of the statistics if the contents of directory is newer than the summary.
So far my Makefile looks like:
2011-12.txt: 2011-12/ @for i in $^/*; do tail -1 $$i; done | sort | uniq -c > $@
1) I am not sure how to build a list of targets from 20*/
2) Also I would like to optimize the dependency to be a basename of the target, i.e. $(basename 2011-12.txt .txt)/