]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/build/build.py
Maintainers.txt: Change maintainer for Intel*Pkg.
[mirror_edk2.git] / BaseTools / Source / Python / build / build.py
index fd94ae69d29fc81fb36f78efe8d4508f21da42bf..4d05ee27612d22bec11d24c1ef1749c3617d1d18 100644 (file)
@@ -890,7 +890,7 @@ class Build():
         for Tool in self.ToolChainList:\r
             if TAB_TOD_DEFINES_FAMILY not in ToolDefinition or Tool not in ToolDefinition[TAB_TOD_DEFINES_FAMILY] \\r
                or not ToolDefinition[TAB_TOD_DEFINES_FAMILY][Tool]:\r
-                EdkLogger.warn("No tool chain family found in configuration for %s. Default to MSFT." % Tool)\r
+                EdkLogger.warn("build", "No tool chain family found in configuration for %s. Default to MSFT." % Tool)\r
                 ToolChainFamily.append("MSFT")\r
             else:\r
                 ToolChainFamily.append(ToolDefinition[TAB_TOD_DEFINES_FAMILY][Tool])\r
@@ -1029,6 +1029,11 @@ class Build():
         if self.Prebuild:\r
             EdkLogger.info("\n- Prebuild Start -\n")\r
             self.LaunchPrebuildFlag = True\r
+            #\r
+            # The purpose of .PrebuildEnv file is capture environment variable settings set by the prebuild script\r
+            # and preserve them for the rest of the main build step, because the child process environment will\r
+            # evaporate as soon as it exits, we cannot get it in build step.\r
+            #\r
             PrebuildEnvFile = os.path.join(GlobalData.gConfDirectory,'.cache','.PrebuildEnv')\r
             if os.path.isfile(PrebuildEnvFile):\r
                 os.remove(PrebuildEnvFile)\r
@@ -1036,7 +1041,7 @@ class Build():
                 os.remove(self.PlatformBuildPath)\r
             if sys.platform == "win32":\r
                 args = ' && '.join((self.Prebuild, 'set > ' + PrebuildEnvFile))\r
-                Process = Popen(args, stdout=PIPE, stderr=PIPE)\r
+                Process = Popen(args, stdout=PIPE, stderr=PIPE, shell=True)\r
             else:\r
                 args = ' && '.join((self.Prebuild, 'env > ' + PrebuildEnvFile))\r
                 Process = Popen(args, stdout=PIPE, stderr=PIPE, shell=True)\r
@@ -1079,7 +1084,7 @@ class Build():
         if self.Postbuild:\r
             EdkLogger.info("\n- Postbuild Start -\n")\r
             if sys.platform == "win32":\r
-                Process = Popen(self.Postbuild, stdout=PIPE, stderr=PIPE)\r
+                Process = Popen(self.Postbuild, stdout=PIPE, stderr=PIPE, shell=True)\r
             else:\r
                 Process = Popen(self.Postbuild, stdout=PIPE, stderr=PIPE, shell=True)\r
             # launch two threads to read the STDOUT and STDERR\r
@@ -1499,7 +1504,7 @@ class Build():
                         if IsIpfPlatform and ImageInfo.Image.Size % 0x2000 != 0:\r
                             ImageInfo.Image.Size = (ImageInfo.Image.Size / 0x2000 + 1) * 0x2000\r
                         RtSize += ImageInfo.Image.Size\r
-                    elif Module.ModuleType in ['SMM_CORE', 'DXE_SMM_DRIVER']:\r
+                    elif Module.ModuleType in ['SMM_CORE', 'DXE_SMM_DRIVER', 'MM_STANDALONE', 'MM_CORE_STANDALONE']:\r
                         SmmModuleList[Module.MetaFile] = ImageInfo\r
                         SmmSize += ImageInfo.Image.Size\r
                         if Module.ModuleType == 'DXE_SMM_DRIVER':\r
@@ -1736,12 +1741,15 @@ class Build():
                 MaList = []\r
                 for Arch in Wa.ArchList:\r
                     GlobalData.gGlobalDefines['ARCH'] = Arch\r
-                    Ma = ModuleAutoGen(Wa, self.ModuleFile, BuildTarget, ToolChain, Arch, self.PlatformFile)\r
-                    if Ma == None: continue\r
-                    MaList.append(Ma)\r
-                    self.BuildModules.append(Ma)\r
-                    if not Ma.IsBinaryModule:\r
-                        self._Build(self.Target, Ma, BuildModule=True)\r
+                    Pa = PlatformAutoGen(Wa, self.PlatformFile, BuildTarget, ToolChain, Arch)\r
+                    for Module in Pa.Platform.Modules:\r
+                        if self.ModuleFile.Dir == Module.Dir and self.ModuleFile.File == Module.File:\r
+                            Ma = ModuleAutoGen(Wa, Module, BuildTarget, ToolChain, Arch, self.PlatformFile)\r
+                            if Ma == None: continue\r
+                            MaList.append(Ma)\r
+                            self.BuildModules.append(Ma)\r
+                            if not Ma.IsBinaryModule:\r
+                                self._Build(self.Target, Ma, BuildModule=True)\r
 \r
                 self.BuildReport.AddPlatformReport(Wa, MaList)\r
                 if MaList == []:\r