]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
BaseTools: DataType - cleanup list constants
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / GenFdsGlobalVariable.py
index fcb191981c95a75489a4134cc51392eaab41cea2..6745a89514b768e246bd165e3860ff2ec635acb9 100644 (file)
@@ -130,7 +130,7 @@ class GenFdsGlobalVariable:
     @staticmethod\r
     def GetBuildRules(Inf, Arch):\r
         if not Arch:\r
-            Arch = 'COMMON'\r
+            Arch = DataType.TAB_COMMON\r
 \r
         if not Arch in GenFdsGlobalVariable.OutputDirDict:\r
             return {}\r
@@ -217,7 +217,7 @@ class GenFdsGlobalVariable:
                     FileList.append((File, DataType.TAB_UNKNOWN_FILE))\r
 \r
         for File in Inf.Binaries:\r
-            if File.Target in ['COMMON', '*', GenFdsGlobalVariable.TargetName]:\r
+            if File.Target in [DataType.TAB_COMMON, '*', GenFdsGlobalVariable.TargetName]:\r
                 FileList.append((File, File.Type))\r
 \r
         for File, FileType in FileList:\r
@@ -464,9 +464,11 @@ class GenFdsGlobalVariable:
         if Ui not in [None, '']:\r
             #Cmd += ["-n", '"' + Ui + '"']\r
             if IsMakefile:\r
-                Cmd += ["-n", "$(MODULE_NAME)"]\r
+                if Ui == "$(MODULE_NAME)":\r
+                    Cmd += ['-n', Ui]\r
+                else:\r
+                    Cmd += ["-n", '"' + Ui + '"']\r
                 Cmd += ["-o", Output]\r
-                #SaveFileOnChange(CommandFile, ' '.join(Cmd), False)\r
                 if ' '.join(Cmd).strip() not in GenFdsGlobalVariable.SecCmdList:\r
                     GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).strip())\r
             else:\r
@@ -547,7 +549,7 @@ class GenFdsGlobalVariable:
 \r
         GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, Input))\r
         if MakefilePath:\r
-            if (tuple(Cmd),tuple(GenFdsGlobalVariable.SecCmdList),tuple(GenFdsGlobalVariable.CopyList)) not in GenFdsGlobalVariable.FfsCmdDict.keys():\r
+            if (tuple(Cmd),tuple(GenFdsGlobalVariable.SecCmdList),tuple(GenFdsGlobalVariable.CopyList)) not in GenFdsGlobalVariable.FfsCmdDict:\r
                 GenFdsGlobalVariable.FfsCmdDict[tuple(Cmd), tuple(GenFdsGlobalVariable.SecCmdList), tuple(GenFdsGlobalVariable.CopyList)] = MakefilePath\r
             GenFdsGlobalVariable.SecCmdList = []\r
             GenFdsGlobalVariable.CopyList = []\r
@@ -757,7 +759,7 @@ class GenFdsGlobalVariable:
     #   @param  Str           String that may contain macro\r
     #   @param  MacroDict     Dictionary that contains macro value pair\r
     #\r
-    def MacroExtend (Str, MacroDict={}, Arch='COMMON'):\r
+    def MacroExtend (Str, MacroDict={}, Arch=DataType.TAB_COMMON):\r
         if Str is None :\r
             return None\r
 \r
@@ -769,7 +771,7 @@ class GenFdsGlobalVariable:
                 '$(SPACE)' : ' '\r
                }\r
         OutputDir = GenFdsGlobalVariable.OutputDirFromDscDict[GenFdsGlobalVariable.ArchList[0]]\r
-        if Arch != 'COMMON' and Arch in GenFdsGlobalVariable.ArchList:\r
+        if Arch != DataType.TAB_COMMON and Arch in GenFdsGlobalVariable.ArchList:\r
             OutputDir = GenFdsGlobalVariable.OutputDirFromDscDict[Arch]\r
 \r
         Dict['$(OUTPUT_DIRECTORY)'] = OutputDir\r
@@ -777,7 +779,7 @@ class GenFdsGlobalVariable:
         if MacroDict is not None  and len (MacroDict) != 0:\r
             Dict.update(MacroDict)\r
 \r
-        for key in Dict.keys():\r
+        for key in Dict:\r
             if Str.find(key) >= 0 :\r
                 Str = Str.replace (key, Dict[key])\r
 \r
@@ -809,7 +811,7 @@ class GenFdsGlobalVariable:
                 if (PcdObj.TokenCName == TokenCName) and (PcdObj.TokenSpaceGuidCName == TokenSpace):\r
                     if PcdObj.Type != 'FixedAtBuild':\r
                         EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not FixedAtBuild type." % PcdPattern)\r
-                    if PcdObj.DatumType != 'VOID*':\r
+                    if PcdObj.DatumType != DataType.TAB_VOID:\r
                         EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not VOID* datum type." % PcdPattern)\r
                         \r
                     PcdValue = PcdObj.DefaultValue\r
@@ -825,7 +827,7 @@ class GenFdsGlobalVariable:
                     if (PcdObj.TokenCName == TokenCName) and (PcdObj.TokenSpaceGuidCName == TokenSpace):\r
                         if PcdObj.Type != 'FixedAtBuild':\r
                             EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not FixedAtBuild type." % PcdPattern)\r
-                        if PcdObj.DatumType != 'VOID*':\r
+                        if PcdObj.DatumType != DataType.TAB_VOID:\r
                             EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not VOID* datum type." % PcdPattern)\r
                             \r
                         PcdValue = PcdObj.DefaultValue\r