diff options
author | Ken Martin <ken.martin@kitware.com> | 2006-01-30 18:57:01 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2006-01-30 18:57:01 (GMT) |
commit | 5d35fd4b7ea9699fd114c2176c66fa2c484ec5af (patch) | |
tree | 550f76b573f00dc68663ee25d0f087efebe33d2d | |
parent | 8c77bb3cf36658d8edeb09ddda9f28fcb47a17e6 (diff) | |
download | CMake-5d35fd4b7ea9699fd114c2176c66fa2c484ec5af.zip CMake-5d35fd4b7ea9699fd114c2176c66fa2c484ec5af.tar.gz CMake-5d35fd4b7ea9699fd114c2176c66fa2c484ec5af.tar.bz2 |
ENH: cleanup and remove some old code
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 67 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.h | 10 |
2 files changed, 15 insertions, 62 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 5b15e96..ec82003 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -2184,41 +2184,6 @@ cmLocalUnixMakefileGenerator3::GetRelativeTargetDirectory(cmTarget& target) //---------------------------------------------------------------------------- std::string cmLocalUnixMakefileGenerator3 -::GetSubdirTargetName(const char* pass, const char* subdir) -{ - // Convert the subdirectory name to a relative path to keep it short. - std::string reldir = this->Convert(subdir,START_OUTPUT); - - // Convert the subdirectory name to a valid make target name. - std::string s = pass; - s += "_"; - s += reldir; - - // Replace "../" with 3 underscores. This allows one .. at the beginning. - size_t pos = s.find("../"); - if(pos != std::string::npos) - { - s.replace(pos, 3, "___"); - } - - // Replace "/" directory separators with a single underscore. - while((pos = s.find('/')) != std::string::npos) - { - s.replace(pos, 1, "_"); - } - - // Replace ":" drive specifier with a single underscore - while((pos = s.find(':')) != std::string::npos) - { - s.replace(pos, 1, "_"); - } - - return s; -} - -//---------------------------------------------------------------------------- -std::string -cmLocalUnixMakefileGenerator3 ::GetObjectFileName(cmTarget& target, const cmSourceFile& source, std::string* nameWithoutTargetDir) @@ -2969,7 +2934,11 @@ void cmLocalUnixMakefileGenerator3 dir = "all"; depends.push_back("cmake_check_build_system"); } - this->CreateJumpCommand(commands,"CMakeFiles/Makefile2",dir); + commands.push_back(this->GetRecursiveMakeCall + ("CMakeFiles/Makefile2",dir.c_str())); + this->CreateCDCommand(commands, + m_Makefile->GetHomeOutputDirectory(), + m_Makefile->GetStartOutputDirectory()); this->WriteMakeRule(ruleFileStream, "The main all target", "all", depends, commands); // Write the clean rule. @@ -2982,7 +2951,11 @@ void cmLocalUnixMakefileGenerator3 { depends.push_back(sym); } - this->CreateJumpCommand(commands,"CMakeFiles/Makefile2",dir); + commands.push_back(this->GetRecursiveMakeCall + ("CMakeFiles/Makefile2",dir.c_str())); + this->CreateCDCommand(commands, + m_Makefile->GetHomeOutputDirectory(), + m_Makefile->GetStartOutputDirectory()); this->WriteMakeRule(ruleFileStream, "The main clean target", "clean", depends, commands); // write the depend rule, really a recompute depends rule @@ -3065,7 +3038,11 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile() tgtMakefileName += "/build.make"; targetName += "/"; targetName += lo->first.c_str(); - this->CreateJumpCommand(commands,tgtMakefileName.c_str(),targetName); + commands.push_back(this->GetRecursiveMakeCall + (tgtMakefileName.c_str(),targetName.c_str())); + this->CreateCDCommand(commands, + m_Makefile->GetHomeOutputDirectory(), + m_Makefile->GetStartOutputDirectory()); } this->WriteMakeRule(ruleFileStream, "target for object file", @@ -3179,20 +3156,6 @@ void cmLocalUnixMakefileGenerator3 } } -void cmLocalUnixMakefileGenerator3 -::CreateJumpCommand(std::vector<std::string>& commands, - const char *MakefileName, - std::string& localName) -{ - // Build the target for this pass. - commands.push_back(this->GetRecursiveMakeCall - (MakefileName,localName.c_str())); - - this->CreateCDCommand(commands, - m_Makefile->GetHomeOutputDirectory(), - m_Makefile->GetStartOutputDirectory()); -} - //---------------------------------------------------------------------------- void cmLocalUnixMakefileGenerator3::CheckDependencies(cmMakefile* mf, bool verbose, diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index a744b94..6b86ce5 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -192,11 +192,6 @@ protected: // write the local help rule void WriteHelpRule(std::ostream& ruleFileStream); - // create the cd to home commands - void CreateJumpCommand(std::vector<std::string>& commands, - const char *MakefileName, - std::string & localName); - // create a command that cds to the start dir then runs the commands void CreateCDCommand(std::vector<std::string>& commands, const char *targetDir, const char *returnDir); @@ -303,10 +298,6 @@ protected: void WriteLocalMakefile(); - - - void WriteLocalRule(std::ostream& ruleFileStream, const char* pass, - const char* dependency); void WriteConvenienceRule(std::ostream& ruleFileStream, const char* realTarget, const char* helpTarget); @@ -326,7 +317,6 @@ protected: const std::vector<std::string>& objects); std::string GetTargetDirectory(cmTarget& target); - std::string GetSubdirTargetName(const char* pass, const char* subdir); std::string GetObjectFileName(cmTarget& target, const cmSourceFile& source, std::string* nameWithoutTargetDir = 0); |