3 class GenFdsGlobalVariable:
\r
7 FfsDir = '' # FvDir + os.sep + 'Ffs'
\r
16 ActivePlatform = None
\r
17 def ExtendMarco (String):
\r
20 def SetDir (OutputDir, FdfParser, WorkSpace, ArchList):
\r
21 print "GenFdsGlobalVariable.OuputDir :%s" %OutputDir
\r
22 GenFdsGlobalVariable.OuputDir = os.path.normpath(OutputDir)
\r
23 GenFdsGlobalVariable.FdfParser = FdfParser
\r
24 GenFdsGlobalVariable.WorkSpace = WorkSpace
\r
25 GenFdsGlobalVariable.FvDir = os.path.join(GenFdsGlobalVariable.OuputDir, 'Fv')
\r
26 GenFdsGlobalVariable.FfsDir = os.path.join(GenFdsGlobalVariable.FvDir, 'Ffs')
\r
27 if ArchList != None:
\r
28 GenFdsGlobalVariable.ArchList = ArchList
\r
30 if not os.path.exists(GenFdsGlobalVariable.FvDir) :
\r
31 os.makedirs(GenFdsGlobalVariable.FvDir)
\r
33 def SetDefaultRule (Rule) :
\r
34 GenFdsGlobalVariable.DefaultRule = Rule
\r
36 def ReplaceWorkspaceMarco(String):
\r
37 Str = String.replace('$(WORKSPACE)', GenFdsGlobalVariable.WorkSpaceDir)
\r
38 if os.path.exists(Str):
\r
39 Str = os.path.realpath(Str)
\r
41 Str = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, String)
\r
44 def CallExternalTool (cmd, errorMess):
\r
45 PopenObject = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr= subprocess.PIPE)
\r
46 (out, error) = PopenObject.communicate()
\r
48 while PopenObject.returncode == None :
\r
50 if PopenObject.returncode != 0:
\r
51 print "Return Value = %d" %PopenObject.returncode
\r
54 raise Exception(errorMess)
\r
56 SetDir = staticmethod(SetDir)
\r
57 ExtendMarco = staticmethod(ExtendMarco)
\r
58 SetDefaultRule = staticmethod(SetDefaultRule)
\r
59 ReplaceWorkspaceMarco = staticmethod(ReplaceWorkspaceMarco)
\r
60 CallExternalTool = staticmethod(CallExternalTool)
\r