From: Evan Martin Date: Fri, 4 Feb 2011 00:44:30 +0000 (-0800) Subject: include path when printing a makefile parse error X-Git-Tag: release-120715~492 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad1ac0b8fd8c9d5e7f007791038923c0fca37b4b;p=platform%2Fupstream%2Fninja.git include path when printing a makefile parse error --- diff --git a/src/build_test.cc b/src/build_test.cc index 71c950b..0c35f8c 100644 --- a/src/build_test.cc +++ b/src/build_test.cc @@ -462,7 +462,7 @@ TEST_F(BuildTest, DepFileParseError) { fs_.Create("foo.c", now_, ""); fs_.Create("foo.o.d", now_, "foo.o blah.h bar.h\n"); EXPECT_FALSE(builder_.AddTarget("foo.o", &err)); - EXPECT_EQ("line 1, col 7: expected ':', got 'blah.h'", err); + EXPECT_EQ("foo.o.d: line 1, col 7: expected ':', got 'blah.h'", err); } TEST_F(BuildTest, OrderOnlyDeps) { diff --git a/src/graph.cc b/src/graph.cc index 45fcea8..f73028e 100644 --- a/src/graph.cc +++ b/src/graph.cc @@ -121,8 +121,11 @@ bool Edge::LoadDepFile(State* state, DiskInterface* disk_interface, string* err) return true; MakefileParser makefile; - if (!makefile.Parse(content, err)) + string makefile_err; + if (!makefile.Parse(content, &makefile_err)) { + *err = path + ": " + makefile_err; return false; + } // Check that this depfile matches our output. if (outputs_.size() != 1) {