]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Normalize case of pathname when evaluating Macros.
authorMingyue Liang <mingyuex.liang@intel.com>
Wed, 23 Sep 2020 10:57:32 +0000 (18:57 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 25 Sep 2020 02:27:35 +0000 (02:27 +0000)
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>
BaseTools/Source/Python/AutoGen/GenMake.py

index 0314d0ea34d99a014379e8d30c46ac0f0a7068ce..b04d3f54368ea9e41d7e07ea473569528db2f264 100755 (executable)
@@ -786,8 +786,10 @@ cleanlib:
 \r
     def ReplaceMacro(self, str):\r
         for Macro in self.MacroList:\r
-            if self._AutoGenObject.Macros[Macro] and self._AutoGenObject.Macros[Macro] in str:\r
-                str = str.replace(self._AutoGenObject.Macros[Macro], '$(' + Macro + ')')\r
+            if self._AutoGenObject.Macros[Macro] and os.path.normcase(self._AutoGenObject.Macros[Macro]) in os.path.normcase(str):\r
+                replace_dir = str[os.path.normcase(str).index(os.path.normcase(self._AutoGenObject.Macros[Macro])): os.path.normcase(str).index(\r
+                    os.path.normcase(self._AutoGenObject.Macros[Macro])) + len(self._AutoGenObject.Macros[Macro])]\r
+                str = str.replace(replace_dir, '$(' + Macro + ')')\r
         return str\r
 \r
     def CommandExceedLimit(self):\r