]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/DepexSection.py
Sync tool code to BuildTools project r1739.
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / DepexSection.py
index 1c8c82a72e5b8ea90be5f28938c0ce01bcd6d190..a0a1905dfae1ce914e784effe6659999a2fee6e4 100644 (file)
@@ -80,23 +80,27 @@ class DepexSection (DepexSectionClassObject):
             self.Expression = self.Expression.replace(Item, ExpGuidDict[Item])\r
 \r
         self.Expression = self.Expression.strip()\r
-        ModuleType = (self.DepexType.startswith('PEI') and ['PEIM'] or ['DXE_DRIVER'])[0]\r
-        if self.DepexType.startswith('SMM'):\r
-            ModuleType = 'SMM_DRIVER'\r
-        InputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + '.dpx')\r
-        InputFile = os.path.normpath(InputFile)\r
+        if self.DepexType == 'PEI_DEPEX_EXP':\r
+            ModuleType = 'PEIM'\r
+            SecType    = 'PEI_DEPEX'\r
+        elif self.DepexType == 'DXE_DEPEX_EXP':\r
+            ModuleType = 'DXE_DRIVER'\r
+            SecType    = 'DXE_DEPEX'\r
+        elif self.DepexType == 'SMM_DEPEX_EXP':\r
+            ModuleType = 'DXE_SMM_DRIVER'\r
+            SecType    = 'SMM_DEPEX'\r
+        else:\r
+            EdkLogger.error("GenFds", FORMAT_INVALID,\r
+                            "Depex type %s is not valid for module %s" % (self.DepexType, ModuleName))\r
 \r
-        Dpx = DependencyExpression(self.Expression, ModuleType)\r
-        Dpx.Generate(InputFile)\r
+        InputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + '.depex')\r
+        InputFile = os.path.normpath(InputFile)\r
+        Depex = DependencyExpression(self.Expression, ModuleType)\r
+        Depex.Generate(InputFile)\r
 \r
-        OutputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + '.depex')\r
-        if self.DepexType.startswith('SMM'):\r
-            OutputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + '.smm')\r
+        OutputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + '.dpx')\r
         OutputFile = os.path.normpath(OutputFile)\r
-        SecType = (self.DepexType.startswith('PEI') and ['PEI_DEPEX'] or ['DXE_DEPEX'])[0]\r
-        if self.DepexType.startswith('SMM'):\r
-            SecType = 'SMM_DEPEX'\r
-        \r
+\r
         GenFdsGlobalVariable.GenerateSection(OutputFile, [InputFile], Section.Section.SectionType.get (SecType))\r
         FileList = [OutputFile]\r
         return FileList, self.Alignment\r