Hi
Suppose we have the following build steps:
shared.c -> shared.o -> shared library A
prog.c -> prog.o -> program B, linked with A
If we change shared.c, then program B gets relinked. But we should only need to relink B if symbols exported by A change (or prog.c or its dependencies change, but let's ignore that). This is a common scenario so it would be nice to make this fast. Let's assume that we can extract this dependency to a file with script C. Then we have something like this:
shared.c -> shared.o -> shared library A
A -> A.symbols (generated with C)
prog.c -> prog.o -> program B, linked with A but only if A.symbols has changed
The dependency tree is quite simple to generate with Ninja but the problem comes when processing A.symbols. Suppose the generator script will only update A.symbols if its contents would change.
In this case Ninja has a build rule that is triggered, but the output file is not updated. I could not find any text in Ninja's manual that would specify what happens in this case. Does Ninja notice that the output was not updated and assume from that point on that it was up to date? Does it blindly go on? More importantly, is what happens next undefined or platform-dependent behavior. Is there a better way of achieving the same result?
IIRC tells me that Chrome's build system does something like this so it should be possible.