]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
BaseTools/build: Expand PREBUILD/POSTBUILD DSC actions
[mirror_edk2.git] / BaseTools / Source / Python / Workspace / WorkspaceDatabase.py
index 06867219b71191ef5d6d2fbeb80c2d448d9f386a..fe2c7c17c4699b3d03ad6202f39b2744411c7a43 100644 (file)
@@ -237,7 +237,7 @@ class DscBuildData(PlatformBuildClassObject):
                         EdkLogger.error('build', FORMAT_INVALID, 'Missing double quotes in the end of %s statement.' % TAB_DSC_PREBUILD,\r
                                     File=self.MetaFile, Line=Record[-1])\r
                     PrebuildValue = Record[2][1:-1]\r
-                self._Prebuild = PathClass(NormPath(PrebuildValue, self._Macros), GlobalData.gWorkspace)\r
+                self._Prebuild = PrebuildValue\r
             elif Name == TAB_DSC_POSTBUILD:\r
                 PostbuildValue = Record[2]\r
                 if Record[2][0] == '"':\r
@@ -245,7 +245,7 @@ class DscBuildData(PlatformBuildClassObject):
                         EdkLogger.error('build', FORMAT_INVALID, 'Missing double quotes in the end of %s statement.' % TAB_DSC_POSTBUILD,\r
                                     File=self.MetaFile, Line=Record[-1])\r
                     PostbuildValue = Record[2][1:-1]\r
-                self._Postbuild = PathClass(NormPath(PostbuildValue, self._Macros), GlobalData.gWorkspace)\r
+                self._Postbuild = PostbuildValue\r
             elif Name == TAB_DSC_DEFINES_SUPPORTED_ARCHITECTURES:\r
                 self._SupArchList = GetSplitValueList(Record[2], TAB_VALUE_SPLIT)\r
             elif Name == TAB_DSC_DEFINES_BUILD_TARGETS:\r
@@ -1830,8 +1830,6 @@ class InfBuildData(ModuleBuildClassObject):
             if self.AutoGenVersion < 0x00010005:\r
                 self.__Macros.update(GlobalData.gEdkGlobal)\r
                 self.__Macros.update(GlobalData.gGlobalDefines)\r
-            else:\r
-                self.__Macros.update(self.Defines)\r
         return self.__Macros\r
 \r
     ## Get architecture\r
@@ -1896,6 +1894,7 @@ class InfBuildData(ModuleBuildClassObject):
                 if self._Defs == None:\r
                     self._Defs = sdict()\r
                 self._Defs[Name] = Value\r
+                self._Macros[Name] = Value\r
             # some special items in [Defines] section need special treatment\r
             elif Name in ('EFI_SPECIFICATION_VERSION', 'UEFI_SPECIFICATION_VERSION', 'EDK_RELEASE_VERSION', 'PI_SPECIFICATION_VERSION'):\r
                 if Name in ('EFI_SPECIFICATION_VERSION', 'UEFI_SPECIFICATION_VERSION'):\r
@@ -1956,6 +1955,7 @@ class InfBuildData(ModuleBuildClassObject):
                 if self._Defs == None:\r
                     self._Defs = sdict()\r
                 self._Defs[Name] = Value\r
+                self._Macros[Name] = Value\r
 \r
         #\r
         # Retrieve information in sections specific to Edk.x modules\r
@@ -1977,6 +1977,11 @@ class InfBuildData(ModuleBuildClassObject):
             if (self._Specification == None) or (not 'PI_SPECIFICATION_VERSION' in self._Specification) or (int(self._Specification['PI_SPECIFICATION_VERSION'], 16) < 0x0001000A):\r
                 if self._ModuleType == SUP_MODULE_SMM_CORE:\r
                     EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "SMM_CORE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x0001000A", File=self.MetaFile)\r
+            if (self._Specification == None) or (not 'PI_SPECIFICATION_VERSION' in self._Specification) or (int(self._Specification['PI_SPECIFICATION_VERSION'], 16) < 0x00010032):\r
+                if self._ModuleType == SUP_MODULE_MM_CORE_STANDALONE:\r
+                    EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "MM_CORE_STANDALONE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x00010032", File=self.MetaFile)\r
+                if self._ModuleType == SUP_MODULE_MM_STANDALONE:\r
+                    EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "MM_STANDALONE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x00010032", File=self.MetaFile)\r
             if self._Defs and 'PCI_DEVICE_ID' in self._Defs and 'PCI_VENDOR_ID' in self._Defs \\r
                and 'PCI_CLASS_CODE' in self._Defs and 'PCI_REVISION' in self._Defs:\r
                 self._BuildType = 'UEFI_OPTIONROM'\r