From 8daa162753b7ea03ecf9cd21ac8cc93c41dc0492 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 1 Aug 2003 15:33:59 -0400 Subject: ENH: Dependency lists are now split into multiple make lines to allow longer lists on limited make programs. --- Source/cmLocalUnixMakefileGenerator.cxx | 50 +++++++++++++++++++++++---------- 1 file 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 allsources; std::map& targets = m_Makefile->GetTargets(); for(std::map::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 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::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::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::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::const_iterator i = commands.begin(); i != commands.end(); ++i) -- cgit v0.12