+## @file\r
+# Target Tool Parser\r
#\r
-# Copyright (c) 2007 - 2010, Intel Corporation\r
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
#\r
-# All rights reserved. This program and the accompanying materials\r
+# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
\r
-import os\r
+import Common.LongFilePathOs as os\r
import sys\r
import traceback\r
from optparse import OptionParser\r
import Common.EdkLogger as EdkLogger\r
import Common.BuildToolError as BuildToolError\r
from Common.DataType import *\r
+from Common.BuildVersion import gBUILD_VERSION\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
\r
# To Do 1.set clean, 2. add item, if the line is disabled.\r
\r
self.TargetTxtDictionary = {\r
TAB_TAT_DEFINES_ACTIVE_PLATFORM : None,\r
TAB_TAT_DEFINES_TOOL_CHAIN_CONF : None,\r
- TAB_TAT_DEFINES_MULTIPLE_THREAD : None,\r
TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER : None,\r
TAB_TAT_DEFINES_TARGET : None,\r
TAB_TAT_DEFINES_TOOL_CHAIN_TAG : None,\r
\r
def LoadTargetTxtFile(self, filename):\r
if os.path.exists(filename) and os.path.isfile(filename):\r
- return self.ConvertTextFileToDict(filename, '#', '=')\r
+ return self.ConvertTextFileToDict(filename, '#', '=')\r
else:\r
raise ParseError('LoadTargetTxtFile() : No Target.txt file exists.')\r
return 1\r
Key = LineList[0].strip()\r
if Key.startswith(CommentCharacter) == False and Key in self.TargetTxtDictionary.keys():\r
if Key == TAB_TAT_DEFINES_ACTIVE_PLATFORM or Key == TAB_TAT_DEFINES_TOOL_CHAIN_CONF \\r
- or Key == TAB_TAT_DEFINES_MULTIPLE_THREAD or Key == TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER \\r
+ or Key == TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER \\r
or Key == TAB_TAT_DEFINES_ACTIVE_MODULE:\r
self.TargetTxtDictionary[Key] = LineList[1].replace('\\', '/').strip()\r
elif Key == TAB_TAT_DEFINES_TARGET or Key == TAB_TAT_DEFINES_TARGET_ARCH \\r
else:\r
EdkLogger.error("TagetTool", BuildToolError.FILE_NOT_FOUND, \r
"Tooldef file %s does not exist!" % self.Opt.TOOL_DEFINITION_FILE, RaiseError=False)\r
- elif Key == TAB_TAT_DEFINES_MULTIPLE_THREAD and self.Opt.NUM != None:\r
- if self.Opt.NUM >= 2:\r
- Line = "%-30s = %s\n" % (Key, 'Enable')\r
- else:\r
- Line = "%-30s = %s\n" % (Key, 'Disable')\r
+\r
+ elif self.Opt.NUM >= 2:\r
+ Line = "%-30s = %s\n" % (Key, 'Enable')\r
+ elif self.Opt.NUM <= 1:\r
+ Line = "%-30s = %s\n" % (Key, 'Disable') \r
elif Key == TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER and self.Opt.NUM != None:\r
Line = "%-30s = %s\n" % (Key, str(self.Opt.NUM))\r
- elif Key == TAB_TAT_DEFINES_MULTIPLE_THREAD and self.Opt.ENABLE_MULTI_THREAD != None:\r
- Line = "%-30s = %s\n" % (Key, self.Opt.ENABLE_MULTI_THREAD)\r
elif Key == TAB_TAT_DEFINES_TARGET and self.Opt.TARGET != None:\r
Line = "%-30s = %s\n" % (Key, ''.join(elem + ' ' for elem in self.Opt.TARGET))\r
elif Key == TAB_TAT_DEFINES_TARGET_ARCH and self.Opt.TARGET_ARCH != None:\r
"Build rule file %s does not exist!" % self.Opt.BUILD_RULE_FILE, RaiseError=False)\r
return Line\r
\r
-VersionNumber = "0.01"\r
+VersionNumber = ("0.01" + " " + gBUILD_VERSION)\r
__version__ = "%prog Version " + VersionNumber\r
__copyright__ = "Copyright (c) 2007 - 2010, Intel Corporation All rights reserved."\r
__usage__ = "%prog [options] {args} \\r
\r
def MyOptionParser():\r
parser = OptionParser(version=__version__,prog="TargetTool.exe",usage=__usage__,description=__copyright__)\r
- parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32','X64','IPF','EBC', 'ARM','0'], dest="TARGET_ARCH",\r
- help="ARCHS is one of list: IA32, X64, IPF, ARM or EBC, which replaces target.txt's TARGET_ARCH definition. To specify more archs, please repeat this option. 0 will clear this setting in target.txt and can't combine with other value.")\r
+ parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32','X64','IPF','EBC', 'ARM', 'AARCH64','0'], dest="TARGET_ARCH",\r
+ help="ARCHS is one of list: IA32, X64, IPF, ARM, AARCH64 or EBC, which replaces target.txt's TARGET_ARCH definition. To specify more archs, please repeat this option. 0 will clear this setting in target.txt and can't combine with other value.")\r
parser.add_option("-p", "--platform", action="callback", type="string", dest="DSCFILE", callback=SingleCheckCallback,\r
help="Specify a DSC file, which replace target.txt's ACTIVE_PLATFORM definition. 0 will clear this setting in target.txt and can't combine with other value.")\r
parser.add_option("-c", "--tooldef", action="callback", type="string", dest="TOOL_DEFINITION_FILE", callback=SingleCheckCallback,\r
help="Specify the build rule configure file, which replaces target.txt's BUILD_RULE_CONF definition. If not specified, the default value Conf/build_rule.txt will be set.")\r
parser.add_option("-m", "--multithreadnum", action="callback", type="int", dest="NUM", callback=RangeCheckCallback,\r
help="Specify the multi-thread number which replace target.txt's MAX_CONCURRENT_THREAD_NUMBER. If the value is less than 2, MULTIPLE_THREAD will be disabled. If the value is larger than 1, MULTIPLE_THREAD will be enabled.")\r
- parser.add_option("-e", "--enablemultithread", action="store", type="choice", choices=['Enable', 'Disable'], dest="ENABLE_MULTI_THREAD", \r
- help="Specify whether enable multi-thread! If Enable, multi-thread is enabled; If Disable, mutli-thread is disable")\r
(opt, args)=parser.parse_args()\r
return (opt, args)\r
\r