diff options
author | Brad King <brad.king@kitware.com> | 2001-04-25 09:39:23 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2001-04-25 09:39:23 -0400 |
commit | c3ab7066981037dcb96993c901ed970c39e5ad8b (patch) | |
tree | a0f1e218781fc0db21ecafb527c7d32ec7b80bc7 /Source/cmUnixMakefileGenerator.cxx | |
parent | ddbf1feab40fd3e8cd0242fdc1bfb8017b7f0dc1 (diff) | |
download | cmake-c3ab7066981037dcb96993c901ed970c39e5ad8b.tar.gz |
BUG: Fixed output of dependencies. It needs to loop over the makefile's targets, not the source lists.
Diffstat (limited to 'Source/cmUnixMakefileGenerator.cxx')
-rw-r--r-- | Source/cmUnixMakefileGenerator.cxx | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index a1e7dfef74..589e4b14d7 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -214,7 +214,6 @@ void cmUnixMakefileGenerator::OutputDependencies(std::ostream& fout) { fout << "CMAKE_DEPEND_LIBS = "; std::vector<std::string>& libs = m_Makefile->GetLinkLibraries(); - std::vector<std::string>& libdirs = m_Makefile->GetLinkDirectories(); std::vector<std::string>::iterator dir, lib; // Search the list of libraries that will be linked into // the executable @@ -384,30 +383,27 @@ void cmUnixMakefileGenerator::OutputSubDirectoryRules(std::ostream& fout) // by the class cmMakeDepend GenerateMakefile void cmUnixMakefileGenerator::OutputObjectDepends(std::ostream& fout) { - cmMakefile::SourceMap &Sources = m_Makefile->GetSources(); - for(cmMakefile::SourceMap::iterator l = Sources.begin(); - l != Sources.end(); l++) + // Iterate over every target. + std::map<std::string, cmTarget>& targets = m_Makefile->GetTargets(); + for(std::map<std::string, cmTarget>::const_iterator target = targets.begin(); + target != targets.end(); ++target) { - for(std::vector<cmSourceFile>::iterator i = l->second.begin(); - i != l->second.end(); i++) + // Iterate over every source for this target. + const std::vector<cmSourceFile>& sources = target->second.GetSourceFiles(); + for(std::vector<cmSourceFile>::const_iterator source = sources.begin(); + source != sources.end(); ++source) { - if(!i->IsAHeaderFileOnly()) + if(!source->IsAHeaderFileOnly()) { - if(i->GetDepends().size()) + if(!source->GetDepends().empty()) { - fout << i->GetSourceName() << ".o : \\\n"; - for(std::vector<std::string>::iterator j = - i->GetDepends().begin(); - j != i->GetDepends().end(); ++j) + fout << source->GetSourceName() << ".o :"; + // Iterate through all the dependencies for this source. + for(std::vector<std::string>::const_iterator dep = + source->GetDepends().begin(); + dep != source->GetDepends().end(); ++dep) { - if(j+1 == i->GetDepends().end()) - { - fout << *j << " \n"; - } - else - { - fout << *j << " \\\n"; - } + fout << " \\\n" << dep->c_str(); } fout << "\n\n"; } |