]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add check when copy flashMap.h to ${ModuleOutputDir}/Debug/TianoR8FlashMap.h.
authorqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 21 Jul 2006 08:26:32 +0000 (08:26 +0000)
committerqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 21 Jul 2006 08:26:32 +0000 (08:26 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1065 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java

index 3547808ccb50fe710d93512e93b56c4e4a759991..751438c27dc1ad40744d739f75fe74c2166c6990 100644 (file)
@@ -2060,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
         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
             }\r
-        } catch (Exception e){\r
-            throw new AutoGenException(e.getMessage());\r
-        }\r
-        \r
+               }\r
     }\r
     }\r
-\r
 }
\ No newline at end of file
 }
\ No newline at end of file