There is such a build system, but I can't remember the name right now.
It tracks system calls to see every file opened by the compiler to produce exact dependency graphs (assuming compiler is deterministic).
The downside is that it's Linux only.
If anyone remembers the name, please do share.