git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@210 7335b...
authorhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 27 Jun 2007 03:13:51 +0000 (03:13 +0000)
committerhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 27 Jun 2007 03:13:51 +0000 (03:13 +0000)
Source/Python/EdkIIWorkspaceBuild.py
Source/Python/InfClassObject.py
Source/Python/StrGather.py
Source/Python/String.py
Source/Python/UniClassObject.py

index 43866a5..7e141c7 100644 (file)
@@ -67,6 +67,7 @@ class ModuleBuildClassObject(object):
         self.ModuleType              = ''\r
         self.Guid                    = ''\r
         self.Version                 = ''\r
+        self.CustomMakefile          = {}\r
         self.Specification           = {}\r
         self.LibraryClass            = None      # LibraryClassObject\r
         self.ModuleEntryPointList    = []\r
@@ -83,6 +84,7 @@ class ModuleBuildClassObject(object):
         self.Packages                = []        #[ DecFileName, ... ]\r
         self.Pcds                    = {}        #{ [(PcdCName, PcdGuidCName)] : PcdClassObject}\r
         self.BuildOptions            = {}        #{ [BuildOptionKey] : BuildOptionValue}\r
+        self.Depex                   = ''\r
 \r
     def __str__(self):\r
         return self.DescFilePath\r
@@ -332,6 +334,16 @@ class WorkspaceBuild(object):
                 pb.Guid = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_FILE_GUID][0]\r
                 pb.Version = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_VERSION_STRING][0]\r
                 pb.ModuleType = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_MODULE_TYPE][0]\r
+                \r
+                for Index in range(len(infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_CUSTOM_MAKEFILE])):\r
+                    Makefile = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_CUSTOM_MAKEFILE][Index]\r
+                    if Makefile != '':\r
+                        MakefileList = Makefile.split(DataType.TAB_VALUE_SPLIT)\r
+                        if len(MakefileList) == 2:\r
+                            pb.CustomMakefile[CleanString(MakefileList[0])] = CleanString(MakefileList[1])\r
+                        else:\r
+                            EdkLogger.error('Wrong custom makefile defined in file ' + inf + ', correct format is CUSTOM_MAKEFILE = Family|Filename')\r
+                \r
                 if infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_EDK_RELEASE_VERSION][0] != '':\r
                     pb.Specification[TAB_INF_DEFINES_EDK_RELEASE_VERSION] = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_EDK_RELEASE_VERSION][0]\r
                 if infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_EFI_SPECIFICATION_VERSION][0] != '':\r
@@ -392,6 +404,9 @@ class WorkspaceBuild(object):
                     pb.BuildOptions[CleanString(b.split(DataType.TAB_EQUAL_SPLIT)[0])] = CleanString(b.split(DataType.TAB_EQUAL_SPLIT)[1])\r
                 self.FindBuildOptions(key, inf, pb.BuildOptions)\r
                 \r
+                #Depex\r
+                pb.Depex = ' '.join(infObj.Contents[key].Depex)\r
+                \r
                 #LibraryClasses\r
                 for index in range(len(infObj.Contents[key].LibraryClasses)):\r
                     #Get LibraryClass name and default instance if existing\r
@@ -582,6 +597,7 @@ if __name__ == '__main__':
             print 'ModuleType = ', p.ModuleType                     \r
             print 'Guid = ', p.Guid                                 \r
             print 'Version = ', p.Version\r
+            print 'CustomMakefile = ', p.CustomMakefile\r
             print 'Specification = ', p.Specification\r
             if p.LibraryClass != None:\r
                 print 'LibraryClass = ', p.LibraryClass.LibraryClass\r
@@ -602,6 +618,7 @@ if __name__ == '__main__':
             print 'Packages = ', p.Packages                         \r
             print 'Pcds = ', p.Pcds                                 \r
             print 'BuildOptions = ', p.BuildOptions\r
+            print 'Depex = ', p.Depex\r
             print ''\r
         #End of Module    \r
             \r
