ENH: another snapshot
This commit is contained in:
parent
25f75d9075
commit
25d6c04add
@ -156,6 +156,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile()
|
|||||||
this->WriteConvenienceRules(makefileStream,lg);
|
this->WriteConvenienceRules(makefileStream,lg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lg = static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[0]);
|
||||||
lg->WriteSpecialTargetsBottom(makefileStream);
|
lg->WriteSpecialTargetsBottom(makefileStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,11 +353,20 @@ void cmGlobalUnixMakefileGenerator3::WriteDependMakefile()
|
|||||||
{
|
{
|
||||||
cmLocalUnixMakefileGenerator3 *lg2 =
|
cmLocalUnixMakefileGenerator3 *lg2 =
|
||||||
static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
|
static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
|
||||||
if (!lg2->GetExcludeAll())
|
// are any parents excluded
|
||||||
|
bool exclude = false;
|
||||||
|
cmLocalGenerator *lg3 = lg2;
|
||||||
|
while (lg3)
|
||||||
{
|
{
|
||||||
lg2->WriteMainTargetIncludes(makefileStream,"depend.make","depend");
|
if (lg3->GetExcludeAll())
|
||||||
lg2->WriteMainTargetRules(makefileStream,"depend.make","depend");
|
{
|
||||||
|
exclude = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
lg3 = lg3->GetParent();
|
||||||
}
|
}
|
||||||
|
lg2->WriteMainTargetIncludes(makefileStream,"depend.make","depend");
|
||||||
|
lg2->WriteMainTargetRules(makefileStream,"depend.make","depend",!exclude);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,12 +415,9 @@ void cmGlobalUnixMakefileGenerator3::WriteBuildMakefile()
|
|||||||
}
|
}
|
||||||
lg3 = lg3->GetParent();
|
lg3 = lg3->GetParent();
|
||||||
}
|
}
|
||||||
if (!exclude)
|
lg2->WriteMainTargetIncludes(makefileStream,"build.make","build");
|
||||||
{
|
lg2->WriteMainTargetRules(makefileStream,"build.make","build",!exclude);
|
||||||
lg2->WriteMainTargetIncludes(makefileStream,"build.make","build");
|
lg2->WriteMainTargetRules(makefileStream,"build.make","requires",!exclude);
|
||||||
lg2->WriteMainTargetRules(makefileStream,"build.make","build");
|
|
||||||
lg2->WriteMainTargetRules(makefileStream,"build.make","requires");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,7 +455,7 @@ void cmGlobalUnixMakefileGenerator3::WriteCleanMakefile()
|
|||||||
cmLocalUnixMakefileGenerator3 *lg2 =
|
cmLocalUnixMakefileGenerator3 *lg2 =
|
||||||
static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
|
static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
|
||||||
lg2->WriteMainTargetIncludes(makefileStream,"clean.make","clean");
|
lg2->WriteMainTargetIncludes(makefileStream,"clean.make","clean");
|
||||||
lg2->WriteMainTargetRules(makefileStream,"clean.make","clean");
|
lg2->WriteMainTargetRules(makefileStream,"clean.make","clean",true);
|
||||||
// add the directory based rules
|
// add the directory based rules
|
||||||
lg2->WriteLocalCleanRule(makefileStream);
|
lg2->WriteLocalCleanRule(makefileStream);
|
||||||
}
|
}
|
||||||
@ -494,14 +501,33 @@ cmGlobalUnixMakefileGenerator3
|
|||||||
std::vector<std::string> depends;
|
std::vector<std::string> depends;
|
||||||
std::vector<std::string> tgt_depends;
|
std::vector<std::string> tgt_depends;
|
||||||
std::vector<std::string> commands;
|
std::vector<std::string> commands;
|
||||||
|
|
||||||
depends.push_back("cmake_check_build_system");
|
|
||||||
|
|
||||||
// for each target
|
|
||||||
// Generate the rule files for each target.
|
|
||||||
const cmTargets& targets = lg->GetMakefile()->GetTargets();
|
|
||||||
std::string localName;
|
std::string localName;
|
||||||
std::string makeTargetName;
|
std::string makeTargetName;
|
||||||
|
|
||||||
|
depends.push_back("cmake_check_build_system");
|
||||||
|
std::string dir = lg->GetMakefile()->GetStartOutputDirectory();
|
||||||
|
dir = this->ConvertToHomeRelativeOutputPath(dir.c_str());
|
||||||
|
localName = dir;
|
||||||
|
localName += "/directory";
|
||||||
|
|
||||||
|
// write the directory rule
|
||||||
|
commands.clear();
|
||||||
|
makeTargetName = dir;
|
||||||
|
makeTargetName += "/depend";
|
||||||
|
commands.push_back(lg->GetRecursiveMakeCall("depend.make",makeTargetName.c_str()));
|
||||||
|
makeTargetName = dir;
|
||||||
|
makeTargetName += "/requires";
|
||||||
|
commands.push_back(lg->GetRecursiveMakeCall("depend.make",makeTargetName.c_str()));
|
||||||
|
makeTargetName = dir;
|
||||||
|
makeTargetName += "/build";
|
||||||
|
commands.push_back(lg->GetRecursiveMakeCall("build.make",makeTargetName.c_str()));
|
||||||
|
|
||||||
|
// Write the rule.
|
||||||
|
lg->WriteMakeRule(ruleFileStream, "Convenience name for target.",
|
||||||
|
localName.c_str(), depends, commands);
|
||||||
|
|
||||||
|
// for each target Generate the rule files for each target.
|
||||||
|
const cmTargets& targets = lg->GetMakefile()->GetTargets();
|
||||||
for(cmTargets::const_iterator t = targets.begin(); t != targets.end(); ++t)
|
for(cmTargets::const_iterator t = targets.begin(); t != targets.end(); ++t)
|
||||||
{
|
{
|
||||||
if((t->second.GetType() == cmTarget::EXECUTABLE) ||
|
if((t->second.GetType() == cmTarget::EXECUTABLE) ||
|
||||||
|
@ -1105,34 +1105,69 @@ void cmLocalUnixMakefileGenerator3::WriteMainTargetIncludes(std::ostream& makefi
|
|||||||
|
|
||||||
void cmLocalUnixMakefileGenerator3::WriteMainTargetRules(std::ostream& makefileStream,
|
void cmLocalUnixMakefileGenerator3::WriteMainTargetRules(std::ostream& makefileStream,
|
||||||
const char *file,
|
const char *file,
|
||||||
const char *rule)
|
const char *rule,
|
||||||
|
bool inAll)
|
||||||
{
|
{
|
||||||
|
std::vector<std::string> all_tgts;
|
||||||
std::vector<std::string> depends;
|
std::vector<std::string> depends;
|
||||||
std::vector<std::string> no_commands;
|
std::vector<std::string> no_commands;
|
||||||
|
|
||||||
for (cmTargets::const_iterator l = m_Makefile->GetTargets().begin();
|
if (inAll)
|
||||||
l != m_Makefile->GetTargets().end(); l++)
|
|
||||||
{
|
{
|
||||||
if((l->second.GetType() == cmTarget::EXECUTABLE) ||
|
for (cmTargets::const_iterator l = m_Makefile->GetTargets().begin();
|
||||||
(l->second.GetType() == cmTarget::STATIC_LIBRARY) ||
|
l != m_Makefile->GetTargets().end(); l++)
|
||||||
(l->second.GetType() == cmTarget::SHARED_LIBRARY) ||
|
|
||||||
(l->second.GetType() == cmTarget::MODULE_LIBRARY) ||
|
|
||||||
(l->second.GetType() == cmTarget::UTILITY && !strcmp(rule,"build")))
|
|
||||||
{
|
{
|
||||||
// Add this to the list of depends rules in this directory.
|
if((l->second.GetType() == cmTarget::EXECUTABLE) ||
|
||||||
if(l->second.IsInAll())
|
(l->second.GetType() == cmTarget::STATIC_LIBRARY) ||
|
||||||
|
(l->second.GetType() == cmTarget::SHARED_LIBRARY) ||
|
||||||
|
(l->second.GetType() == cmTarget::MODULE_LIBRARY) ||
|
||||||
|
(l->second.GetType() == cmTarget::UTILITY && !strcmp(rule,"build")))
|
||||||
{
|
{
|
||||||
// add the dependency
|
// Add this to the list of depends rules in this directory.
|
||||||
std::string tname = this->GetRelativeTargetDirectory(l->second);
|
std::string tname = this->GetRelativeTargetDirectory(l->second);
|
||||||
tname += "/";
|
tname += "/";
|
||||||
tname += rule;
|
tname += rule;
|
||||||
depends.clear();
|
all_tgts.push_back(tname);
|
||||||
depends.push_back(tname);
|
if(l->second.IsInAll())
|
||||||
this->WriteMakeRule(makefileStream, 0,
|
{
|
||||||
rule, depends, no_commands);
|
// add the dependency
|
||||||
|
depends.clear();
|
||||||
|
depends.push_back(tname);
|
||||||
|
this->WriteMakeRule(makefileStream, 0,
|
||||||
|
rule, depends, no_commands);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// not for the top gen
|
||||||
|
if (this->GetParent())
|
||||||
|
{
|
||||||
|
// write the directory rule add in the subdirs
|
||||||
|
std::vector<cmLocalGenerator *> subdirs = this->GetChildren();
|
||||||
|
std::string dir;
|
||||||
|
|
||||||
|
// for each subdir add the directory depend
|
||||||
|
std::vector<cmLocalGenerator *>::iterator sdi = subdirs.begin();
|
||||||
|
for (; sdi != subdirs.end(); ++sdi)
|
||||||
|
{
|
||||||
|
cmLocalUnixMakefileGenerator3 * lg =
|
||||||
|
static_cast<cmLocalUnixMakefileGenerator3 *>(*sdi);
|
||||||
|
dir = lg->GetMakefile()->GetStartOutputDirectory();
|
||||||
|
dir += "/";
|
||||||
|
dir += rule;
|
||||||
|
dir = m_GlobalGenerator->ConvertToHomeRelativeOutputPath(dir.c_str());
|
||||||
|
all_tgts.push_back(dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
dir = m_Makefile->GetStartOutputDirectory();
|
||||||
|
dir += "/";
|
||||||
|
dir += rule;
|
||||||
|
dir = m_GlobalGenerator->ConvertToHomeRelativeOutputPath(dir.c_str());
|
||||||
|
|
||||||
|
this->WriteMakeRule(makefileStream, 0,
|
||||||
|
dir.c_str(), all_tgts, no_commands);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@ -2952,25 +2987,22 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
|
|||||||
|
|
||||||
this->WriteMakeVariables(ruleFileStream);
|
this->WriteMakeVariables(ruleFileStream);
|
||||||
|
|
||||||
std::vector<std::string> all_depends;
|
|
||||||
std::vector<std::string> depends;
|
std::vector<std::string> depends;
|
||||||
std::vector<std::string> commands;
|
std::vector<std::string> commands;
|
||||||
|
|
||||||
// Write the empty all rule.
|
// Write the empty all rule.
|
||||||
|
std::string dir = m_Makefile->GetStartOutputDirectory();
|
||||||
|
dir += "/directory";
|
||||||
|
dir = m_GlobalGenerator->ConvertToHomeRelativeOutputPath(dir.c_str());
|
||||||
|
this->CreateJumpCommand(commands,dir);
|
||||||
this->WriteMakeRule(ruleFileStream, "The main all target", "all", depends, commands);
|
this->WriteMakeRule(ruleFileStream, "The main all target", "all", depends, commands);
|
||||||
|
|
||||||
// recursively write our targets
|
// recursively write our targets
|
||||||
this->WriteLocalMakefileTargets(ruleFileStream, all_depends);
|
this->WriteLocalMakefileTargets(ruleFileStream);
|
||||||
|
|
||||||
// write out the all rule depends
|
|
||||||
commands.clear();
|
|
||||||
this->WriteMakeRule(ruleFileStream, "The main all target", "all", all_depends, commands);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmLocalUnixMakefileGenerator3
|
void cmLocalUnixMakefileGenerator3
|
||||||
::WriteLocalMakefileTargets(std::ostream& ruleFileStream,
|
::WriteLocalMakefileTargets(std::ostream& ruleFileStream)
|
||||||
std::vector<std::string>& all_depends)
|
|
||||||
{
|
{
|
||||||
std::vector<std::string> depends;
|
std::vector<std::string> depends;
|
||||||
std::vector<std::string> commands;
|
std::vector<std::string> commands;
|
||||||
@ -2990,7 +3022,6 @@ void cmLocalUnixMakefileGenerator3
|
|||||||
localName = this->GetRelativeTargetDirectory(t->second);
|
localName = this->GetRelativeTargetDirectory(t->second);
|
||||||
commands.clear();
|
commands.clear();
|
||||||
depends.clear();
|
depends.clear();
|
||||||
all_depends.push_back(localName);
|
|
||||||
|
|
||||||
this->CreateJumpCommand(commands,localName);
|
this->CreateJumpCommand(commands,localName);
|
||||||
this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
|
this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
|
||||||
@ -3006,18 +3037,6 @@ void cmLocalUnixMakefileGenerator3
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// for all children recurse
|
|
||||||
std::vector<cmLocalGenerator *> subdirs = this->GetChildren();
|
|
||||||
|
|
||||||
// for each subdir recurse
|
|
||||||
std::vector<cmLocalGenerator *>::iterator sdi = subdirs.begin();
|
|
||||||
for (; sdi != subdirs.end(); ++sdi)
|
|
||||||
{
|
|
||||||
cmLocalUnixMakefileGenerator3 * lg =
|
|
||||||
static_cast<cmLocalUnixMakefileGenerator3 *>(*sdi);
|
|
||||||
lg->WriteLocalMakefileTargets(ruleFileStream,all_depends);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmLocalUnixMakefileGenerator3::CreateJumpCommand(std::vector<std::string>& commands,
|
void cmLocalUnixMakefileGenerator3::CreateJumpCommand(std::vector<std::string>& commands,
|
||||||
@ -3136,7 +3155,9 @@ cmLocalUnixMakefileGenerator3
|
|||||||
// Add the target.
|
// Add the target.
|
||||||
if (tgt && tgt[0] != '\0')
|
if (tgt && tgt[0] != '\0')
|
||||||
{
|
{
|
||||||
cmd += tgt;
|
std::string tgt2 = m_GlobalGenerator->ConvertToHomeRelativeOutputPath(tgt);
|
||||||
|
tgt2 = this->ConvertToMakeTarget(tgt2.c_str());
|
||||||
|
cmd += tgt2;
|
||||||
}
|
}
|
||||||
return cmd;
|
return cmd;
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ public:
|
|||||||
void WriteMainTargetIncludes(std::ostream& makefileStream,const char *file,
|
void WriteMainTargetIncludes(std::ostream& makefileStream,const char *file,
|
||||||
const char *rule);
|
const char *rule);
|
||||||
void WriteMainTargetRules(std::ostream& makefileStream,const char *file,
|
void WriteMainTargetRules(std::ostream& makefileStream,const char *file,
|
||||||
const char *rule);
|
const char *rule, bool inAll);
|
||||||
|
|
||||||
|
|
||||||
void WriteSpecialTargetsBottom(std::ostream& makefileStream);
|
void WriteSpecialTargetsBottom(std::ostream& makefileStream);
|
||||||
@ -148,8 +148,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
// write the target rules for the local Makefile into the stream
|
// write the target rules for the local Makefile into the stream
|
||||||
void WriteLocalMakefileTargets(std::ostream& ruleFileStream,
|
void WriteLocalMakefileTargets(std::ostream& ruleFileStream);
|
||||||
std::vector<std::string>& all_depends);
|
|
||||||
|
|
||||||
// create the cd to home commands
|
// create the cd to home commands
|
||||||
void CreateJumpCommand(std::vector<std::string>& commands, std::string & localName);
|
void CreateJumpCommand(std::vector<std::string>& commands, std::string & localName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user