summaryrefslogtreecommitdiff
path: root/BaseTools
diff options
context:
space:
mode:
authorAbner Chang <abner.chang@hp.com>2014-09-11 06:44:17 +0000
committeryingke <yingke@6f19259b-4bc3-4df7-8a09-765794883524>2014-09-11 06:44:17 +0000
commit0acb3d286258f50aec7dea6f86f4567078705ffa (patch)
tree4faf6bf40cc6bbb37a4aa9fdc5098a546877d816 /BaseTools
parentfba9b6ba24bbbed0666f4e184c95f6b15a581d49 (diff)
Add support for ${s_*} and ${d_*} macros for in FDF file for the INF files, and for each statement in the build rules.
The following keywords are supported: "src", "s_path", "s_dir", "s_name", "s_base", "s_ext", "dst", "d_path", "d_name", "d_base", "d_ext" Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Abner Chang <abner.chang@hp.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Larry Hauch <larry.hauch@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16094 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/GenFds/FfsInfStatement.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
index cc85a32796..6f5aac02f5 100644
--- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py
+++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
@@ -2,6 +2,7 @@
# process FFS generation from INF statement
#
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -362,7 +363,31 @@ class FfsInfStatement(FfsInfStatementClassObject):
#
self.__InfParse__(Dict)
+ SrcFile = os.path.join( GenFdsGlobalVariable.WorkSpaceDir , self.InfFileName);
+ DestFile = os.path.join( self.OutputPath, self.ModuleGuid + '.ffs')
+ SrcFileDir = "."
+ SrcPath = os.path.dirname(SrcFile)
+ SrcFileName = os.path.basename(SrcFile)
+ SrcFileBase, SrcFileExt = os.path.splitext(SrcFileName)
+ DestPath = os.path.dirname(DestFile)
+ DestFileName = os.path.basename(DestFile)
+ DestFileBase, DestFileExt = os.path.splitext(DestFileName)
+ self.MacroDict = {
+ # source file
+ "${src}" : SrcFile,
+ "${s_path}" : SrcPath,
+ "${s_dir}" : SrcFileDir,
+ "${s_name}" : SrcFileName,
+ "${s_base}" : SrcFileBase,
+ "${s_ext}" : SrcFileExt,
+ # destination file
+ "${dst}" : DestFile,
+ "${d_path}" : DestPath,
+ "${d_name}" : DestFileName,
+ "${d_base}" : DestFileBase,
+ "${d_ext}" : DestFileExt
+ }
#
# Allow binary type module not specify override rule in FDF file.
#
@@ -420,6 +445,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
'$(NAMED_GUID)' : self.ModuleGuid
}
String = GenFdsGlobalVariable.MacroExtend(String, MacroDict)
+ String = GenFdsGlobalVariable.MacroExtend(String, self.MacroDict)
return String
## __GetRule__() method