diff options
author | Sebastien Barre <sebastien.barre@kitware.com> | 2002-04-11 13:53:41 (GMT) |
---|---|---|
committer | Sebastien Barre <sebastien.barre@kitware.com> | 2002-04-11 13:53:41 (GMT) |
commit | e455a83969be5ff4642a9c505f2f1c23248b01f7 (patch) | |
tree | a40fe7fb31079af7e0c3d83776d801c8ac053e0d /Source/cmNMakeMakefileGenerator.cxx | |
parent | 9d0a4b8a5f45a6c8884c1a386c21b39bda9c3739 (diff) | |
download | CMake-e455a83969be5ff4642a9c505f2f1c23248b01f7.zip CMake-e455a83969be5ff4642a9c505f2f1c23248b01f7.tar.gz CMake-e455a83969be5ff4642a9c505f2f1c23248b01f7.tar.bz2 |
FIX: echo pb, make Nmake gen use Unix gen, factorize stuff in Unix gen
Diffstat (limited to 'Source/cmNMakeMakefileGenerator.cxx')
-rw-r--r-- | Source/cmNMakeMakefileGenerator.cxx | 97 |
1 files changed, 33 insertions, 64 deletions
diff --git a/Source/cmNMakeMakefileGenerator.cxx b/Source/cmNMakeMakefileGenerator.cxx index 9e55a03..27ef084 100644 --- a/Source/cmNMakeMakefileGenerator.cxx +++ b/Source/cmNMakeMakefileGenerator.cxx @@ -69,6 +69,10 @@ std::string cmNMakeMakefileGenerator::ShortPath(const char* path) // them back together std::string cmNMakeMakefileGenerator::ShortPathCommand(const char* command) { + if (!command) + { + return ""; + } if(!strchr(command, ' ')) { return command; @@ -248,78 +252,43 @@ void cmNMakeMakefileGenerator::OutputMakeRule(std::ostream& fout, const char* command3, const char* command4) { - if(!target) - { - cmSystemTools::Error("no target for OutputMakeRule"); - return; - } - - std::string replace; - if(comment) - { - replace = comment; - m_Makefile->ExpandVariablesInString(replace); - fout << "#---------------------------------------------------------\n"; - fout << "# " << comment; - fout << "\n#\n"; - } - fout << "\n"; - replace = target; - m_Makefile->ExpandVariablesInString(replace); - replace = this->ConvertToOutputPath(replace.c_str()); - fout << replace.c_str() << ": "; - if(depends) + std::string short_command; + if (command) { - replace = depends; - m_Makefile->ExpandVariablesInString(replace); - fout << replace.c_str(); + short_command = ShortPathCommand(command); + command = short_command.c_str(); } - fout << "\n"; - if(command) - { - replace = ShortPathCommand(command); - m_Makefile->ExpandVariablesInString(replace); - if(replace[0] != '-' && replace.find("echo") != 0 - && replace.find("$(MAKE)") != 0) - { - fout << "\t" << "echo " << replace.c_str() << "\n"; - } - fout << "\t" << replace.c_str() << "\n"; - } - if(command2) + + std::string short_command2; + if (command2) { - replace = ShortPathCommand(command2); - m_Makefile->ExpandVariablesInString(replace); - if(replace[0] != '-' && replace.find("echo") != 0 - && replace.find("$(MAKE)") != 0) - { - fout << "\t" << "echo " << replace.c_str() << "\n"; - } - fout << "\t" << replace.c_str() << "\n"; + short_command2 = ShortPathCommand(command2); + command2 = short_command2.c_str(); } - if(command3) + + std::string short_command3; + if (command3) { - replace = ShortPathCommand(command3); - m_Makefile->ExpandVariablesInString(replace); - if(replace[0] != '-' && replace.find("echo") != 0 - && replace.find("$(MAKE)") != 0) - { - fout << "\t" << "echo " << replace.c_str() << "\n"; - } - fout << "\t" << replace.c_str() << "\n"; + short_command3 = ShortPathCommand(command3); + command3 = short_command3.c_str(); } - if(command4) + + std::string short_command4; + if (command4) { - replace = ShortPathCommand(command4); - m_Makefile->ExpandVariablesInString(replace); - if(replace[0] != '-' && replace.find("echo") != 0 - && replace.find("$(MAKE)") != 0) - { - fout << "\t" << "echo " << replace.c_str() << "\n"; - } - fout << "\t" << replace.c_str() << "\n"; + short_command4 = ShortPathCommand(command4); + command4 = short_command4.c_str(); } - fout << "\n"; + + cmUnixMakefileGenerator::OutputMakeRule(fout, + comment, + target, + depends, + command, + command2, + command3, + command4); + return; } void |