##\r
# Import Modules\r
#\r
+from __future__ import print_function\r
import Common.LongFilePathOs as os\r
import re\r
import copy\r
from Common.GlobalData import *\r
from Common.BuildToolError import *\r
from Common.Misc import tdict, PathClass\r
-from Common.String import NormPath\r
+from Common.StringUtils import NormPath\r
from Common.DataType import *\r
\r
import Common.EdkLogger as EdkLogger\r
return "%s_LIST" % FileListMacro(FileType)\r
\r
class TargetDescBlock(object):\r
- _Cache_ = {} # {TargetFile : TargetDescBlock object}\r
-\r
- # Factory method\r
- def __new__(Class, Inputs, Outputs, Commands, Dependencies):\r
- if Outputs[0] in Class._Cache_:\r
- Tdb = Class._Cache_[Outputs[0]]\r
- for File in Inputs:\r
- Tdb.AddInput(File)\r
- else:\r
- Tdb = super(TargetDescBlock, Class).__new__(Class)\r
- Tdb._Init(Inputs, Outputs, Commands, Dependencies)\r
- #Class._Cache_[Outputs[0]] = Tdb\r
- return Tdb\r
+ def __init__(self, Inputs, Outputs, Commands, Dependencies):\r
+ self.InitWorker(Inputs, Outputs, Commands, Dependencies)\r
\r
- def _Init(self, Inputs, Outputs, Commands, Dependencies):\r
+ def InitWorker(self, Inputs, Outputs, Commands, Dependencies):\r
self.Inputs = Inputs\r
self.Outputs = Outputs\r
self.Commands = Commands\r
def IsMultipleInput(self):\r
return len(self.Inputs) > 1\r
\r
- @staticmethod\r
- def Renew():\r
- TargetDescBlock._Cache_ = {}\r
-\r
## Class for one build rule\r
#\r
# This represents a build rule which can give out corresponding command list for\r
# Command line should be regenerated since some macros are different\r
#\r
CommandList = self._BuildCommand(BuildRulePlaceholderDict)\r
- TargetDesc._Init([SourceFile], DstFile, CommandList, self.ExtraSourceFileList)\r
+ TargetDesc.InitWorker([SourceFile], DstFile, CommandList, self.ExtraSourceFileList)\r
break\r
else:\r
TargetDesc.AddInput(SourceFile)\r
self.RuleContent[Index] = Line\r
\r
# find the build_rule_version\r
- if Line and Line[0] == "#" and Line.find(TAB_BUILD_RULE_VERSION) <> -1:\r
- if Line.find("=") <> -1 and Line.find("=") < (len(Line) - 1) and (Line[(Line.find("=") + 1):]).split():\r
+ if Line and Line[0] == "#" and Line.find(TAB_BUILD_RULE_VERSION) != -1:\r
+ if Line.find("=") != -1 and Line.find("=") < (len(Line) - 1) and (Line[(Line.find("=") + 1):]).split():\r
self._FileVersion = (Line[(Line.find("=") + 1):]).split()[0]\r
# skip empty or comment line\r
if Line == "" or Line[0] == "#":\r
EdkLogger.Initialize()\r
if len(sys.argv) > 1:\r
Br = BuildRule(sys.argv[1])\r
- print str(Br[".c", "DXE_DRIVER", "IA32", "MSFT"][1])\r
- print\r
- print str(Br[".c", "DXE_DRIVER", "IA32", "INTEL"][1])\r
- print\r
- print str(Br[".c", "DXE_DRIVER", "IA32", "GCC"][1])\r
- print\r
- print str(Br[".ac", "ACPI_TABLE", "IA32", "MSFT"][1])\r
- print\r
- print str(Br[".h", "ACPI_TABLE", "IA32", "INTEL"][1])\r
- print\r
- print str(Br[".ac", "ACPI_TABLE", "IA32", "MSFT"][1])\r
- print\r
- print str(Br[".s", "SEC", "IPF", "COMMON"][1])\r
- print\r
- print str(Br[".s", "SEC"][1])\r
+ print(str(Br[".c", SUP_MODULE_DXE_DRIVER, "IA32", "MSFT"][1]))\r
+ print()\r
+ print(str(Br[".c", SUP_MODULE_DXE_DRIVER, "IA32", "INTEL"][1]))\r
+ print()\r
+ print(str(Br[".c", SUP_MODULE_DXE_DRIVER, "IA32", "GCC"][1]))\r
+ print()\r
+ print(str(Br[".ac", "ACPI_TABLE", "IA32", "MSFT"][1]))\r
+ print()\r
+ print(str(Br[".h", "ACPI_TABLE", "IA32", "INTEL"][1]))\r
+ print()\r
+ print(str(Br[".ac", "ACPI_TABLE", "IA32", "MSFT"][1]))\r
+ print()\r
+ print(str(Br[".s", SUP_MODULE_SEC, "IPF", "COMMON"][1]))\r
+ print()\r
+ print(str(Br[".s", SUP_MODULE_SEC][1]))\r
\r