BUG: Fixed ordering of code generated in Makefile and build.make files to make sure .SUFFIXES rule comes as early as possible. Also cleaned up documentation in generated files.

This commit is contained in:
Brad King 2006-09-08 10:42:14 -04:00
parent cff915cb8e
commit 76f6ea8011
3 changed files with 40 additions and 35 deletions

View File

@ -215,8 +215,6 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
"The main recursive preinstall target", "preinstall", "The main recursive preinstall target", "preinstall",
depends, no_commands, true); depends, no_commands, true);
lg->WriteMakeVariables(makefileStream);
// Write out the "special" stuff // Write out the "special" stuff
lg->WriteSpecialTargetsTop(makefileStream); lg->WriteSpecialTargetsTop(makefileStream);

View File

@ -256,12 +256,6 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
ruleFileStream.SetCopyIfDifferent(true); ruleFileStream.SetCopyIfDifferent(true);
} }
// Include the progress variables for the target.
ruleFileStream
<< "# Include the progress variables for this target.\n"
<< this->IncludeDirective << " "
<< "progress.make\n\n";
// write the all rules // write the all rules
this->WriteLocalAllRules(ruleFileStream); this->WriteLocalAllRules(ruleFileStream);
@ -701,15 +695,28 @@ cmLocalUnixMakefileGenerator3
<< "# Special targets provided by cmake.\n" << "# Special targets provided by cmake.\n"
<< "\n"; << "\n";
std::vector<std::string> no_commands;
std::vector<std::string> no_depends;
// Special target to cleanup operation of make tool.
// This should be the first target except for the default_target in
// the interface Makefile.
this->WriteMakeRule(
makefileStream, "Disable implicit rules so canoncical targets will work.",
".SUFFIXES", no_depends, no_commands, false);
// Add a fake suffix to keep HP happy. Must be max 32 chars for SGI make.
std::vector<std::string> depends;
depends.push_back(".hpux_make_needs_suffix_list");
this->WriteMakeRule(makefileStream, 0,
".SUFFIXES", depends, no_commands, false);
// Write special target to silence make output. This must be after // Write special target to silence make output. This must be after
// the default target in case VERBOSE is set (which changes the // the default target in case VERBOSE is set (which changes the
// name). The setting of CMAKE_VERBOSE_MAKEFILE to ON will cause a // name). The setting of CMAKE_VERBOSE_MAKEFILE to ON will cause a
// "VERBOSE=1" to be added as a make variable which will change the // "VERBOSE=1" to be added as a make variable which will change the
// name of this special target. This gives a make-time choice to // name of this special target. This gives a make-time choice to
// the user. // the user.
std::vector<std::string> commands;
std::vector<std::string> no_depends;
commands.clear();
if((this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE")) if((this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"))
|| (this->ForceVerboseMakefiles)) || (this->ForceVerboseMakefiles))
{ {
@ -728,28 +735,11 @@ cmLocalUnixMakefileGenerator3
"Suppress display of executed commands.", "Suppress display of executed commands.",
"$(VERBOSE).SILENT", "$(VERBOSE).SILENT",
no_depends, no_depends,
commands, false); no_commands, false);
} }
// Special symbolic target that never exists to force dependers to // Variables for reference by other rules.
// run their rules. this->WriteMakeVariables(makefileStream);
std::vector<std::string> depends;
this->WriteMakeRule
(makefileStream,
"A target that is always out of date.",
"cmake_force", depends, commands, true);
// Special target to cleanup operation of make tool.
this->WriteMakeRule
(makefileStream,
"Disable implicit rules so canoncical targets will work.",
".SUFFIXES",
depends, commands, false);
// Add a fake suffix to keep HP happy. Must be max 32 chars for SGI make.
depends.push_back(".hpux_make_needs_suffix_list");
this->WriteMakeRule(makefileStream, 0,
".SUFFIXES", depends, commands, false);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -793,7 +783,16 @@ void cmLocalUnixMakefileGenerator3
commands, true); commands, true);
} }
// Special symbolic target that never exists to force dependers to
// run their rules.
{
std::vector<std::string> no_depends;
std::vector<std::string> no_commands; std::vector<std::string> no_commands;
this->WriteMakeRule
(makefileStream,
"A target that is always out of date.",
"cmake_force", no_depends, no_commands, true);
}
} }
@ -1378,7 +1377,6 @@ void cmLocalUnixMakefileGenerator3
::WriteLocalAllRules(std::ostream& ruleFileStream) ::WriteLocalAllRules(std::ostream& ruleFileStream)
{ {
this->WriteDisclaimer(ruleFileStream); this->WriteDisclaimer(ruleFileStream);
this->WriteMakeVariables(ruleFileStream);
// Write the main entry point target. This must be the VERY first // Write the main entry point target. This must be the VERY first
// target so that make with no arguments will run it. // target so that make with no arguments will run it.
@ -1397,7 +1395,19 @@ void cmLocalUnixMakefileGenerator3
no_commands, true); no_commands, true);
} }
this->WriteSpecialTargetsTop(ruleFileStream);
// Include the progress variables for the target.
ruleFileStream
<< "# Include the progress variables for this target.\n"
<< this->IncludeDirective << " "
<< "progress.make\n\n";
// Write all global targets // Write all global targets
this->WriteDivider(ruleFileStream);
ruleFileStream
<< "# Targets provided globally by CMake.\n"
<< "\n";
cmTargets* targets = &(this->Makefile->GetTargets()); cmTargets* targets = &(this->Makefile->GetTargets());
cmTargets::iterator glIt; cmTargets::iterator glIt;
for ( glIt = targets->begin(); glIt != targets->end(); ++ glIt ) for ( glIt = targets->begin(); glIt != targets->end(); ++ glIt )
@ -1456,8 +1466,6 @@ void cmLocalUnixMakefileGenerator3
} }
} }
this->WriteSpecialTargetsTop(ruleFileStream);
std::vector<std::string> depends; std::vector<std::string> depends;
std::vector<std::string> commands; std::vector<std::string> commands;

View File

@ -105,7 +105,6 @@ void cmMakefileTargetGenerator::CreateRuleFile()
} }
this->LocalGenerator->WriteDisclaimer(*this->BuildFileStream); this->LocalGenerator->WriteDisclaimer(*this->BuildFileStream);
this->LocalGenerator->WriteSpecialTargetsTop(*this->BuildFileStream); this->LocalGenerator->WriteSpecialTargetsTop(*this->BuildFileStream);
this->LocalGenerator->WriteMakeVariables(*this->BuildFileStream);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------