]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/GenMake.py
BaseTools: Remove equality operator with None
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / GenMake.py
index afe6f2f99c47bee78e8bc76e426c4d5b98f551cd..dcdfcca1a5b066e453752781268083a99265c3d2 100644 (file)
@@ -906,12 +906,12 @@ cleanlib:
             # skip non-C files\r
             if File.Ext not in [".c", ".C"] or File.Name == "AutoGen.c":\r
                 continue\r
-            elif DepSet == None:\r
+            elif DepSet is None:\r
                 DepSet = set(self.FileDependency[File])\r
             else:\r
                 DepSet &= set(self.FileDependency[File])\r
         # in case nothing in SourceFileList\r
-        if DepSet == None:\r
+        if DepSet is None:\r
             DepSet = set()\r
         #\r
         # Extract common files list in the dependency files\r
@@ -1516,7 +1516,7 @@ class TopLevelMakefile(BuildFile):
 \r
         # TRICK: for not generating GenFds call in makefile if no FDF file\r
         MacroList = []\r
-        if PlatformInfo.FdfFile != None and PlatformInfo.FdfFile != "":\r
+        if PlatformInfo.FdfFile is not None and PlatformInfo.FdfFile != "":\r
             FdfFileList = [PlatformInfo.FdfFile]\r
             # macros passed to GenFds\r
             MacroList.append('"%s=%s"' % ("EFI_SOURCE", GlobalData.gEfiSource.replace('\\', '\\\\')))\r
@@ -1551,20 +1551,15 @@ class TopLevelMakefile(BuildFile):
         if GlobalData.gIgnoreSource:\r
             ExtraOption += " --ignore-sources"\r
 \r
-        if GlobalData.BuildOptionPcd:\r
-            for index, option in enumerate(GlobalData.gCommand):\r
-                if "--pcd" == option and GlobalData.gCommand[index+1]:\r
-                    pcdName, pcdValue = GlobalData.gCommand[index+1].split('=')\r
-                    if pcdValue.startswith('H'):\r
-                        pcdValue = 'H' + '"' + pcdValue[1:] + '"'\r
-                        ExtraOption += " --pcd " + pcdName + '=' + pcdValue\r
-                    elif pcdValue.startswith("L'"):\r
-                        ExtraOption += "--pcd " + pcdName + '=' + pcdValue\r
-                    elif pcdValue.startswith('L'):\r
-                        pcdValue = 'L' + '"' + pcdValue[1:] + '"'\r
-                        ExtraOption += " --pcd " + pcdName + '=' + pcdValue\r
-                    else:\r
-                        ExtraOption += " --pcd " + GlobalData.gCommand[index+1]\r
+        for pcd in GlobalData.BuildOptionPcd:\r
+            if pcd[2]:\r
+                pcdname = '.'.join(pcd[0:3])\r
+            else:\r
+                pcdname = '.'.join(pcd[0:2])\r
+            if pcd[3].startswith('{'):\r
+                ExtraOption += " --pcd " + pcdname + '=' + 'H' + '"' + pcd[3] + '"'\r
+            else:\r
+                ExtraOption += " --pcd " + pcdname + '=' + pcd[3]\r
 \r
         MakefileName = self._FILE_NAME_[self._FileType]\r
         SubBuildCommandList = []\r