diff --git a/arch/nios2/Makefile b/arch/nios2/Makefile index 84464461a96..ae551c4e137 100644 --- a/arch/nios2/Makefile +++ b/arch/nios2/Makefile @@ -29,3 +29,17 @@ soc-aflags ?= $(soc-cflags) KBUILD_CFLAGS += $(soc-cflags) KBUILD_CXXFLAGS += $(soc-cxxflags) KBUILD_AFLAGS += $(soc-aflags) + +KERNEL_HEX_NAME = $(KERNEL_NAME).hex + +quiet_cmd_gen_hex = HEX $@ + cmd_gen_hex = \ +( \ + $(OBJCOPY) -S -O ihex -R .note -R .comment -R COMMON -R .eh_frame $< $@; \ +) + +$(KERNEL_HEX_NAME): $(KERNEL_ELF_NAME) + $(call cmd,gen_hex) + +zephyr: $(KERNEL_HEX_NAME) +all: $(KERNEL_HEX_NAME)