summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/GenMake.py
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2019-09-20 14:00:12 +0800
committerLiming Gao <liming.gao@intel.com>2019-09-21 00:25:48 +0800
commitfcdedafd97c8f18c33a63d26b954e5dbaee81a2b (patch)
treee308927b485caf3c19ba8942cd918fbda076d022 /BaseTools/Source/Python/AutoGen/GenMake.py
parentf4c898f2b2db2819c519cdce05403d4ba0234979 (diff)
downloadedk2-fcdedafd97c8f18c33a63d26b954e5dbaee81a2b.tar.gz
edk2-fcdedafd97c8f18c33a63d26b954e5dbaee81a2b.tar.bz2
edk2-fcdedafd97c8f18c33a63d26b954e5dbaee81a2b.zip
Revert "BaseTools: Improve GetDependencyList function"
This reverts commit bc9e4194cf3edaf9524c83098ba3f72008c70190. This change causes the dependent header files are missing in Makefile. It makes the incremental build not work. So, revert this change. Cc: Bob Feng<bob.c.feng@Intel.com> Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng<bob.c.feng@Intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/GenMake.py')
-rwxr-xr-xBaseTools/Source/Python/AutoGen/GenMake.py29
1 files changed, 13 insertions, 16 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
index 940136248f..2fe0e78bec 100755
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -1696,25 +1696,22 @@ def GetDependencyList(AutoGenObject, FileCache, File, ForceList, SearchPathList)
CurrentFileDependencyList = DepDb[F]
else:
try:
- with open(F.Path, 'rb') as Fd:
- FileContent = Fd.read(1)
- Fd.seek(0)
- if not FileContent:
- continue
- if FileContent[0] == 0xff or FileContent[0] == 0xfe:
- FileContent2 = Fd.read()
- FileContent2 = FileContent2.decode('utf-16')
- IncludedFileList = gIncludePattern.findall(FileContent2)
- else:
- FileLines = Fd.readlines()
- FileContent2 = [line for line in FileLines if str(line).lstrip("#\t ")[:8] == "include "]
- simpleFileContent="".join(FileContent2)
-
- IncludedFileList = gIncludePattern.findall(simpleFileContent)
+ Fd = open(F.Path, 'rb')
+ FileContent = Fd.read()
+ Fd.close()
except BaseException as X:
EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=F.Path + "\n\t" + str(X))
- if not FileContent:
+ if len(FileContent) == 0:
+ continue
+ try:
+ if FileContent[0] == 0xff or FileContent[0] == 0xfe:
+ FileContent = FileContent.decode('utf-16')
+ else:
+ FileContent = FileContent.decode()
+ except:
+ # The file is not txt file. for example .mcb file
continue
+ IncludedFileList = gIncludePattern.findall(FileContent)
for Inc in IncludedFileList:
Inc = Inc.strip()