- 论坛徽章:
- 0
|
回复 1# zmdesperado
原来makefile的wildcard是从cache中获得的,而OUTDIR下的.o file不是通过target生成的:
> The original poster's problem is almost certainly due to the
> combination of caching and a Makefile which doesn't tell the full
> truth. In particular: make caches the list of files in each directory
> as it happens to read them, and will answer $(wildcard) expansions
> from that cache. As part of that, make assumes that your makefile
> tells the truth and that a file won't be created unless it was the
> target of a rule that was invoked at some point.
>
> My guess is that the *.out files are created as the side-effect of
> some other rule. Make doesn't know that, so it doesn't know to add
> them to the cache, so $(wildcard *.out) gives the wrong result.
However, the way this is being invoked via a submake $(MAKE) leads me to
believe from the observed behaviour that the changes to the cache are
not getting propagated back up the stack. Thus the top-level make
(where the wildcard gets expanded) doesn't have them in it's cache. I
guess I'll have to do a $(shell ...) for things to work as they are. |
|