ENH: undo change that broke borland 5.6 cont

This commit is contained in:
Bill Hoffman 2006-08-01 19:52:12 -04:00
parent fe5a6e9413
commit 16e73643f3
2 changed files with 22 additions and 39 deletions

View File

@ -275,15 +275,34 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
gg->WriteConvenienceRules(ruleFileStream,emittedTargets); gg->WriteConvenienceRules(ruleFileStream,emittedTargets);
} }
std::vector<std::string> depends;
std::vector<std::string> commands;
// now write out the object rules // now write out the object rules
// for each object file name // for each object file name
for (std::map<cmStdString,std::vector<cmTarget *> >::iterator lo = for (std::map<cmStdString,std::vector<cmTarget *> >::iterator lo =
this->LocalObjectFiles.begin(); this->LocalObjectFiles.begin();
lo != this->LocalObjectFiles.end(); ++lo) lo != this->LocalObjectFiles.end(); ++lo)
{ {
this->WriteObjectConvenienceRule(ruleFileStream, commands.clear();
"target to build an object file", // for each target using the object file
lo->first.c_str(), lo->second); for (std::vector<cmTarget *>::iterator to =
lo->second.begin(); to != lo->second.end(); ++to)
{
std::string tgtMakefileName = this->GetRelativeTargetDirectory(**to);
std::string targetName = tgtMakefileName;
tgtMakefileName += "/build.make";
targetName += "/";
targetName += lo->first.c_str();
commands.push_back(this->GetRecursiveMakeCall
(tgtMakefileName.c_str(),targetName.c_str()));
this->CreateCDCommand(commands,
this->Makefile->GetHomeOutputDirectory(),
this->Makefile->GetStartOutputDirectory());
}
this->WriteMakeRule(ruleFileStream,
"target for object file",
lo->first.c_str(), depends, commands, false);
} }
// add a help target as long as there isn;t a real target named help // add a help target as long as there isn;t a real target named help
@ -297,38 +316,6 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
this->WriteSpecialTargetsBottom(ruleFileStream); this->WriteSpecialTargetsBottom(ruleFileStream);
} }
//----------------------------------------------------------------------------
void
cmLocalUnixMakefileGenerator3
::WriteObjectConvenienceRule(std::ostream& ruleFileStream,
const char* output, const char* comment,
std::vector<cmTarget*>& targets)
{
// Recursively make the rule for each target using the object file.
std::vector<std::string> commands;
for(std::vector<cmTarget*>::iterator t = targets.begin();
t != targets.end(); ++t)
{
std::string tgtMakefileName = this->GetRelativeTargetDirectory(**t);
std::string targetName = tgtMakefileName;
tgtMakefileName += "/build.make";
targetName += "/";
targetName += output;
commands.push_back(
this->GetRecursiveMakeCall(tgtMakefileName.c_str(), targetName.c_str())
);
this->CreateCDCommand(commands,
this->Makefile->GetHomeOutputDirectory(),
this->Makefile->GetStartOutputDirectory());
}
// Write the rule to the makefile.
std::vector<std::string> no_depends;
this->WriteMakeRule(ruleFileStream, comment,
output, no_depends, commands, true);
}
//----------------------------------------------------------------------------
void cmLocalUnixMakefileGenerator3 void cmLocalUnixMakefileGenerator3
::WriteLocalMakefileTargets(std::ostream& ruleFileStream, ::WriteLocalMakefileTargets(std::ostream& ruleFileStream,
std::set<cmStdString> &emitted) std::set<cmStdString> &emitted)

View File

@ -223,7 +223,6 @@ protected:
void WriteLocalMakefile(); void WriteLocalMakefile();
// write the target rules for the local Makefile into the stream // write the target rules for the local Makefile into the stream
void WriteLocalMakefileTargets(std::ostream& ruleFileStream, void WriteLocalMakefileTargets(std::ostream& ruleFileStream,
std::set<cmStdString> &emitted); std::set<cmStdString> &emitted);
@ -268,9 +267,6 @@ protected:
void WriteTargetRequiresRule(std::ostream& ruleFileStream, void WriteTargetRequiresRule(std::ostream& ruleFileStream,
cmTarget& target, cmTarget& target,
const std::vector<std::string>& objects); const std::vector<std::string>& objects);
void WriteObjectConvenienceRule(std::ostream& ruleFileStream,
const char* comment, const char* output,
std::vector<cmTarget*>& targets);
std::string GetObjectFileName(cmTarget& target, std::string GetObjectFileName(cmTarget& target,
const cmSourceFile& source, const cmSourceFile& source,