index d27a7b1..538ab34 100644 (file)
@@ -79,7 +79,7 @@ class Inf(InfObject):
         self.KeyList = [\r
             TAB_BINARIES, TAB_SOURCES, TAB_INCLUDES, TAB_GUIDS, TAB_PROTOCOLS, TAB_PPIS, TAB_LIBRARY_CLASSES, TAB_PACKAGES, TAB_BUILD_OPTIONS, \\r
             TAB_PCDS_FIXED_AT_BUILD_NULL, TAB_PCDS_PATCHABLE_IN_MODULE_NULL, TAB_PCDS_FEATURE_FLAG_NULL, \\r
-            TAB_PCDS_DYNAMIC_NULL, TAB_PCDS_DYNAMIC_EX_NULL\r
+            TAB_PCDS_DYNAMIC_NULL, TAB_PCDS_DYNAMIC_EX_NULL, TAB_DEPEX\r
         ]\r
                 \r
         if filename != None:\r
index c07473d..408980c 100644 (file)
@@ -43,8 +43,8 @@ def DecToHexStr(Dec):
     return '0x%04X' % int(Dec)\r
 \r
 def DecToHexList(Dec):\r
-    Hex = "%04X" % int(Dec)\r
-    List = [HexHeader + Hex[2:4], HexHeader + Hex[0:2]]\r
+    Hex = "%08X" % int(Dec)\r
+    List = [HexHeader + Hex[6:8], HexHeader + Hex[4:6], HexHeader + Hex[2:4], HexHeader + Hex[0:2]]\r
     return List\r
 \r
 def CreateHFileHeader(BaseName):\r
@@ -89,7 +89,7 @@ def CreateArrayItem(Value):
     Line = '  '\r
     ArrayItem = ''\r
     \r
-    Value = Value + UniToHexList(u'\x00')\r
+    #Value = Value + UniToHexList(u'\x00')\r
     for Item in Value:\r
         if Index < MaxLength:\r
             Line = Line + Item + ', '\r
@@ -117,7 +117,7 @@ def CreateCFileStringDef(Name, Offset, Token):
     \r
 def CreateCFileStringValue(Name, Language, Value, Offset):\r
     Str = WriteLine('  ', COMMENT + STRING + ' ' + Name + ' ' + OFFSET + ' ' + str(Offset))\r
-    Str = WriteLine(Str, CreateArrayItem(Value))\r
+    Str = WriteLine(Str, CreateArrayItem(Value + UniToHexList(u'\x00')))\r
     \r
     return Str\r
 \r
@@ -241,6 +241,7 @@ def WriteLine(Target, Item):
 # This acts like the main() function for the script, unless it is 'import'ed into another\r
 # script.\r
 if __name__ == '__main__':\r
+    print 'start'\r
     UniFileList = ['C:\\Tiano\\Edk\\Sample\\Universal\\UserInterface\\SetupBrowser\\Dxe\\DriverSample\\inventorystrings.uni', 'C:\\Tiano\\Edk\\Sample\\Universal\\UserInterface\\SetupBrowser\\Dxe\\DriverSample\\VfrStrings.uni']\r
     IncludeList = ['C:\\Tiano\\Edk\\Sample\\Universal\\UserInterface\\SetupBrowser\\Dxe\\DriverSample']\r
     SkipList = ['.inf', '.uni']\r
@@ -252,3 +253,4 @@ if __name__ == '__main__':
     cfile.write(c)\r
     #print h\r
     #print c\r
+    print 'end'\r
index 59ec644..1b7ad7d 100644 (file)
@@ -169,10 +169,10 @@ def NormPath(path):
         return path\r
 \r
 def CleanString(Line, CommentCharacter = DataType.TAB_COMMENT_SPLIT):\r
-    #remove comments\r
-    Line = Line.split(CommentCharacter, 1)[0];\r
     #remove whitespace\r
     Line = Line.strip();\r
+    #remove comments\r
+    Line = Line.split(CommentCharacter, 1)[0];\r
     #replace '\\', '\' with '/'\r
     Line = Line.replace('\\', '/')\r
     Line = Line.replace('//', '/')\r
index dd7bcaa..9fdf99f 100644 (file)
@@ -28,7 +28,9 @@ def UniToStr(Uni):
 def UniToHexList(Uni):\r
     List = []\r
     for Item in Uni:\r
-        List.append('0x%02X' % ord(Item))\r
+        Temp = '%04X' % ord(Item)\r
+        List.append('0x' + Temp[2:4])\r
+        List.append('0x' + Temp[0:2])\r
     return List\r
 \r
 class StringDefinitionClassObject(object):\r