]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/build/build.py
Fix build break caused by adding DebugAgentLib to the DXE Core.
[mirror_edk2.git] / BaseTools / Source / Python / build / build.py
index c92b44261592ec6b9c32bec37ceb752212c603b4..624d941b0ff1fd158379078faad24a6c7da42433 100644 (file)
@@ -158,13 +158,6 @@ def CheckEnvVariable():
         EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "Environment variable not found",
                         ExtraData="PATH")
 
-    # for macro replacement in R9 DSC/DEC/INF file
-    GlobalData.gGlobalDefines["WORKSPACE"] = ""
-
-    # for macro replacement in R8 INF file
-    GlobalData.gGlobalDefines["EFI_SOURCE"] = EfiSourceDir
-    GlobalData.gGlobalDefines["EDK_SOURCE"] = EdkSourceDir
-
     GlobalData.gWorkspace = WorkspaceDir
     GlobalData.gEfiSource = EfiSourceDir
     GlobalData.gEdkSource = EdkSourceDir
@@ -683,7 +676,8 @@ class Build():
     def __init__(self, Target, WorkspaceDir, Platform, Module, Arch, ToolChain,
                  BuildTarget, FlashDefinition, FdList=[], FvList=[],
                  MakefileType="nmake", SilentMode=False, ThreadNumber=2,
-                 SkipAutoGen=False, Reparse=False, SkuId=None):
+                 SkipAutoGen=False, Reparse=False, SkuId=None, 
+                 ReportFile=None, ReportType=None):
 
         self.WorkspaceDir = WorkspaceDir
         self.Target         = Target
@@ -702,11 +696,16 @@ class Build():
         self.Reparse        = Reparse
         self.SkuId          = SkuId
         self.SpawnMode      = True
+        self.ReportFile     = ReportFile
+        if ReportType == None:
+          self.ReportType   = ['ALL']
+        else:
+          self.ReportType   = ReportType
 
         self.TargetTxt      = TargetTxtClassObject()
         self.ToolDef        = ToolDefClassObject()
-        #self.Db             = WorkspaceDatabase(None, GlobalData.gGlobalDefines, self.Reparse)
-        self.Db             = WorkspaceDatabase(None, {}, self.Reparse)
+        self.Db             = WorkspaceDatabase(None, GlobalData.gGlobalDefines, self.Reparse)
+        #self.Db             = WorkspaceDatabase(None, {}, self.Reparse)
         self.BuildDatabase  = self.Db.BuildObject
         self.Platform       = None
 
@@ -961,7 +960,9 @@ class Build():
                         self.Fdf,
                         self.FdList,
                         self.FvList,
-                        self.SkuId
+                        self.SkuId,
+                        self.ReportFile,
+                        self.ReportType
                         )
                 self.Progress.Stop("done!")
                 self._Build(self.Target, Wa)
@@ -987,7 +988,9 @@ class Build():
                         self.Fdf,
                         self.FdList,
                         self.FvList,
-                        self.SkuId
+                        self.SkuId,
+                        self.ReportFile,
+                        self.ReportType
                         )
                 Wa.CreateMakeFile(False)
                 self.Progress.Stop("done!")
@@ -1025,7 +1028,9 @@ class Build():
                         self.Fdf,
                         self.FdList,
                         self.FvList,
-                        self.SkuId
+                        self.SkuId,
+                        self.ReportFile,
+                        self.ReportType
                         )
                 Wa.CreateMakeFile(False)
 
@@ -1258,6 +1263,11 @@ def MyOptionParser():
                                                                                "including library instances selected, final dependency expression, "\
                                                                                "and warning messages, etc.")
     Parser.add_option("-d", "--debug", action="store", type="int", help="Enable debug messages at specified level.")
+    Parser.add_option("-D", "--define", action="append", type="string", dest="Macros", help="Macro: \"Name [= Value]\".")
+
+    Parser.add_option("-y", "--report-file", action="store", dest="ReportFile", help="Create/overwrite the report to the specified filename.")
+    Parser.add_option("-Y", "--report-type", action="append", type="choice", choices=['ALL','PCD',], dest="ReportType",
+        help="Flags that control the type of build report to generate.  Must be one of: [ALL, PCD].  To specify more than one flag, repeat this option on the command line.")
 
     (Opt, Args)=Parser.parse_args()
     return (Opt, Args)
@@ -1321,7 +1331,7 @@ def Main():
             EdkLogger.error("build", OPTION_NOT_SUPPORTED, "Not supported target [%s]." % Target,
                             ExtraData="Please select one of: %s" %(' '.join(gSupportedTarget)))
 
-        # GlobalData.gGlobalDefines = ParseDefines(Option.Defines)
+        GlobalData.gGlobalDefines = ParseDefines(Option.Macros)
         #
         # Check environment variable: EDK_TOOLS_PATH, WORKSPACE, PATH
         #
@@ -1364,7 +1374,8 @@ def Main():
                         Option.TargetArch, Option.ToolChain, Option.BuildTarget,
                         Option.FdfFile, Option.RomImage, Option.FvImage,
                         None, Option.SilentMode, Option.ThreadNumber,
-                        Option.SkipAutoGen, Option.Reparse, Option.SkuId)
+                        Option.SkipAutoGen, Option.Reparse, Option.SkuId, 
+                        Option.ReportFile, Option.ReportType)
         MyBuild.Launch()
         #MyBuild.DumpBuildData()
     except FatalError, X: