diff options
-rw-r--r-- | eval.cc | 2 | ||||
-rw-r--r-- | main.cc | 4 | ||||
-rw-r--r-- | value.cc | 2 | ||||
-rw-r--r-- | value.h | 2 |
4 files changed, 8 insertions, 2 deletions
@@ -159,6 +159,8 @@ void Evaluator::DoInclude(const char* fname, bool should_exist) { return; } + Var* var_list = LookupVar("MAKEFILE_LIST"); + var_list->AppendVar(this, NewLiteral(Intern(fname))); for (AST* ast : mk->asts()) { LOG("%s", ast->DebugString().c_str()); ast->Eval(this); @@ -134,6 +134,10 @@ static int Run(const vector<StringPiece>& targets, } ev->set_is_bootstrap(false); + vars->Assign("MAKEFILE_LIST", + new SimpleVar(make_shared<string>( + StringPrintf(" %s", g_makefile)), "file")); + Makefile* mk = cache_mgr->ReadMakefile(g_makefile); for (AST* ast : mk->asts()) { LOG("%s", ast->DebugString().c_str()); @@ -487,6 +487,6 @@ Value* NewExpr3(Value* v1, Value* v2, Value* v3) { return e; } -Value* NewLiteral(const char* s) { +Value* NewLiteral(StringPiece s) { return new Literal(s); } @@ -48,6 +48,6 @@ string JoinValues(const vector<Value*>& vals, const char* sep); Value* NewExpr3(Value* v1, Value* v2, Value* v3); -Value* NewLiteral(const char* s); +Value* NewLiteral(StringPiece s); #endif // VALUE_H_ |