From 16e73643f3506f34164243b2f7816cba5cd4ad9a Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 1 Aug 2006 19:52:12 -0400 Subject: ENH: undo change that broke borland 5.6 cont --- Source/cmLocalUnixMakefileGenerator3.cxx | 57 ++++++++++++-------------------- Source/cmLocalUnixMakefileGenerator3.h | 4 --- 2 files changed, 22 insertions(+), 39 deletions(-) diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 549ecaf..fea2bd6 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -275,15 +275,34 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile() gg->WriteConvenienceRules(ruleFileStream,emittedTargets); } + std::vector depends; + std::vector commands; + // now write out the object rules // for each object file name for (std::map >::iterator lo = this->LocalObjectFiles.begin(); lo != this->LocalObjectFiles.end(); ++lo) { - this->WriteObjectConvenienceRule(ruleFileStream, - "target to build an object file", - lo->first.c_str(), lo->second); + commands.clear(); + // for each target using the object file + for (std::vector::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 @@ -297,38 +316,6 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile() this->WriteSpecialTargetsBottom(ruleFileStream); } -//---------------------------------------------------------------------------- -void -cmLocalUnixMakefileGenerator3 -::WriteObjectConvenienceRule(std::ostream& ruleFileStream, - const char* output, const char* comment, - std::vector& targets) -{ - // Recursively make the rule for each target using the object file. - std::vector commands; - for(std::vector::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 no_depends; - this->WriteMakeRule(ruleFileStream, comment, - output, no_depends, commands, true); -} - -//---------------------------------------------------------------------------- void cmLocalUnixMakefileGenerator3 ::WriteLocalMakefileTargets(std::ostream& ruleFileStream, std::set &emitted) diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index f83f102..7744e1b 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -223,7 +223,6 @@ protected: void WriteLocalMakefile(); - // write the target rules for the local Makefile into the stream void WriteLocalMakefileTargets(std::ostream& ruleFileStream, std::set &emitted); @@ -268,9 +267,6 @@ protected: void WriteTargetRequiresRule(std::ostream& ruleFileStream, cmTarget& target, const std::vector& objects); - void WriteObjectConvenienceRule(std::ostream& ruleFileStream, - const char* comment, const char* output, - std::vector& targets); std::string GetObjectFileName(cmTarget& target, const cmSourceFile& source, -- cgit v0.12