--- C:\tmp\cmake-2.8.0-rc4-orig\cmake-2.8.0-rc4\Source\cmLocalGenerator.cxx	2009-10-28 11:38:30.000000000 +0200
+++ C:\tmp\cmake-2.8.0-rc4-patch\cmake-2.8.0-rc4\Source\cmLocalGenerator.cxx	2009-11-02 18:11:56.666162100 +0200
@@ -779,16 +779,46 @@
           return;
           }
         // if the language is not in the set lang then create custom
         // commands to build the target
         if(lang.count(llang) == 0)
           {
           this->AddBuildTargetRule(llang, target);
           }
+		else
+		  {
+		  // Add all the sources outputs to the depends of the target
+		  std::vector<cmSourceFile*> const& classes = target.GetSourceFiles();
+		  for(std::vector<cmSourceFile*>::const_iterator i = classes.begin();
+			  i != classes.end(); ++i)
+			{
+			cmSourceFile* sf = *i;
+			const char* lang = sf->GetLanguage();
+			if(lang &&
+			   strncmp(lang,"ASM",3)==0 &&
+			   !sf->GetCustomCommand() &&
+			   !sf->GetPropertyAsBool("HEADER_FILE_ONLY") &&
+			   !sf->GetPropertyAsBool("EXTERNAL_OBJECT"))
+			  {
+			  std::string dir_max;
+			  dir_max += this->Makefile->GetCurrentOutputDirectory();
+			  dir_max += "/";
+			  std::string obj = this->GetObjectFileNameWithoutTarget(*sf, dir_max);
+			  if(!obj.empty())
+				{
+				std::string ofname = this->Makefile->GetCurrentOutputDirectory();
+				ofname += "/";
+				ofname += obj;
+				this->AddCustomCommandToCreateObject(ofname.c_str(), 
+													 sf->GetLanguage(), *(*i), target);
+				}
+			  }
+			}
+		  }
         }
         break; 
       default:
         break;
       }
     }
 }
 
