diff --git a/ports/esp32/Makefile b/ports/esp32/Makefile index 239618c6f7..9d57ee4c21 100644 --- a/ports/esp32/Makefile +++ b/ports/esp32/Makefile @@ -17,8 +17,13 @@ ifeq ($(wildcard $(BOARD_DIR)/.),) $(error Invalid BOARD specified: $(BOARD_DIR)) endif -# If the build directory is not given, make it reflect the board name. +# If the build directory is not given, make it reflect the board name (and +# optionally the board variant). +ifneq ($(BOARD_VARIANT),) +BUILD ?= build-$(BOARD)-$(BOARD_VARIANT) +else BUILD ?= build-$(BOARD) +endif # Device serial settings. PORT ?= /dev/ttyUSB0 diff --git a/ports/rp2/Makefile b/ports/rp2/Makefile index ccfc1ac7d6..fdca11d11e 100644 --- a/ports/rp2/Makefile +++ b/ports/rp2/Makefile @@ -16,8 +16,14 @@ endif ifeq ($(wildcard $(BOARD_DIR)/.),) $(error Invalid BOARD specified: $(BOARD_DIR)) endif - + +# If the build directory is not given, make it reflect the board name (and +# optionally the board variant). +ifneq ($(BOARD_VARIANT),) +BUILD ?= build-$(BOARD)-$(BOARD_VARIANT) +else BUILD ?= build-$(BOARD) +endif $(VERBOSE)MAKESILENT = -s diff --git a/ports/stm32/Makefile b/ports/stm32/Makefile index 7051398970..475d8f1004 100644 --- a/ports/stm32/Makefile +++ b/ports/stm32/Makefile @@ -13,8 +13,13 @@ ifeq ($(wildcard $(BOARD_DIR)/.),) $(error Invalid BOARD specified: $(BOARD_DIR)) endif -# If the build directory is not given, make it reflect the board name. +# If the build directory is not given, make it reflect the board name (and +# optionally the board variant). +ifneq ($(BOARD_VARIANT),) +BUILD ?= build-$(BOARD)-$(BOARD_VARIANT) +else BUILD ?= build-$(BOARD) +endif include ../../py/mkenv.mk -include mpconfigport.mk