ENH: cleanup and remove some old code
This commit is contained in:
parent
8c77bb3cf3
commit
5d35fd4b7e
@ -2181,41 +2181,6 @@ cmLocalUnixMakefileGenerator3::GetRelativeTargetDirectory(cmTarget& target)
|
|||||||
return this->Convert(dir.c_str(),NONE,MAKEFILE);
|
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
|
std::string
|
||||||
cmLocalUnixMakefileGenerator3
|
cmLocalUnixMakefileGenerator3
|
||||||
@ -2969,7 +2934,11 @@ void cmLocalUnixMakefileGenerator3
|
|||||||
dir = "all";
|
dir = "all";
|
||||||
depends.push_back("cmake_check_build_system");
|
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);
|
this->WriteMakeRule(ruleFileStream, "The main all target", "all", depends, commands);
|
||||||
|
|
||||||
// Write the clean rule.
|
// Write the clean rule.
|
||||||
@ -2982,7 +2951,11 @@ void cmLocalUnixMakefileGenerator3
|
|||||||
{
|
{
|
||||||
depends.push_back(sym);
|
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);
|
this->WriteMakeRule(ruleFileStream, "The main clean target", "clean", depends, commands);
|
||||||
|
|
||||||
// write the depend rule, really a recompute depends rule
|
// write the depend rule, really a recompute depends rule
|
||||||
@ -3065,7 +3038,11 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
|
|||||||
tgtMakefileName += "/build.make";
|
tgtMakefileName += "/build.make";
|
||||||
targetName += "/";
|
targetName += "/";
|
||||||
targetName += lo->first.c_str();
|
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,
|
this->WriteMakeRule(ruleFileStream,
|
||||||
"target for object file",
|
"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,
|
void cmLocalUnixMakefileGenerator3::CheckDependencies(cmMakefile* mf,
|
||||||
bool verbose,
|
bool verbose,
|
||||||
|
@ -192,11 +192,6 @@ protected:
|
|||||||
// write the local help rule
|
// write the local help rule
|
||||||
void WriteHelpRule(std::ostream& ruleFileStream);
|
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
|
// create a command that cds to the start dir then runs the commands
|
||||||
void CreateCDCommand(std::vector<std::string>& commands,
|
void CreateCDCommand(std::vector<std::string>& commands,
|
||||||
const char *targetDir, const char *returnDir);
|
const char *targetDir, const char *returnDir);
|
||||||
@ -303,10 +298,6 @@ protected:
|
|||||||
void WriteLocalMakefile();
|
void WriteLocalMakefile();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void WriteLocalRule(std::ostream& ruleFileStream, const char* pass,
|
|
||||||
const char* dependency);
|
|
||||||
void WriteConvenienceRule(std::ostream& ruleFileStream,
|
void WriteConvenienceRule(std::ostream& ruleFileStream,
|
||||||
const char* realTarget,
|
const char* realTarget,
|
||||||
const char* helpTarget);
|
const char* helpTarget);
|
||||||
@ -326,7 +317,6 @@ protected:
|
|||||||
const std::vector<std::string>& objects);
|
const std::vector<std::string>& objects);
|
||||||
|
|
||||||
std::string GetTargetDirectory(cmTarget& target);
|
std::string GetTargetDirectory(cmTarget& target);
|
||||||
std::string GetSubdirTargetName(const char* pass, const char* subdir);
|
|
||||||
std::string GetObjectFileName(cmTarget& target,
|
std::string GetObjectFileName(cmTarget& target,
|
||||||
const cmSourceFile& source,
|
const cmSourceFile& source,
|
||||||
std::string* nameWithoutTargetDir = 0);
|
std::string* nameWithoutTargetDir = 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user