From 9f92a78be21a7f126f1776d481cc4bd2acdf4a1b Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 22 Jul 2014 12:27:57 -0400 Subject: cmLocalGenerator: Rename 'MAKEFILE' to 'MAKERULE' Rename the internal enumeration value for converting paths destined for use in Makefile rule syntax. --- Source/cmDepends.cxx | 2 +- Source/cmDependsC.cxx | 2 +- Source/cmDependsFortran.cxx | 12 ++++++------ Source/cmGlobalUnixMakefileGenerator3.cxx | 2 +- Source/cmLocalGenerator.cxx | 4 ++-- Source/cmLocalGenerator.h | 2 +- Source/cmLocalUnixMakefileGenerator3.cxx | 4 ++-- Source/cmMakefileTargetGenerator.cxx | 6 +++--- Source/cmMakefileUtilityTargetGenerator.cxx | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx index 50a395e..cdc480c 100644 --- a/Source/cmDepends.cxx +++ b/Source/cmDepends.cxx @@ -63,7 +63,7 @@ bool cmDepends::Write(std::ostream &makeDepends, // Make sure the object file is relative to the top of the build tree. obj = this->LocalGenerator->Convert(obj, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKEFILE); + cmLocalGenerator::MAKERULE); dependencies[obj].insert(src); } for(std::map >::const_iterator diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index d26d3a9..dd239c4 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -276,7 +276,7 @@ bool cmDependsC::WriteDependencies(const std::set& sources, makeDepends << obj << ": " << this->LocalGenerator->Convert(*i, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKEFILE) + cmLocalGenerator::MAKERULE) << std::endl; internalDepends << " " << *i << std::endl; } diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index f06971d..b1d55f3 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -451,7 +451,7 @@ cmDependsFortran makeDepends << obj << ": " << this->LocalGenerator->Convert(*i, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKEFILE) + cmLocalGenerator::MAKERULE) << std::endl; internalDepends << " " << *i << std::endl; } @@ -482,7 +482,7 @@ cmDependsFortran proxy += ".mod.proxy"; proxy = this->LocalGenerator->Convert(proxy, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKEFILE); + cmLocalGenerator::MAKERULE); // since we require some things add them to our list of requirements makeDepends << obj << ".requires: " << proxy << std::endl; @@ -499,7 +499,7 @@ cmDependsFortran std::string stampFile = this->LocalGenerator->Convert(required->second, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKEFILE); + cmLocalGenerator::MAKERULE); makeDepends << obj << ": " << stampFile << "\n"; } else @@ -512,7 +512,7 @@ cmDependsFortran module = this->LocalGenerator->Convert(module, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKEFILE); + cmLocalGenerator::MAKERULE); makeDepends << obj << ": " << module << "\n"; } } @@ -528,7 +528,7 @@ cmDependsFortran proxy += ".mod.proxy"; proxy = this->LocalGenerator->Convert(proxy, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKEFILE); + cmLocalGenerator::MAKERULE); makeDepends << proxy << ": " << obj << ".provides" << std::endl; } @@ -584,7 +584,7 @@ cmDependsFortran driver += "/build"; driver = this->LocalGenerator->Convert(driver, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKEFILE); + cmLocalGenerator::MAKERULE); makeDepends << driver << ": " << obj << ".provides.build\n"; } diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 8dae81b..3478534 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -530,7 +530,7 @@ cmGlobalUnixMakefileGenerator3 // Begin the directory-level rules section. std::string dir = lg->GetMakefile()->GetStartOutputDirectory(); dir = lg->Convert(dir, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKEFILE); + cmLocalGenerator::MAKERULE); lg->WriteDivider(ruleFileStream); ruleFileStream << "# Directory level rules for directory " diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 5380d06..d2652f7 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -681,7 +681,7 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang, objVector.push_back(ofname); this->AddCustomCommandToCreateObject(ofname.c_str(), llang, *(*i), target); - objs += this->Convert(ofname,START_OUTPUT,MAKEFILE); + objs += this->Convert(ofname,START_OUTPUT,MAKERULE); objs += " "; } } @@ -2755,7 +2755,7 @@ std::string cmLocalGenerator::ConvertToOutputFormat(const std::string& source, { std::string result = source; // Convert it to an output path. - if (output == MAKEFILE) + if (output == MAKERULE) { result = cmSystemTools::ConvertToOutputPath(result.c_str()); } diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index ad73073..b25b9ab 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -106,7 +106,7 @@ public: * path setting */ enum RelativeRoot { NONE, FULL, HOME, START, HOME_OUTPUT, START_OUTPUT }; - enum OutputFormat { UNCHANGED, MAKEFILE, SHELL, WATCOMQUOTE, RESPONSE }; + enum OutputFormat { UNCHANGED, MAKERULE, SHELL, WATCOMQUOTE, RESPONSE }; std::string ConvertToOutputFormat(const std::string& source, OutputFormat output); std::string Convert(const std::string& remote, RelativeRoot local, diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 94e45e5..23513fa 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -630,7 +630,7 @@ cmLocalUnixMakefileGenerator3 // Construct the left hand side of the rule. replace = target; - std::string tgt = this->Convert(replace,HOME_OUTPUT,MAKEFILE); + std::string tgt = this->Convert(replace,HOME_OUTPUT,MAKERULE); const char* space = ""; if(tgt.size() == 1) { @@ -663,7 +663,7 @@ cmLocalUnixMakefileGenerator3 dep != depends.end(); ++dep) { replace = *dep; - replace = this->Convert(replace,HOME_OUTPUT,MAKEFILE); + replace = this->Convert(replace,HOME_OUTPUT,MAKERULE); os << cmMakeSafe(tgt) << space << ": " << cmMakeSafe(replace) << "\n"; } } diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 403f6e6..758c8e4 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -218,7 +218,7 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules() << this->LocalGenerator->IncludeDirective << " " << root << this->Convert(dependFileNameFull, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKEFILE) + cmLocalGenerator::MAKERULE) << "\n\n"; if(!this->NoRuleMessages) @@ -229,7 +229,7 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules() << this->LocalGenerator->IncludeDirective << " " << root << this->Convert(this->ProgressFileNameFull, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKEFILE) + cmLocalGenerator::MAKERULE) << "\n\n"; } @@ -262,7 +262,7 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules() << this->LocalGenerator->IncludeDirective << " " << root << this->Convert(this->FlagFileNameFull, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKEFILE) + cmLocalGenerator::MAKERULE) << "\n\n"; } diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx index 6b039bb..617214f 100644 --- a/Source/cmMakefileUtilityTargetGenerator.cxx +++ b/Source/cmMakefileUtilityTargetGenerator.cxx @@ -54,7 +54,7 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles() << this->LocalGenerator->IncludeDirective << " " << root << this->Convert(this->ProgressFileNameFull, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKEFILE) + cmLocalGenerator::MAKERULE) << "\n\n"; } -- cgit v0.12 From e7ee892b391992e0e8198917b8ef5cce76da2fd1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 22 Jul 2014 12:38:08 -0400 Subject: cmLocalGenerator: Fix AddBuildTargetRule object file path conversion The object file list is constructed for a shell, not a Makefile rule. --- Source/cmLocalGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index d2652f7..4bd9191 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -681,7 +681,7 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang, objVector.push_back(ofname); this->AddCustomCommandToCreateObject(ofname.c_str(), llang, *(*i), target); - objs += this->Convert(ofname,START_OUTPUT,MAKERULE); + objs += this->Convert(ofname,START_OUTPUT,SHELL); objs += " "; } } -- cgit v0.12 From 85cea8a7af77cd482f4d3c7ec15f68bc5adeb0ba Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 22 Jul 2014 12:50:37 -0400 Subject: cmDepends: Refactor object file path conversion Delay conversion of the path to object files (on the left-hand side of dependencies) until just before they are written. Also do not convert the format of paths written to the 'depend.internal' file. This is consistent with the way the right-hand side of dependencies are already handled. --- Source/cmDepends.cxx | 7 +------ Source/cmDependsC.cxx | 10 ++++++++-- Source/cmDependsFortran.cxx | 23 ++++++++++++++--------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx index cdc480c..134f45b 100644 --- a/Source/cmDepends.cxx +++ b/Source/cmDepends.cxx @@ -58,12 +58,7 @@ bool cmDepends::Write(std::ostream &makeDepends, // Get the source and object file. std::string const& src = *si++; if(si == pairs.end()) { break; } - std::string obj = *si++; - - // Make sure the object file is relative to the top of the build tree. - obj = this->LocalGenerator->Convert(obj, - cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKERULE); + std::string const& obj = *si++; dependencies[obj].insert(src); } for(std::map >::const_iterator diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index dd239c4..a1fc268 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -269,11 +269,17 @@ bool cmDependsC::WriteDependencies(const std::set& sources, // written by the original local generator for this directory // convert the dependencies to paths relative to the home output // directory. We must do the same here. - internalDepends << obj << std::endl; + std::string obj_i = + this->LocalGenerator->Convert(obj, cmLocalGenerator::HOME_OUTPUT); + std::string obj_m = + this->LocalGenerator->ConvertToOutputFormat(obj_i, + cmLocalGenerator::MAKERULE); + internalDepends << obj_i << std::endl; + for(std::set::const_iterator i=dependencies.begin(); i != dependencies.end(); ++i) { - makeDepends << obj << ": " << + makeDepends << obj_m << ": " << this->LocalGenerator->Convert(*i, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::MAKERULE) diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index b1d55f3..8fc8347 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -443,12 +443,17 @@ cmDependsFortran const char* src = info.Source.c_str(); // Write the include dependencies to the output stream. - internalDepends << obj << std::endl; + std::string obj_i = + this->LocalGenerator->Convert(obj, cmLocalGenerator::HOME_OUTPUT); + std::string obj_m = + this->LocalGenerator->ConvertToOutputFormat(obj_i, + cmLocalGenerator::MAKERULE); + internalDepends << obj_i << std::endl; internalDepends << " " << src << std::endl; for(std::set::const_iterator i = info.Includes.begin(); i != info.Includes.end(); ++i) { - makeDepends << obj << ": " << + makeDepends << obj_m << ": " << this->LocalGenerator->Convert(*i, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::MAKERULE) @@ -485,7 +490,7 @@ cmDependsFortran cmLocalGenerator::MAKERULE); // since we require some things add them to our list of requirements - makeDepends << obj << ".requires: " << proxy << std::endl; + makeDepends << obj_m << ".requires: " << proxy << std::endl; } // The object file should depend on timestamped files for the @@ -500,7 +505,7 @@ cmDependsFortran this->LocalGenerator->Convert(required->second, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::MAKERULE); - makeDepends << obj << ": " << stampFile << "\n"; + makeDepends << obj_m << ": " << stampFile << "\n"; } else { @@ -513,7 +518,7 @@ cmDependsFortran this->LocalGenerator->Convert(module, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::MAKERULE); - makeDepends << obj << ": " << module << "\n"; + makeDepends << obj_m << ": " << module << "\n"; } } } @@ -529,7 +534,7 @@ cmDependsFortran proxy = this->LocalGenerator->Convert(proxy, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::MAKERULE); - makeDepends << proxy << ": " << obj << ".provides" << std::endl; + makeDepends << proxy << ": " << obj_m << ".provides" << std::endl; } // If any modules are provided then they must be converted to stamp files. @@ -537,7 +542,7 @@ cmDependsFortran { // Create a target to copy the module after the object file // changes. - makeDepends << obj << ".provides.build:\n"; + makeDepends << obj_m << ".provides.build:\n"; for(std::set::const_iterator i = info.Provides.begin(); i != info.Provides.end(); ++i) { @@ -575,7 +580,7 @@ cmDependsFortran } // After copying the modules update the timestamp file so that // copying will not be done again until the source rebuilds. - makeDepends << "\t$(CMAKE_COMMAND) -E touch " << obj + makeDepends << "\t$(CMAKE_COMMAND) -E touch " << obj_m << ".provides.build\n"; // Make sure the module timestamp rule is evaluated by the time @@ -585,7 +590,7 @@ cmDependsFortran driver = this->LocalGenerator->Convert(driver, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::MAKERULE); - makeDepends << driver << ": " << obj << ".provides.build\n"; + makeDepends << driver << ": " << obj_m << ".provides.build\n"; } return true; -- cgit v0.12 From 848fab9575271f41c9632086011af4c4560702e3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 22 Jul 2014 13:10:14 -0400 Subject: cmGlobalVisualStudio7Generator: Remove unused variable --- Source/cmGlobalVisualStudio7Generator.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 602d678..3d79357 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -773,7 +773,6 @@ void cmGlobalVisualStudio7Generator::WriteExternalProject(std::ostream& fout, const char* typeGuid, const std::set&) { - std::string d = cmSystemTools::ConvertToOutputPath(location); fout << "Project(" << "\"{" << (typeGuid ? typeGuid : this->ExternalProjectType(location)) -- cgit v0.12