ports: Make BOARD default from BOARD_DIR in Makefile's.
This allows:
$ make BOARD_DIR=path/to/board
to infer BOARD=board, rather than the previous behavior that required
additionally setting BOARD explicitly.
Also makes the same change for VARIANT_DIR -> VARIANT on Unix.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
b110266897
commit
69b93527d5
@ -1,15 +1,21 @@
|
|||||||
# Select the board to build for: if not given on the command line,
|
# Select the board to build for:
|
||||||
# then default to GENERIC.
|
ifdef BOARD_DIR
|
||||||
|
# Custom board path - remove trailing slash and get the final component of
|
||||||
|
# the path as the board name.
|
||||||
|
BOARD ?= $(notdir $(BOARD_DIR:/=))
|
||||||
|
else
|
||||||
|
# If not given on the command line, then default to GENERIC.
|
||||||
BOARD ?= GENERIC
|
BOARD ?= GENERIC
|
||||||
|
|
||||||
# If the build directory is not given, make it reflect the board name.
|
|
||||||
BUILD ?= build-$(BOARD)
|
|
||||||
|
|
||||||
BOARD_DIR ?= boards/$(BOARD)
|
BOARD_DIR ?= boards/$(BOARD)
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(wildcard $(BOARD_DIR)/.),)
|
ifeq ($(wildcard $(BOARD_DIR)/.),)
|
||||||
$(error Invalid BOARD specified: $(BOARD_DIR))
|
$(error Invalid BOARD specified: $(BOARD_DIR))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# If the build directory is not given, make it reflect the board name.
|
||||||
|
BUILD ?= build-$(BOARD)
|
||||||
|
|
||||||
include ../../py/mkenv.mk
|
include ../../py/mkenv.mk
|
||||||
|
|
||||||
# Optional
|
# Optional
|
||||||
|
|||||||
@ -2,8 +2,21 @@
|
|||||||
# Parameter Configuration
|
# Parameter Configuration
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
|
# Select the board to build for:
|
||||||
|
ifdef BOARD_DIR
|
||||||
|
# Custom board path - remove trailing slash and get the final component of
|
||||||
|
# the path as the board name.
|
||||||
|
BOARD ?= $(notdir $(BOARD_DIR:/=))
|
||||||
|
else
|
||||||
|
# If not given on the command line, then default to TEENSY40.
|
||||||
BOARD ?= TEENSY40
|
BOARD ?= TEENSY40
|
||||||
BOARD_DIR ?= boards/$(BOARD)
|
BOARD_DIR ?= boards/$(BOARD)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(wildcard $(BOARD_DIR)/.),)
|
||||||
|
$(error Invalid BOARD specified: $(BOARD_DIR))
|
||||||
|
endif
|
||||||
|
|
||||||
BUILD ?= build-$(BOARD)
|
BUILD ?= build-$(BOARD)
|
||||||
PORT ?= /dev/ttyACM0
|
PORT ?= /dev/ttyACM0
|
||||||
CROSS_COMPILE ?= arm-none-eabi-
|
CROSS_COMPILE ?= arm-none-eabi-
|
||||||
@ -25,9 +38,6 @@ MAKE_FLEXRAM_LD = boards/make-flexram-config.py
|
|||||||
include ../../py/mkenv.mk
|
include ../../py/mkenv.mk
|
||||||
|
|
||||||
# Include micropython configuration board makefile
|
# Include micropython configuration board makefile
|
||||||
ifeq ($(wildcard $(BOARD_DIR)/.),)
|
|
||||||
$(error Invalid BOARD specified: $(BOARD_DIR))
|
|
||||||
endif
|
|
||||||
include $(BOARD_DIR)/mpconfigboard.mk
|
include $(BOARD_DIR)/mpconfigboard.mk
|
||||||
|
|
||||||
# File containing description of content to be frozen into firmware.
|
# File containing description of content to be frozen into firmware.
|
||||||
|
|||||||
@ -1,12 +1,18 @@
|
|||||||
# Select the board to build for: if not given on the command line,
|
# Select the board to build for:
|
||||||
# then default to pca10040.
|
ifdef BOARD_DIR
|
||||||
|
# Custom board path - remove trailing slash and get the final component of
|
||||||
|
# the path as the board name.
|
||||||
|
BOARD ?= $(notdir $(BOARD_DIR:/=))
|
||||||
|
else
|
||||||
|
# If not given on the command line, then default to pca10040.
|
||||||
BOARD ?= pca10040
|
BOARD ?= pca10040
|
||||||
|
BOARD_DIR ?= boards/$(BOARD)
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(wildcard boards/$(BOARD)/.),)
|
ifeq ($(wildcard boards/$(BOARD)/.),)
|
||||||
$(error Invalid BOARD specified)
|
$(error Invalid BOARD specified)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
BOARD_DIR ?= boards/$(BOARD)
|
|
||||||
|
|
||||||
# If SoftDevice is selected, try to use that one.
|
# If SoftDevice is selected, try to use that one.
|
||||||
SD ?=
|
SD ?=
|
||||||
SD_LOWER = $(shell echo $(SD) | tr '[:upper:]' '[:lower:]')
|
SD_LOWER = $(shell echo $(SD) | tr '[:upper:]' '[:lower:]')
|
||||||
|
|||||||
@ -1,15 +1,21 @@
|
|||||||
# Select the board to build for: if not given on the command line,
|
# Select the board to build for:
|
||||||
# then default to RA6M2_EK.
|
ifdef BOARD_DIR
|
||||||
|
# Custom board path - remove trailing slash and get the final component of
|
||||||
|
# the path as the board name.
|
||||||
|
BOARD ?= $(notdir $(BOARD_DIR:/=))
|
||||||
|
else
|
||||||
|
# If not given on the command line, then default to RA6M2_EK.
|
||||||
BOARD ?= RA6M2_EK
|
BOARD ?= RA6M2_EK
|
||||||
|
|
||||||
# If the build directory is not given, make it reflect the board name.
|
|
||||||
BUILD ?= build-$(BOARD)
|
|
||||||
|
|
||||||
BOARD_DIR ?= boards/$(BOARD)
|
BOARD_DIR ?= boards/$(BOARD)
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(wildcard $(BOARD_DIR)/.),)
|
ifeq ($(wildcard $(BOARD_DIR)/.),)
|
||||||
$(error Invalid BOARD specified: $(BOARD_DIR))
|
$(error Invalid BOARD specified: $(BOARD_DIR))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# If the build directory is not given, make it reflect the board name.
|
||||||
|
BUILD ?= build-$(BOARD)
|
||||||
|
|
||||||
ifeq ($(BOARD),RA4M1_CLICKER)
|
ifeq ($(BOARD),RA4M1_CLICKER)
|
||||||
BOARD_LOW = ra4m1_ek
|
BOARD_LOW = ra4m1_ek
|
||||||
CMSIS_MCU_LOW = ra4m1
|
CMSIS_MCU_LOW = ra4m1
|
||||||
|
|||||||
@ -1,14 +1,23 @@
|
|||||||
|
# Select the board to build for:
|
||||||
|
ifdef BOARD_DIR
|
||||||
|
# Custom board path - remove trailing slash and get the final component of
|
||||||
|
# the path as the board name.
|
||||||
|
BOARD ?= $(notdir $(BOARD_DIR:/=))
|
||||||
|
else
|
||||||
|
# If not given on the command line, then default to ADAFRUIT_ITSYBITSY_M4_EXPRESS.
|
||||||
BOARD ?= ADAFRUIT_ITSYBITSY_M4_EXPRESS
|
BOARD ?= ADAFRUIT_ITSYBITSY_M4_EXPRESS
|
||||||
BOARD_DIR ?= boards/$(BOARD)
|
BOARD_DIR ?= boards/$(BOARD)
|
||||||
BUILD ?= build-$(BOARD)
|
endif
|
||||||
|
|
||||||
CROSS_COMPILE ?= arm-none-eabi-
|
|
||||||
UF2CONV ?= $(TOP)/tools/uf2conv.py
|
|
||||||
|
|
||||||
ifeq ($(wildcard $(BOARD_DIR)/.),)
|
ifeq ($(wildcard $(BOARD_DIR)/.),)
|
||||||
$(error Invalid BOARD specified: $(BOARD_DIR))
|
$(error Invalid BOARD specified: $(BOARD_DIR))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
BUILD ?= build-$(BOARD)
|
||||||
|
|
||||||
|
CROSS_COMPILE ?= arm-none-eabi-
|
||||||
|
UF2CONV ?= $(TOP)/tools/uf2conv.py
|
||||||
|
|
||||||
MCU_SERIES_LOWER = $(shell echo $(MCU_SERIES) | tr '[:upper:]' '[:lower:]')
|
MCU_SERIES_LOWER = $(shell echo $(MCU_SERIES) | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
include ../../py/mkenv.mk
|
include ../../py/mkenv.mk
|
||||||
|
|||||||
@ -1,15 +1,21 @@
|
|||||||
# Select the board to build for: if not given on the command line,
|
# Select the board to build for:
|
||||||
# then default to PYBV10.
|
ifdef BOARD_DIR
|
||||||
|
# Custom board path - remove trailing slash and get the final component of
|
||||||
|
# the path as the board name.
|
||||||
|
BOARD ?= $(notdir $(BOARD_DIR:/=))
|
||||||
|
else
|
||||||
|
# If not given on the command line, then default to PYBV10.
|
||||||
BOARD ?= PYBV10
|
BOARD ?= PYBV10
|
||||||
|
|
||||||
# If the build directory is not given, make it reflect the board name.
|
|
||||||
BUILD ?= build-$(BOARD)
|
|
||||||
|
|
||||||
BOARD_DIR ?= boards/$(BOARD)
|
BOARD_DIR ?= boards/$(BOARD)
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(wildcard $(BOARD_DIR)/.),)
|
ifeq ($(wildcard $(BOARD_DIR)/.),)
|
||||||
$(error Invalid BOARD specified: $(BOARD_DIR))
|
$(error Invalid BOARD specified: $(BOARD_DIR))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# If the build directory is not given, make it reflect the board name.
|
||||||
|
BUILD ?= build-$(BOARD)
|
||||||
|
|
||||||
include ../../py/mkenv.mk
|
include ../../py/mkenv.mk
|
||||||
-include mpconfigport.mk
|
-include mpconfigport.mk
|
||||||
include $(BOARD_DIR)/mpconfigboard.mk
|
include $(BOARD_DIR)/mpconfigboard.mk
|
||||||
|
|||||||
@ -1,13 +1,17 @@
|
|||||||
# Select the board to build for: if not given on the command line,
|
# Select the board to build for:
|
||||||
# then default to PYBV10.
|
ifdef BOARD_DIR
|
||||||
|
# Custom board path - remove trailing slash and get the final component of
|
||||||
|
# the path as the board name.
|
||||||
|
BOARD ?= $(notdir $(BOARD_DIR:/=))
|
||||||
|
else
|
||||||
|
# If not given on the command line, then default to PYBV10.
|
||||||
BOARD ?= PYBV10
|
BOARD ?= PYBV10
|
||||||
|
BOARD_DIR ?= $(abspath ../boards/$(BOARD))
|
||||||
|
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.
|
||||||
BUILD ?= build-$(BOARD)
|
BUILD ?= build-$(BOARD)
|
||||||
|
|
||||||
# Allow the directory containing the board configuration to be specified
|
|
||||||
BOARD_DIR ?= $(abspath ../boards/$(BOARD))
|
|
||||||
|
|
||||||
# Set USE_MBOOT to 1 so that TEXT0_ADDR gets set properly for those boards
|
# Set USE_MBOOT to 1 so that TEXT0_ADDR gets set properly for those boards
|
||||||
# that can be built with or without mboot.
|
# that can be built with or without mboot.
|
||||||
USE_MBOOT ?= 1
|
USE_MBOOT ?= 1
|
||||||
|
|||||||
@ -1,14 +1,21 @@
|
|||||||
# Select the variant to build for.
|
# Select the variant to build for:
|
||||||
|
ifdef VARIANT_DIR
|
||||||
|
# Custom variant path - remove trailing slash and get the final component of
|
||||||
|
# the path as the variant name.
|
||||||
|
VARIANT ?= $(notdir $(VARIANT_DIR:/=))
|
||||||
|
else
|
||||||
|
# If not given on the command line, then default to standard.
|
||||||
VARIANT ?= standard
|
VARIANT ?= standard
|
||||||
|
|
||||||
# If the build directory is not given, make it reflect the variant name.
|
|
||||||
BUILD ?= build-$(VARIANT)
|
|
||||||
|
|
||||||
VARIANT_DIR ?= variants/$(VARIANT)
|
VARIANT_DIR ?= variants/$(VARIANT)
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(wildcard $(VARIANT_DIR)/.),)
|
ifeq ($(wildcard $(VARIANT_DIR)/.),)
|
||||||
$(error Invalid VARIANT specified: $(VARIANT_DIR))
|
$(error Invalid VARIANT specified: $(VARIANT_DIR))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# If the build directory is not given, make it reflect the variant name.
|
||||||
|
BUILD ?= build-$(VARIANT)
|
||||||
|
|
||||||
include ../../py/mkenv.mk
|
include ../../py/mkenv.mk
|
||||||
-include mpconfigport.mk
|
-include mpconfigport.mk
|
||||||
include $(VARIANT_DIR)/mpconfigvariant.mk
|
include $(VARIANT_DIR)/mpconfigvariant.mk
|
||||||
|
|||||||
@ -1,14 +1,21 @@
|
|||||||
# Select the variant to build for.
|
# Select the variant to build for:
|
||||||
|
ifdef VARIANT_DIR
|
||||||
|
# Custom variant path - remove trailing slash and get the final component of
|
||||||
|
# the path as the variant name.
|
||||||
|
VARIANT ?= $(notdir $(VARIANT_DIR:/=))
|
||||||
|
else
|
||||||
|
# If not given on the command line, then default to standard.
|
||||||
VARIANT ?= standard
|
VARIANT ?= standard
|
||||||
|
|
||||||
# If the build directory is not given, make it reflect the variant name.
|
|
||||||
BUILD ?= build-$(VARIANT)
|
|
||||||
|
|
||||||
VARIANT_DIR ?= variants/$(VARIANT)
|
VARIANT_DIR ?= variants/$(VARIANT)
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(wildcard $(VARIANT_DIR)/.),)
|
ifeq ($(wildcard $(VARIANT_DIR)/.),)
|
||||||
$(error Invalid VARIANT specified: $(VARIANT_DIR))
|
$(error Invalid VARIANT specified: $(VARIANT_DIR))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# If the build directory is not given, make it reflect the variant name.
|
||||||
|
BUILD ?= build-$(VARIANT)
|
||||||
|
|
||||||
include ../../py/mkenv.mk
|
include ../../py/mkenv.mk
|
||||||
-include mpconfigport.mk
|
-include mpconfigport.mk
|
||||||
include $(VARIANT_DIR)/mpconfigvariant.mk
|
include $(VARIANT_DIR)/mpconfigvariant.mk
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user