summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2003-08-01 19:33:59 (GMT)
committerBrad King <brad.king@kitware.com>2003-08-01 19:33:59 (GMT)
commit8daa162753b7ea03ecf9cd21ac8cc93c41dc0492 (patch)
tree60be8ae0b0410f7c985d396f543cc540d2a50904
parentf5559b0ec850b4af9ac01e5b282593428e9270ac (diff)
downloadCMake-8daa162753b7ea03ecf9cd21ac8cc93c41dc0492.zip
CMake-8daa162753b7ea03ecf9cd21ac8cc93c41dc0492.tar.gz
CMake-8daa162753b7ea03ecf9cd21ac8cc93c41dc0492.tar.bz2
ENH: Dependency lists are now split into multiple make lines to allow longer lists on limited make programs.
-rw-r--r--Source/cmLocalUnixMakefileGenerator.cxx50
1 files changed, 35 insertions, 15 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx
index 227bdc0..955c1a9 100644
--- a/Source/cmLocalUnixMakefileGenerator.cxx
+++ b/Source/cmLocalUnixMakefileGenerator.cxx
@@ -2264,7 +2264,7 @@ void cmLocalUnixMakefileGenerator::OutputMakeRules(std::ostream& fout)
" $(TARGETS) $(GENERATED_QT_FILES) $(GENERATED_FLTK_FILES)");
// collect up all the sources
- std::string allsources;
+ std::vector<std::string> allsources;
std::map<cmStdString, cmTarget>& targets = m_Makefile->GetTargets();
for(std::map<cmStdString,cmTarget>::const_iterator target = targets.begin();
target != targets.end(); ++target)
@@ -2276,8 +2276,7 @@ void cmLocalUnixMakefileGenerator::OutputMakeRules(std::ostream& fout)
{
if(!(*source)->GetPropertyAsBool("HEADER_FILE_ONLY"))
{
- allsources += " \\\n";
- allsources += cmSystemTools::ConvertToOutputPath((*source)->GetFullPath().c_str());
+ allsources.push_back(cmSystemTools::ConvertToOutputPath((*source)->GetFullPath().c_str()));
}
}
}
@@ -2290,14 +2289,15 @@ void cmLocalUnixMakefileGenerator::OutputMakeRules(std::ostream& fout)
"-S$(CMAKE_CURRENT_SOURCE) -O$(CMAKE_CURRENT_BINARY) "
"-H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)"
);
+ std::vector<std::string> commands;
+ commands.push_back("$(CMAKE_COMMAND) "
+ "-S$(CMAKE_CURRENT_SOURCE) -O$(CMAKE_CURRENT_BINARY) "
+ "-H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)");
this->OutputMakeRule(fout,
"dependencies",
"cmake.check_depends",
- allsources.c_str(),
- "$(CMAKE_COMMAND) "
- "-S$(CMAKE_CURRENT_SOURCE) -O$(CMAKE_CURRENT_BINARY) "
- "-H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)"
- );
+ allsources,
+ commands);
this->OutputMakeRule(fout,
"dependencies",
@@ -2719,16 +2719,36 @@ void cmLocalUnixMakefileGenerator::OutputMakeRule(std::ostream& fout,
replace = target;
m_Makefile->ExpandVariablesInString(replace);
- fout << cmSystemTools::ConvertToOutputPath(replace.c_str()) << ":";
+
+ if(depends.size() > 1)
+ {
+ // Create a proxy target collecting all the dependencies. This
+ // allows for very long dependency lists.
+ std::string tgt = cmSystemTools::ConvertToOutputPath(replace.c_str());
+ for(std::vector<std::string>::const_iterator dep = depends.begin();
+ dep != depends.end(); ++dep)
+ {
+ replace = *dep;
+ m_Makefile->ExpandVariablesInString(replace);
+ fout << tgt.c_str() << ".dependency_list:: " << replace.c_str() << "\n";
+ }
- for(std::vector<std::string>::const_iterator dep = depends.begin();
- dep != depends.end(); ++dep)
+ // Forward dependencies through the proxy target.
+ fout << tgt.c_str() << ": " << tgt.c_str() << ".dependency_list\n";
+ }
+ else
{
- replace = *dep;
- m_Makefile->ExpandVariablesInString(replace);
- fout << " " << replace.c_str();
+ fout << cmSystemTools::ConvertToOutputPath(replace.c_str()) << ":";
+
+ for(std::vector<std::string>::const_iterator dep = depends.begin();
+ dep != depends.end(); ++dep)
+ {
+ replace = *dep;
+ m_Makefile->ExpandVariablesInString(replace);
+ fout << " " << replace.c_str();
+ }
+ fout << "\n";
}
- fout << "\n";
int count = 0;
for (std::vector<std::string>::const_iterator i = commands.begin();
i != commands.end(); ++i)