Almost all other systems have this flaw because they require dependencies before a build. If recording dependencies after the build, the entire problem becomes very simple. See here:
http://news.dieweltistgarnichtso.net/posts/redo-gcc-automati...
http://news.dieweltistgarnichtso.net/posts/redo-gcc-automati...
Also, have you looked at the redo tool redo-ifcreate? http://news.dieweltistgarnichtso.net/bin/redo-sh.html