diff --git a/Makefile.include b/Makefile.include index b08d6fb7ed..b6cd9e3db1 100644 --- a/Makefile.include +++ b/Makefile.include @@ -317,6 +317,7 @@ BASELIBS += $(APPDEPS) ELFFILE ?= $(BINDIR)/$(APPLICATION).elf HEXFILE ?= $(ELFFILE:.elf=.hex) +BINFILE ?= $(ELFFILE:.elf=.bin) # variables used to compile and link c++ CPPMIX ?= $(if $(wildcard *.cpp),1,) @@ -355,8 +356,11 @@ $(BINDIR)/$(APPLICATION_MODULE).a: FORCE print-size: $(ELFFILE) $(Q)$(SIZE) $< -$(HEXFILE): $(ELFFILE) - $(Q)$(OBJCOPY) $(OFLAGS) $< $@ +%.hex: %.elf + $(Q)$(OBJCOPY) $(OFLAGS) -Oihex $< $@ + +%.bin: %.elf + $(Q)$(OBJCOPY) $(OFLAGS) -Obinary $< $@ endif # BUILD_IN_DOCKER diff --git a/boards/native/Makefile.include b/boards/native/Makefile.include index 0fe2faae66..3d739ac2d0 100644 --- a/boards/native/Makefile.include +++ b/boards/native/Makefile.include @@ -27,9 +27,9 @@ else export OBJCOPY ?= gobjcopy export OFLAGS ?= -O ihex else - # If gobjcopy is not available, just create an empty file. The hexfile + # If gobjcopy is not available, just do nothing. The hexfile # is not used for native anyways. - export OBJCOPY ?= touch + export OBJCOPY ?= true export OFLAGS = endif endif