make: custom up-to-date
ian_dunbar at hotmail.com
Thu Sep 9 10:35:03 CDT 2004
On your custom up-to-date system there seems to be one small bug/feature.
If everything is up to date according to the md5 test, but changed according
to timestamps you can end up with this kind of situation:
md5sum a.c | cmp -s a.c.md5 -; if test $? -ne 0; then md5sum a.c > a.c.md5;
md5sum b.c | cmp -s b.c.md5 -; if test $? -ne 0; then md5sum b.c > b.c.md5;
i.e. On each make invocation, md5sum is always run for every .c file that is
"touched" but not "changed". Also you don't get the reassuring "make: `foo'
is up to date." message.
One possible workaround might be, in the md5 rule, to touch the .c to be the
same (older) date as the .md5 as an else part of your if statement.
Unfortunately touch doesn't have a use-same-timestamp-as-this-other-file
option, so getting the timestamp information might be tricky.
More information about the notes