Commit 1612dc39 authored by jan.koester's avatar jan.koester
Browse files

test

parent 98576774
Loading
Loading
Loading
Loading
+8 −0
Changes for parser.cpp: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -815,6 +815,14 @@ void Parser::handle_include(const std::string& args, Makefile& mf, bool optional
        if (file.is_open()) {
            std::string content((std::istreambuf_iterator<char>(file)),
                                 std::istreambuf_iterator<char>());
            // Record the included file in MAKEFILE_LIST before parsing it, so
            // $(lastword $(MAKEFILE_LIST)) resolves to this file during its
            // own parse (Kbuild relies on this for $(src)/$(obj)).
            {
                auto& ml = mf.variables["MAKEFILE_LIST"];
                ml.value += (ml.value.empty() ? "" : " ") + path;
                ml.flavor = VarFlavor::Simple;
            }
            // An included makefile is parsed in its own conditional context and
            // must have balanced conditionals; it may not close a conditional
            // opened by the parent. parse_string() resets cond_stack_/define