4 # Copyright 2008 Develer S.r.l. (http://www.develer.com/)
9 # Author: Lorenzo Berni <duplo@develer.com>
18 def isBertosDir(directory):
19 return os.path.exists(directory + "/VERSION")
21 def bertosVersion(directory):
22 return open(directory + "/VERSION").readline().strip()
24 def createBertosProject(directory):
25 if not os.path.isdir(directory):
27 open(directory + "/project.bertos", "w")
30 path = os.environ["PATH"]
32 path = path.split(";")
34 path = path.split(":")
37 def findToolchains(pathList):
39 for element in pathList:
40 toolchains += glob.glob(element+ "/" + const.GCC_NAME)
43 def findDefinitions(ftype, path):
46 for filename in element[2]:
47 if fnmatch.fnmatch(filename, ftype):
48 yield (filename, element[0])
50 def loadCpuInfos(path):
52 for definition in findDefinitions(const.CPU_DEFINITION, path):
54 D.update(const.CPU_DEF)
55 def include(filename, dict = D, directory=definition[1]):
56 execfile(directory + "/" + filename, {}, D)
57 D["include"] = include
58 include(definition[0], D)
59 D["CPU_NAME"] = definition[0].split(".")[0]