Follow GCC/Clang behavior wrt depfiles

The option is called "depfile = gcc" and should support depfiles created
by GCC. GCC does not escape backslashes and GNU Make does not try to
unescape it, so neither should Ninja try to "unescape" it.

Only space (' ') and hash sign ('#') are specially treated by GCC/Clang.
Note that while tabs are also treated specially by GCC, Clang does not,
so do not special case it (why would someone use tabs in a filename?).
Support for 2N trailing backslashes in a filename is a bit questionable,
but is added to be as consistent as possible with GCC/Clang.

See also
https://github.com/llvm-mirror/clang/blob/44c160f916a1b080098b17b466b026aa07475ec2/lib/Frontend/DependencyFile.cpp#L316
https://github.com/gcc-mirror/gcc/blob/22a8377023d59cc01ab0a84a1df56d0e1336efa3/libcpp/mkdeps.c#L47

Fixes https://github.com/ninja-build/ninja/issues/1262
3 files changed