From ecfdece104f353af1938561dacd80485a5d3ce4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Fri, 1 Mar 2019 16:28:22 +0100 Subject: [PATCH] Makefile.include: include 'riotboot.mk' before using FLASHFILE Include the 'riotboot.mk' file before using FLASHFILE/ELFFILE/HEXFILE variables. This will allow setting variables to values from riotboot.mk like `FLASHFILE = $(RIOTBOOT_COMBINED_BIN)` before it is evaluated in Makefile.include. It should be included after defining 'BINFILE' for 'riotboot.bin' handling. --- Makefile.include | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile.include b/Makefile.include index 9c45a7440..b50a1ef3a 100644 --- a/Makefile.include +++ b/Makefile.include @@ -407,6 +407,11 @@ ELFFILE ?= $(BINDIR)/$(APPLICATION).elf HEXFILE ?= $(ELFFILE:.elf=.hex) BINFILE ?= $(ELFFILE:.elf=.bin) +# include bootloaders support. It should be included early to allow using +# variables defined in `riotboot.mk` for `FLASHFILE` before it is evaluated. +# It should be included after defining 'BINFILE' for 'riotboot.bin' handling. +include $(RIOTMAKE)/boot/riotboot.mk + # Targets to get given file elffile: $(ELFFILE) hexfile: $(HEXFILE) @@ -442,11 +447,6 @@ else _LINK = $(if $(CPPMIX),$(LINKXX),$(LINK)) $(UNDEF) $(LINKFLAGPREFIX)--start-group $(BASELIBS) -lm $(LINKFLAGPREFIX)--end-group $(LINKFLAGS) $(LINKFLAGPREFIX)-Map=$(BINDIR)/$(APPLICATION).map endif # BUILDOSXNATIVE -# include bootloaders support. When trying to overwrite one variable -# like HEXFILE, the value will already have been evaluated when declaring -# the link target. Therefore, it must be placed before `link`. -include $(RIOTMAKE)/boot/riotboot.mk - ifeq ($(BUILD_IN_DOCKER),1) link: ..in-docker-container else