ENH: some updates to the provides requires code

This commit is contained in:
Ken Martin 2005-05-16 10:53:02 -04:00
parent c2c0956c43
commit 1c95c08ccf
2 changed files with 28 additions and 3 deletions

View File

@ -185,6 +185,15 @@ bool cmDependsFortran::WriteDependencies(std::ostream& os)
os << "\t@touch " << m_TargetFile.c_str() << ".provides\n";
}
// if it provides something then connect the requires rule to the build rule
if(!parser.Provides.empty())
{
os << m_TargetFile.c_str() << ".requires: " << m_TargetFile.c_str()
<< ".requires.build" << std::endl;
// provide empty build rule for old gen for now, TODO remove later
os << m_TargetFile.c_str() << ".requires.build:" << std::endl;
}
/*
// TODO:
What about .mod files provided in another directory and found with a

View File

@ -625,15 +625,20 @@ cmLocalUnixMakefileGenerator3
// If the language needs provides-requires mode, create the
// corresponding targets.
std::string objectRequires = obj;
objectRequires += ".requires";
std::vector<std::string> no_commands;
// always provide an empty requires target
this->WriteMakeRule(ruleFileStream, 0,
objectRequires.c_str(), no_commands, no_commands);
if(strcmp(lang, "Fortran") == 0)
{
std::string objectRequires = obj;
std::string objectProvides = obj;
objectRequires += ".requires";
objectProvides += ".provides";
{
// Add the provides target to build the object file.
std::vector<std::string> no_commands;
std::vector<std::string> p_depends;
p_depends.push_back(obj);
this->WriteMakeRule(ruleFileStream, 0,
@ -642,7 +647,18 @@ cmLocalUnixMakefileGenerator3
// Add this to the set of provides-requires objects on the target.
provides_requires.push_back(objectRequires);
{
// Add the requires.build target to recursively build the provides
// target after needed information is up to date.
std::vector<std::string> no_depends;
std::vector<std::string> r_commands;
r_commands.push_back(this->GetRecursiveMakeCall("Makefile",objectProvides.c_str()));
objectRequires += ".build";
this->WriteMakeRule(ruleFileStream, 0,
objectRequires.c_str(), no_depends, r_commands);
}
}
}
//----------------------------------------------------------------------------