## @file\r
# This file is used to create a database used by build tool\r
#\r
-# Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.<BR>\r
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
EdkLogger.error('build', ErrorCode, File=self.MetaFile, Line=Record[-1],\r
ExtraData=ErrorInfo)\r
elif Name == TAB_DSC_PREBUILD:\r
- self._Prebuild = PathClass(NormPath(Record[2], self._Macros), GlobalData.gWorkspace)\r
+ PrebuildValue = Record[2]\r
+ if Record[2][0] == '"':\r
+ if Record[2][-1] != '"':\r
+ 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 = PrebuildValue\r
elif Name == TAB_DSC_POSTBUILD:\r
- self._Postbuild = PathClass(NormPath(Record[2], self._Macros), GlobalData.gWorkspace)\r
+ PostbuildValue = Record[2]\r
+ if Record[2][0] == '"':\r
+ if Record[2][-1] != '"':\r
+ 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 = 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
options = sdict()\r
self._ModuleTypeOptions[Edk, ModuleType] = options\r
DriverType = '%s.%s' % (Edk, ModuleType)\r
+ CommonDriverType = '%s.%s' % ('COMMON', ModuleType)\r
RecordList = self._RawData[MODEL_META_DATA_BUILD_OPTION, self._Arch, DriverType]\r
for ToolChainFamily, ToolChain, Option, Arch, Type, Dummy3, Dummy4 in RecordList:\r
- if Type == DriverType:\r
+ if Type == DriverType or Type == CommonDriverType:\r
Key = (ToolChainFamily, ToolChain, Edk)\r
if Key not in options or not ToolChain.endswith('_FLAGS') or Option.startswith('='):\r
options[Key] = Option\r
MaxDatumSize,\r
{},\r
False,\r
- None\r
- )\r
+ None,\r
+ IsDsc=True)\r
return Pcds\r
\r
## Retrieve dynamic PCD settings\r
MaxDatumSize,\r
{SkuName : SkuInfo},\r
False,\r
- None\r
- )\r
- \r
+ None,\r
+ IsDsc=True)\r
+\r
for pcd in Pcds.values():\r
pcdDecObject = self._DecPcds[pcd.TokenCName,pcd.TokenSpaceGuidCName]\r
if 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not in pcd.SkuInfoList.keys(): \r
None,\r
pcdDecObject.validateranges,\r
pcdDecObject.validlists,\r
- pcdDecObject.expressions\r
- )\r
- \r
+ pcdDecObject.expressions,\r
+ IsDsc=True)\r
\r
for pcd in Pcds.values():\r
SkuInfoObj = pcd.SkuInfoList.values()[0]\r
MaxDatumSize,\r
{SkuName : SkuInfo},\r
False,\r
- None\r
- )\r
+ None,\r
+ IsDsc=True)\r
for pcd in Pcds.values():\r
SkuInfoObj = pcd.SkuInfoList.values()[0]\r
pcdDecObject = self._DecPcds[pcd.TokenCName,pcd.TokenSpaceGuidCName]\r
PrivateProtocolDict = tdict(True)\r
NameList = []\r
PrivateNameList = []\r
+ PublicNameList = []\r
# find out all protocol definitions for specific and 'common' arch\r
RecordList = self._RawData[MODEL_EFI_PROTOCOL, self._Arch]\r
for Name, Guid, Dummy, Arch, PrivateFlag, ID, LineNo in RecordList:\r
if Name not in PrivateNameList:\r
PrivateNameList.append(Name)\r
PrivateProtocolDict[Arch, Name] = Guid\r
+ if Name in PublicNameList:\r
+ EdkLogger.error('build', OPTION_CONFLICT, "Can't determine %s's attribute, it is both defined as Private and non-Private attribute in DEC file." % Name, File=self.MetaFile, Line=LineNo)\r
+ else:\r
+ if Name not in PublicNameList:\r
+ PublicNameList.append(Name)\r
+ if Name in PrivateNameList:\r
+ EdkLogger.error('build', OPTION_CONFLICT, "Can't determine %s's attribute, it is both defined as Private and non-Private attribute in DEC file." % Name, File=self.MetaFile, Line=LineNo)\r
if Name not in NameList:\r
NameList.append(Name)\r
ProtocolDict[Arch, Name] = Guid\r
PrivatePpiDict = tdict(True)\r
NameList = []\r
PrivateNameList = []\r
+ PublicNameList = []\r
# find out all PPI definitions for specific arch and 'common' arch\r
RecordList = self._RawData[MODEL_EFI_PPI, self._Arch]\r
for Name, Guid, Dummy, Arch, PrivateFlag, ID, LineNo in RecordList:\r
if Name not in PrivateNameList:\r
PrivateNameList.append(Name)\r
PrivatePpiDict[Arch, Name] = Guid\r
+ if Name in PublicNameList:\r
+ EdkLogger.error('build', OPTION_CONFLICT, "Can't determine %s's attribute, it is both defined as Private and non-Private attribute in DEC file." % Name, File=self.MetaFile, Line=LineNo)\r
+ else:\r
+ if Name not in PublicNameList:\r
+ PublicNameList.append(Name)\r
+ if Name in PrivateNameList:\r
+ EdkLogger.error('build', OPTION_CONFLICT, "Can't determine %s's attribute, it is both defined as Private and non-Private attribute in DEC file." % Name, File=self.MetaFile, Line=LineNo)\r
if Name not in NameList:\r
NameList.append(Name)\r
PpiDict[Arch, Name] = Guid\r
PrivateGuidDict = tdict(True)\r
NameList = []\r
PrivateNameList = []\r
+ PublicNameList = []\r
# find out all protocol definitions for specific and 'common' arch\r
RecordList = self._RawData[MODEL_EFI_GUID, self._Arch]\r
for Name, Guid, Dummy, Arch, PrivateFlag, ID, LineNo in RecordList:\r
if Name not in PrivateNameList:\r
PrivateNameList.append(Name)\r
PrivateGuidDict[Arch, Name] = Guid\r
+ if Name in PublicNameList:\r
+ EdkLogger.error('build', OPTION_CONFLICT, "Can't determine %s's attribute, it is both defined as Private and non-Private attribute in DEC file." % Name, File=self.MetaFile, Line=LineNo)\r
+ else:\r
+ if Name not in PublicNameList:\r
+ PublicNameList.append(Name)\r
+ if Name in PrivateNameList:\r
+ EdkLogger.error('build', OPTION_CONFLICT, "Can't determine %s's attribute, it is both defined as Private and non-Private attribute in DEC file." % Name, File=self.MetaFile, Line=LineNo)\r
if Name not in NameList:\r
NameList.append(Name)\r
GuidDict[Arch, Name] = Guid\r
if self._Includes == None:\r
self._Includes = []\r
self._PrivateIncludes = []\r
+ PublicInclues = []\r
RecordList = self._RawData[MODEL_EFI_INCLUDE, self._Arch]\r
Macros = self._Macros\r
Macros["EDK_SOURCE"] = GlobalData.gEcpSource\r
if Record[4] == 'PRIVATE':\r
if File not in self._PrivateIncludes:\r
self._PrivateIncludes.append(File)\r
+ if File in PublicInclues:\r
+ EdkLogger.error('build', OPTION_CONFLICT, "Can't determine %s's attribute, it is both defined as Private and non-Private attribute in DEC file." % File, File=self.MetaFile, Line=LineNo)\r
+ else:\r
+ if File not in PublicInclues:\r
+ PublicInclues.append(File)\r
+ if File in self._PrivateIncludes:\r
+ EdkLogger.error('build', OPTION_CONFLICT, "Can't determine %s's attribute, it is both defined as Private and non-Private attribute in DEC file." % File, File=self.MetaFile, Line=LineNo)\r
+\r
return self._Includes\r
\r
## Retrieve library class declarations (not used in build at present)\r
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
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
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:\r
+ and 'PCI_CLASS_CODE' in self._Defs and 'PCI_REVISION' in self._Defs:\r
self._BuildType = 'UEFI_OPTIONROM'\r
+ if 'PCI_COMPRESS' in self._Defs:\r
+ if self._Defs['PCI_COMPRESS'] not in ('TRUE', 'FALSE'):\r
+ EdkLogger.error("build", FORMAT_INVALID, "Expected TRUE/FALSE for PCI_COMPRESS: %s" %self.MetaFile)\r
+\r
elif self._Defs and 'UEFI_HII_RESOURCE_SECTION' in self._Defs \\r
and self._Defs['UEFI_HII_RESOURCE_SECTION'] == 'TRUE':\r
self._BuildType = 'UEFI_HII'\r
def GetPackageList(self, Platform, Arch, TargetName, ToolChainTag):\r
self.Platform = Platform\r
PackageList = []\r
- Pa = self.BuildObject[self.Platform, 'COMMON']\r
+ Pa = self.BuildObject[self.Platform, Arch]\r
#\r
# Get Package related to Modules\r
#\r