diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx index 6c209522d..950d44009 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.cxx +++ b/Source/cmGlobalBorlandMakefileGenerator.cxx @@ -49,6 +49,7 @@ cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator() lg->SetUnixCD(false); lg->SetMakeCommandEscapeTargetTwice(true); lg->SetBorlandMakeCurlyHack(true); + lg->SetNoMultiOutputMultiDepRules(true); return lg; } diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 56b2b9709..812ded32d 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -92,6 +92,7 @@ cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3() this->SkipAssemblySourceRules = false; this->MakeCommandEscapeTargetTwice = false; this->BorlandMakeCurlyHack = false; + this->NoMultiOutputMultiDepRules = false; } //---------------------------------------------------------------------------- @@ -696,6 +697,19 @@ cmLocalUnixMakefileGenerator3 // No dependencies. The commands will always run. os << cmMakeSafe(tgt) << space << ":\n"; } + else if(this->NoMultiOutputMultiDepRules && outputs.size() >= 2) + { + // Borland make does not understand multiple dependency rules when + // there are multiple outputs, so write them all on one line. + os << cmMakeSafe(tgt) << space << ":"; + for(std::vector::const_iterator dep = depends.begin(); + dep != depends.end(); ++dep) + { + replace = this->Convert(*dep, HOME_OUTPUT, MAKERULE); + os << " " << cmMakeSafe(replace); + } + os << "\n"; + } else { // Split dependencies into multiple rule lines. This allows for diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 65265ce08..7c8e27f49 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -161,6 +161,9 @@ public: void SetBorlandMakeCurlyHack(bool b) { this->BorlandMakeCurlyHack = b; } + void SetNoMultiOutputMultiDepRules(bool b) + { this->NoMultiOutputMultiDepRules = b; } + // used in writing out Cmake files such as WriteDirectoryInformation static void WriteCMakeArgument(std::ostream& os, const char* s); @@ -345,6 +348,7 @@ private: bool PassMakeflags; bool MakeCommandEscapeTargetTwice; bool BorlandMakeCurlyHack; + bool NoMultiOutputMultiDepRules; //========================================================================== std::string HomeRelativeOutputPath;