Ninja Custom Command file depends don't need to exist before building

When converting custom commands for the ninja build system we
need to make sure that any file dependencies that exist in the build
tree are converted to phony targets. This tells ninja that these
files might not exist when starting the build, but could be generated
during the build.

This is done by tracking all dependencies for custom command targets.
After all have been written out we remove all items from the set
that have been seen as a; target, custom command output, an alias,
or a file in the source directory. Anything that is left is considered
to be a file that will be generated as a side effect of another
custom command.