]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
BaseTools: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / GenFdsGlobalVariable.py
index ea61f723a73cd87ac46ced91dba2092a21423dd9..eb7a56d252025d6bca46da4f24505992b42029ed 100644 (file)
@@ -3,13 +3,7 @@
 #\r
 #  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 #\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution.  The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
 \r
 ##\r
@@ -50,13 +44,11 @@ class GenFdsGlobalVariable:
     WorkSpace = None\r
     WorkSpaceDir = ''\r
     ConfDir = ''\r
-    EdkSourceDir = ''\r
     OutputDirFromDscDict = {}\r
     TargetName = ''\r
     ToolChainTag = ''\r
     RuleDict = {}\r
     ArchList = None\r
-    VtfDict = {}\r
     ActivePlatform = None\r
     FvAddressFileName = ''\r
     VerboseMode = False\r
@@ -217,12 +209,12 @@ class GenFdsGlobalVariable:
 \r
         if not Inf.IsBinaryModule:\r
             for File in Inf.Sources:\r
-                if File.TagName in {"", "*", GenFdsGlobalVariable.ToolChainTag} and \\r
-                    File.ToolChainFamily in {"", "*", GenFdsGlobalVariable.ToolChainFamily}:\r
+                if File.TagName in {"", DataType.TAB_STAR, GenFdsGlobalVariable.ToolChainTag} and \\r
+                    File.ToolChainFamily in {"", DataType.TAB_STAR, GenFdsGlobalVariable.ToolChainFamily}:\r
                     FileList.append((File, DataType.TAB_UNKNOWN_FILE))\r
 \r
         for File in Inf.Binaries:\r
-            if File.Target in {DataType.TAB_COMMON, '*', GenFdsGlobalVariable.TargetName}:\r
+            if File.Target in {DataType.TAB_COMMON, DataType.TAB_STAR, GenFdsGlobalVariable.TargetName}:\r
                 FileList.append((File, File.Type))\r
 \r
         for File, FileType in FileList:\r
@@ -341,7 +333,6 @@ class GenFdsGlobalVariable:
         GenFdsGlobalVariable.ToolChainTag = GlobalData.gGlobalDefines["TOOL_CHAIN_TAG"]\r
         GenFdsGlobalVariable.TargetName = GlobalData.gGlobalDefines["TARGET"]\r
         GenFdsGlobalVariable.ActivePlatform = GlobalData.gActivePlatform\r
-        GenFdsGlobalVariable.EdkSourceDir = GlobalData.gGlobalDefines["EDK_SOURCE"]\r
         GenFdsGlobalVariable.ConfDir  = GlobalData.gConfDirectory\r
         GenFdsGlobalVariable.EnableGenfdsMultiThread = GlobalData.gEnableGenfdsMultiThread\r
         for Arch in ArchList:\r
@@ -725,8 +716,8 @@ class GenFdsGlobalVariable:
             return\r
         if PopenObject.returncode != 0 or GenFdsGlobalVariable.VerboseMode or GenFdsGlobalVariable.DebugLevel != -1:\r
             GenFdsGlobalVariable.InfLogger ("Return Value = %d" % PopenObject.returncode)\r
-            GenFdsGlobalVariable.InfLogger (out)\r
-            GenFdsGlobalVariable.InfLogger (error)\r
+            GenFdsGlobalVariable.InfLogger(out.decode(encoding='utf-8', errors='ignore'))\r
+            GenFdsGlobalVariable.InfLogger(error.decode(encoding='utf-8', errors='ignore'))\r
             if PopenObject.returncode != 0:\r
                 print("###", cmd)\r
                 EdkLogger.error("GenFds", COMMAND_FAILURE, errorMess)\r
@@ -758,7 +749,6 @@ class GenFdsGlobalVariable:
             return None\r
 \r
         Dict = {'$(WORKSPACE)': GenFdsGlobalVariable.WorkSpaceDir,\r
-                '$(EDK_SOURCE)': GenFdsGlobalVariable.EdkSourceDir,\r
 #                '$(OUTPUT_DIRECTORY)': GenFdsGlobalVariable.OutputDirFromDsc,\r
                 '$(TARGET)': GenFdsGlobalVariable.TargetName,\r
                 '$(TOOL_CHAIN_TAG)': GenFdsGlobalVariable.ToolChainTag,\r
@@ -893,7 +883,7 @@ def FindExtendTool(KeyStringList, CurrentArchList, NameGuid):
             for Index in range(2, -1, -1):\r
                 for Key in list(BuildOption.keys()):\r
                     List = Key.split('_')\r
-                    if List[Index] == '*':\r
+                    if List[Index] == DataType.TAB_STAR:\r
                         for String in ToolDb[ToolList[Index]]:\r
                             if String in [Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]:\r
                                 List[Index] = String\r