]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
Add check when copy flashMap.h to ${ModuleOutputDir}/Debug/TianoR8FlashMap.h.
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / autogen / AutoGen.java
index e36945501b5a7806fb335424910843e9d408b8f3..751438c27dc1ad40744d739f75fe74c2166c6990 100644 (file)
@@ -1990,14 +1990,12 @@ public class AutoGen {
                        //\r
                        Count = 0;\r
                        if (exitBootList != null) {\r
-                               if (setVirtualList != null) {\r
-                                       for (i = 0; i < exitBootList.length; i++) {\r
-                                               if (exitBootList[i].equalsIgnoreCase("")) {\r
-                                                       break;\r
-                                               }\r
+                               for (i = 0; i < exitBootList.length; i++) {\r
+                                       if (exitBootList[i].equalsIgnoreCase("")) {\r
+                                               break;\r
                                        }\r
-                                       Count = i;\r
                                }\r
+                               Count = i;\r
                        }\r
                        fileBuffer.append(Integer.toString(Count));\r
                        fileBuffer.append(";\r\n\r\n");\r
@@ -2062,21 +2060,25 @@ public class AutoGen {
         int size = (int)inFile.length();\r
         byte[] buffer = new byte[size];\r
         File outFile = new File (this.outputPath + File.separatorChar + CommonDefinition.tianoR8FlashMapH);\r
-        try{\r
-            if (inFile.exists()) {\r
-                FileInputStream fis = new FileInputStream (inFile);\r
-                fis.read(buffer);\r
-                FileOutputStream fos = new FileOutputStream(outFile);\r
-                fos.write(buffer);\r
-                fis.close();\r
-                fos.close();\r
-            }else {\r
-                throw new AutoGenException("The flashMap.h file don't exist!!");\r
+               //\r
+               //  If TianoR8FlashMap.h existed and the flashMap.h don't change, \r
+               //  do nothing.\r
+               // \r
+        if ((!outFile.exists()) ||(inFile.lastModified() - outFile.lastModified()) >= 0) {\r
+                   try{\r
+                if (inFile.exists()) {\r
+                    FileInputStream fis = new FileInputStream (inFile);\r
+                    fis.read(buffer);\r
+                    FileOutputStream fos = new FileOutputStream(outFile);\r
+                    fos.write(buffer);\r
+                    fis.close();\r
+                    fos.close();\r
+                }else {\r
+                    throw new AutoGenException("The flashMap.h file don't exist!!");\r
+                }\r
+            } catch (Exception e){\r
+                throw new AutoGenException(e.getMessage());\r
             }\r
-        } catch (Exception e){\r
-            throw new AutoGenException(e.getMessage());\r
-        }\r
-        \r
+               }\r
     }\r
-\r
 }
\ No newline at end of file