summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2004-10-15 12:57:32 (GMT)
committerBrad King <brad.king@kitware.com>2004-10-15 12:57:32 (GMT)
commit4b20a7ad2d7ab259d75ac35309c8c27fbdc62f40 (patch)
treed764703cc7b3015be0a37649294e2334ae57a474 /Source
parent39f112b71b375e627093a23b210896f058a72e9b (diff)
downloadCMake-4b20a7ad2d7ab259d75ac35309c8c27fbdc62f40.zip
CMake-4b20a7ad2d7ab259d75ac35309c8c27fbdc62f40.tar.gz
CMake-4b20a7ad2d7ab259d75ac35309c8c27fbdc62f40.tar.bz2
ENH: Added generation of rule to build object file.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalUnixMakefileGenerator2.cxx62
1 files changed, 59 insertions, 3 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator2.cxx b/Source/cmLocalUnixMakefileGenerator2.cxx
index fc96247..e603849 100644
--- a/Source/cmLocalUnixMakefileGenerator2.cxx
+++ b/Source/cmLocalUnixMakefileGenerator2.cxx
@@ -106,7 +106,7 @@ void cmLocalUnixMakefileGenerator2::GenerateMakefile()
{
std::vector<std::string> depends;
std::vector<std::string> commands;
- //commands.push_back(runRule);
+ commands.push_back(runRule);
commands.push_back(depRule);
commands.push_back(allRule);
this->OutputMakeRule(
@@ -343,6 +343,46 @@ cmLocalUnixMakefileGenerator2
this->OutputMakeRule(ruleFileStream, depComment.c_str(), depTarget.c_str(),
depends, commands);
}
+
+ // Write the requires rule.
+ {
+ std::vector<std::string> depends;
+ std::vector<std::string> commands;
+ std::string reqComment = "requirements for ";
+ reqComment += target.GetName();
+ std::string reqTarget = target.GetName();
+ reqTarget += ".requires";
+ for(std::vector<std::string>::const_iterator obj = objects.begin();
+ obj != objects.end(); ++obj)
+ {
+ depends.push_back(*obj);
+ }
+ depends.push_back(ruleFileName);
+ this->OutputMakeRule(ruleFileStream, reqComment.c_str(), reqTarget.c_str(),
+ depends, commands);
+ }
+
+#if 0
+ // Write the build rule.
+ {
+ std::vector<std::string> depends;
+ std::vector<std::string> commands;
+ std::string buildComment = " target ";
+ buildComment += objName;
+ for(std::vector<std::string>::const_iterator obj = objects.begin();
+ obj != objects.end(); ++obj)
+ {
+ depends.push_back(*obj);
+ }
+ depends.push_back(ruleFileName);
+ std::string touchCmd = "@touch ";
+ touchCmd += this->ConvertToRelativeOutputPath(obj.c_str());
+ // TODO: Construct build rule and append command.
+ commands.push_back(touchCmd);
+ this->OutputMakeRule(ruleFileStream, buildComment.c_str(), obj.c_str(),
+ depends, commands);
+ }
+#endif
}
//----------------------------------------------------------------------------
@@ -398,13 +438,13 @@ cmLocalUnixMakefileGenerator2
<< "\n\n";
// Write the dependency generation rule.
+ std::string depTarget = obj;
+ depTarget += ".depends";
{
std::vector<std::string> depends;
std::vector<std::string> commands;
std::string depComment = "dependencies for ";
depComment += objName;
- std::string depTarget = obj;
- depTarget += ".depends";
depends.push_back(source.GetFullPath());
depends.push_back(ruleFileName);
std::string touchCmd = "@touch ";
@@ -414,6 +454,22 @@ cmLocalUnixMakefileGenerator2
this->OutputMakeRule(ruleFileStream, depComment.c_str(), depTarget.c_str(),
depends, commands);
}
+
+ // Write the build rule.
+ {
+ std::vector<std::string> depends;
+ std::vector<std::string> commands;
+ std::string buildComment = "object ";
+ buildComment += objName;
+ depends.push_back(depTarget);
+ depends.push_back(ruleFileName);
+ std::string touchCmd = "@touch ";
+ touchCmd += this->ConvertToRelativeOutputPath(obj.c_str());
+ // TODO: Construct build rule and append command.
+ commands.push_back(touchCmd);
+ this->OutputMakeRule(ruleFileStream, buildComment.c_str(), obj.c_str(),
+ depends, commands);
+ }
}
//----------------------------------------------------------------------------