X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FAutoGen%2FAutoGen.py;h=aaba768b4a84867be9d545296f52a978855c7173;hp=d95f40bf82ae52c4c5820617289fe8f956e134a2;hb=08dd311f5dc735c595d39faf2e6f7e2810bb79a9;hpb=d69bf66dc1ad8143260dcb8e095d7ed91b211dd7 diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index d95f40bf82..aaba768b4a 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -162,6 +162,10 @@ class WorkspaceAutoGen(AutoGen): # parse FDF file to get PCDs in it, if any if self.FdfFile != None and self.FdfFile != '': + # + # Make global macros available when parsing FDF file + # + InputMacroDict.update(self.BuildDatabase.WorkspaceDb._GlobalMacros) Fdf = FdfParser(self.FdfFile.Path) Fdf.ParseFile() PcdSet = Fdf.Profile.PcdDict @@ -544,9 +548,18 @@ class PlatformAutoGen(AutoGen): DecPcdEntry = eachDec.Pcds[DecPcd] if (DecPcdEntry.TokenSpaceGuidCName == DscPcdEntry.TokenSpaceGuidCName) and \ (DecPcdEntry.TokenCName == DscPcdEntry.TokenCName): + # Print warning message to let the developer make a determine. + EdkLogger.warn("build", "Unreferenced vpd pcd used!", + File=self.MetaFile, \ + ExtraData = "PCD: %s.%s used in the DSC file %s is unreferenced." \ + %(DscPcdEntry.TokenSpaceGuidCName, DscPcdEntry.TokenCName, self.Platform.MetaFile.Path)) + DscPcdEntry.DatumType = DecPcdEntry.DatumType DscPcdEntry.DefaultValue = DecPcdEntry.DefaultValue - Sku.DefaultValue = DecPcdEntry.DefaultValue + # Only fix the value while no value provided in DSC file. + if (Sku.DefaultValue == "" or Sku.DefaultValue==None): + DscPcdEntry.SkuInfoList[DscPcdEntry.SkuInfoList.keys()[0]].DefaultValue = DecPcdEntry.DefaultValue + VpdFile.Add(DscPcdEntry, Sku.VpdOffset) # if the offset of a VPD is *, then it need to be fixed up by third party tool. @@ -569,11 +582,9 @@ class PlatformAutoGen(AutoGen): except: EdkLogger.error("build", FILE_WRITE_FAILURE, "Fail to create FV folder under %s" % self.BuildDir) - VpdFileName = self.Platform.VpdFileName - if VpdFileName == None or VpdFileName == "" : - VpdFilePath = os.path.join(FvPath, "%s.txt" % self.Platform.VpdToolGuid) - else : - VpdFilePath = os.path.join(FvPath, "%s.txt" % VpdFileName) + + VpdFilePath = os.path.join(FvPath, "%s.txt" % self.Platform.VpdToolGuid) + if not os.path.exists(VpdFilePath) or os.path.getmtime(VpdFilePath) < DscTimeStamp: VpdFile.Write(VpdFilePath) @@ -588,16 +599,13 @@ class PlatformAutoGen(AutoGen): break # Call third party GUID BPDG tool. if BPDGToolName != None: - VpdInfoFile.CallExtenalBPDGTool(BPDGToolName, VpdFilePath, VpdFileName) + VpdInfoFile.CallExtenalBPDGTool(BPDGToolName, VpdFilePath) else: EdkLogger.error("Build", FILE_NOT_FOUND, "Fail to find third-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.") # Process VPD map file generated by third party BPDG tool if NeedProcessVpdMapFile: - if VpdFileName == None or VpdFileName == "" : - VpdMapFilePath = os.path.join(self.BuildDir, "FV", "%s.map" % self.Platform.VpdToolGuid) - else : - VpdMapFilePath = os.path.join(self.BuildDir, "FV", "%s.map" % VpdFileName) + VpdMapFilePath = os.path.join(self.BuildDir, "FV", "%s.map" % self.Platform.VpdToolGuid) if os.path.exists(VpdMapFilePath): VpdFile.Read(VpdMapFilePath) @@ -1709,12 +1717,12 @@ class ModuleAutoGen(AutoGen): self._SourceFileList = [] for F in self.Module.Sources: # match tool chain - if F.TagName != "" and F.TagName != self.ToolChain: + if F.TagName not in ("", "*", self.ToolChain): EdkLogger.debug(EdkLogger.DEBUG_9, "The toolchain [%s] for processing file [%s] is found, " "but [%s] is needed" % (F.TagName, str(F), self.ToolChain)) continue # match tool chain family - if F.ToolChainFamily != "" and F.ToolChainFamily != self.ToolChainFamily: + if F.ToolChainFamily not in ("", "*", self.ToolChainFamily): EdkLogger.debug( EdkLogger.DEBUG_0, "The file [%s] must be built by tools of [%s], " \ @@ -2128,14 +2136,6 @@ class ModuleAutoGen(AutoGen): self._ApplyBuildRule(Lib.Target, TAB_UNKNOWN_FILE) return self._LibraryAutoGenList - ## Return build command string - # - # @retval string Build command string - # - def _GetBuildCommand(self): - return self.PlatformInfo.BuildCommand - - Module = property(_GetModule) Name = property(_GetBaseName) Guid = property(_GetGuid)