From 7c1470f146fd326ff3d5308abead412a2ed07f1f Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 22 Jan 2020 08:56:02 -0500 Subject: Makefiles: Organize help output to group 'like' targets --- Source/cmGlobalUnixMakefileGenerator3.cxx | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 0591758..90c9ef0 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -892,6 +892,9 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule( // Keep track of targets already listed. std::set emittedTargets; + std::set utility_targets; + std::set globals_targets; + std::set project_targets; // for each local generator for (const auto& localGen : this->LocalGenerators) { @@ -907,18 +910,30 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule( (type == cmStateEnums::STATIC_LIBRARY) || (type == cmStateEnums::SHARED_LIBRARY) || (type == cmStateEnums::MODULE_LIBRARY) || - (type == cmStateEnums::OBJECT_LIBRARY) || - (type == cmStateEnums::GLOBAL_TARGET) || - (type == cmStateEnums::UTILITY)) { - std::string const& name = target->GetName(); - if (emittedTargets.insert(name).second) { - path = cmStrCat("... ", name); - lg->AppendEcho(commands, path); - } + (type == cmStateEnums::OBJECT_LIBRARY)) { + project_targets.insert(target->GetName()); + } else if (type == cmStateEnums::GLOBAL_TARGET) { + globals_targets.insert(target->GetName()); + } else if (type == cmStateEnums::UTILITY) { + utility_targets.insert(target->GetName()); } } } } + + for (std::string const& name : globals_targets) { + path = cmStrCat("... ", name); + lg->AppendEcho(commands, path); + } + for (std::string const& name : utility_targets) { + path = cmStrCat("... ", name); + lg->AppendEcho(commands, path); + } + for (std::string const& name : project_targets) { + path = cmStrCat("... ", name); + lg->AppendEcho(commands, path); + } + for (std::string const& o : lg->GetLocalHelp()) { path = cmStrCat("... ", o); lg->AppendEcho(commands, path); -- cgit v0.12