diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx
index 92ff314b8af69bbb766d8f0c585c1abbaf58ebc6..e4d9f107e9d7068341d3f839dd64a20f8272706d 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -25,19 +25,18 @@
 cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile(
         const std::string &input,
         cmsys::auto_ptr<cmCompiledGeneratorExpression> outputFileExpr,
-        cmMakefile *makefile,
         cmsys::auto_ptr<cmCompiledGeneratorExpression> condition,
         bool inputIsContent)
   : Input(input),
     OutputFileExpr(outputFileExpr),
-    Makefile(makefile),
     Condition(condition),
     InputIsContent(inputIsContent)
 {
 }
 
 //----------------------------------------------------------------------------
-void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
+void cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator* lg,
+              const std::string& config,
               const std::string& lang,
               cmCompiledGeneratorExpression* inputExpression,
               std::map<std::string, std::string> &outputFiles, mode_t perm)
@@ -45,7 +44,8 @@ void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
   std::string rawCondition = this->Condition->GetInput();
   if (!rawCondition.empty())
     {
-    std::string condResult = this->Condition->Evaluate(this->Makefile, config,
+    std::string condResult = this->Condition->Evaluate(lg->GetMakefile(),
+                                                       config,
                                                        false, 0, 0, 0, lang);
     if (condResult == "0")
       {
@@ -56,16 +56,17 @@ void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
       std::ostringstream e;
       e << "Evaluation file condition \"" << rawCondition << "\" did "
           "not evaluate to valid content. Got \"" << condResult << "\".";
-      this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+      lg->IssueMessage(cmake::FATAL_ERROR, e.str());
       return;
       }
     }
 
   const std::string outputFileName
-                    = this->OutputFileExpr->Evaluate(this->Makefile, config,
+                    = this->OutputFileExpr->Evaluate(lg->GetMakefile(), config,
                                                      false, 0, 0, 0, lang);
   const std::string outputContent
-                          = inputExpression->Evaluate(this->Makefile, config,
+                          = inputExpression->Evaluate(lg->GetMakefile(),
+                                                      config,
                                                       false, 0, 0, 0, lang);
 
   std::map<std::string, std::string>::iterator it
@@ -81,11 +82,11 @@ void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
     e << "Evaluation file to be written multiple times for different "
          "configurations or languages with different content:\n  "
       << outputFileName;
-    this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+    lg->IssueMessage(cmake::FATAL_ERROR, e.str());
     return;
     }
 
-  this->Makefile->AddCMakeOutputFile(outputFileName.c_str());
+  lg->GetMakefile()->AddCMakeOutputFile(outputFileName.c_str());
   this->Files.push_back(outputFileName);
   outputFiles[outputFileName] = outputContent;
 
@@ -100,18 +101,19 @@ void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
 
 //----------------------------------------------------------------------------
 void cmGeneratorExpressionEvaluationFile::CreateOutputFile(
-                                              std::string const& config)
+    cmLocalGenerator *lg, std::string const& config)
 {
   std::vector<std::string> enabledLanguages;
-  cmGlobalGenerator *gg = this->Makefile->GetGlobalGenerator();
+  cmGlobalGenerator *gg = lg->GetGlobalGenerator();
   gg->GetEnabledLanguages(enabledLanguages);
 
   for(std::vector<std::string>::const_iterator le = enabledLanguages.begin();
       le != enabledLanguages.end(); ++le)
     {
-    std::string name = this->OutputFileExpr->Evaluate(this->Makefile, config,
+    std::string name = this->OutputFileExpr->Evaluate(lg->GetMakefile(),
+                                                      config,
                                                       false, 0, 0, 0, *le);
-    cmSourceFile* sf = this->Makefile->GetOrCreateSource(name);
+    cmSourceFile* sf = lg->GetMakefile()->GetOrCreateSource(name);
     sf->SetProperty("GENERATED", "1");
 
     gg->SetFilenameTargetDepends(sf,
@@ -120,7 +122,7 @@ void cmGeneratorExpressionEvaluationFile::CreateOutputFile(
 }
 
 //----------------------------------------------------------------------------
-void cmGeneratorExpressionEvaluationFile::Generate()
+void cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator *lg)
 {
   mode_t perm = 0;
   std::string inputContent;
@@ -130,14 +132,14 @@ void cmGeneratorExpressionEvaluationFile::Generate()
     }
   else
     {
-    this->Makefile->AddCMakeDependFile(this->Input.c_str());
+    lg->GetMakefile()->AddCMakeDependFile(this->Input.c_str());
     cmSystemTools::GetPermissions(this->Input.c_str(), perm);
     cmsys::ifstream fin(this->Input.c_str());
     if(!fin)
       {
       std::ostringstream e;
       e << "Evaluation file \"" << this->Input << "\" cannot be read.";
-      this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+      lg->GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str());
       return;
       }
 
@@ -159,7 +161,7 @@ void cmGeneratorExpressionEvaluationFile::Generate()
   std::map<std::string, std::string> outputFiles;
 
   std::vector<std::string> allConfigs;
-  this->Makefile->GetConfigurations(allConfigs);
+  lg->GetMakefile()->GetConfigurations(allConfigs);
 
   if (allConfigs.empty())
     {
@@ -167,7 +169,7 @@ void cmGeneratorExpressionEvaluationFile::Generate()
     }
 
   std::vector<std::string> enabledLanguages;
-  cmGlobalGenerator *gg = this->Makefile->GetGlobalGenerator();
+  cmGlobalGenerator *gg = lg->GetGlobalGenerator();
   gg->GetEnabledLanguages(enabledLanguages);
 
   for(std::vector<std::string>::const_iterator le = enabledLanguages.begin();
@@ -176,7 +178,7 @@ void cmGeneratorExpressionEvaluationFile::Generate()
     for(std::vector<std::string>::const_iterator li = allConfigs.begin();
         li != allConfigs.end(); ++li)
       {
-      this->Generate(*li, *le, inputExpression.get(), outputFiles, perm);
+      this->Generate(lg, *li, *le, inputExpression.get(), outputFiles, perm);
       if(cmSystemTools::GetFatalErrorOccured())
         {
         return;
diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h
index 5d8b54c0a6119a98d87fd179346ccf6a2f5d149f..ad41274cad45a7a6253433e5e481ca56f1235af5 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.h
+++ b/Source/cmGeneratorExpressionEvaluationFile.h
@@ -18,31 +18,32 @@
 
 #include "cmGeneratorExpression.h"
 
+class cmLocalGenerator;
+
 //----------------------------------------------------------------------------
 class cmGeneratorExpressionEvaluationFile
 {
 public:
   cmGeneratorExpressionEvaluationFile(const std::string &input,
         cmsys::auto_ptr<cmCompiledGeneratorExpression> outputFileExpr,
-        cmMakefile *makefile,
         cmsys::auto_ptr<cmCompiledGeneratorExpression> condition,
         bool inputIsContent);
 
-  void Generate();
+  void Generate(cmLocalGenerator* lg);
 
   std::vector<std::string> GetFiles() const { return this->Files; }
 
-  void CreateOutputFile(std::string const& config);
+  void CreateOutputFile(cmLocalGenerator* lg, std::string const& config);
 
 private:
-  void Generate(const std::string& config, const std::string& lang,
-              cmCompiledGeneratorExpression* inputExpression,
-              std::map<std::string, std::string> &outputFiles, mode_t perm);
+  void Generate(cmLocalGenerator* lg, const std::string& config,
+                const std::string& lang,
+                cmCompiledGeneratorExpression* inputExpression,
+                std::map<std::string, std::string> &outputFiles, mode_t perm);
 
 private:
   const std::string Input;
   const cmsys::auto_ptr<cmCompiledGeneratorExpression> OutputFileExpr;
-  cmMakefile *Makefile;
   const cmsys::auto_ptr<cmCompiledGeneratorExpression> Condition;
   std::vector<std::string> Files;
   const bool InputIsContent;
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 7cc256aca37710e7a677af73c01cc478b4910b5e..ea0f6580b3b6af4e6fd6e068892ab12c97d1f9ae 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -220,7 +220,7 @@ void cmLocalGenerator::CreateEvaluationFileOutputs(std::string const& config)
   for(std::vector<cmGeneratorExpressionEvaluationFile*>::const_iterator
       li = ef.begin(); li != ef.end(); ++li)
     {
-    (*li)->CreateOutputFile(config);
+    (*li)->CreateOutputFile(this, config);
     }
 }
 
@@ -234,7 +234,7 @@ void cmLocalGenerator::ProcessEvaluationFiles(
       li != ef.end();
       ++li)
     {
-    (*li)->Generate();
+    (*li)->Generate(this);
     if (cmSystemTools::GetFatalErrorOccured())
       {
       return;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 1407888451e3ba91eb5cec5face5427ba7bd3e85..3e8abbcbb4d94f0b1bd1d5a1632f168bda018d35 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -788,7 +788,7 @@ void cmMakefile::AddEvaluationFile(const std::string& inputFile,
 {
   this->EvaluationFiles.push_back(
               new cmGeneratorExpressionEvaluationFile(inputFile, outputName,
-                                                      this, condition,
+                                                      condition,
                                                       inputIsContent));
 }