From 4b20a7ad2d7ab259d75ac35309c8c27fbdc62f40 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 15 Oct 2004 08:57:32 -0400 Subject: ENH: Added generation of rule to build object file. --- Source/cmLocalUnixMakefileGenerator2.cxx | 62 ++++++++++++++++++++++++++++++-- 1 file 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 depends; std::vector 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 depends; + std::vector commands; + std::string reqComment = "requirements for "; + reqComment += target.GetName(); + std::string reqTarget = target.GetName(); + reqTarget += ".requires"; + for(std::vector::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 depends; + std::vector commands; + std::string buildComment = " target "; + buildComment += objName; + for(std::vector::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 depends; std::vector 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 depends; + std::vector 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); + } } //---------------------------------------------------------------------------- -- cgit v0.12