diff options
author | Ken Martin <ken.martin@kitware.com> | 2005-06-30 13:53:03 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2005-06-30 13:53:03 (GMT) |
commit | 154a0cd16274832d8d4a64137478ebf65b95c684 (patch) | |
tree | ec4b054251577fd6dec762fe879d373ef6b14031 /Source/cmLocalUnixMakefileGenerator3.cxx | |
parent | 33abddf90c9ae09fce93f74eddc8bf9fea16b2c6 (diff) | |
download | CMake-154a0cd16274832d8d4a64137478ebf65b95c684.zip CMake-154a0cd16274832d8d4a64137478ebf65b95c684.tar.gz CMake-154a0cd16274832d8d4a64137478ebf65b95c684.tar.bz2 |
ENH: added local help and install targets
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index aa79fed..04e64c9 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -2780,6 +2780,8 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile() this->WriteMakeVariables(ruleFileStream); + this->WriteSpecialTargetsTop(ruleFileStream); + std::vector<std::string> depends; std::vector<std::string> commands; @@ -2824,6 +2826,8 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile() "target for object file", lo->first.c_str(), depends, commands); } + + this->WriteHelpRule(ruleFileStream); } void cmLocalUnixMakefileGenerator3 @@ -2999,3 +3003,44 @@ cmLocalUnixMakefileGenerator3 return cmd; } +//---------------------------------------------------------------------------- +void +cmLocalUnixMakefileGenerator3::WriteHelpRule(std::ostream& ruleFileStream) +{ + // add the help target + std::string path; + std::vector<std::string> no_depends; + std::vector<std::string> commands; + this->AppendEcho(commands, + "The following are some of the valid targets for this Makefile:"); + this->AppendEcho(commands,"... all (the default if no target is provided)"); + this->AppendEcho(commands,"... clean"); + this->AppendEcho(commands,"... install"); + this->AppendEcho(commands,"... rebuild_cache"); + + // Keep track of targets already listed. + std::set<cmStdString> emittedTargets; + + // for each target Generate the rule files for each target. + cmTargets& targets = this->GetMakefile()->GetTargets(); + for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t) + { + if((t->second.GetType() == cmTarget::EXECUTABLE) || + (t->second.GetType() == cmTarget::STATIC_LIBRARY) || + (t->second.GetType() == cmTarget::SHARED_LIBRARY) || + (t->second.GetType() == cmTarget::MODULE_LIBRARY) || + (t->second.GetType() == cmTarget::UTILITY)) + { + if(emittedTargets.insert(t->second.GetName()).second) + { + path = "... "; + path += t->second.GetName(); + this->AppendEcho(commands,path.c_str()); + } + } + } + this->WriteMakeRule(ruleFileStream, "Help Target", + "help:", + no_depends, commands); + ruleFileStream << "\n\n"; +} |