Fix .d generation in Chrome OS.

Chrome OS toolchain generates "-:" instead of "-.o:" when reading the
source from stdin "-". This patch makes the code handle both cases and
fixes some missing quotes.

Bug: chromium:609385
Bug: 27954979
TEST=FEATURES=test emerge-link chromeos-minijail

(cherry picked from commit 477f2e32a7e4a6ce96baf960ad9f915f52f920a6)

Change-Id: I783db1c0617cafa9b999500b49df36a927fe16b9
Reviewed-on: https://chromium-review.googlesource.com/360255
Commit-Ready: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
2 files changed