mirror of https://github.com/ARMmbed/mbed-os.git
Fix building with python 3
parent
9cbc91f2d7
commit
dc0a2332b8
|
@ -812,8 +812,23 @@ class mbedToolchain:
|
||||||
mkdir(obj_dir)
|
mkdir(obj_dir)
|
||||||
return join(obj_dir, name + '.o')
|
return join(obj_dir, name + '.o')
|
||||||
|
|
||||||
# Generate response file for all includes.
|
def make_option_file(self, options, naming=".options_{}.txt"):
|
||||||
# ARM, GCC, IAR cross compatible
|
""" Generate a via file for a pile of defines
|
||||||
|
ARM, GCC, IAR cross compatible
|
||||||
|
"""
|
||||||
|
to_write = " ".join(options).encode('utf-8')
|
||||||
|
new_md5 = md5(to_write).hexdigest()
|
||||||
|
via_file = join(self.build_dir, naming.format(new_md5))
|
||||||
|
try:
|
||||||
|
with open(via_file, "r") as fd:
|
||||||
|
old_md5 = md5(fd.read().encode('utf-8')).hexdigest()
|
||||||
|
except IOError:
|
||||||
|
old_md5 = None
|
||||||
|
if old_md5 != new_md5:
|
||||||
|
with open(via_file, "wb") as fd:
|
||||||
|
fd.write(to_write)
|
||||||
|
return via_file
|
||||||
|
|
||||||
def get_inc_file(self, includes):
|
def get_inc_file(self, includes):
|
||||||
include_file = join(self.build_dir, ".includes_%s.txt" % self.inc_md5)
|
include_file = join(self.build_dir, ".includes_%s.txt" % self.inc_md5)
|
||||||
if not exists(include_file):
|
if not exists(include_file):
|
||||||
|
|
Loading…
Reference in New Issue