mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Makefile.include: add %.hex and %.bin rules
Replace HEXFILE rule by a rule for each type. HACK: Adding '-Oformat' after OFLAGS overwrite the value in flags.
This commit is contained in:
parent
42d1e1ad0b
commit
70c5079b16
@ -317,6 +317,7 @@ BASELIBS += $(APPDEPS)
|
|||||||
|
|
||||||
ELFFILE ?= $(BINDIR)/$(APPLICATION).elf
|
ELFFILE ?= $(BINDIR)/$(APPLICATION).elf
|
||||||
HEXFILE ?= $(ELFFILE:.elf=.hex)
|
HEXFILE ?= $(ELFFILE:.elf=.hex)
|
||||||
|
BINFILE ?= $(ELFFILE:.elf=.bin)
|
||||||
|
|
||||||
# variables used to compile and link c++
|
# variables used to compile and link c++
|
||||||
CPPMIX ?= $(if $(wildcard *.cpp),1,)
|
CPPMIX ?= $(if $(wildcard *.cpp),1,)
|
||||||
@ -355,8 +356,11 @@ $(BINDIR)/$(APPLICATION_MODULE).a: FORCE
|
|||||||
print-size: $(ELFFILE)
|
print-size: $(ELFFILE)
|
||||||
$(Q)$(SIZE) $<
|
$(Q)$(SIZE) $<
|
||||||
|
|
||||||
$(HEXFILE): $(ELFFILE)
|
%.hex: %.elf
|
||||||
$(Q)$(OBJCOPY) $(OFLAGS) $< $@
|
$(Q)$(OBJCOPY) $(OFLAGS) -Oihex $< $@
|
||||||
|
|
||||||
|
%.bin: %.elf
|
||||||
|
$(Q)$(OBJCOPY) $(OFLAGS) -Obinary $< $@
|
||||||
|
|
||||||
endif # BUILD_IN_DOCKER
|
endif # BUILD_IN_DOCKER
|
||||||
|
|
||||||
|
@ -27,9 +27,9 @@ else
|
|||||||
export OBJCOPY ?= gobjcopy
|
export OBJCOPY ?= gobjcopy
|
||||||
export OFLAGS ?= -O ihex
|
export OFLAGS ?= -O ihex
|
||||||
else
|
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.
|
# is not used for native anyways.
|
||||||
export OBJCOPY ?= touch
|
export OBJCOPY ?= true
|
||||||
export OFLAGS =
|
export OFLAGS =
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user