Skip to content

Commit

Permalink
{esp32,rp2,stm32}/Makefile: Append board variant to BUILD.
Browse files Browse the repository at this point in the history
This allows switching between variants without clobbering the build
output.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
  • Loading branch information
jimmo committed Aug 23, 2023
1 parent 1a99f74 commit 97ffc53
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
7 changes: 6 additions & 1 deletion ports/esp32/Makefile
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion ports/rp2/Makefile
Expand Up @@ -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

Expand Down
7 changes: 6 additions & 1 deletion ports/stm32/Makefile
Expand Up @@ -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
Expand Down

0 comments on commit 97ffc53

Please sign in to comment.