summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2003-10-28 16:06:06 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2003-10-28 16:06:06 (GMT)
commit3e2c1f347701155f2713ab144f3c7b3cf00d8aca (patch)
tree8d8b7b5a6cb31a3f0b3255c37769e274ea0e9a4f
parent032883cc348fad280ada33bcaa4598e0fcea7dd3 (diff)
downloadCMake-3e2c1f347701155f2713ab144f3c7b3cf00d8aca.zip
CMake-3e2c1f347701155f2713ab144f3c7b3cf00d8aca.tar.gz
CMake-3e2c1f347701155f2713ab144f3c7b3cf00d8aca.tar.bz2
BUG: fix for bug 303 pass makeflags to sub makes
-rw-r--r--Source/cmGlobalBorlandMakefileGenerator.cxx2
-rw-r--r--Source/cmGlobalNMakeMakefileGenerator.cxx1
-rw-r--r--Source/cmLocalUnixMakefileGenerator.cxx13
-rw-r--r--Source/cmLocalUnixMakefileGenerator.h7
4 files changed, 20 insertions, 3 deletions
diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx
index cc384da..6857219 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.cxx
+++ b/Source/cmGlobalBorlandMakefileGenerator.cxx
@@ -55,7 +55,7 @@ cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator()
lg->SetIncludeDirective("!include");
lg->SetWindowsShell(true);
lg->SetMakefileVariableSize(32);
-
+ lg->SetPassMakeflags(true);
lg->SetGlobalGenerator(this);
return lg;
}
diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx
index 8615dd5..ccba3a4 100644
--- a/Source/cmGlobalNMakeMakefileGenerator.cxx
+++ b/Source/cmGlobalNMakeMakefileGenerator.cxx
@@ -42,6 +42,7 @@ cmLocalGenerator *cmGlobalNMakeMakefileGenerator::CreateLocalGenerator()
lg->SetMakeSilentFlag("/nologo");
lg->SetGlobalGenerator(this);
lg->SetIgnoreLibPrefix(true);
+ lg->SetPassMakeflags(true);
return lg;
}
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx
index b596b80..f444c41 100644
--- a/Source/cmLocalUnixMakefileGenerator.cxx
+++ b/Source/cmLocalUnixMakefileGenerator.cxx
@@ -31,6 +31,7 @@ cmLocalUnixMakefileGenerator::cmLocalUnixMakefileGenerator()
m_IncludeDirective = "include";
m_MakefileVariableSize = 0;
m_IgnoreLibPrefix = false;
+ m_PassMakeflags = false;
}
cmLocalUnixMakefileGenerator::~cmLocalUnixMakefileGenerator()
@@ -232,6 +233,14 @@ void cmLocalUnixMakefileGenerator::OutputMakefile(const char* file,
std::string checkCache = m_Makefile->GetHomeOutputDirectory();
checkCache += "/cmake.check_cache";
checkCache = cmSystemTools::ConvertToOutputPath(checkCache.c_str());
+ // most unix makes will pass the command line flags to make down
+ // to sub invoked makes via an environment variable. However, some
+ // makes do not support that, so you have to pass the flags explicitly
+ const char* allRule = "$(MAKE) $(MAKESILENT) all";
+ if(m_PassMakeflags)
+ {
+ allRule = "$(MAKE) $(MAKESILENT) -$(MAKEFLAGS) all";
+ }
// Set up the default target as the VERY first target, so that make with no arguments will run it
this->
OutputMakeRule(fout,
@@ -241,8 +250,8 @@ void cmLocalUnixMakefileGenerator::OutputMakefile(const char* file,
"$(MAKE) $(MAKESILENT) cmake.depends",
"$(MAKE) $(MAKESILENT) cmake.check_depends",
"$(MAKE) $(MAKESILENT) -f cmake.check_depends",
- "$(MAKE) $(MAKESILENT) all");
-
+ allRule);
+
// Generation of SILENT target must be after default_target.
if(!m_Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"))
{
diff --git a/Source/cmLocalUnixMakefileGenerator.h b/Source/cmLocalUnixMakefileGenerator.h
index 6e16a2c..2bbb9d3 100644
--- a/Source/cmLocalUnixMakefileGenerator.h
+++ b/Source/cmLocalUnixMakefileGenerator.h
@@ -80,6 +80,12 @@ public:
///! If ignore lib prefix is true, then do not strip lib from the name of a library.
void SetIgnoreLibPrefix(bool s) { m_IgnoreLibPrefix = s; }
+ /**
+ * If true, then explicitly pass MAKEFLAGS on the make all target for makes
+ * that do not use environment variables.
+ *
+ */
+ void SetPassMakeflags(bool s){m_PassMakeflags = s;}
protected:
void AddDependenciesToSourceFile(cmDependInformation const*info,
@@ -227,6 +233,7 @@ protected:
std::string m_ExecutableOutputPath;
std::string m_LibraryOutputPath;
bool m_WindowsShell;
+ bool m_PassMakeflags;
private:
};