From 5f8b3418384f414c969fe58ba5de8e59c3887dcd Mon Sep 17 00:00:00 2001
From: Daniel Teske <daniel.teske@nokia.com>
Date: Wed, 16 Nov 2011 16:08:15 +0100
Subject: [PATCH] Actually pass MAKEFLAGS to nmake/jom

Change-Id: Ia42fccff507fce1e999d4534656984b6ebf5180b
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
---
 src/plugins/qt4projectmanager/makestep.cpp | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/plugins/qt4projectmanager/makestep.cpp b/src/plugins/qt4projectmanager/makestep.cpp
index b2ddf71fed7..d7d770d2780 100644
--- a/src/plugins/qt4projectmanager/makestep.cpp
+++ b/src/plugins/qt4projectmanager/makestep.cpp
@@ -142,9 +142,6 @@ bool MakeStep::init()
     ProjectExplorer::ProcessParameters *pp = processParameters();
     pp->setMacroExpander(bc->macroExpander());
 
-    Utils::Environment environment = bc->environment();
-    pp->setEnvironment(environment);
-
     QString workingDirectory;
     if (bc->subNodeBuild())
         workingDirectory = bc->subNodeBuild()->buildDir();
@@ -191,15 +188,25 @@ bool MakeStep::init()
         if (!bc->defaultMakeTarget().isEmpty())
             Utils::QtcProcess::addArg(&args, bc->defaultMakeTarget());
     }
+
+    Utils::Environment env = bc->environment();
     // -w option enables "Enter"/"Leaving directory" messages, which we need for detecting the
     // absolute file path
     // FIXME doing this without the user having a way to override this is rather bad
     // so we only do it for unix and if the user didn't override the make command
     // but for now this is the least invasive change
-    if (toolchain
-            && toolchain->targetAbi().binaryFormat() != ProjectExplorer::Abi::PEFormat
-            && m_makeCmd.isEmpty())
-        Utils::QtcProcess::addArg(&args, QLatin1String("-w"));
+    // We also prepend "L" to the MAKEFLAGS, so that nmake / jom are less verbose
+    ProjectExplorer::ToolChain *toolChain = bc->toolChain();
+    if (toolChain && m_makeCmd.isEmpty()) {
+        if (toolChain->targetAbi().binaryFormat() != ProjectExplorer::Abi::PEFormat )
+            Utils::QtcProcess::addArg(&args, QLatin1String("-w"));
+        if (toolChain->targetAbi().os() == ProjectExplorer::Abi::WindowsOS
+                && toolChain->targetAbi().osFlavor() != ProjectExplorer::Abi::WindowsMSysFlavor) {
+            env.set("MAKEFLAGS", env.value("MAKEFLAGS").prepend("L"));
+        }
+    }
+
+    pp->setEnvironment(env);
 
     setEnabled(true);
     pp->setArguments(args);
-- 
GitLab