ENH: Centralized generation of targets listed in the help to be done by the code that actually writes the targets.

This commit is contained in:
Brad King 2006-08-23 09:45:24 -04:00
parent 539e5ac4c2
commit f826c6c58b
3 changed files with 20 additions and 11 deletions

View File

@ -1231,15 +1231,13 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule
} }
} }
} }
typedef cmLocalUnixMakefileGenerator3::LocalObjectInfo LocalObjectInfo; std::vector<cmStdString> const& localHelp = lg->GetLocalHelp();
std::map<cmStdString, LocalObjectInfo> const& objs = for(std::vector<cmStdString>::const_iterator o = localHelp.begin();
lg->GetLocalObjectFiles(); o != localHelp.end(); ++o)
for(std::map<cmStdString, LocalObjectInfo>::const_iterator o =
objs.begin(); o != objs.end(); ++o)
{ {
path = "... "; path = "... ";
path += o->first; path += *o;
lg->AppendEcho(commands, path.c_str()); lg->AppendEcho(commands, path.c_str());
} }
} }
} }

View File

@ -369,7 +369,7 @@ cmLocalUnixMakefileGenerator3
// Write the rule to the makefile. // Write the rule to the makefile.
std::vector<std::string> no_depends; std::vector<std::string> no_depends;
this->WriteMakeRule(ruleFileStream, comment, this->WriteMakeRule(ruleFileStream, comment,
output, no_depends, commands, true); output, no_depends, commands, true, true);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -561,7 +561,8 @@ cmLocalUnixMakefileGenerator3
const char* target, const char* target,
const std::vector<std::string>& depends, const std::vector<std::string>& depends,
const std::vector<std::string>& commands, const std::vector<std::string>& commands,
bool symbolic) bool symbolic,
bool in_help)
{ {
// Make sure there is a target. // Make sure there is a target.
if(!target || !*target) if(!target || !*target)
@ -637,6 +638,12 @@ cmLocalUnixMakefileGenerator3
os << "\t" << replace.c_str() << "\n"; os << "\t" << replace.c_str() << "\n";
} }
os << "\n"; os << "\n";
// Add the output to the local help if requested.
if(in_help)
{
this->LocalHelp.push_back(target);
}
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View File

@ -73,7 +73,8 @@ public:
const char* target, const char* target,
const std::vector<std::string>& depends, const std::vector<std::string>& depends,
const std::vector<std::string>& commands, const std::vector<std::string>& commands,
bool symbolic); bool symbolic,
bool in_help = false);
// write the main variables used by the makefiles // write the main variables used by the makefiles
void WriteMakeVariables(std::ostream& makefileStream); void WriteMakeVariables(std::ostream& makefileStream);
@ -214,6 +215,8 @@ public:
std::map<cmStdString, LocalObjectInfo> const& GetLocalObjectFiles() std::map<cmStdString, LocalObjectInfo> const& GetLocalObjectFiles()
{ return this->LocalObjectFiles;} { return this->LocalObjectFiles;}
std::vector<cmStdString> const& GetLocalHelp() { return this->LocalHelp; }
// return info about progress actions // return info about progress actions
unsigned long GetNumberOfProgressActions(); unsigned long GetNumberOfProgressActions();
unsigned long GetNumberOfProgressActionsForTarget(const char *); unsigned long GetNumberOfProgressActionsForTarget(const char *);
@ -346,6 +349,7 @@ private:
bool SkipAssemblySourceRules; bool SkipAssemblySourceRules;
std::map<cmStdString, LocalObjectInfo> LocalObjectFiles; std::map<cmStdString, LocalObjectInfo> LocalObjectFiles;
std::vector<cmStdString> LocalHelp;
/* does the work for each target */ /* does the work for each target */
std::vector<cmMakefileTargetGenerator *> TargetGenerators; std::vector<cmMakefileTargetGenerator *> TargetGenerators;