diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 5b15e968ac..ec82003d9c 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -2181,41 +2181,6 @@ cmLocalUnixMakefileGenerator3::GetRelativeTargetDirectory(cmTarget& target) return this->Convert(dir.c_str(),NONE,MAKEFILE); } -//---------------------------------------------------------------------------- -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 @@ -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& 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 a744b94b69..6b86ce5949 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& commands, - const char *MakefileName, - std::string & localName); - // create a command that cds to the start dir then runs the commands void CreateCDCommand(std::vector& 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& 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);