summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2021-04-08 21:35:38 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-04-14 16:28:41 +0000
commitc055be5b82d3591c531ced88965523dfdbe1b9ae (patch)
tree9b5aa94f9e63a353787ba4091fe86725ec40a3d8 /BaseTools/Source/Python
parent037090cb7c0063bcb7788982cab73bf7c5b66924 (diff)
downloadedk2-c055be5b82d3591c531ced88965523dfdbe1b9ae.zip
edk2-c055be5b82d3591c531ced88965523dfdbe1b9ae.tar.gz
edk2-c055be5b82d3591c531ced88965523dfdbe1b9ae.tar.bz2
BaseTools/PlatformAutoGen: MAKE_FLAGS and MAKE_PATH fixes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3312 Update parsing of MAKE_FLAGS in DSC [BuildOptions] sections to split the flags into a list to be compatible with running the make command using Popen(). Parsing MAKE_FLAGS from tools_def.txt already uses _SplitOption(). This change uses the same _SplitOption() method for MAKE_FLAGS from a DSC [BuildOptions] section. Also update the parsing of MAKE_PATH to support MAKE_PATH from tools_def.txt or the DSC [BuildOptions] section. MAKE_PATH in DSC [BuildOptions] section is higher priority than MAKE_PATH in tools_def.txt. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r--BaseTools/Source/Python/AutoGen/PlatformAutoGen.py36
1 files changed, 21 insertions, 15 deletions
diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
index 7d8e7b3..c16f2e4 100644
--- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
@@ -1,7 +1,7 @@
## @file
# Create makefile for MS nmake and GNU make
#
-# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -805,20 +805,26 @@ class PlatformAutoGen(AutoGen):
#
@cached_property
def BuildCommand(self):
- RetVal = []
- if "MAKE" in self.ToolDefinition and "PATH" in self.ToolDefinition["MAKE"]:
- RetVal += _SplitOption(self.ToolDefinition["MAKE"]["PATH"])
- if "FLAGS" in self.ToolDefinition["MAKE"]:
- NewOption = self.ToolDefinition["MAKE"]["FLAGS"].strip()
- if NewOption != '':
- RetVal += _SplitOption(NewOption)
- if "MAKE" in self.EdkIIBuildOption:
- if "FLAGS" in self.EdkIIBuildOption["MAKE"]:
- Flags = self.EdkIIBuildOption["MAKE"]["FLAGS"]
- if Flags.startswith('='):
- RetVal = [RetVal[0]] + [Flags[1:]]
- else:
- RetVal.append(Flags)
+ if "MAKE" in self.EdkIIBuildOption and "PATH" in self.EdkIIBuildOption["MAKE"]:
+ # MAKE_PATH in DSC [BuildOptions] section is higher priority
+ Path = self.EdkIIBuildOption["MAKE"]["PATH"]
+ if Path.startswith('='):
+ Path = Path[1:].strip()
+ RetVal = _SplitOption(Path)
+ elif "MAKE" in self.ToolDefinition and "PATH" in self.ToolDefinition["MAKE"]:
+ RetVal = _SplitOption(self.ToolDefinition["MAKE"]["PATH"])
+ else:
+ return []
+ if "MAKE" in self.ToolDefinition and "FLAGS" in self.ToolDefinition["MAKE"]:
+ NewOption = self.ToolDefinition["MAKE"]["FLAGS"].strip()
+ if NewOption != '':
+ RetVal += _SplitOption(NewOption)
+ if "MAKE" in self.EdkIIBuildOption and "FLAGS" in self.EdkIIBuildOption["MAKE"]:
+ Flags = self.EdkIIBuildOption["MAKE"]["FLAGS"]
+ if Flags.startswith('='):
+ RetVal = [RetVal[0]] + _SplitOption(Flags[1:].strip())
+ else:
+ RetVal = RetVal + _SplitOption(Flags.strip())
return RetVal
## Get tool chain definition