diff options
Diffstat (limited to 'Source/cmUnixMakefileGenerator.cxx')
-rw-r--r-- | Source/cmUnixMakefileGenerator.cxx | 64 |
1 files changed, 41 insertions, 23 deletions
diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index 1bd39ec..584dba8 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -291,17 +291,20 @@ void cmUnixMakefileGenerator::OutputTargetRules(std::ostream& fout) { if(l->second.GetType() == cmTarget::STATIC_LIBRARY) { - fout << " \\\n" << m_LibraryOutputPath << "lib" << l->first.c_str() - << ".a"; + fout << " \\\n" << m_LibraryOutputPath << m_LibraryPrefix + << l->first.c_str() + << m_StaticLibraryExtension; } else if(l->second.GetType() == cmTarget::SHARED_LIBRARY) { - fout << " \\\n" << m_LibraryOutputPath << "lib" << l->first.c_str() + fout << " \\\n" << m_LibraryOutputPath << m_LibraryPrefix + << l->first.c_str() << m_Makefile->GetDefinition("CMAKE_SHLIB_SUFFIX"); } else if(l->second.GetType() == cmTarget::MODULE_LIBRARY) { - fout << " \\\n" << m_LibraryOutputPath << "lib" << l->first.c_str() + fout << " \\\n" << m_LibraryOutputPath << m_LibraryPrefix + << l->first.c_str() << m_Makefile->GetDefinition("CMAKE_MODULE_SUFFIX"); } } @@ -792,18 +795,19 @@ void cmUnixMakefileGenerator::OutputLibDepend(std::ostream& fout, if(m_LibraryOutputPath.size()) { libpath = m_LibraryOutputPath; - libpath += "lib"; + libpath += m_LibraryPrefix; } else { - libpath += "/lib"; + libpath += "/"; + libpath += m_LibraryPrefix; } } else { // library is in current Makefile so use lib as a prefix libpath = m_LibraryOutputPath; - libpath += "lib"; + libpath += m_LibraryPrefix; } // add the library name libpath += name; @@ -821,7 +825,7 @@ void cmUnixMakefileGenerator::OutputLibDepend(std::ostream& fout, } else { - libpath += ".a"; + libpath += m_StaticLibraryExtension; } fout << libpath << " "; } @@ -1043,16 +1047,22 @@ void cmUnixMakefileGenerator::OutputCustomRules(std::ostream& fout) // with no outputs if(commandFiles.m_Outputs.size() == 0) { - fout << source.c_str() << ": "; - // Write out all the dependencies for this rule. - for(std::set<std::string>::const_iterator d = - commandFiles.m_Depends.begin(); - d != commandFiles.m_Depends.end(); ++d) - { - std::string dep = cmSystemTools::EscapeSpaces(d->c_str()); - fout << " " << dep.c_str(); - } - fout << "\n\t" << command.c_str() << "\n\n"; + std::string depends; + // collect out all the dependencies for this rule. + for(std::set<std::string>::const_iterator d = + commandFiles.m_Depends.begin(); + d != commandFiles.m_Depends.end(); ++d) + { + std::string dep = cmSystemTools::EscapeSpaces(d->c_str()); + depends += " "; + depends += dep; + } + // output rule + this->OutputMakeRule(fout, + "Custom command", + source.c_str(), + depends.c_str(), + command.c_str()); } // Write a rule for every output generated by this command. for(std::set<std::string>::const_iterator output = @@ -1060,16 +1070,23 @@ void cmUnixMakefileGenerator::OutputCustomRules(std::ostream& fout) output != commandFiles.m_Outputs.end(); ++output) { std::string src = cmSystemTools::EscapeSpaces(source.c_str()); - fout << output->c_str() << ": " << src.c_str(); - // Write out all the dependencies for this rule. + std::string depends; + depends += src; + // Collect out all the dependencies for this rule. for(std::set<std::string>::const_iterator d = commandFiles.m_Depends.begin(); d != commandFiles.m_Depends.end(); ++d) { std::string dep = cmSystemTools::EscapeSpaces(d->c_str()); - fout << " " << dep.c_str(); - } - fout << "\n\t" << command.c_str() << "\n\n"; + depends += " "; + depends += dep; + } + // output rule + this->OutputMakeRule(fout, + "Custom command", + output->c_str(), + depends.c_str(), + command.c_str()); } } } @@ -1510,6 +1527,7 @@ void cmUnixMakefileGenerator::OutputSourceObjectBuildRules(std::ostream& fout) sourceName = source->GetFullPath(); shortName = cmSystemTools::GetFilenameName(source->GetSourceName()); } + shortName += source->GetSourceExtension(); // Only output a rule for each .o once. if(rules.find(shortName) == rules.end()) { |