]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/EfiSection.py
BaseTools: fix --genfds-multi-thread generate makefile issue
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / EfiSection.py
index 7e6c88a0594e643c97766feb76216c781c0b4714..5bb1ae6f664c8649fbbb75e8befac7a70899d3ce 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process rule section generation\r
 #\r
-#  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -64,6 +64,7 @@ class EfiSection (EfiSectionClassObject):
             Filename = FfsInf.__ExtendMacro__(self.FileName)\r
             BuildNum = FfsInf.__ExtendMacro__(self.BuildNum)\r
             StringData = FfsInf.__ExtendMacro__(self.StringData)\r
+            ModuleNameStr = FfsInf.__ExtendMacro__('$(MODULE_NAME)')\r
             NoStrip = True\r
             if FfsInf.ModuleType in ('SEC', 'PEI_CORE', 'PEIM') and SectionType in ('TE', 'PE32'):\r
                 if FfsInf.KeepReloc is not None:\r
@@ -91,8 +92,9 @@ class EfiSection (EfiSectionClassObject):
                 FileList.append(Filename)\r
             elif os.path.exists(Filename):\r
                 FileList.append(Filename)\r
-            elif '.depex' in FfsInf.FinalTargetSuffixMap or FfsInf.Depex:\r
-                if IsMakefile:\r
+            elif IsMakefile:\r
+                SuffixMap = FfsInf.GetFinalTargetSuffixMap()\r
+                if '.depex' in SuffixMap:\r
                     FileList.append(Filename)\r
         else:\r
             FileList, IsSect = Section.Section.GetFileList(FfsInf, self.FileType, self.FileExtension, Dict, IsMakefile=IsMakefile)\r
@@ -179,6 +181,8 @@ class EfiSection (EfiSectionClassObject):
 \r
             if InfOverrideUiString:\r
                 Num = SecNum\r
+                if IsMakefile and StringData == ModuleNameStr:\r
+                    StringData = "$(MODULE_NAME)"\r
                 OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + str(Num) + Ffs.SectionSuffix.get(SectionType))\r
                 GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_USER_INTERFACE',\r
                                                      Ui=StringData, IsMakefile=IsMakefile)\r
@@ -192,6 +196,8 @@ class EfiSection (EfiSectionClassObject):
                     f = open(File, 'r')\r
                     UiString = f.read()\r
                     f.close()\r
+                    if IsMakefile and UiString == ModuleNameStr:\r
+                        UiString = "$(MODULE_NAME)"\r
                     GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_USER_INTERFACE',\r
                                                         Ui=UiString, IsMakefile=IsMakefile)\r
                     OutputFileList.append(OutputFile)\r
@@ -208,6 +214,8 @@ class EfiSection (EfiSectionClassObject):
                         EdkLogger.error("GenFds", GENFDS_ERROR, "File: %s miss UI Section value" %InfFileName)\r
 \r
                 Num = SecNum\r
+                if IsMakefile and StringData == ModuleNameStr:\r
+                    StringData = "$(MODULE_NAME)"\r
                 OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + str(Num) + Ffs.SectionSuffix.get(SectionType))\r
                 GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_USER_INTERFACE',\r
                                                      Ui=StringData, IsMakefile=IsMakefile)\r