diff options
-rw-r--r-- | dep.cc | 4 | ||||
-rw-r--r-- | eval.cc | 2 | ||||
-rw-r--r-- | parser.cc | 2 |
3 files changed, 6 insertions, 2 deletions
@@ -140,9 +140,9 @@ class DepBuilder { } if (!old_rule.cmds.empty() && !rule.cmds.empty() && !is_suffix_rule && !rule.is_double_colon) { - WARN("%s:%d: overriding commands for target `%s'", + WARN("%s:%d: warning: overriding commands for target `%s'", LOCF(rule.cmd_loc()), output.as_string().c_str()); - WARN("%s:%d: ignoring old commands for target `%s'", + WARN("%s:%d: warning: ignoring old commands for target `%s'", LOCF(old_rule.cmd_loc()), output.as_string().c_str()); } @@ -164,6 +164,8 @@ void Evaluator::EvalCommand(const CommandAST* ast) { } last_rule_->cmds.push_back(ast->expr); + if (last_rule_->cmd_lineno == 0) + last_rule_->cmd_lineno = ast->loc().lineno; LOG("Command: %s", ast->expr->DebugString().c_str()); } @@ -226,6 +226,7 @@ class Parser { ast->expr = ParseExpr(line); ast->should_exist = directive[0] == 'i'; out_asts_->push_back(ast); + state_ = ParserState::NOT_AFTER_RULE; } void ParseDefine(StringPiece line, StringPiece) { @@ -235,6 +236,7 @@ class Parser { define_name_ = line; define_start_ = 0; define_start_line_ = loc_.lineno; + state_ = ParserState::NOT_AFTER_RULE; } void ParseInsideDefine(StringPiece line) { |