Skip to content

Commit 227ffec

Browse files
committed
Make - handle invalid targets (catch KeyError)
1 parent 7f1306f commit 227ffec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/make.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,12 @@
240240
if options.build_dir is not None:
241241
build_dir = options.build_dir
242242

243-
target = TARGET_MAP[mcu]
243+
try:
244+
target = TARGET_MAP[mcu]
245+
except KeyError:
246+
print "[ERROR] Target %s not supported" % mcu
247+
sys.exit(1)
248+
244249
try:
245250
bin_file = build_project(test.source_dir, build_dir, target, toolchain, test.dependencies, options.options,
246251
linker_script=options.linker_script,

0 commit comments

Comments
 (0)