]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/build/build.py
Sync basetools' source and binary files with r1707 of the basetools project.
[mirror_edk2.git] / BaseTools / Source / Python / build / build.py
index c92b44261592ec6b9c32bec37ceb752212c603b4..7d14e1542048585e640b5694eeafa709b4d2ff59 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
@@ -705,8 +698,8 @@ class Build():
 
         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
 
@@ -1258,6 +1251,7 @@ 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]\".")
 
     (Opt, Args)=Parser.parse_args()
     return (Opt, Args)
@@ -1321,7 +1315,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
         #