public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 1/1] BaseTools/GenMake: Sort generated makefile tool definitions
@ 2021-04-26  0:49 Michael D Kinney
  2021-04-26  2:40 ` Yuwei Chen
  2021-04-26 23:20 ` [edk2-devel] " Bob Feng
  0 siblings, 2 replies; 3+ messages in thread
From: Michael D Kinney @ 2021-04-26  0:49 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Liming Gao, Yuwei Chen

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>
---
 BaseTools/Source/Python/AutoGen/GenMake.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
index 1cfac1cd82ca..961b2ab1c399 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()
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch 1/1] BaseTools/GenMake: Sort generated makefile tool definitions
  2021-04-26  0:49 [Patch 1/1] BaseTools/GenMake: Sort generated makefile tool definitions Michael D Kinney
@ 2021-04-26  2:40 ` Yuwei Chen
  2021-04-26 23:20 ` [edk2-devel] " Bob Feng
  1 sibling, 0 replies; 3+ messages in thread
From: Yuwei Chen @ 2021-04-26  2:40 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io; +Cc: Feng, Bob C, Liming Gao

Reviewed-by: Yuwei Chen<yuwei.chen@intel.com>

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Monday, April 26, 2021 8:50 AM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>
> Subject: [Patch 1/1] 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>
> ---
>  BaseTools/Source/Python/AutoGen/GenMake.py | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py
> b/BaseTools/Source/Python/AutoGen/GenMake.py
> index 1cfac1cd82ca..961b2ab1c399 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()
> --
> 2.31.1.windows.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [Patch 1/1] BaseTools/GenMake: Sort generated makefile tool definitions
  2021-04-26  0:49 [Patch 1/1] BaseTools/GenMake: Sort generated makefile tool definitions Michael D Kinney
  2021-04-26  2:40 ` Yuwei Chen
@ 2021-04-26 23:20 ` Bob Feng
  1 sibling, 0 replies; 3+ messages in thread
From: Bob Feng @ 2021-04-26 23:20 UTC (permalink / raw)
  To: devel@edk2.groups.io, Kinney, Michael D; +Cc: Liming Gao, Chen, Christine

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael D Kinney
Sent: Monday, April 26, 2021 8:50 AM
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>
Subject: [edk2-devel] [Patch 1/1] 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>
---
 BaseTools/Source/Python/AutoGen/GenMake.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
index 1cfac1cd82ca..961b2ab1c399 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()
--
2.31.1.windows.1







^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-26 23:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-26  0:49 [Patch 1/1] BaseTools/GenMake: Sort generated makefile tool definitions Michael D Kinney
2021-04-26  2:40 ` Yuwei Chen
2021-04-26 23:20 ` [edk2-devel] " Bob Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox