]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add support for ${s_*} and ${d_*} macros for in FDF file for the INF files, and for...
authorAbner Chang <abner.chang@hp.com>
Thu, 11 Sep 2014 06:44:17 +0000 (06:44 +0000)
committeryingke <yingke@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 11 Sep 2014 06:44:17 +0000 (06:44 +0000)
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

BaseTools/Source/Python/GenFds/FfsInfStatement.py

index cc85a32796d2e2b4e0200ada753bcf4dbfa47d83..6f5aac02f54efee40354ff3a20966e9586c9fb7c 100644 (file)
@@ -2,6 +2,7 @@
 # process FFS generation from INF statement\r
 #\r
 #  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2014 Hewlett-Packard Development Company, L.P.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -362,7 +363,31 @@ class FfsInfStatement(FfsInfStatementClassObject):
         #\r
 \r
         self.__InfParse__(Dict)\r
+        SrcFile = os.path.join( GenFdsGlobalVariable.WorkSpaceDir , self.InfFileName);\r
+        DestFile = os.path.join( self.OutputPath, self.ModuleGuid + '.ffs')\r
         \r
+        SrcFileDir = "."\r
+        SrcPath = os.path.dirname(SrcFile)\r
+        SrcFileName = os.path.basename(SrcFile)\r
+        SrcFileBase, SrcFileExt = os.path.splitext(SrcFileName)   \r
+        DestPath = os.path.dirname(DestFile)\r
+        DestFileName = os.path.basename(DestFile)\r
+        DestFileBase, DestFileExt = os.path.splitext(DestFileName)   \r
+        self.MacroDict = {\r
+            # source file\r
+            "${src}"      :   SrcFile,\r
+            "${s_path}"   :   SrcPath,\r
+            "${s_dir}"    :   SrcFileDir,\r
+            "${s_name}"   :   SrcFileName,\r
+            "${s_base}"   :   SrcFileBase,\r
+            "${s_ext}"    :   SrcFileExt,\r
+            # destination file\r
+            "${dst}"      :   DestFile,\r
+            "${d_path}"   :   DestPath,\r
+            "${d_name}"   :   DestFileName,\r
+            "${d_base}"   :   DestFileBase,\r
+            "${d_ext}"    :   DestFileExt\r
+        }\r
         #\r
         # Allow binary type module not specify override rule in FDF file.\r
         # \r
@@ -420,6 +445,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
             '$(NAMED_GUID)'  : self.ModuleGuid\r
         }\r
         String = GenFdsGlobalVariable.MacroExtend(String, MacroDict)\r
+        String = GenFdsGlobalVariable.MacroExtend(String, self.MacroDict)        \r
         return String\r
 \r
     ## __GetRule__() method\r