summaryrefslogtreecommitdiffstats
path: root/Source/cmUnixMakefileGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-11-13 20:54:41 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-11-13 20:54:41 (GMT)
commit6220a187ba1e500442ce05efc16a3c0f016ed5cd (patch)
treee1728668db5094bb796db903a868443ee08ae99b /Source/cmUnixMakefileGenerator.cxx
parent274099f7ecb20bf3346abfd694705ea5ac411d2b (diff)
downloadCMake-6220a187ba1e500442ce05efc16a3c0f016ed5cd.zip
CMake-6220a187ba1e500442ce05efc16a3c0f016ed5cd.tar.gz
CMake-6220a187ba1e500442ce05efc16a3c0f016ed5cd.tar.bz2
clean up object file build rule, and do not attempt to remove link_directories that are in the build tree
Diffstat (limited to 'Source/cmUnixMakefileGenerator.cxx')
-rw-r--r--Source/cmUnixMakefileGenerator.cxx106
1 files changed, 58 insertions, 48 deletions
diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx
index 786a32e..59bf908 100644
--- a/Source/cmUnixMakefileGenerator.cxx
+++ b/Source/cmUnixMakefileGenerator.cxx
@@ -397,15 +397,6 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
libDir != libdirs.end(); ++libDir)
{
std::string libpath = cmSystemTools::EscapeSpaces(libDir->c_str());
- if (m_LibraryOutputPath.size())
- {
- if(m_LibraryOutputPath != libpath
- && (libpath.find(m_Makefile->GetHomeOutputDirectory())
- != std::string::npos))
- {
- emitted.insert(libpath);
- }
- }
if(emitted.insert(libpath).second)
{
std::string::size_type pos = libDir->find("-L");
@@ -422,7 +413,7 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
linkLibs += " ";
}
}
-
+
std::string librariesLinked;
const cmTarget::LinkLibraries& libs = tgt.GetLinkLibraries();
for(cmTarget::LinkLibraries::const_iterator lib = libs.begin();
@@ -646,8 +637,11 @@ void cmUnixMakefileGenerator::OutputTargets(std::ostream& fout)
this->OutputExecutableRule(fout, l->first.c_str(), l->second);
break;
case cmTarget::UTILITY:
+ // This is handled by the OutputCustomRules method
case cmTarget::INSTALL_FILES:
+ // This is handled by the OutputInstallRules method
case cmTarget::INSTALL_PROGRAMS:
+ // This is handled by the OutputInstallRules method
break;
}
}
@@ -1061,7 +1055,6 @@ void cmUnixMakefileGenerator::OutputCustomRules(std::ostream& fout)
fout << "# End of source group \"" << name.c_str() << "\"\n\n";
}
}
-
}
@@ -1387,6 +1380,55 @@ void cmUnixMakefileGenerator::OutputMakeRules(std::ostream& fout)
}
}
+void
+cmUnixMakefileGenerator::
+OutputBuildObjectFromSource(std::ostream& fout,
+ const char* shortName,
+ const cmSourceFile& source,
+ const char* extraCompileFlags,
+ bool shared)
+{
+
+ std::string comment = "Build ";
+ std::string objectFile = std::string(shortName) + ".o";
+ comment += objectFile + " From ";
+ comment += source.GetFullPath();
+ std::string compileCommand;
+ std::string ext = source.GetSourceExtension();
+ if(ext == "c" )
+ {
+ compileCommand = "$(CMAKE_C_COMPILER) $(CMAKE_CFLAGS) ";
+ compileCommand += extraCompileFlags;
+ if(shared)
+ {
+ compileCommand += "$(CMAKE_SHLIB_CFLAGS) ";
+ }
+ compileCommand += "$(INCLUDE_FLAGS) -c ";
+ compileCommand += source.GetFullPath();
+ compileCommand += " -o ";
+ compileCommand += objectFile;
+ }
+ else
+ {
+ compileCommand = "$(CMAKE_CXX_COMPILER) $(CMAKE_CXXFLAGS) ";
+ compileCommand += extraCompileFlags;
+ if(shared)
+ {
+ compileCommand += "$(CMAKE_SHLIB_CFLAGS) ";
+ }
+ compileCommand += "$(INCLUDE_FLAGS) -c ";
+ compileCommand += source.GetFullPath();
+ compileCommand += " -o ";
+ compileCommand += objectFile;
+ }
+ this->OutputMakeRule(fout,
+ comment.c_str(),
+ objectFile.c_str(),
+ source.GetFullPath().c_str(),
+ compileCommand.c_str());
+}
+
+
void cmUnixMakefileGenerator::OutputSourceObjectBuildRules(std::ostream& fout)
{
@@ -1446,43 +1488,11 @@ void cmUnixMakefileGenerator::OutputSourceObjectBuildRules(std::ostream& fout)
// Only output a rule for each .o once.
if(rules.find(shortName) == rules.end())
{
- std::string comment = "Build ";
- std::string objectFile = shortName + ".o";
- comment += objectFile + " From ";
- comment += source->GetFullPath();
- std::string compileCommand;
- std::string ext = source->GetSourceExtension();
- if(ext == "c" )
- {
- compileCommand = "$(CMAKE_C_COMPILER) $(CMAKE_CFLAGS) ";
- compileCommand += exportsDef;
- if(shared)
- {
- compileCommand += "$(CMAKE_SHLIB_CFLAGS) ";
- }
- compileCommand += "$(INCLUDE_FLAGS) -c ";
- compileCommand += source->GetFullPath();
- compileCommand += " -o ";
- compileCommand += objectFile;
- }
- else
- {
- compileCommand = "$(CMAKE_CXX_COMPILER) $(CMAKE_CXXFLAGS) ";
- compileCommand += exportsDef;
- if(shared)
- {
- compileCommand += "$(CMAKE_SHLIB_CFLAGS) ";
- }
- compileCommand += "$(INCLUDE_FLAGS) -c ";
- compileCommand += source->GetFullPath();
- compileCommand += " -o ";
- compileCommand += objectFile;
- }
- this->OutputMakeRule(fout,
- comment.c_str(),
- objectFile.c_str(),
- source->GetFullPath().c_str(),
- compileCommand.c_str());
+ this->OutputBuildObjectFromSource(fout,
+ shortName.c_str(),
+ *source,
+ exportsDef.c_str(),
+ shared);
rules.insert(shortName);
}
}