self._DscFile = ''\r
self._FvDir = ''\r
self._MapVer = 0\r
+ self._DscTime = 0\r
\r
def ParseMacros (self, MacroDefStr):\r
# ['-DABC=1', '-D', 'CFG_DEBUG=1', '-D', 'CFG_OUTDIR=Build']\r
self._DscFile = DscFile\r
self._FvDir = FvDir\r
\r
+ # Initial DSC time is parent DSC time.\r
+ self._DscTime = os.path.getmtime(DscFile)\r
+\r
IsDefSect = False\r
IsPcdSect = False\r
IsUpdSect = False\r
if IncludeDsc == None:\r
print("ERROR: Cannot open file '%s'" % IncludeFilePath)\r
raise SystemExit\r
+\r
+ # Update DscTime when newer DSC time found.\r
+ CurrentDscTime = os.path.getmtime(os.path.realpath(IncludeDsc.name))\r
+ if CurrentDscTime > self._DscTime:\r
+ self._DscTime = CurrentDscTime\r
+\r
NewDscLines = IncludeDsc.readlines()\r
IncludeDsc.close()\r
DscLines = NewDscLines + DscLines\r
if not os.path.exists(OutPutFile):\r
NoFileChange = False\r
else:\r
- DscTime = os.path.getmtime(self._DscFile)\r
OutputTime = os.path.getmtime(OutPutFile)\r
- if DscTime > OutputTime:\r
+ if self._DscTime > OutputTime:\r
NoFileChange = False\r
return NoFileChange\r
\r