summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorMingyue Liang <mingyuex.liang@intel.com>2020-09-23 18:57:32 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-09-25 02:27:35 +0000
commit9641a7f975ff5a18f83a8c899626342e15409c48 (patch)
tree07f165d7009ecb8885385f8784de9a5efbd3a578 /BaseTools
parenta8c77eba374cc90860172b29a191bf47c735000b (diff)
downloadedk2-9641a7f975ff5a18f83a8c899626342e15409c48.tar.gz
edk2-9641a7f975ff5a18f83a8c899626342e15409c48.tar.bz2
edk2-9641a7f975ff5a18f83a8c899626342e15409c48.zip
BaseTools: Normalize case of pathname when evaluating Macros.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2880 Currently, When doing the Incremental build, the directory macros extended to absolute path in output Makefile, which is inconsistent with the output of Clean build. When we do macro replacement, we can't replace macro due to inconsistent path case, which results in inconsistent display of incremental build and clean build in makefile.Therefore, the path is converted to achieve the correct macro replacement. Signed-off-by: Mingyue Liang <mingyuex.liang@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
Diffstat (limited to 'BaseTools')
-rwxr-xr-xBaseTools/Source/Python/AutoGen/GenMake.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
index 0314d0ea34..b04d3f5436 100755
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -786,8 +786,10 @@ cleanlib:
def ReplaceMacro(self, str):
for Macro in self.MacroList:
- if self._AutoGenObject.Macros[Macro] and self._AutoGenObject.Macros[Macro] in str:
- str = str.replace(self._AutoGenObject.Macros[Macro], '$(' + Macro + ')')
+ if self._AutoGenObject.Macros[Macro] and os.path.normcase(self._AutoGenObject.Macros[Macro]) in os.path.normcase(str):
+ replace_dir = str[os.path.normcase(str).index(os.path.normcase(self._AutoGenObject.Macros[Macro])): os.path.normcase(str).index(
+ os.path.normcase(self._AutoGenObject.Macros[Macro])) + len(self._AutoGenObject.Macros[Macro])]
+ str = str.replace(replace_dir, '$(' + Macro + ')')
return str
def CommandExceedLimit(self):