+\r
+ if Line.startswith("!include"):\r
+ IncFile = Line[8:].strip()\r
+ Done, IncFile = self.ExpandMacros(IncFile)\r
+ if not Done:\r
+ EdkLogger.error("tools_def.txt parser", ATTRIBUTE_NOT_AVAILABLE,\r
+ "Macro or Environment has not been defined",\r
+ ExtraData=IncFile[4:-1], File=FileName, Line=Index+1)\r
+ IncFile = NormPath(IncFile)\r
+\r
+ if not os.path.isabs(IncFile):\r
+ #\r
+ # try WORKSPACE\r
+ #\r
+ IncFileTmp = PathClass(IncFile, GlobalData.gWorkspace)\r
+ ErrorCode = IncFileTmp.Validate()[0]\r
+ if ErrorCode != 0:\r
+ #\r
+ # try PACKAGES_PATH\r
+ #\r
+ IncFileTmp = mws.join(GlobalData.gWorkspace, IncFile)\r
+ if not os.path.exists(IncFileTmp):\r
+ #\r
+ # try directory of current file\r
+ #\r
+ IncFileTmp = PathClass(IncFile, os.path.dirname(FileName))\r
+ ErrorCode = IncFileTmp.Validate()[0]\r
+ if ErrorCode != 0:\r
+ EdkLogger.error("tools_def.txt parser", FILE_NOT_FOUND, ExtraData=IncFile)\r
+\r
+ if type(IncFileTmp) is PathClass:\r
+ IncFile = IncFileTmp.Path\r
+ else:\r
+ IncFile = IncFileTmp\r
+\r
+ self.IncludeToolDefFile(IncFile)\r
+ continue\r
+\r