summaryrefslogtreecommitdiffstats
path: root/Source/cmUnixMakefileGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmUnixMakefileGenerator.cxx')
-rw-r--r--Source/cmUnixMakefileGenerator.cxx47
1 files changed, 35 insertions, 12 deletions
diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx
index 59bf908..94f8662 100644
--- a/Source/cmUnixMakefileGenerator.cxx
+++ b/Source/cmUnixMakefileGenerator.cxx
@@ -204,6 +204,10 @@ void cmUnixMakefileGenerator::OutputMakefile(const char* file)
return;
}
fout << "# CMAKE generated Makefile, DO NOT EDIT!\n"
+ << "# Generated by \"" << this->GetName() << "\""
+ << " Generator, CMake Version "
+ << cmMakefile::GetMajorVersion() << "."
+ << cmMakefile::GetMinorVersion() << "\n"
<< "# Generated from the following files:\n# "
<< m_Makefile->GetHomeOutputDirectory() << "/CMakeCache.txt\n";
std::vector<std::string> lfiles = m_Makefile->GetListFiles();
@@ -256,6 +260,12 @@ void cmUnixMakefileGenerator::OutputMakefile(const char* file)
}
this->OutputObjectDepends(dependout);
}
+ else
+ {
+ std::cout << "skipping depends\n";
+ }
+ std::cout << "hello\n";
+
this->OutputCustomRules(fout);
this->OutputMakeRules(fout);
this->OutputInstallRules(fout);
@@ -839,6 +849,27 @@ inline std::string FixDirectoryName(const char* dir)
return s;
}
+
+void cmUnixMakefileGenerator::BuildInSubDirectory(std::ostream& fout,
+ const char* directory,
+ const char* target1,
+ const char* target2)
+{
+ if(target1)
+ {
+ fout << "\t@if test ! -d " << directory
+ << "; then $(MAKE) rebuild_cache; fi\n"
+ "\tcd " << directory
+ << "; $(MAKE) -$(MAKEFLAGS) " << target1 << "\n";
+ }
+ if(target2)
+ {
+ fout << "\t@cd " << directory
+ << "; $(MAKE) -$(MAKEFLAGS) " << target2 << "\n";
+ }
+}
+
+
void
cmUnixMakefileGenerator::
OutputSubDirectoryVars(std::ostream& fout,
@@ -881,17 +912,8 @@ OutputSubDirectoryVars(std::ostream& fout,
fout << " " << target << "_" << fixed_d.c_str();
}
fout << "\n";
- if(target1)
- {
- fout << "\t@if test ! -d " << SubDirectories[i].c_str() << "; then $(MAKE) rebuild_cache; fi\n"
- "\tcd " << SubDirectories[i].c_str()
- << "; $(MAKE) -$(MAKEFLAGS) " << target1 << "\n";
- }
- if(target2)
- {
- fout << "\t@cd " << SubDirectories[i].c_str()
- << "; $(MAKE) -$(MAKEFLAGS) " << target2 << "\n";
- }
+ this->BuildInSubDirectory(fout, SubDirectories[i].c_str(),
+ target1, target2);
}
fout << "\n\n";
}
@@ -1080,7 +1102,8 @@ void cmUnixMakefileGenerator::RecursiveGenerateCacheOnly()
{
mf->AddDefinition("RUN_CONFIGURE", true);
}
- cmUnixMakefileGenerator* gen = new cmUnixMakefileGenerator;
+ cmUnixMakefileGenerator* gen =
+ static_cast<cmUnixMakefileGenerator*>(this->CreateObject());
gen->SetCacheOnlyOn();
gen->SetRecurseOff();
mf->SetMakefileGenerator(gen);