]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/GenDepex.py
Sync BaseTools Branch (version r2321) to EDKII main trunk.
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / GenDepex.py
index f456f0d25efc80cb4521935118901ecd78080829..37ba7bc72cd25bcc1284ab1ac28aae40e17abf51 100644 (file)
@@ -1,8 +1,8 @@
 ## @file\r
 # This file is used to generate DEPEX file for module's dependency expression\r
 #\r
-# Copyright (c) 2007 - 2010, Intel Corporation\r
-# All rights reserved. This program and the accompanying materials\r
+# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.    The full text of the license may be found at\r
 # http://opensource.org/licenses/bsd-license.php\r
@@ -23,7 +23,7 @@ from Common.BuildToolError import *
 from Common.Misc import SaveFileOnChange\r
 from Common.Misc import GuidStructureStringToGuidString\r
 from Common import EdkLogger as EdkLogger\r
-\r
+from Common.BuildVersion import gBUILD_VERSION\r
 \r
 ## Regular expression for matching "DEPENDENCY_START ... DEPENDENCY_END"\r
 gStartClosePattern = re.compile(".*DEPENDENCY_START(.+)DEPENDENCY_END.*", re.S)\r
@@ -354,7 +354,7 @@ class DependencyExpression:
         Buffer.close()\r
         return FileChangeFlag\r
 \r
-versionNumber = "0.04"\r
+versionNumber = ("0.04" + " " + gBUILD_VERSION)\r
 __version__ = "%prog Version " + versionNumber\r
 __copyright__ = "Copyright (c) 2007-2010, Intel Corporation  All rights reserved."\r
 __usage__ = "%prog [options] [dependency_expression_file]"\r
@@ -423,7 +423,14 @@ def Main():
 \r
         Dpx = DependencyExpression(DxsString, Option.ModuleType, Option.Optimize)\r
         if Option.OutputFile != None:\r
-            Dpx.Generate(Option.OutputFile)\r
+            FileChangeFlag = Dpx.Generate(Option.OutputFile)\r
+            if not FileChangeFlag and DxsFile: \r
+                #\r
+                # Touch the output file if its time stamp is older than the original\r
+                # DXS file to avoid re-invoke this tool for the dependency check in build rule.\r
+                #\r
+                if os.stat(DxsFile)[8] > os.stat(Option.OutputFile)[8]:\r
+                    os.utime(Option.OutputFile, None)\r
         else:\r
             Dpx.Generate()\r
     except BaseException, X:\r