Changed StrGather behavior to be more R8 like
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Mon, 17 Mar 2008 05:52:41 +0000 (05:52 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Mon, 17 Mar 2008 05:52:41 +0000 (05:52 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1070 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/AutoGen/AutoGen.py
Source/Python/AutoGen/GenC.py
Source/Python/AutoGen/GenMake.py
Source/Python/AutoGen/StrGather.py

index 5d7d613..ef3678d 100755 (executable)
@@ -935,7 +935,7 @@ class ModuleAutoGen(object):
                              % (Info.ToolChain, Info.BuildTarget, Info.Arch))\r
         ToolChainFamily = Info.PlatformInfo.ToolChainFamily["CC"]\r
         BuildRule = Info.PlatformInfo.BuildRule\r
-        BuildFileList = []\r
+        FileList = []\r
         for F in self.Module.Sources:\r
             SourceFile = F.SourceFile\r
             # match tool chain\r
@@ -961,28 +961,20 @@ class ModuleAutoGen(object):
 \r
             # skip file which needs a tool having no matching toolchain family\r
             FileType, RuleObject = BuildRule.Get(Ext, ToolChainFamily)\r
-            if FileType == None:\r
-                EdkLogger.verbose("Don't know how to process file [%s]." % SourceFile)\r
-                continue\r
-\r
             # unicode must be processed by AutoGen\r
             if FileType == "Unicode-Text-File":\r
                 self.BuildInfo.UnicodeFileList.append(os.path.join(self.WorkspaceDir, self.BuildInfo.SourceDir, SourceFile))\r
-                continue\r
 \r
             # if there's dxs file, don't use content in [depex] section to generate .depex file\r
             if FileType == "Dependency-Expression-File":\r
                 Info.DepexList = []\r
 \r
             # no command, no build\r
-            if RuleObject == None or RuleObject.CommandList == []:\r
-                Buildable = False\r
-                EdkLogger.verbose("No rule or command defined for building [%s], ignore file [%s]" % (FileType, SourceFile))\r
-                continue\r
-\r
-            BuildFileList.append([SourceFile, FileType, RuleObject])\r
+            if RuleObject != None and RuleObject.CommandList == []:\r
+                RuleObject = None\r
+            FileList.append([SourceFile, FileType, RuleObject])\r
 \r
-        return BuildFileList\r
+        return FileList\r
 \r
     ## Return a list of files which can be built from binary\r
     #\r
index 7526baa..c8fb01d 100644 (file)
@@ -1557,8 +1557,10 @@ def CreateUnicodeStringCode(Info, AutoGenC, AutoGenH):
     WorkingDir = os.getcwd()\r
     os.chdir(Info.WorkspaceDir)\r
 \r
-    IncList = [os.path.join(Info.WorkspaceDir, Inc) for Inc in Info.IncludePathList]\r
-    Header, Code = GetStringFiles(Info.UnicodeFileList, IncList, [], Info.Name)\r
+    #IncList = [os.path.join(Info.WorkspaceDir, Inc) for Inc in Info.IncludePathList]\r
+    IncList = [Info.SourceDir]\r
+    SrcList = [F[0] for F in Info.SourceFileList]\r
+    Header, Code = GetStringFiles(Info.UnicodeFileList, SrcList, IncList, ['.uni'], Info.Name)\r
     AutoGenC.Append("\n//\n//Unicode String Pack Definition\n//\n")\r
     AutoGenC.Append(Code)\r
     AutoGenC.Append("\n")\r
index f305aa8..295b18e 100755 (executable)
@@ -997,6 +997,9 @@ class Makefile(object):
         SourceDir = os.path.join(self.ModuleInfo.WorkspaceDir, self.ModuleInfo.SourceDir)\r
         for FileInfo in FileList:\r
             F, SrcFileType, SrcFileBuildRule = FileInfo\r
+            # no rule, no build\r
+            if SrcFileBuildRule == None:\r
+                continue\r
             if SrcFileType == "C-Code-File":\r
                 CCodeFlag = True\r
             SrcFileName = path.basename(F)\r
index 828ab72..5eec28a 100644 (file)
@@ -385,7 +385,7 @@ def CreateCFile(BaseName, UniObjectClass):
 #\r
 # @retval FileList:    A list of all files found\r
 #\r
-def GetFileList(IncludeList, SkipList):\r
+def GetFileList(SourceFileList, IncludeList, SkipList):\r
     if IncludeList == None:\r
         EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, "Include path for unicode file is not defined")\r
 \r
@@ -393,10 +393,10 @@ def GetFileList(IncludeList, SkipList):
     if SkipList == None:\r
         SkipList = []\r
 \r
-    for Dir in IncludeList:\r
-        if not os.path.exists(Dir):\r
-            continue\r
-        for File in os.listdir(Dir):\r
+    for File in SourceFileList:\r
+        for Dir in IncludeList:\r
+            if not os.path.exists(Dir):\r
+                continue\r
             File = os.path.join(Dir, os.path.normcase(File))\r
             #\r
             # Ignore Dir\r
@@ -409,11 +409,13 @@ def GetFileList(IncludeList, SkipList):
             IsSkip = False\r
             for Skip in SkipList:\r
                 if os.path.splitext(File)[1].upper() == Skip.upper():\r
+                    EdkLogger.verbose("Skipped %s for string token uses search" % File)\r
                     IsSkip = True\r
                     break\r
 \r
             if not IsSkip:\r
                 FileList.append(File)\r
+            break\r
 \r
     return FileList\r
 \r
@@ -449,7 +451,7 @@ def SearchString(UniObjectClass, FileList):
 # This function is used for UEFI2.1 spec\r
 # \r
 #\r
-def GetStringFiles(UniFilList, IncludeList, SkipList, BaseName):\r
+def GetStringFiles(UniFilList, SourceFileList, IncludeList, SkipList, BaseName):\r
     Status = True\r
     ErrorMessage = ''\r
 \r
@@ -458,7 +460,7 @@ def GetStringFiles(UniFilList, IncludeList, SkipList, BaseName):
     else:\r
         EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, 'No unicode files given')\r
 \r
-    FileList = GetFileList(IncludeList, SkipList)\r
+    FileList = GetFileList(SourceFileList, IncludeList, SkipList)\r
 \r
     Uni = SearchString(Uni, FileList)\r
 \r