I've checked out make from CVS today (10/4/08) and verified that this problem still exists.
This Makefile shows the problem: FOO := $(shell mkdir -p mtmp/a) FOO := $(wildcard mtmp/a) .PHONY: clean clean: rm -rf mtmp On Linux one can easily see the directory opened but never closed with strace: strace -e trace=open,close make Part of the output is here: open("mtmp", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 4 close(3) = 0 open(".", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3 close(3) = 0 rm -rf mtmp One can see that make opens up the "mtmp" directory to perform the wildcard. However, after that the "mtmp" directory remains open while the clean rule is executed. On Linux systems this doesn't manifest itself as a problem, but on other systems where a directory can not be removed as long as a file handle is open to it, this causes the "rm -rf mtmp" to fail. This is a bug. The directory should be closed when the wildcard is finished and before the rule is fired. I tried to look in the sources, but since directories are hashed and kept around for a while, I'm not sure where to start. -JJ -- << Jason J. Noakes >> _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make