Skip to content

Commit

Permalink
BaseTools/GenMake: Sort generated makefile tool definitions
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Yuwei Chen <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Bob Feng <[email protected]>
Reviewed-by: Yuwei Chen <[email protected]>
  • Loading branch information
mdkinney authored and mergify[bot] committed Apr 27, 2021
1 parent 5396354 commit 8d20120
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions BaseTools/Source/Python/AutoGen/GenMake.py
Original file line number Diff line number Diff line change
@@ -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
#
Expand Down Expand Up @@ -519,13 +519,15 @@ def _TemplateDict(self):
# 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":
Expand All @@ -542,7 +544,9 @@ def _TemplateDict(self):
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()
Expand Down

0 comments on commit 8d20120

Please sign in to comment.