diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2002-04-10 20:45:06 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2002-04-10 20:45:06 (GMT) |
commit | b26be30740de0320258c1152d88aaeadb849b199 (patch) | |
tree | 9973657b269a6933f84b610c66fe4de4f85d7db1 /Source/cmUnixMakefileGenerator.cxx | |
parent | 7fc1bd128155f49434d79acb912c0b733a233759 (diff) | |
download | CMake-b26be30740de0320258c1152d88aaeadb849b199.zip CMake-b26be30740de0320258c1152d88aaeadb849b199.tar.gz CMake-b26be30740de0320258c1152d88aaeadb849b199.tar.bz2 |
Fix problem with custom commands on unix
Diffstat (limited to 'Source/cmUnixMakefileGenerator.cxx')
-rw-r--r-- | Source/cmUnixMakefileGenerator.cxx | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index cb51514..417fb3b 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -1386,12 +1386,15 @@ void cmUnixMakefileGenerator::OutputCustomRules(std::ostream& fout) tgt->second.GetCustomCommands().begin(); cr != tgt->second.GetCustomCommands().end(); ++cr) { - cmSourceGroup& sourceGroup = - m_Makefile->FindSourceGroup(cr->GetSourceName().c_str(), - sourceGroups); - cmCustomCommand cc(*cr); - cc.ExpandVariables(*m_Makefile); - sourceGroup.AddCustomCommand(cc); + if ( cr->GetSourceName() != tgt->first ) + { + cmSourceGroup& sourceGroup = + m_Makefile->FindSourceGroup(cr->GetSourceName().c_str(), + sourceGroups); + cmCustomCommand cc(*cr); + cc.ExpandVariables(*m_Makefile); + sourceGroup.AddCustomCommand(cc); + } } } @@ -2044,7 +2047,9 @@ void cmUnixMakefileGenerator::OutputMakeRule(std::ostream& fout, if(replace[0] != '-' && replace.find("echo") != 0 && replace.find("$(MAKE)") != 0) { - fout << "\t" << "echo \"" << replace.c_str() << "\"\n"; + std::string echostring = replace; + cmSystemTools::ReplaceString(echostring, "\n", "\\n"); + fout << "\t" << "echo \"" << echostring.c_str() << "\"\n"; } fout << "\t" << replace.c_str() << "\n"; } @@ -2055,7 +2060,9 @@ void cmUnixMakefileGenerator::OutputMakeRule(std::ostream& fout, if(replace[0] != '-' && replace.find("echo") != 0 && replace.find("$(MAKE)") != 0) { - fout << "\t" << "echo \"" << replace.c_str() << "\"\n"; + std::string echostring = replace; + cmSystemTools::ReplaceString(echostring, "\n", "\\n"); + fout << "\t" << "echo \"" << echostring.c_str() << "\"\n"; } fout << "\t" << replace.c_str() << "\n"; } @@ -2066,7 +2073,9 @@ void cmUnixMakefileGenerator::OutputMakeRule(std::ostream& fout, if(replace[0] != '-' && replace.find("echo") != 0 && replace.find("$(MAKE)") != 0) { - fout << "\t" << "echo \"" << replace.c_str() << "\"\n"; + std::string echostring = replace; + cmSystemTools::ReplaceString(echostring, "\n", "\\n"); + fout << "\t" << "echo \"" << echostring.c_str() << "\"\n"; } fout << "\t" << replace.c_str() << "\n"; } @@ -2077,7 +2086,9 @@ void cmUnixMakefileGenerator::OutputMakeRule(std::ostream& fout, if(replace[0] != '-' && replace.find("echo") != 0 && replace.find("$(MAKE)") != 0) { - fout << "\t" << "echo \"" << replace.c_str() << "\"\n"; + std::string echostring = replace; + cmSystemTools::ReplaceString(echostring, "\n", "\\n"); + fout << "\t" << "echo \"" << echostring.c_str() << "\"\n"; } fout << "\t" << replace.c_str() << "\n"; } |