+
+#######################################
+# Override configuration for specified target
+try:
+ target = open(os.path.join(absroot, '.target'), 'r').readline().rstrip()
+ conffile = os.path.join(absroot, 'targets', target, 'conf.py')
+ try:
+ ovconf = importlib.machinery.SourceFileLoader("module.name", conffile).load_module()
+ for name in dir(ovconf):
+ if not re.match('__*__', name):
+ vars()[name] = vars(ovconf)[name]
+ except:
+ print("E: Invalid target specifier. Write valid target to .target file.")
+ sys.exit(-99)
+except:
+ print("E: No target specifier. Write target to .target file.")
+ sys.exit(-99)