summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/GenMake.py
diff options
context:
space:
mode:
authorLin, Derek (HPS SW) <derek.lin2@hpe.com>2019-10-16 14:17:26 +0800
committerFeng, Bob C <bob.c.feng@intel.com>2019-10-18 08:30:38 +0800
commitb1c6e9f55e08843c0bec909abf87601579cea386 (patch)
treedf7721609386342b4690733b2551389182a03507 /BaseTools/Source/Python/AutoGen/GenMake.py
parente797a806a8d090a09a782fe10ba2765154579d4b (diff)
downloadedk2-b1c6e9f55e08843c0bec909abf87601579cea386.tar.gz
edk2-b1c6e9f55e08843c0bec909abf87601579cea386.tar.bz2
edk2-b1c6e9f55e08843c0bec909abf87601579cea386.zip
BaseTools: Fix an incremental build issue caused by macro in #include
When c/h file use macro after #include, for example, In this case, GenMake is not able to create a healthy dependency for the c file. GenMake used to add $(FORCE_REBUILD) dependency in the c file, this guarantee the c file is always compiled in incremental build. But, this function is broken since 05217d210e8da37b47d0be58ec363f7af2fa1c18 which enable /MP for MSVC compiler, in order to compile multiple c files in one command multi-processing. The fix here is adding '$(FORCE_REBUILD)' back to retain the original function. Line number 1728 and 978 are the code pieces which handle this logic. Signed-off-by: Derek Lin <derek.lin2@hpe.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.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
index 97ba158ff2..59a01a7f24 100755
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -1080,13 +1080,17 @@ cleanlib:
else:
CmdCppDict[item.Target.SubDir] = ['$(MAKE_FILE)', Path]
if CppPath.Path in DependencyDict:
- for Temp in DependencyDict[CppPath.Path]:
- try:
- Path = self.PlaceMacro(Temp.Path, self.Macros)
- except:
- continue
- if Path not in (self.CommonFileDependency + CmdCppDict[item.Target.SubDir]):
- CmdCppDict[item.Target.SubDir].append(Path)
+ if '$(FORCE_REBUILD)' in DependencyDict[CppPath.Path]:
+ if '$(FORCE_REBUILD)' not in (self.CommonFileDependency + CmdCppDict[item.Target.SubDir]):
+ CmdCppDict[item.Target.SubDir].append('$(FORCE_REBUILD)')
+ else:
+ for Temp in DependencyDict[CppPath.Path]:
+ try:
+ Path = self.PlaceMacro(Temp.Path, self.Macros)
+ except:
+ continue
+ if Path not in (self.CommonFileDependency + CmdCppDict[item.Target.SubDir]):
+ CmdCppDict[item.Target.SubDir].append(Path)
if T.Commands:
CommandList = T.Commands[:]
for Item in CommandList[:]: