Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Build): Allow Cordio to Build with Custom BSPs #1209

Merged
merged 5 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Libraries/Cordio/platform/targets/maxim/build/cordio_lib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ ${CORDIO_BUILD_DIR}/${CORDIO_LIB}: ${CORDIO_C_FILES} ${PROJECTMK}
$(MAKE) -f ${CORDIO_DIR}/platform/targets/maxim/build/libCordio.mk lib MAXIM_PATH=${MAXIM_PATH} PROJECT=${CORDIO_LIB} \
CORDIO_LIB_VAR=${CORDIO_LIB_VAR} BUILD_DIR=${CORDIO_BUILD_DIR} MFLOAT_ABI=$(MFLOAT_ABI) \
DUAL_CORE=$(DUAL_CORE) RISCV_CORE=$(RISCV_CORE) TRACE=${TRACE} DEBUG=${DEBUG} RTOS=${RTOS} \
CFG_DEV="${CFG_DEV}" PROJECTMK=${PROJECTMK} BOARD=${BOARD} MXC_OPTIMIZE_CFLAGS=${CORDIO_OPTIMIZE_CFLAGS} \
CFG_DEV="${CFG_DEV}" PROJECTMK=${PROJECTMK} MXC_OPTIMIZE_CFLAGS=${CORDIO_OPTIMIZE_CFLAGS} \
BT_VER=${BT_VER}

clean.cordio:
@$(MAKE) -f ${CORDIO_DIR}/platform/targets/maxim/build/libCordio.mk BUILD_DIR=${CORDIO_BUILD_DIR} clean

query.cordio:
@$(MAKE) -f ${CORDIO_DIR}/platform/targets/maxim/build/libCordio.mk query QUERY_VAR="${QUERY_VAR}"
@$(MAKE) -f ${CORDIO_DIR}/platform/targets/maxim/build/libCordio.mk query QUERY_VAR="${QUERY_VAR}"
9 changes: 6 additions & 3 deletions Libraries/Cordio/platform/targets/maxim/build/libCordio.mk
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ SRCS += $(C_FILES)
VPATH += %.c $(sort $(dir $(C_FILES)))
IPATH += $(INC_DIRS)

# Add dependencies in the Board library and the PeripheralDrivers

IPATH += ${LIBS_DIR}/MiscDrivers/PushButton
IPATH += ${LIBS_DIR}/MiscDrivers/LED
IPATH += ${LIBS_DIR}/Boards/$(TARGET_UC)/$(BOARD)/Include
include ${LIBS_DIR}/PeriphDrivers/periphdriver.mk

# Add dependencies in the Board library and the PeripheralDrivers
LIB_BOARD = 1
LIB_PERIPHDRIVERS = 1
include ${LIBS_DIR}/libs.mk

# Use absolute paths if building within eclipse environment.
ifeq "$(ECLIPSE)" "1"
Expand Down
12 changes: 12 additions & 0 deletions Libraries/libs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,21 @@ LIBS_DIR ?= $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
# ************************
LIB_BOARD ?= 1
ifeq ($(LIB_BOARD), 1)

ifeq "$(BOARD)" ""
$(error ERROR: BOARD not set!)
endif

BSP_SEARCH_DIR ?= $(LIBS_DIR)/Boards/$(TARGET_UC)
BOARD_DIR := $(BSP_SEARCH_DIR)/$(BOARD)
PROJ_CFLAGS += -DLIB_BOARD

# Export BOARD and BSP_SEARCH_DIR so that all recursive Make sub-calls
# that include libs.mk will use the same BSP. Exports in general should
# be used sparingly since they will override ALL recursive sub-calls, but
# in this case we want to avoid building with mismatched BSPs.
export BOARD
export BSP_SEARCH_DIR
include $(BOARD_DIR)/board.mk
endif
# ************************
Expand Down
Loading