Fri 07 Jul 2006 02:34:31 AM UTC, comment #1:
I'm seeing the same problem, I believe, on RHEL 4 with Make 3.80. In my case, I'm testing for a (target-like) directory with $(wildcard $(DIR)), then creating the directory. In my real Makefile, a later sanity test with $(if $(wildcard $(DIR)) then aborts, even though the directory does indeed exist.
I see the need for cacheing to minimize the time spent calling stat(2), as mentioned in bug #443, but I think there should be some mechanism to invalidate the cache.
The easiest would be to invalidate the cache when a shell command is invoked. Possibly make this an attribute for some target trees via a phony target like .PRECIOUS:
.INVALIDATE_CACHE_WHEN_SHELLING: targ1 targ2
.INVALIDATE_CACHE_WHEN_SHELLING: # no dependencies = "always"
Of course a less stupid name would be preferable.
Or an explicit function: $(invalidate_cache), possibly accepting a list of filenames: $(invalidate_cache file1 file2) if it's not too much work.
Anyway, I'm uploading an example Makefile that demonstrates the problem, and the output from "make -d -p".
|