BUG: fix for bug 303 pass makeflags to sub makes

This commit is contained in:
Bill Hoffman 2003-10-28 11:06:06 -05:00
parent 032883cc34
commit 3e2c1f3477
4 changed files with 20 additions and 3 deletions

View File

@ -55,7 +55,7 @@ cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator()
lg->SetIncludeDirective("!include"); lg->SetIncludeDirective("!include");
lg->SetWindowsShell(true); lg->SetWindowsShell(true);
lg->SetMakefileVariableSize(32); lg->SetMakefileVariableSize(32);
lg->SetPassMakeflags(true);
lg->SetGlobalGenerator(this); lg->SetGlobalGenerator(this);
return lg; return lg;
} }

View File

@ -42,6 +42,7 @@ cmLocalGenerator *cmGlobalNMakeMakefileGenerator::CreateLocalGenerator()
lg->SetMakeSilentFlag("/nologo"); lg->SetMakeSilentFlag("/nologo");
lg->SetGlobalGenerator(this); lg->SetGlobalGenerator(this);
lg->SetIgnoreLibPrefix(true); lg->SetIgnoreLibPrefix(true);
lg->SetPassMakeflags(true);
return lg; return lg;
} }

View File

@ -31,6 +31,7 @@ cmLocalUnixMakefileGenerator::cmLocalUnixMakefileGenerator()
m_IncludeDirective = "include"; m_IncludeDirective = "include";
m_MakefileVariableSize = 0; m_MakefileVariableSize = 0;
m_IgnoreLibPrefix = false; m_IgnoreLibPrefix = false;
m_PassMakeflags = false;
} }
cmLocalUnixMakefileGenerator::~cmLocalUnixMakefileGenerator() cmLocalUnixMakefileGenerator::~cmLocalUnixMakefileGenerator()
@ -232,6 +233,14 @@ void cmLocalUnixMakefileGenerator::OutputMakefile(const char* file,
std::string checkCache = m_Makefile->GetHomeOutputDirectory(); std::string checkCache = m_Makefile->GetHomeOutputDirectory();
checkCache += "/cmake.check_cache"; checkCache += "/cmake.check_cache";
checkCache = cmSystemTools::ConvertToOutputPath(checkCache.c_str()); 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 // Set up the default target as the VERY first target, so that make with no arguments will run it
this-> this->
OutputMakeRule(fout, OutputMakeRule(fout,
@ -241,8 +250,8 @@ void cmLocalUnixMakefileGenerator::OutputMakefile(const char* file,
"$(MAKE) $(MAKESILENT) cmake.depends", "$(MAKE) $(MAKESILENT) cmake.depends",
"$(MAKE) $(MAKESILENT) cmake.check_depends", "$(MAKE) $(MAKESILENT) cmake.check_depends",
"$(MAKE) $(MAKESILENT) -f cmake.check_depends", "$(MAKE) $(MAKESILENT) -f cmake.check_depends",
"$(MAKE) $(MAKESILENT) all"); allRule);
// Generation of SILENT target must be after default_target. // Generation of SILENT target must be after default_target.
if(!m_Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE")) if(!m_Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"))
{ {

View File

@ -80,6 +80,12 @@ public:
///! If ignore lib prefix is true, then do not strip lib from the name of a library. ///! If ignore lib prefix is true, then do not strip lib from the name of a library.
void SetIgnoreLibPrefix(bool s) { m_IgnoreLibPrefix = s; } 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: protected:
void AddDependenciesToSourceFile(cmDependInformation const*info, void AddDependenciesToSourceFile(cmDependInformation const*info,
@ -227,6 +233,7 @@ protected:
std::string m_ExecutableOutputPath; std::string m_ExecutableOutputPath;
std::string m_LibraryOutputPath; std::string m_LibraryOutputPath;
bool m_WindowsShell; bool m_WindowsShell;
bool m_PassMakeflags;
private: private:
}; };