This deduplicates dependencies on custom build rules by writing
them once and using phony targets to collect them.
Uses order_only instead of implicit dependencies to avoid
rebuilding source files when a custom build rule is dirty.
Cleans up typing issues in ninja_syntax.py.
ninja_syntax.py should be writing native
platform paths instead of converting
things to unix paths.
Separately, fixed type errors introduced
by the previous commit.