summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-21 08:26:32 +0000
committerqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-21 08:26:32 +0000
commit31a9215c3223d3818d1709f39d06774e18df103f (patch)
treedb0addeba72507e86e7c92b6484bb54aa8ab30b2
parentf9d0ab926630722309d9ff401523045b79868a64 (diff)
downloadedk2-platforms-31a9215c3223d3818d1709f39d06774e18df103f.tar.xz
Add check when copy flashMap.h to ${ModuleOutputDir}/Debug/TianoR8FlashMap.h.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1065 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java34
1 files changed, 19 insertions, 15 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java b/Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
index 3547808ccb..751438c27d 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
@@ -2060,21 +2060,25 @@ public class AutoGen {
int size = (int)inFile.length();
byte[] buffer = new byte[size];
File outFile = new File (this.outputPath + File.separatorChar + CommonDefinition.tianoR8FlashMapH);
- try{
- if (inFile.exists()) {
- FileInputStream fis = new FileInputStream (inFile);
- fis.read(buffer);
- FileOutputStream fos = new FileOutputStream(outFile);
- fos.write(buffer);
- fis.close();
- fos.close();
- }else {
- throw new AutoGenException("The flashMap.h file don't exist!!");
+ //
+ // If TianoR8FlashMap.h existed and the flashMap.h don't change,
+ // do nothing.
+ //
+ if ((!outFile.exists()) ||(inFile.lastModified() - outFile.lastModified()) >= 0) {
+ try{
+ if (inFile.exists()) {
+ FileInputStream fis = new FileInputStream (inFile);
+ fis.read(buffer);
+ FileOutputStream fos = new FileOutputStream(outFile);
+ fos.write(buffer);
+ fis.close();
+ fos.close();
+ }else {
+ throw new AutoGenException("The flashMap.h file don't exist!!");
+ }
+ } catch (Exception e){
+ throw new AutoGenException(e.getMessage());
}
- } catch (Exception e){
- throw new AutoGenException(e.getMessage());
- }
-
+ }
}
-
} \ No newline at end of file