Commit 3dc6b513 authored by jan.koester's avatar jan.koester
Browse files

test

parent 55e59af0
Loading
Loading
Loading
Loading
+2 −0
Changes for executor.cpp: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -460,7 +460,9 @@ std::vector<std::string> Executor::collect_exports(const Makefile& mf) {
    } else {
        for (const auto& name : mf.exported) {
            auto it = mf.variables.find(name);
            // "export VAR" of a still undefined variable exports it empty (GNU)
            if (it != mf.variables.end()) export_one(name, it->second);
            else out.push_back(name + "=");
        }
    }
    return out;
+6 −0
Changes for main.cpp: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -488,6 +488,12 @@ int main(int argc, char* argv[]) {
            if (!eq || eq == *e) continue;
            std::string name(*e, eq - *e);
            m.variables[name] = {std::string(eq + 1), makeplus::VarFlavor::Recursive, false};
            // GNU make passes a variable that came from the environment on
            // to its children with its current value -- also after the
            // makefile reassigned it (Kbuild: the top make exports srcroot
            // still empty, the sub-make sets it to "." without exporting
            // again, and Makefile.build a level further down needs ".").
            m.exported.insert(name);
        }
        // Command-line variables have the highest priority.
        for (const auto& [name, value] : cmdline_vars)