NFS dir timestamp question
Date: 9 May 2005 13:45:07 -0700
In my code compilation environment, I have setup my Makefile
dependencies to use a directory timestamp, like this:
$(CC) my_obj_dir/*.o $(LDFLAGS) -o abc
my_obj_dir contains a bunch of .o files. This method assumes that
whenever any file in my_obj_dir changes, the timestamp of my_obj_dir
changes too. So when any .o file gets updated, program "abc" will be
regenerated using those files. This provides an easy way to keep abc
up-to-date, even when the number of .o files in my_obj_dir changes.
This method works fine on locally mounted partitions, but it fails when
my_obj_dir is mounted over NFS. I found that when a new file gets
created in my_obj_dir, my_obj_dir's timestamp is updated, which is
expected. However, when an existing file gets changed/overwritten,
my_obj_dir's timestamp is NOT changed. Hence, abc is not regenerated.
This doesn't seem to be an NFS caching problem, because the timestamp
of my_obj_dir on the NFS server really did not change.
Is this an expected behavior with NFS? If so, what would be a better
solution to achieve the same dependency checking behavior as I