summaryrefslogtreecommitdiffstats
path: root/Source/cmNMakeMakefileGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-11-15 22:11:26 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-11-15 22:11:26 (GMT)
commit407afb906c6f3627d14acd959fb518d16caa5d7b (patch)
treed54bf9fbdaceddb600e45c262aab4f8c8b400c20 /Source/cmNMakeMakefileGenerator.cxx
parenta6f5f8395ce28d50f28ce322f53c4390214ff956 (diff)
downloadCMake-407afb906c6f3627d14acd959fb518d16caa5d7b.zip
CMake-407afb906c6f3627d14acd959fb518d16caa5d7b.tar.gz
CMake-407afb906c6f3627d14acd959fb518d16caa5d7b.tar.bz2
closer to nmake working, added CMAKE_MAKE_COMMAND instead of MAKECOMMAND used by Dart, nmake makefiles work with borland make and nmake
Diffstat (limited to 'Source/cmNMakeMakefileGenerator.cxx')
-rw-r--r--Source/cmNMakeMakefileGenerator.cxx51
1 files changed, 47 insertions, 4 deletions
diff --git a/Source/cmNMakeMakefileGenerator.cxx b/Source/cmNMakeMakefileGenerator.cxx
index 0964326..00e90f6 100644
--- a/Source/cmNMakeMakefileGenerator.cxx
+++ b/Source/cmNMakeMakefileGenerator.cxx
@@ -137,7 +137,7 @@ void cmNMakeMakefileGenerator::BuildInSubDirectory(std::ostream& fout,
cmSystemTools::ConvertToWindowsSlashes(dir);
fout << "\tif not exist " << dir.c_str() << " "
<< "$(MAKE) rebuild_cache\n"
- << "\tcd \".\\" << directory << "\"\n"
+ << "\tcd .\\" << directory << "\n"
<< "\t$(MAKE) -$(MAKEFLAGS) " << target1 << "\n";
}
if(target2)
@@ -146,7 +146,7 @@ void cmNMakeMakefileGenerator::BuildInSubDirectory(std::ostream& fout,
}
std::string currentDir = m_Makefile->GetCurrentOutputDirectory();
cmSystemTools::ConvertToWindowsSlashes(currentDir);
- fout << "\tcd \"" << currentDir.c_str() << "\"\n";
+ fout << "\tcd " << currentDir.c_str() << "\n";
}
// This needs to be overriden because nmake requires commands to be quoted
@@ -235,11 +235,15 @@ OutputBuildObjectFromSource(std::ostream& fout,
bool shared)
{
std::string comment = "Build ";
- std::string objectFile = std::string(shortName) + ".obj";
+ std::string objectFile = std::string(shortName) +
+ this->GetOutputExtension(source.GetSourceExtension().c_str());
+ std::cerr << "short name objectfile " << objectFile.c_str() << " " << shortName << "\n";
+
comment += objectFile + " From ";
comment += source.GetFullPath();
std::string compileCommand;
std::string ext = source.GetSourceExtension();
+ std::cerr << "ext " << ext.c_str() << "\n";
if(ext == "c" )
{
compileCommand = "$(CMAKE_C_COMPILER) $(CMAKE_CFLAGS) ";
@@ -255,12 +259,23 @@ OutputBuildObjectFromSource(std::ostream& fout,
}
else if (ext == "rc")
{
- std::cerr << "rc file " << source.GetFullPath() << "\n";
+ compileCommand = "$(RC) /fo\"";
+ compileCommand += objectFile;
+ compileCommand += "\" ";
+ compileCommand += source.GetFullPath();
}
else if (ext == "def")
{
std::cerr << "def file " << source.GetFullPath() << "\n";
}
+ else if (ext == "ico")
+ {
+ std::cerr << "ico file " << source.GetFullPath() << "\n";
+ }
+ else if (ext == "rc2")
+ {
+ std::cerr << "rc2 file " << source.GetFullPath() << "\n";
+ }
// assume c++ if not c rc or def
else
{
@@ -348,6 +363,11 @@ void cmNMakeMakefileGenerator::OutputExecutableRule(std::ostream& fout,
command += "$(" + std::string(name) + "_SRC_OBJS) ";
command += " /Fe" + m_ExecutableOutputPath + name;
command += ".exe /link ";
+ if(t.GetType() == cmTarget::WIN32_EXECUTABLE)
+ {
+ command += " /subsystem:windows ";
+ }
+
std::strstream linklibs;
this->OutputLinkLibraries(linklibs, 0, t);
linklibs << std::ends;
@@ -412,3 +432,26 @@ void cmNMakeMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
fout << linkLibs << "$(CMAKE_STANDARD_WINDOWS_LIBRARIES) ";
}
}
+
+
+std::string cmNMakeMakefileGenerator::GetOutputExtension(const char* s)
+{
+ std::string sourceExtension = s;
+ if(sourceExtension == "def" || sourceExtension == "ico" || sourceExtension == "rc2")
+ {
+ return "";
+ }
+ if(sourceExtension == "rc")
+ {
+ return ".res";
+ }
+ return ".obj";
+}
+
+
+void cmNMakeMakefileGenerator::OutputIncludeMakefile(std::ostream& fout,
+ const char* file)
+{
+ fout << "!include " << file << "\n";
+}
+