diff options
author | Ken Martin <ken.martin@kitware.com> | 2005-05-31 14:16:28 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2005-05-31 14:16:28 (GMT) |
commit | f79376c1d1211b60f2440a137ed0eeec2dc32677 (patch) | |
tree | 1751f1da3871e2e1177bd9d5dce84fbb891d653a /Source/cmGlobalUnixMakefileGenerator3.cxx | |
parent | d101f94f9bb9ef0ee3153cfe2bae209e61007b4a (diff) | |
download | CMake-f79376c1d1211b60f2440a137ed0eeec2dc32677.zip CMake-f79376c1d1211b60f2440a137ed0eeec2dc32677.tar.gz CMake-f79376c1d1211b60f2440a137ed0eeec2dc32677.tar.bz2 |
STYLE: add some better comments and remove some unused code
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 94 |
1 files changed, 32 insertions, 62 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index e5eb27c..f00af8d 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -99,9 +99,6 @@ void cmGlobalUnixMakefileGenerator3::Generate() // write the main makefile this->WriteMainMakefile(); this->WriteMainCMakefile(); - - // now write the support Makefiles - //this->WriteBuildMakefile(); } void cmGlobalUnixMakefileGenerator3::WriteMainMakefile() @@ -327,61 +324,6 @@ void cmGlobalUnixMakefileGenerator3 } } -void cmGlobalUnixMakefileGenerator3::WriteBuildMakefile() -{ - unsigned int i; - - // Open the output file. This should not be copy-if-different - // because the check-build-system step compares the makefile time to - // see if the build system must be regenerated. - std::string makefileName = this->GetCMakeInstance()->GetHomeOutputDirectory(); - makefileName += "/build.make"; - cmGeneratedFileStream makefileStream(makefileName.c_str()); - if(!makefileStream) - { - return; - } - - // get a local generator for some useful methods - cmLocalUnixMakefileGenerator3 *lg = - static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[0]); - - // Write the do not edit header. - lg->WriteDisclaimer(makefileStream); - lg->WriteMakeVariables(makefileStream); - - // add the generic dependency - std::vector<std::string> depends; - std::vector<std::string> no_commands; - lg->WriteMakeRule(makefileStream, 0, "build", depends, no_commands); - lg->WriteMakeRule(makefileStream, 0, "depend", depends, no_commands); - lg->WriteMakeRule(makefileStream, 0, "requires", depends, no_commands); - - // include all the target depends - for (i = 0; i < m_LocalGenerators.size(); ++i) - { - cmLocalUnixMakefileGenerator3 *lg2 = - static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]); - // are any parents excluded - bool exclude = false; - cmLocalGenerator *lg3 = lg2; - while (lg3) - { - if (lg3->GetExcludeAll()) - { - exclude = true; - break; - } - lg3 = lg3->GetParent(); - } - lg2->WriteMainTargetIncludes(makefileStream,"build.make","build"); - lg2->WriteMainTargetRules(makefileStream,"build.make","depend",!exclude); - lg2->WriteMainTargetRules(makefileStream,"build.make","requires",!exclude); - lg2->WriteMainTargetRules(makefileStream,"build.make","build",!exclude); - } -} - - //---------------------------------------------------------------------------- void cmGlobalUnixMakefileGenerator3 ::WriteAllRules(cmLocalUnixMakefileGenerator3 *lg, @@ -418,20 +360,25 @@ void cmGlobalUnixMakefileGenerator3 //---------------------------------------------------------------------------- void cmGlobalUnixMakefileGenerator3 -::WriteConvenienceRules(std::ostream& ruleFileStream, - cmLocalUnixMakefileGenerator3 *lg, - bool exclude) +::WriteDirectoryRules(std::ostream& ruleFileStream, + cmLocalUnixMakefileGenerator3 *lg) { std::vector<std::string> depends; std::vector<std::string> commands; std::string localName; std::string makeTargetName; - + depends.push_back("cmake_check_build_system"); if (lg->GetParent()) { std::string dir = lg->GetMakefile()->GetStartOutputDirectory(); dir = lg->Convert(dir.c_str(),cmLocalGenerator::HOME_OUTPUT,cmLocalGenerator::MAKEFILE); + + lg->WriteDivider(ruleFileStream); + ruleFileStream + << "# Directory level rules for directory " + << dir << "\n\n"; + localName = dir; localName += "/directorystart"; makeTargetName = dir; @@ -538,6 +485,24 @@ cmGlobalUnixMakefileGenerator3 lg->WriteMakeRule(ruleFileStream, "Convenience name for directory clean.", makeTargetName.c_str(), all_tgts, commands); } +} + +//---------------------------------------------------------------------------- +void +cmGlobalUnixMakefileGenerator3 +::WriteConvenienceRules(std::ostream& ruleFileStream, + cmLocalUnixMakefileGenerator3 *lg, + bool exclude) +{ + std::vector<std::string> depends; + std::vector<std::string> commands; + std::string localName; + std::string makeTargetName; + + // write the directory level rules for this local gen + this->WriteDirectoryRules(ruleFileStream,lg); + + depends.push_back("cmake_check_build_system"); // for each target Generate the rule files for each target. const cmTargets& targets = lg->GetMakefile()->GetTargets(); @@ -555,6 +520,11 @@ cmGlobalUnixMakefileGenerator3 std::string makefileName = localName; makefileName += "/build.make"; + lg->WriteDivider(ruleFileStream); + ruleFileStream + << "# Target rules for target " + << localName << "\n\n"; + commands.clear(); if (t->second.GetType() != cmTarget::UTILITY) { |