diff options
author | Ken Martin <ken.martin@kitware.com> | 2001-05-04 21:00:22 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2001-05-04 21:00:22 (GMT) |
commit | e126954393c945b71c4bd243090076dc24c0ec7d (patch) | |
tree | 57ad815fa8de67f1c5fc8377b38b099b63f80f33 | |
parent | 1349d06e7851e7d73b8cfbea00d89bfb074a2acb (diff) | |
download | CMake-e126954393c945b71c4bd243090076dc24c0ec7d.zip CMake-e126954393c945b71c4bd243090076dc24c0ec7d.tar.gz CMake-e126954393c945b71c4bd243090076dc24c0ec7d.tar.bz2 |
fixes for untiltiy targets in all
-rw-r--r-- | Source/cmMakefile.cxx | 2 | ||||
-rw-r--r-- | Source/cmUnixMakefileGenerator.cxx | 33 |
2 files changed, 29 insertions, 6 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 9680064..d8dfe2f 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -467,6 +467,7 @@ void cmMakefile::AddLibrary(const char* lname, const std::vector<std::string> &s { cmTarget target; target.SetType(cmTarget::LIBRARY); + target.SetInAll(true); target.GetSourceLists() = srcs; m_Targets.insert(cmTargets::value_type(lname,target)); } @@ -476,6 +477,7 @@ void cmMakefile::AddExecutable(const char *exeName, { cmTarget target; target.SetType(cmTarget::EXECUTABLE); + target.SetInAll(true); target.GetSourceLists() = srcs; m_Targets.insert(cmTargets::value_type(exeName,target)); } diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index 4e1506a..be72113 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -95,11 +95,12 @@ void cmUnixMakefileGenerator::OutputTargetRules(std::ostream& fout) // for each target add to the list of targets fout << "TARGETS = "; const cmTargets &tgts = m_Makefile->GetTargets(); - // libraries + // list libraries first for(cmTargets::const_iterator l = tgts.begin(); l != tgts.end(); l++) { - if (l->second.GetType() == cmTarget::LIBRARY) + if (l->second.GetType() == cmTarget::LIBRARY && + l->second.IsInAll()) { fout << " \\\nlib" << l->first.c_str() << "${CMAKE_LIB_EXT}"; } @@ -108,9 +109,20 @@ void cmUnixMakefileGenerator::OutputTargetRules(std::ostream& fout) for(cmTargets::const_iterator l = tgts.begin(); l != tgts.end(); l++) { - if (!l->second.GetType() == cmTarget::LIBRARY) + if (l->second.GetType() == cmTarget::EXECUTABLE && + l->second.IsInAll()) + { + fout << " \\\n" << l->first.c_str(); + } + } + // list utilities last + for(cmTargets::const_iterator l = tgts.begin(); + l != tgts.end(); l++) + { + if (l->second.GetType() == cmTarget::UTILITY && + l->second.IsInAll()) { - fout << "\\\n" << l->first.c_str(); + fout << " \\\n" << l->first.c_str(); } } fout << "\n\n"; @@ -488,10 +500,19 @@ void cmUnixMakefileGenerator::OutputCustomRules(std::ostream& fout) std::string command = c->first; const cmSourceGroup::CommandFiles& commandFiles = c->second; // if the command has no outputs, then it is a utility command - // with no outputs or depends + // with no outputs if(commandFiles.m_Outputs.size() == 0) { - fout << source.c_str() << ":\n\t" << command.c_str() << "\n\n"; + fout << source.c_str() << ": "; + // Write out all the dependencies for this rule. + for(std::set<std::string>::const_iterator d = + commandFiles.m_Depends.begin(); + d != commandFiles.m_Depends.end(); ++d) + { + std::string dep = cmSystemTools::EscapeSpaces(d->c_str()); + fout << " " << dep.c_str(); + } + fout << "\n\t" << command.c_str() << "\n\n"; } // Write a rule for every output generated by this command. for(std::set<std::string>::const_iterator output = |