Make - handle invalid targets (catch KeyError)

Martin Kojtal 2016-04-20 13:04:53 +01:00
parent 7f1306f2f0
commit 227ffecb83
1 changed files with 6 additions and 1 deletions

View File

@ -240,7 +240,12 @@ if __name__ == '__main__':
if options.build_dir is not None:
build_dir = options.build_dir
target = TARGET_MAP[mcu]
try:
target = TARGET_MAP[mcu]
except KeyError:
print "[ERROR] Target %s not supported" % mcu
sys.exit(1)
try:
bin_file = build_project(test.source_dir, build_dir, target, toolchain, test.dependencies, options.options,
linker_script=options.linker_script,