diff --git a/makefiles/boards.inc.mk b/makefiles/boards.inc.mk index 15b67f7803..7d7374d1af 100644 --- a/makefiles/boards.inc.mk +++ b/makefiles/boards.inc.mk @@ -12,8 +12,8 @@ ifneq ($(RIOTBOARD),$(BOARDSDIR)) ALLBOARDS_RIOTBOARD ?= $(call _get_boards_in_directory,$(RIOTBOARD)) endif -# Get all boards -ALLBOARDS ?= $(sort $(call _get_boards_in_directory,$(BOARDSDIR)) $(ALLBOARDS_RIOTBOARD)) +# Use `:=` so that it is evaluated before BOARDSDIR gets eventually changed +ALLBOARDS := $(sort $(call _get_boards_in_directory,$(BOARDSDIR)) $(ALLBOARDS_RIOTBOARD)) # Set the default value from `BOARDS` BOARDS ?= $(ALLBOARDS)