On Thu, 2016-10-06 at 10:26 -0700, Kyle Rose wrote:
> all: $(addprefix target,1 2 3 4 5 6 7 8 9 10)
>     @echo glob: $(wildcard target*)
> 
> target%:
>     touch $@
> 
> To wit:
> 
> $ make
> touch target1
> touch target2
> touch target3
> touch target4
> touch target5
> touch target6
> touch target7
> touch target8
> touch target9
> touch target10
> glob:

You should include the version of GNU make that you're using; my
version works as expected:

$ make --version
GNU Make 4.2.1

$ make
touch target1
touch target2
touch target3
touch target4
touch target5
touch target6
touch target7
touch target8
touch target9
touch target10
glob: target3 target10 target9 target8 target7 target6 target5 target1 target2 
target4

What you're seeing is definitely a bug.

> Why not refresh the cache when the directory's mtime has changed?

Because not all systems have the same rules for directory mtime as
POSIX does, so that's not a reliable/portable indicator.

There's no question the caching needs to be improved.

_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to