diff options
author | Michael D Kinney <michael.d.kinney@intel.com> | 2021-04-23 12:31:09 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-04-27 05:56:39 +0000 |
commit | 8d2012035db3cb869d1da8a95c1308025cadbeee (patch) | |
tree | 52d0c2495426407b9e0b5baf1988a297e89b1e92 /BaseTools | |
parent | 5396354b868bd6652600a654bba7df16701ac1cb (diff) | |
download | edk2-8d2012035db3cb869d1da8a95c1308025cadbeee.tar.gz edk2-8d2012035db3cb869d1da8a95c1308025cadbeee.tar.bz2 edk2-8d2012035db3cb869d1da8a95c1308025cadbeee.zip |
BaseTools/GenMake: Sort generated makefile tool definitions
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3353
Sort the tool definition content of generated makefiles to help
verify that makefile contents have not changed after BaseTools
code changes.
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: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
Diffstat (limited to 'BaseTools')
-rwxr-xr-x | BaseTools/Source/Python/AutoGen/GenMake.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py index 1cfac1cd82..961b2ab1c3 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 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -519,13 +519,15 @@ cleanlib: # tools definitions
ToolsDef = []
IncPrefix = self._INC_FLAG_[MyAgo.ToolChainFamily]
- for Tool in MyAgo.BuildOption:
- for Attr in MyAgo.BuildOption[Tool]:
+ for Tool in sorted(list(MyAgo.BuildOption)):
+ Appended = False
+ for Attr in sorted(list(MyAgo.BuildOption[Tool])):
Value = MyAgo.BuildOption[Tool][Attr]
if Attr == "FAMILY":
continue
elif Attr == "PATH":
ToolsDef.append("%s = %s" % (Tool, Value))
+ Appended = True
else:
# Don't generate MAKE_FLAGS in makefile. It's put in environment variable.
if Tool == "MAKE":
@@ -542,7 +544,9 @@ cleanlib: Value = ' '.join(ValueList)
ToolsDef.append("%s_%s = %s" % (Tool, Attr, Value))
- ToolsDef.append("")
+ Appended = True
+ if Appended:
+ ToolsDef.append("")
# generate the Response file and Response flag
RespDict = self.CommandExceedLimit()
|