diff --git a/Makefile.include b/Makefile.include index 6b5d8a2e06..9c45a7440f 100644 --- a/Makefile.include +++ b/Makefile.include @@ -385,7 +385,7 @@ include $(RIOTMAKE)/modules.inc.mk .PHONY: all link clean flash flash-only term doc debug debug-server reset objdump help info-modules -.PHONY: print-size elffile binfile hexfile +.PHONY: print-size elffile binfile hexfile flashfile .PHONY: ..in-docker-container # Targets that depend on FORCE will always be rebuilt. Contrary to a .PHONY @@ -411,6 +411,12 @@ BINFILE ?= $(ELFFILE:.elf=.bin) elffile: $(ELFFILE) hexfile: $(HEXFILE) binfile: $(BINFILE) +# # # FLASHFILE Being introduced, only supported if bsp define FLASHFILE # # # +# # # Not all boards use this file for the moment +# +# FLASHFILE is the file used by the flasher +# (can be overwritten to $(HEXFILE), $(BINFILE)) +flashfile: $(FLASHFILE) # variables used to compile and link c++ CPPMIX ?= $(if $(wildcard *.cpp),1,) @@ -445,7 +451,7 @@ ifeq ($(BUILD_IN_DOCKER),1) link: ..in-docker-container else ifeq (,$(RIOTNOLINK)) -link: ..compiler-check ..build-message $(ELFFILE) $(HEXFILE) print-size +link: ..compiler-check ..build-message $(ELFFILE) $(FLASHFILE) $(HEXFILE) print-size else link: ..compiler-check ..build-message $(BASELIBS) endif # RIOTNOLINK diff --git a/makefiles/docker.inc.mk b/makefiles/docker.inc.mk index 775549f630..058e623632 100644 --- a/makefiles/docker.inc.mk +++ b/makefiles/docker.inc.mk @@ -44,6 +44,7 @@ export DOCKER_ENV_VARS = \ CXXUWFLAGS \ ELFFILE \ HEXFILE \ + FLASHFILE \ LINK \ LINKFLAGPREFIX \ LINKFLAGS \ diff --git a/makefiles/info.inc.mk b/makefiles/info.inc.mk index c9587ac391..239b819c11 100644 --- a/makefiles/info.inc.mk +++ b/makefiles/info.inc.mk @@ -44,6 +44,7 @@ info-build: @echo '' @echo 'ELFFILE: $(ELFFILE)' @echo 'HEXFILE: $(HEXFILE)' + @echo 'FLASHFILE: $(FLASHFILE)' @echo '' @echo 'FEATURES_REQUIRED (excl. optional features):' @echo ' $(or $(sort $(filter-out $(FEATURES_OPTIONAL), $(FEATURES_REQUIRED))), -none-)' diff --git a/makefiles/scan-build.inc.mk b/makefiles/scan-build.inc.mk index 10fb376f06..9fcf881b0d 100644 --- a/makefiles/scan-build.inc.mk +++ b/makefiles/scan-build.inc.mk @@ -17,6 +17,7 @@ SCANBUILD_ENV_VARS := \ CXXUWFLAGS \ ELFFILE \ HEXFILE \ + FLASHFILE \ HOME \ LINK \ LINKFLAGPREFIX \ diff --git a/makefiles/vars.inc.mk b/makefiles/vars.inc.mk index dece27bdf6..bff4d74f52 100644 --- a/makefiles/vars.inc.mk +++ b/makefiles/vars.inc.mk @@ -77,6 +77,7 @@ export FLASH_ADDR # Define an offset to flash code into ROM memory. export PORT # The port to connect the TERMPROG to. export ELFFILE # The unstripped result of the compilation. export HEXFILE # The stripped result of the compilation. +# FLASHFILE # The output file used for flashing (transition phase: only if defined) export DEBUGGER # The command to call on "make debug", usually a script starting the GDB front-end. export DEBUGGER_FLAGS # The parameters to supply to DEBUGGER. export DEBUGSERVER # The command to call on "make debug-server", usually a script starting the GDB server.