From: Pavel Pisa Date: Wed, 16 Nov 2022 19:18:40 +0000 (+0100) Subject: RTEMS rules: add support for multiple OUTPUT_FORMATS X-Git-Url: https://rtime.felk.cvut.cz/gitweb/omk.git/commitdiff_plain/a03596bfb557526c2caa9fcde77a81dfbd1fa49e RTEMS rules: add support for multiple OUTPUT_FORMATS This allows to specify followup rules to build U-boot images by specific config.target. Usesfull for example for MicroZed Xilinx Zynq based boards. Signed-off-by: Pavel Pisa --- diff --git a/snippets/rtems.omk b/snippets/rtems.omk index 7854470..c5ea7d6 100644 --- a/snippets/rtems.omk +++ b/snippets/rtems.omk @@ -220,7 +220,18 @@ $(2)/$(1): $$($(1)_OBJS) # FIXME: Why the map file was commented out? endef +# Rules for other output formats (can be specified by OUTPUT_FORMATS) +%.bin: % + @$(QUIET_CMD_ECHO) " OBJCOPY $@" + $(Q) $(OBJCOPY) --output-target=binary -S $< $@ +%.hex: % + @$(QUIET_CMD_ECHO) " OBJCOPY $@" + $(Q) $(OBJCOPY) --output-target=ihex -S $< $@ + +%.srec: % + @$(QUIET_CMD_ECHO) " OBJCOPY $@" + $(Q) $(OBJCOPY) --output-target=srec -S $< $@ # Syntax: $(call LIBRARY_template,) define LIBRARY_template @@ -282,7 +293,8 @@ endef library-pass-local: $(lib_LIBRARIES:%=$(USER_LIB_DIR)/lib%.a) $(shared_LIBRARIES:%=$(USER_LIB_DIR)/lib%.so) -binary-pass-local: $(bin_PROGRAMS:%=$(USER_BIN_DIR)/%) $(utils_PROGRAMS:%=$(USER_UTILS_DIR)/%) $(test_PROGRAMS:%=$(USER_TESTS_DIR)/%) +binary-pass-local: $(bin_PROGRAMS:%=$(USER_BIN_DIR)/%) $(utils_PROGRAMS:%=$(USER_UTILS_DIR)/%) $(test_PROGRAMS:%=$(USER_TESTS_DIR)/%) \ + $(foreach of,$(OUTPUT_FORMATS),$(bin_PROGRAMS:%=$(USER_BIN_DIR)/%.$(of)) $(test_PROGRAMS:%=$(USER_TESTS_DIR)/%.$(of))) GEN_HEADERS+=$(filter %.h,$(USER_IDLS:%.idl=%.h))