blob: 0ff7c8dc085bfef16147440d3fd0d3773bc8e757 [file] [log] [blame]
def hex_from_elf(name, target_compatible_with = None):
native.genrule(
name = name,
srcs = ["%s.elf" % name],
outs = ["%s.hex" % name],
cmd = "$(OBJCOPY) -O ihex $< $@",
executable = True,
output_to_bindir = True,
target_compatible_with = target_compatible_with,
toolchains = ["@bazel_tools//tools/cpp:current_cc_toolchain"],
)