+
+ #
+ # Add source directory as the first search directory
+ #
+ IncludePathList = [SourceDir]
+
+ #
+ # If additional include path file is specified, append them all
+ # to the search directory list.
+ #
+ if IncludePathFile:
+ try:
+ LineNum = 0
+ for Line in open(IncludePathFile,'r'):
+ LineNum += 1
+ if Line.startswith("/I") or Line.startswith ("-I"):
+ IncludePathList.append(Line[2:].strip())
+ else:
+ EdkLogger.warn("Trim", "Invalid include line in include list file.", IncludePathFile, LineNum)
+ except:
+ EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=IncludePathFile)
+
+ Lines = DoInclude(Source, '', IncludePathList)
+
+ #
+ # Undef MIN and MAX to avoid collision in ASL source code
+ #
+ Lines.insert(0, "#undef MIN\n#undef MAX\n")