X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2Fbuild%2Fbuild.py;h=1e14fb4dcc7d259f48347fc9a6f61a36e7930ef5;hp=f17b55c4cfa8003938ab43f634c3003b2819da97;hb=b926f2f2a4cd404df1d2c1dddbcd1178acc63b5e;hpb=ed72804638c9b240477c5235d72c3823483813b2 diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index f17b55c4cf..1e14fb4dcc 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -2,7 +2,7 @@ # build a platform or a module # # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.
-# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -54,7 +54,7 @@ import Common.GlobalData as GlobalData # Version and Copyright VersionNumber = "0.60" + ' ' + gBUILD_VERSION __version__ = "%prog Version " + VersionNumber -__copyright__ = "Copyright (c) 2007 - 2016, Intel Corporation All rights reserved." +__copyright__ = "Copyright (c) 2007 - 2017, Intel Corporation All rights reserved." ## standard targets of build command gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run'] @@ -825,6 +825,8 @@ class Build(): EdkLogger.quiet("%-16s = %s" % ("POSTBUILD", self.PostbuildScript)) if self.PrebuildScript: self.LaunchPrebuild() + self.TargetTxt = TargetTxtClassObject() + self.ToolDef = ToolDefClassObject() if not (self.LaunchPrebuildFlag and os.path.exists(self.PlatformBuildPath)): self.InitBuild() @@ -987,7 +989,6 @@ class Build(): self.PostbuildScript = PostbuildList[0] self.Postbuild = ' '.join(PostbuildList) self.Postbuild += self.PassCommandOption(self.BuildTargetList, self.ArchList, self.ToolChainList) - #self.LanuchPostbuild() else: EdkLogger.error("Postbuild", POSTBUILD_ERROR, "the postbuild script %s is not exist.\n If you'd like to disable the Postbuild process, please use the format: -D POSTBUILD=\"\" " %(PostbuildList[0])) @@ -1035,10 +1036,10 @@ class Build(): os.remove(self.PlatformBuildPath) if sys.platform == "win32": args = ' && '.join((self.Prebuild, 'set > ' + PrebuildEnvFile)) - Process = Popen(args, stdout=PIPE, stderr=PIPE) + Process = Popen(args, stdout=PIPE, stderr=PIPE, shell=True) else: args = ' && '.join((self.Prebuild, 'env > ' + PrebuildEnvFile)) - Process = Popen(args, stdout=PIPE, stderr=PIPE, shell=True, executable="/bin/bash") + Process = Popen(args, stdout=PIPE, stderr=PIPE, shell=True) # launch two threads to read the STDOUT and STDERR EndOfProcedure = Event() @@ -1074,13 +1075,13 @@ class Build(): os.environ.update(dict(envs)) EdkLogger.info("\n- Prebuild Done -\n") - def LanuchPostbuild(self): + def LaunchPostbuild(self): if self.Postbuild: EdkLogger.info("\n- Postbuild Start -\n") if sys.platform == "win32": - Process = Popen(self.Postbuild, stdout=PIPE, stderr=PIPE) + Process = Popen(self.Postbuild, stdout=PIPE, stderr=PIPE, shell=True) else: - Process = Popen(self.Postbuild, stdout=PIPE, stderr=PIPE, shell=True, executable="/bin/bash") + Process = Popen(self.Postbuild, stdout=PIPE, stderr=PIPE, shell=True) # launch two threads to read the STDOUT and STDERR EndOfProcedure = Event() EndOfProcedure.clear() @@ -1498,7 +1499,7 @@ class Build(): if IsIpfPlatform and ImageInfo.Image.Size % 0x2000 != 0: ImageInfo.Image.Size = (ImageInfo.Image.Size / 0x2000 + 1) * 0x2000 RtSize += ImageInfo.Image.Size - elif Module.ModuleType in ['SMM_CORE', 'DXE_SMM_DRIVER']: + elif Module.ModuleType in ['SMM_CORE', 'DXE_SMM_DRIVER', 'MM_STANDALONE', 'MM_CORE_STANDALONE']: SmmModuleList[Module.MetaFile] = ImageInfo SmmSize += ImageInfo.Image.Size if Module.ModuleType == 'DXE_SMM_DRIVER': @@ -1735,12 +1736,15 @@ class Build(): MaList = [] for Arch in Wa.ArchList: GlobalData.gGlobalDefines['ARCH'] = Arch - Ma = ModuleAutoGen(Wa, self.ModuleFile, BuildTarget, ToolChain, Arch, self.PlatformFile) - if Ma == None: continue - MaList.append(Ma) - self.BuildModules.append(Ma) - if not Ma.IsBinaryModule: - self._Build(self.Target, Ma, BuildModule=True) + Pa = PlatformAutoGen(Wa, self.PlatformFile, BuildTarget, ToolChain, Arch) + for Module in Pa.Platform.Modules: + if self.ModuleFile.Dir == Module.Dir and self.ModuleFile.File == Module.File: + Ma = ModuleAutoGen(Wa, Module, BuildTarget, ToolChain, Arch, self.PlatformFile) + if Ma == None: continue + MaList.append(Ma) + self.BuildModules.append(Ma) + if not Ma.IsBinaryModule: + self._Build(self.Target, Ma, BuildModule=True) self.BuildReport.AddPlatformReport(Wa, MaList) if MaList == []: @@ -2329,7 +2333,7 @@ def Main(): if ReturnCode == 0: try: - MyBuild.LanuchPostbuild() + MyBuild.LaunchPostbuild() Conclusion = "Done" except: Conclusion = "Failed"