Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 1 | def hex_from_elf(name, target_compatible_with = None): |
Austin Schuh | 8e17be9 | 2019-12-24 09:32:11 -0800 | [diff] [blame] | 2 | 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 Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 9 | target_compatible_with = target_compatible_with, |
Philipp Schrader | 00e7834 | 2020-11-08 10:33:22 -0800 | [diff] [blame] | 10 | toolchains = ["@bazel_tools//tools/cpp:current_cc_toolchain"], |
Austin Schuh | 8e17be9 | 2019-12-24 09:32:11 -0800 | [diff] [blame] | 11 | ) |