8000 {esp32,rp2,stm32}/Makefile: Append board variant to BUILD. · micropython/micropython@6b27abf · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b27abf

Browse files
committed
{esp32,rp2,stm32}/Makefile: Append board variant to BUILD.
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>
1 parent 79ab6f5 commit 6b27abf

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

ports/esp32/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ ifeq ($(wildcard $(BOARD_DIR)/.),)
1717
$(error Invalid BOARD specified: $(BOARD_DIR))
1818
endif
1919

20-
# If the build directory is not given, make it reflect the board name.
20+
# If the build directory is not given, make it reflect the board name (and
21+
# optionally the board variant).
22+
ifneq ($(BOARD_VARIANT),)
23+
BUILD ?= build-$(BOARD)-$(BOARD_VARIANT)
24+
else
2125
BUILD ?= build-$(BOARD)
26+
endif
2227

2328
# Device serial settings.
2429
PORT ?= /dev/ttyUSB0

ports/rp2/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ endif
1616
ifeq ($(wildcard $(BOARD_DIR)/.),)
1717
$(error Invalid BOARD specified: $(BOARD_DIR))
1818
endif
19-
19+
20+
# If the build directory is not given, make it reflect the board name (and
21+
# optionally the board variant).
22+
ifneq ($(BOARD_VARIANT),)
23+
BUILD ?= build-$(BOARD)-$(BOARD_VARIANT)
24+
else
2025
BUILD ?= build-$(BOARD)
26+
endif
2127

2228
$(VERBOSE)MAKESILENT = -s
2329

ports/stm32/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ ifeq ($(wildcard $(BOARD_DIR)/.),)
1313
$(error Invalid BOARD specified: $(BOARD_DIR))
1414
endif
1515

16-
# If the build directory is not given, make it reflect the board name.
16+
# If the build directory is not given, make it reflect the board name (and
17+
# optionally the board variant).
18+
ifneq ($(BOARD_VARIANT),)
19+
BUILD ?= build-$(BOARD)-$(BOARD_VARIANT)
20+
else
1721
BUILD ?= build-$(BOARD)
22+
endif
1823

1924
include ../../py/mkenv.mk
2025
-include mpconfigport.mk

0 commit comments

Comments
 (0)
0