From d1efed14154a708f3b72bdff8f8dbe4a4927bc6e Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 6 Jan 2004 16:18:38 -0500 Subject: ENH: fix for hp make and relative paths never have targets with a ./ at the start of the name --- Source/cmLocalGenerator.cxx | 11 +++++++++++ Source/cmLocalUnixMakefileGenerator.cxx | 8 +------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index e3454ba..9630421 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -192,5 +192,16 @@ std::string cmLocalGenerator::ConvertToRelativeOutputPath(const char* p) } } ret = cmSystemTools::ConvertToOutputPath(ret.c_str()); + if(ret.size() > 2 && + (ret[0] == '.') && + ( (ret[1] == '/') || ret[1] == '\\')) + { + std::string upath = ret; + cmSystemTools::ConvertToUnixSlashes(upath); + if(upath.find(2, '/') == upath.npos) + { + ret = ret.substr(2, ret.size()-2); + } + } return ret; } diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index af4ddf6..8df2be5 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -1325,13 +1325,7 @@ void cmLocalUnixMakefileGenerator::OutputExecutableRule(std::ostream& fout, target = this->ConvertToRelativeOutputPath(target.c_str()); cmSystemTools::ConvertToUnixSlashes(target); bool needsLocalTarget = false; - unsigned int startPos = 2; - if(m_Makefile->GetDefinition("BORLAND")) - { - // the borland makefiles treat .\target and target as different - // targets. All other makes treat them the same - startPos = 0; - } + unsigned int startPos = 0; if(target.find('/', startPos) != target.npos) { needsLocalTarget = true; -- cgit v0.12