]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/build/build.py
Sync BaseTools Branch (version r2321) to EDKII main trunk.
[mirror_edk2.git] / BaseTools / Source / Python / build / build.py
index b21f2204b7757ec4a848bf8fde5e60de6bffabef..51deb3890cae6b9e44dc057b9f4e9530dc97e5ce 100644 (file)
@@ -34,6 +34,7 @@ from Common import Misc as Utils
 from Common.TargetTxtClassObject import *\r
 from Common.ToolDefClassObject import *\r
 from Common.DataType import *\r
+from Common.BuildVersion import gBUILD_VERSION\r
 from AutoGen.AutoGen import *\r
 from Common.BuildToolError import *\r
 from Workspace.WorkspaceDatabase import *\r
@@ -46,7 +47,7 @@ import Common.EdkLogger
 import Common.GlobalData as GlobalData\r
 \r
 # Version and Copyright\r
-VersionNumber = "0.5"\r
+VersionNumber = "0.5" + ' ' + gBUILD_VERSION\r
 __version__ = "%prog Version " + VersionNumber\r
 __copyright__ = "Copyright (c) 2007 - 2010, Intel Corporation  All rights reserved."\r
 \r
@@ -100,7 +101,7 @@ def CheckEnvVariable():
     os.environ["WORKSPACE"] = WorkspaceDir\r
 \r
     #\r
-    # Check EFI_SOURCE (R8 build convention). EDK_SOURCE will always point to ECP\r
+    # Check EFI_SOURCE (Edk build convention). EDK_SOURCE will always point to ECP\r
     #\r
     if "ECP_SOURCE" not in os.environ:\r
         os.environ["ECP_SOURCE"] = os.path.join(WorkspaceDir, GlobalData.gEdkCompatibilityPkg)\r
@@ -122,13 +123,13 @@ def CheckEnvVariable():
     os.environ["EDK_TOOLS_PATH"] = os.path.normcase(os.environ["EDK_TOOLS_PATH"])\r
     \r
     if not os.path.exists(EcpSourceDir):\r
-        EdkLogger.verbose("ECP_SOURCE = %s doesn't exist. R8 modules could not be built." % EcpSourceDir)\r
+        EdkLogger.verbose("ECP_SOURCE = %s doesn't exist. Edk modules could not be built." % EcpSourceDir)\r
     elif ' ' in EcpSourceDir:\r
         EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allowed in ECP_SOURCE path",\r
                         ExtraData=EcpSourceDir)\r
     if not os.path.exists(EdkSourceDir):\r
         if EdkSourceDir == EcpSourceDir:\r
-            EdkLogger.verbose("EDK_SOURCE = %s doesn't exist. R8 modules could not be built." % EdkSourceDir)\r
+            EdkLogger.verbose("EDK_SOURCE = %s doesn't exist. Edk modules could not be built." % EdkSourceDir)\r
         else:\r
             EdkLogger.error("build", PARAMETER_INVALID, "EDK_SOURCE does not exist",\r
                             ExtraData=EdkSourceDir)\r
@@ -137,7 +138,7 @@ def CheckEnvVariable():
                         ExtraData=EdkSourceDir)\r
     if not os.path.exists(EfiSourceDir):\r
         if EfiSourceDir == EcpSourceDir:\r
-            EdkLogger.verbose("EFI_SOURCE = %s doesn't exist. R8 modules could not be built." % EfiSourceDir)\r
+            EdkLogger.verbose("EFI_SOURCE = %s doesn't exist. Edk modules could not be built." % EfiSourceDir)\r
         else:\r
             EdkLogger.error("build", PARAMETER_INVALID, "EFI_SOURCE does not exist",\r
                             ExtraData=EfiSourceDir)\r
@@ -746,13 +747,15 @@ class Build():
         self.LoadConfiguration()\r
         \r
         #\r
-        # @attention Treat $(TARGET) in meta data files as special macro when it has only one build target.\r
-        # This is not a complete support for $(TARGET) macro as it can only support one build target in ONE\r
-        # invocation of build command. However, it should cover the frequent usage model that $(TARGET) macro\r
-        # is used in DSC files to specify different libraries & PCD setting for debug/release build.\r
+        # @attention Treat $(TARGET)/$(TOOL_CHAIN_TAG) in meta data files as special macro when it has only one build target/toolchain.\r
+        # This is not a complete support for $(TARGET)/$(TOOL_CHAIN_TAG) macro as it can only support one build target/toolchain in ONE\r
+        # invocation of build command. However, it should cover the frequent usage model that $(TARGET)/$(TOOL_CHAIN_TAG) macro\r
+        # is used in DSC/FDF files to specify different libraries & PCD setting for debug/release build.\r
         #\r
         if len(self.BuildTargetList) == 1:\r
             self.Db._GlobalMacros.setdefault("TARGET", self.BuildTargetList[0])\r
+        if len(self.ToolChainList) == 1:   \r
+            self.Db._GlobalMacros.setdefault("TOOL_CHAIN_TAG", self.ToolChainList[0])\r
         \r
         self.InitBuild()\r
 \r
@@ -1708,8 +1711,8 @@ def MyOptionParser():
         help="Build the platform specified by the DSC file name argument, overriding target.txt's ACTIVE_PLATFORM definition.")\r
     Parser.add_option("-m", "--module", action="callback", type="string", dest="ModuleFile", callback=SingleCheckCallback,\r
         help="Build the module specified by the INF file name argument.")\r
-    Parser.add_option("-b", "--buildtarget", action="append", type="choice", choices=['DEBUG','RELEASE'], dest="BuildTarget",\r
-        help="BuildTarget is one of list: DEBUG, RELEASE, which overrides target.txt's TARGET definition. To specify more TARGET, please repeat this option.")\r
+    Parser.add_option("-b", "--buildtarget", action="append", type="choice", choices=['DEBUG','RELEASE','NOOPT'], dest="BuildTarget",\r
+        help="BuildTarget is one of list: DEBUG, RELEASE, NOOPT, which overrides target.txt's TARGET definition. To specify more TARGET, please repeat this option.")\r
     Parser.add_option("-t", "--tagname", action="append", type="string", dest="ToolChain",\r
         help="Using the Tool Chain Tagname to build the platform, overriding target.txt's TOOL_CHAIN_TAG definition.")\r
     Parser.add_option("-x", "--sku-id", action="callback", type="string", dest="SkuId", callback=SingleCheckCallback,\r