diff options
author | Yingke Liu <yingke.d.liu@intel.com> | 2014-08-28 13:53:34 +0000 |
---|---|---|
committer | yingke <yingke@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-08-28 13:53:34 +0000 |
commit | 97fa0ee9b1cffbb4b97ee35365afa7afcf50e174 (patch) | |
tree | e4d87275d1ef186373024863ddb6fa3a2ab913cf /BaseTools/Source/Python/GenFds/GenFds.py | |
parent | cb9ec399fe8f0ba0d79d788891ac5829c33abc84 (diff) | |
download | edk2-platforms-97fa0ee9b1cffbb4b97ee35365afa7afcf50e174.tar.xz |
License header updated to match correct format.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yingke Liu <yingke.d.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15971 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/GenFds/GenFds.py')
-rw-r--r-- | BaseTools/Source/Python/GenFds/GenFds.py | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py index c5ccda677b..c4e433d425 100644 --- a/BaseTools/Source/Python/GenFds/GenFds.py +++ b/BaseTools/Source/Python/GenFds/GenFds.py @@ -36,6 +36,7 @@ from Common import EdkLogger from Common.String import *
from Common.Misc import DirCache,PathClass
from Common.Misc import SaveFileOnChange
+from Common.Misc import ClearDuplicatedInf
from Common.Misc import GuidStructureStringToGuidString
from Common.BuildVersion import gBUILD_VERSION
@@ -149,15 +150,36 @@ def main(): GenFdsGlobalVariable.ActivePlatform = PathClass(NormPath(ActivePlatform), Workspace)
- BuildConfigurationFile = os.path.normpath(os.path.join(GenFdsGlobalVariable.WorkSpaceDir, "Conf/target.txt"))
+ if (Options.ConfDirectory):
+ # Get alternate Conf location, if it is absolute, then just use the absolute directory name
+ ConfDirectoryPath = os.path.normpath(Options.ConfDirectory)
+ if ConfDirectoryPath.startswith('"'):
+ ConfDirectoryPath = ConfDirectoryPath[1:]
+ if ConfDirectoryPath.endswith('"'):
+ ConfDirectoryPath = ConfDirectoryPath[:-1]
+ if not os.path.isabs(ConfDirectoryPath):
+ # Since alternate directory name is not absolute, the alternate directory is located within the WORKSPACE
+ # This also handles someone specifying the Conf directory in the workspace. Using --conf=Conf
+ ConfDirectoryPath = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, ConfDirectoryPath)
+ else:
+ # Get standard WORKSPACE/Conf, use the absolute path to the WORKSPACE/Conf
+ ConfDirectoryPath = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, 'Conf')
+ GenFdsGlobalVariable.ConfDir = ConfDirectoryPath
+ BuildConfigurationFile = os.path.normpath(os.path.join(ConfDirectoryPath, "target.txt"))
if os.path.isfile(BuildConfigurationFile) == True:
TargetTxtClassObject.TargetTxtClassObject(BuildConfigurationFile)
else:
EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=BuildConfigurationFile)
+ #Set global flag for build mode
+ GlobalData.gIgnoreSource = Options.IgnoreSources
+
if Options.Macros:
for Pair in Options.Macros:
- Pair = Pair.strip('"')
+ if Pair.startswith('"'):
+ Pair = Pair[1:]
+ if Pair.endswith('"'):
+ Pair = Pair[:-1]
List = Pair.split('=')
if len(List) == 2:
if List[0].strip() == "EFI_SOURCE":
@@ -177,7 +199,8 @@ def main(): os.environ["WORKSPACE"] = Workspace
"""call Workspace build create database"""
- BuildWorkSpace = WorkspaceDatabase(None)
+ GlobalData.gDatabasePath = os.path.normpath(os.path.join(ConfDirectoryPath, GlobalData.gDatabasePath))
+ BuildWorkSpace = WorkspaceDatabase(GlobalData.gDatabasePath)
BuildWorkSpace.InitDatabase()
#
@@ -276,11 +299,13 @@ def main(): "\nPython",
CODE_ERROR,
"Tools code failure",
- ExtraData="Please send email to edk2-buildtools-devel@lists.sourceforge.net for help, attaching following call stack trace!\n",
+ ExtraData="Please send email to edk2-devel@lists.sourceforge.net for help, attaching following call stack trace!\n",
RaiseError=False
)
EdkLogger.quiet(traceback.format_exc())
ReturnCode = CODE_ERROR
+ finally:
+ ClearDuplicatedInf()
return ReturnCode
gParamCheck = []
@@ -321,6 +346,9 @@ def myOptionParser(): action="callback", callback=SingleCheckCallback)
Parser.add_option("-D", "--define", action="append", type="string", dest="Macros", help="Macro: \"Name [= Value]\".")
Parser.add_option("-s", "--specifyaddress", dest="FixedAddress", action="store_true", type=None, help="Specify driver load address.")
+ Parser.add_option("--conf", action="store", type="string", dest="ConfDirectory", help="Specify the customized Conf directory.")
+ Parser.add_option("--ignore-sources", action="store_true", dest="IgnoreSources", default=False, help="Focus to a binary build and ignore all source files")
+
(Options, args) = Parser.parse_args()
return Options
|