blob: 0ff7c8dc085bfef16147440d3fd0d3773bc8e757 [file] [log] [blame]
Philipp Schraderdada1072020-11-24 11:34:46 -08001def hex_from_elf(name, target_compatible_with = None):
Austin Schuh8e17be92019-12-24 09:32:11 -08002 native.genrule(
3 name = name,
4 srcs = ["%s.elf" % name],
5 outs = ["%s.hex" % name],
6 cmd = "$(OBJCOPY) -O ihex $< $@",
7 executable = True,
8 output_to_bindir = True,
Philipp Schraderdada1072020-11-24 11:34:46 -08009 target_compatible_with = target_compatible_with,
Philipp Schrader00e78342020-11-08 10:33:22 -080010 toolchains = ["@bazel_tools//tools/cpp:current_cc_toolchain"],
Austin Schuh8e17be92019-12-24 09:32:11 -080011 )