diff options
author | Bob Feng <bob.c.feng@intel.com> | 2020-01-17 11:11:27 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-01-19 07:46:18 +0000 |
commit | 5cd3d4bc43e543caf5f78baaacced8aaf04c1d91 (patch) | |
tree | 3a63e589900174727ba19c2e4b6dd77d4b9631c3 /BaseTools/Source/Python/AutoGen | |
parent | 18fcb3759888ef2415a9fefe1fffb7f8b9b9211d (diff) | |
download | edk2-5cd3d4bc43e543caf5f78baaacced8aaf04c1d91.tar.gz edk2-5cd3d4bc43e543caf5f78baaacced8aaf04c1d91.tar.bz2 edk2-5cd3d4bc43e543caf5f78baaacced8aaf04c1d91.zip |
BaseTools: Fixed a incremental build bug
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2451
If removing a header file from source code and file
system, the incremental build will fail.
This patch is to fix this issue by setting each header file
as a target without any actions in makefile.
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen')
-rwxr-xr-x | BaseTools/Source/Python/AutoGen/GenMake.py | 9 | ||||
-rw-r--r-- | BaseTools/Source/Python/AutoGen/IncludesAutoGen.py | 5 |
2 files changed, 11 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py index fe94f9a4c2..ba199c1aa7 100755 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -1,7 +1,7 @@ ## @file
# Create makefile for MS nmake and GNU make
#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -191,6 +191,9 @@ class BuildFile(object): if not os.path.exists(os.path.join(self._AutoGenObject.MakeFileDir, "dependency")):
with open(os.path.join(self._AutoGenObject.MakeFileDir, "dependency"),"w+") as fd:
fd.write("")
+ if not os.path.exists(os.path.join(self._AutoGenObject.MakeFileDir, "deps_target")):
+ with open(os.path.join(self._AutoGenObject.MakeFileDir, "deps_target"),"w+") as fd:
+ fd.write("")
return SaveFileOnChange(os.path.join(self._AutoGenObject.MakeFileDir, FileName), FileContent, False)
## Return a list of directory creation command string
@@ -696,7 +699,9 @@ cleanlib: "file_macro" : FileMacroList,
"file_build_target" : self.BuildTargetList,
"backward_compatible_target": BcTargetList,
- "INCLUDETAG" : self._INCLUDE_CMD_[self._FileType] + " " + os.path.join("$(MODULE_BUILD_DIR)","dependency")
+ "INCLUDETAG" : "\n".join([self._INCLUDE_CMD_[self._FileType] + " " + os.path.join("$(MODULE_BUILD_DIR)","dependency"),
+ self._INCLUDE_CMD_[self._FileType] + " " + os.path.join("$(MODULE_BUILD_DIR)","deps_target")
+ ])
}
return MakefileTemplateDict
diff --git a/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py b/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py index bb6e883d84..1ca1798907 100644 --- a/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py @@ -1,7 +1,7 @@ ## @file
# Build cache intermediate result and state
#
-# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
from Common.caching import cached_property
@@ -65,6 +65,9 @@ class IncludesAutoGen(): print(e)
SaveFileOnChange(os.path.join(self.makefile_folder,"dependency"),deps_include_str,False)
+ def CreateDepsTarget(self):
+ SaveFileOnChange(os.path.join(self.makefile_folder,"deps_target"),"\n".join([item +":" for item in self.DepsCollection]),False)
+
@cached_property
def deps_files(self):
""" Get all .deps file under module build folder. """
|