79364111

Date: 2025-01-17 08:38:58
Score: 1
Natty:
Report link

Its because GNU Make contains its own cache of directory entries. $(wildcard) reads from that cache (and not directly from disk like ls) to get its results.

Recommendations

Don't use $(wildcard) in a rule; only use $(wildcard) in the Makefile at parsing time (i.e. before any rules start running). If you restrict use of $(wildcard) to parsing time you can be assured of consistent results: $(wildcard) will show the state of the filesystem before make was run.

Reasons:
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Gedw99