all: $(addprefix target,1 2 3 4 5 6 7 8 9 10)
@echo glob: $(wildcard target*)
glob: target10 target3 target8 target7 target6 target5 target1 target2 target9 target4
This is not a weird or contrived use case: this is wildcard not finding targets in a recipe executed after they've been built as explicit prerequisites.
I understand the performance argument in favor of caching, but the existing behavior is incorrect and entirely counter to expectations: no one writing a makefile wants or expects wildcard to behave this way. $(shell echo target*) is a fine workaround for now, but it's frankly inane to have to do that. I spent several hours tracking down the problem here, time that likely exceeds years of builds with some extra readdirs.
Why not refresh the cache when the directory's mtime has changed?