From f826c6c58bd7dbafee9f0d8d12bb814ac0e8abc5 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 23 Aug 2006 09:45:24 -0400 Subject: ENH: Centralized generation of targets listed in the help to be done by the code that actually writes the targets. --- Source/cmGlobalUnixMakefileGenerator3.cxx | 14 ++++++-------- Source/cmLocalUnixMakefileGenerator3.cxx | 11 +++++++++-- Source/cmLocalUnixMakefileGenerator3.h | 6 +++++- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 255b1a3..a647a9c 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -1231,15 +1231,13 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule } } } - typedef cmLocalUnixMakefileGenerator3::LocalObjectInfo LocalObjectInfo; - std::map const& objs = - lg->GetLocalObjectFiles(); - for(std::map::const_iterator o = - objs.begin(); o != objs.end(); ++o) + std::vector const& localHelp = lg->GetLocalHelp(); + for(std::vector::const_iterator o = localHelp.begin(); + o != localHelp.end(); ++o) { - path = "... "; - path += o->first; - lg->AppendEcho(commands, path.c_str()); + path = "... "; + path += *o; + lg->AppendEcho(commands, path.c_str()); } } } diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 525b791..c082625 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -369,7 +369,7 @@ cmLocalUnixMakefileGenerator3 // Write the rule to the makefile. std::vector no_depends; this->WriteMakeRule(ruleFileStream, comment, - output, no_depends, commands, true); + output, no_depends, commands, true, true); } //---------------------------------------------------------------------------- @@ -561,7 +561,8 @@ cmLocalUnixMakefileGenerator3 const char* target, const std::vector& depends, const std::vector& commands, - bool symbolic) + bool symbolic, + bool in_help) { // Make sure there is a target. if(!target || !*target) @@ -637,6 +638,12 @@ cmLocalUnixMakefileGenerator3 os << "\t" << replace.c_str() << "\n"; } os << "\n"; + + // Add the output to the local help if requested. + if(in_help) + { + this->LocalHelp.push_back(target); + } } //---------------------------------------------------------------------------- diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 9bb2ab7..6e0491e 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -73,7 +73,8 @@ public: const char* target, const std::vector& depends, const std::vector& commands, - bool symbolic); + bool symbolic, + bool in_help = false); // write the main variables used by the makefiles void WriteMakeVariables(std::ostream& makefileStream); @@ -214,6 +215,8 @@ public: std::map const& GetLocalObjectFiles() { return this->LocalObjectFiles;} + std::vector const& GetLocalHelp() { return this->LocalHelp; } + // return info about progress actions unsigned long GetNumberOfProgressActions(); unsigned long GetNumberOfProgressActionsForTarget(const char *); @@ -346,6 +349,7 @@ private: bool SkipAssemblySourceRules; std::map LocalObjectFiles; + std::vector LocalHelp; /* does the work for each target */ std::vector TargetGenerators; -- cgit v0.12