[edk2] [Patch] BaseTools: support building the same INF more than once with -m option

Yonghong Zhu posted 1 patch 7 years, 6 months ago
Failed in applying to current master (apply log)
BaseTools/Source/Python/build/build.py | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
[edk2] [Patch] BaseTools: support building the same INF more than once with -m option
Posted by Yonghong Zhu 7 years, 6 months ago
Currently DSC file [Components] Section can support building the same
INF more than once for the same arch, this patch support build with -m
option to generate multiple instances.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BaseTools/Source/Python/build/build.py | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py
index fd94ae6..ae8aa2f 100644
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -1734,16 +1734,19 @@ class Build():
                 Wa.CreateMakeFile(False)
                 self.Progress.Stop("done!")
                 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 == []:
                     EdkLogger.error(
                                 'build',
-- 
2.6.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch] BaseTools: support building the same INF more than once with -m option
Posted by Gao, Liming 7 years, 6 months ago
Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Zhu, Yonghong
>Sent: Thursday, June 08, 2017 10:06 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>
>Subject: [Patch] BaseTools: support building the same INF more than once
>with -m option
>
>Currently DSC file [Components] Section can support building the same
>INF more than once for the same arch, this patch support build with -m
>option to generate multiple instances.
>
>Cc: Liming Gao <liming.gao@intel.com>
>Contributed-under: TianoCore Contribution Agreement 1.0
>Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
>---
> BaseTools/Source/Python/build/build.py | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
>diff --git a/BaseTools/Source/Python/build/build.py
>b/BaseTools/Source/Python/build/build.py
>index fd94ae6..ae8aa2f 100644
>--- a/BaseTools/Source/Python/build/build.py
>+++ b/BaseTools/Source/Python/build/build.py
>@@ -1734,16 +1734,19 @@ class Build():
>                 Wa.CreateMakeFile(False)
>                 self.Progress.Stop("done!")
>                 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 == []:
>                     EdkLogger.error(
>                                 'build',
>--
>2.6.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel