mirror of https://github.com/ARMmbed/mbed-os.git
CMake: Refactor Freescale targets
Refactor all Freescale targets to be CMake buildsystem targets. This removes the need for checking MBED_TARGET_LABELS repeatedly and allows us to be more flexible in the way we include MBED_TARGET source in the build. A side effect of this is it will allow us to support custom targets without breaking the build for 'standard' targets, as we use CMake's standard mechanism for adding build rules to the build system, rather than implementing our own layer of logic to exclude files not needed for the target being built. Using this approach, if an MBED_TARGET is not linked to using `target_link_libraries` its source files will not be added to the build. This means custom target source can be added to the user's application CMakeLists.txt without polluting the build system when trying to compile for a standard MBED_TARGET.pull/14252/head
parent
8284807a00
commit
ac44f1c3c5
|
@ -1,18 +1,17 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if("KLXX" IN_LIST MBED_TARGET_LABELS)
|
||||
add_subdirectory(TARGET_KLXX)
|
||||
elseif("MCUXpresso_MCUS" IN_LIST MBED_TARGET_LABELS)
|
||||
add_subdirectory(TARGET_MCUXpresso_MCUS)
|
||||
endif()
|
||||
add_subdirectory(TARGET_KLXX EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(TARGET_MCUXpresso_MCUS EXCLUDE_FROM_ALL)
|
||||
|
||||
target_include_directories(mbed-core
|
||||
add_library(mbed-freescale INTERFACE)
|
||||
|
||||
target_include_directories(mbed-freescale
|
||||
INTERFACE
|
||||
.
|
||||
)
|
||||
|
||||
target_sources(mbed-core
|
||||
target_sources(mbed-freescale
|
||||
INTERFACE
|
||||
USBPhy_Kinetis.cpp
|
||||
)
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if("KL25Z" IN_LIST MBED_TARGET_LABELS)
|
||||
add_subdirectory(TARGET_KL25Z)
|
||||
elseif("KL46Z" IN_LIST MBED_TARGET_LABELS)
|
||||
add_subdirectory(TARGET_KL46Z)
|
||||
endif()
|
||||
add_subdirectory(TARGET_KL25Z EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(TARGET_KL46Z EXCLUDE_FROM_ALL)
|
||||
|
||||
target_include_directories(mbed-core
|
||||
add_library(mbed-klxx INTERFACE)
|
||||
|
||||
target_include_directories(mbed-klxx
|
||||
INTERFACE
|
||||
.
|
||||
)
|
||||
|
||||
target_sources(mbed-core
|
||||
target_sources(mbed-klxx
|
||||
INTERFACE
|
||||
analogin_api.c
|
||||
analogout_api.c
|
||||
|
@ -25,3 +24,5 @@ target_sources(mbed-core
|
|||
sleep.c
|
||||
us_ticker.c
|
||||
)
|
||||
|
||||
target_link_libraries(mbed-klxx INTERFACE mbed-freescale)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
|
@ -9,19 +9,15 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
|||
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_MKL25Z4.S)
|
||||
endif()
|
||||
|
||||
set_property(
|
||||
GLOBAL PROPERTY
|
||||
MBED_TARGET_LINKER_FILE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}
|
||||
)
|
||||
add_library(mbed-kl25z INTERFACE)
|
||||
|
||||
target_include_directories(mbed-core
|
||||
target_include_directories(mbed-kl25z
|
||||
INTERFACE
|
||||
.
|
||||
device
|
||||
)
|
||||
|
||||
target_sources(mbed-core
|
||||
target_sources(mbed-kl25z
|
||||
INTERFACE
|
||||
PeripheralPins.c
|
||||
gpio_irq_api.c
|
||||
|
@ -32,3 +28,7 @@ target_sources(mbed-core
|
|||
device/system_MKL25Z4.c
|
||||
${STARTUP_FILE}
|
||||
)
|
||||
|
||||
mbed_set_linker_script(mbed-kl25z ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||
|
||||
target_link_libraries(mbed-kl25z INTERFACE mbed-klxx)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
|
@ -9,19 +9,15 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
|||
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_MKL46Z4.S)
|
||||
endif()
|
||||
|
||||
set_property(
|
||||
GLOBAL PROPERTY
|
||||
MBED_TARGET_LINKER_FILE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}
|
||||
)
|
||||
add_library(mbed-kl46z INTERFACE)
|
||||
|
||||
target_include_directories(mbed-core
|
||||
target_include_directories(mbed-kl46z
|
||||
INTERFACE
|
||||
.
|
||||
device
|
||||
)
|
||||
|
||||
target_sources(mbed-core
|
||||
target_sources(mbed-kl46z
|
||||
INTERFACE
|
||||
PeripheralPins.c
|
||||
flash_api.c
|
||||
|
@ -33,3 +29,7 @@ target_sources(mbed-core
|
|||
device/system_MKL46Z4.c
|
||||
${STARTUP_FILE}
|
||||
)
|
||||
|
||||
mbed_set_linker_script(mbed-kl46z ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||
|
||||
target_link_libraries(mbed-kl46z INTERFACE mbed-klxx)
|
||||
|
|
|
@ -1,32 +1,22 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if("K66F" IN_LIST MBED_TARGET_LABELS)
|
||||
add_subdirectory(TARGET_K66F)
|
||||
elseif("K82F" IN_LIST MBED_TARGET_LABELS)
|
||||
add_subdirectory(TARGET_K82F)
|
||||
elseif("KL27Z" IN_LIST MBED_TARGET_LABELS)
|
||||
add_subdirectory(TARGET_KL27Z)
|
||||
elseif("KL43Z" IN_LIST MBED_TARGET_LABELS)
|
||||
add_subdirectory(TARGET_KL43Z)
|
||||
elseif("KW41Z" IN_LIST MBED_TARGET_LABELS)
|
||||
add_subdirectory(TARGET_KW41Z)
|
||||
elseif("MCU_K22F" IN_LIST MBED_TARGET_LABELS)
|
||||
add_subdirectory(TARGET_MCU_K22F)
|
||||
elseif("MCU_K64F" IN_LIST MBED_TARGET_LABELS)
|
||||
add_subdirectory(TARGET_MCU_K64F)
|
||||
endif()
|
||||
add_subdirectory(TARGET_K66F EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(TARGET_K82F EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(TARGET_KL43Z EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(TARGET_KW41Z EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(TARGET_MCU_K22F EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(TARGET_MCU_K64F EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(middleware/wireless/TARGET_FRAMEWORK_5_3_3 EXCLUDE_FROM_ALL)
|
||||
|
||||
if("FRAMEWORK_5_3_3" IN_LIST MBED_TARGET_LABELS)
|
||||
add_subdirectory(middleware/wireless/TARGET_FRAMEWORK_5_3_3)
|
||||
endif()
|
||||
add_library(mbed-mcuxpresso-mcus INTERFACE)
|
||||
|
||||
target_include_directories(mbed-core
|
||||
target_include_directories(mbed-mcuxpresso-mcus
|
||||
INTERFACE
|
||||
api
|
||||
)
|
||||
|
||||
target_sources(mbed-core
|
||||
target_sources(mbed-mcuxpresso-mcus
|
||||
INTERFACE
|
||||
fsl_common.c
|
||||
|
||||
|
@ -44,3 +34,5 @@ target_sources(mbed-core
|
|||
api/rtc_api.c
|
||||
api/sleep.c
|
||||
)
|
||||
|
||||
target_link_libraries(mbed-mcuxpresso-mcus INTERFACE mbed-freescale)
|
||||
|
|
|
@ -1,21 +1,7 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if("FRDM" IN_LIST MBED_TARGET_LABELS)
|
||||
target_include_directories(mbed-core
|
||||
INTERFACE
|
||||
TARGET_FRDM
|
||||
)
|
||||
|
||||
target_sources(mbed-core
|
||||
INTERFACE
|
||||
TARGET_FRDM/PeripheralPins.c
|
||||
TARGET_FRDM/crc.c
|
||||
TARGET_FRDM/fsl_clock_config.c
|
||||
TARGET_FRDM/fsl_phy.c
|
||||
TARGET_FRDM/mbed_overrides.c
|
||||
)
|
||||
endif()
|
||||
add_subdirectory(TARGET_FRDM EXCLUDE_FROM_ALL)
|
||||
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/MK66FN2M0xxx18.sct)
|
||||
|
@ -25,20 +11,16 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
|||
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_MK66F18.S)
|
||||
endif()
|
||||
|
||||
set_property(
|
||||
GLOBAL PROPERTY
|
||||
MBED_TARGET_LINKER_FILE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}
|
||||
)
|
||||
add_library(mbed-k66f INTERFACE)
|
||||
|
||||
target_include_directories(mbed-core
|
||||
target_include_directories(mbed-k66f
|
||||
INTERFACE
|
||||
.
|
||||
device
|
||||
drivers
|
||||
)
|
||||
|
||||
target_sources(mbed-core
|
||||
target_sources(mbed-k66f
|
||||
INTERFACE
|
||||
pwmout_api.c
|
||||
serial_api.c
|
||||
|
@ -93,3 +75,7 @@ target_sources(mbed-core
|
|||
device/system_MK66F18.c
|
||||
${STARTUP_FILE}
|
||||
)
|
||||
|
||||
mbed_set_linker_script(mbed-k66f ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||
|
||||
target_link_libraries(mbed-k66f INTERFACE mbed-mcuxpresso-mcus mbed-frdm-k66f)
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
# Copyright (c) 2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_library(mbed-frdm-k66f INTERFACE)
|
||||
|
||||
target_include_directories(mbed-frdm-k66f
|
||||
INTERFACE
|
||||
.
|
||||
)
|
||||
|
||||
target_sources(mbed-frdm-k66f
|
||||
INTERFACE
|
||||
PeripheralPins.c
|
||||
crc.c
|
||||
fsl_clock_config.c
|
||||
fsl_phy.c
|
||||
mbed_overrides.c
|
||||
)
|
|
@ -1,19 +1,7 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if("FRDM" IN_LIST MBED_TARGET_LABELS)
|
||||
target_include_directories(mbed-core
|
||||
INTERFACE
|
||||
TARGET_FRDM
|
||||
)
|
||||
|
||||
target_sources(mbed-core
|
||||
INTERFACE
|
||||
TARGET_FRDM/PeripheralPins.c
|
||||
TARGET_FRDM/fsl_clock_config.c
|
||||
TARGET_FRDM/mbed_overrides.c
|
||||
)
|
||||
endif()
|
||||
add_subdirectory(TARGET_FRDM EXCLUDE_FROM_ALL)
|
||||
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/MK82FN256xxx15.sct)
|
||||
|
@ -23,20 +11,16 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
|||
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_MK82F25615.S)
|
||||
endif()
|
||||
|
||||
set_property(
|
||||
GLOBAL PROPERTY
|
||||
MBED_TARGET_LINKER_FILE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}
|
||||
)
|
||||
add_library(mbed-k82f INTERFACE)
|
||||
|
||||
target_include_directories(mbed-core
|
||||
target_include_directories(mbed-k82f
|
||||
INTERFACE
|
||||
.
|
||||
device
|
||||
drivers
|
||||
)
|
||||
|
||||
target_sources(mbed-core
|
||||
target_sources(mbed-k82f
|
||||
INTERFACE
|
||||
pwmout_api.c
|
||||
serial_api.c
|
||||
|
@ -105,3 +89,7 @@ target_sources(mbed-core
|
|||
device/system_MK82F25615.c
|
||||
${STARTUP_FILE}
|
||||
)
|
||||
|
||||
mbed_set_linker_script(mbed-k82f ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||
|
||||
target_link_libraries(mbed-k82f INTERFACE mbed-mcuxpresso-mcus mbed-frdm-k82f)
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
# Copyright (c) 2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_library(mbed-frdm-k82f INTERFACE)
|
||||
|
||||
target_include_directories(mbed-frdm-k82f
|
||||
INTERFACE
|
||||
.
|
||||
)
|
||||
|
||||
target_sources(mbed-frdm-k82f
|
||||
INTERFACE
|
||||
PeripheralPins.c
|
||||
fsl_clock_config.c
|
||||
mbed_overrides.c
|
||||
)
|
|
@ -1,19 +1,7 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if("FRDM" IN_LIST MBED_TARGET_LABELS)
|
||||
target_include_directories(mbed-core
|
||||
INTERFACE
|
||||
TARGET_FRDM
|
||||
)
|
||||
|
||||
target_sources(mbed-core
|
||||
INTERFACE
|
||||
TARGET_FRDM/PeripheralPins.c
|
||||
TARGET_FRDM/fsl_clock_config.c
|
||||
TARGET_FRDM/mbed_overrides.c
|
||||
)
|
||||
endif()
|
||||
add_subdirectory(TARGET_FRDM EXCLUDE_FROM_ALL)
|
||||
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/MKL43Z256xxx4.sct)
|
||||
|
@ -23,20 +11,16 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
|||
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_MKL43Z4.S)
|
||||
endif()
|
||||
|
||||
set_property(
|
||||
GLOBAL PROPERTY
|
||||
MBED_TARGET_LINKER_FILE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}
|
||||
)
|
||||
add_library(mbed-kl43z INTERFACE)
|
||||
|
||||
target_include_directories(mbed-core
|
||||
target_include_directories(mbed-kl43z
|
||||
INTERFACE
|
||||
.
|
||||
device
|
||||
drivers
|
||||
)
|
||||
|
||||
target_sources(mbed-core
|
||||
target_sources(mbed-kl43z
|
||||
INTERFACE
|
||||
pwmout_api.c
|
||||
serial_api.c
|
||||
|
@ -85,3 +69,9 @@ target_sources(mbed-core
|
|||
device/system_MKL43Z4.c
|
||||
${STARTUP_FILE}
|
||||
)
|
||||
|
||||
target_link_libraries(mbed-kl43z INTERFACE mbed-mcuxpresso-mcus)
|
||||
|
||||
mbed_set_linker_script(mbed-kl43z ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||
|
||||
target_link_libraries(mbed-kl43z INTERFACE mbed-frdm-kl43z)
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
# Copyright (c) 2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_library(mbed-frdm-kl43z INTERFACE)
|
||||
|
||||
target_include_directories(mbed-frdm-kl43z
|
||||
INTERFACE
|
||||
.
|
||||
)
|
||||
|
||||
target_sources(mbed-frdm-kl43z
|
||||
INTERFACE
|
||||
PeripheralPins.c
|
||||
fsl_clock_config.c
|
||||
mbed_overrides.c
|
||||
)
|
|
@ -1,19 +1,7 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# Copyright (c) 2020-21 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if("FRDM" IN_LIST MBED_TARGET_LABELS)
|
||||
target_include_directories(mbed-core
|
||||
INTERFACE
|
||||
TARGET_FRDM
|
||||
)
|
||||
|
||||
target_sources(mbed-core
|
||||
INTERFACE
|
||||
TARGET_FRDM/PeripheralPins.c
|
||||
TARGET_FRDM/fsl_clock_config.c
|
||||
TARGET_FRDM/mbed_overrides.c
|
||||
)
|
||||
endif()
|
||||
add_subdirectory(TARGET_FRDM EXCLUDE_FROM_ALL)
|
||||
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/MKW41Z512xxx4.sct)
|
||||
|
@ -23,20 +11,16 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
|||
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_MKW41Z4.S)
|
||||
endif()
|
||||
|
||||
set_property(
|
||||
GLOBAL PROPERTY
|
||||
MBED_TARGET_LINKER_FILE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}
|
||||
)
|
||||
add_library(mbed-kw41z INTERFACE)
|
||||
|
||||
target_include_directories(mbed-core
|
||||
target_include_directories(mbed-kw41z
|
||||
INTERFACE
|
||||
.
|
||||
device
|
||||
drivers
|
||||
)
|
||||
|
||||
target_sources(mbed-core
|
||||
target_sources(mbed-kw41z
|
||||
INTERFACE
|
||||
pwmout_api.c
|
||||
serial_api.c
|
||||
|
@ -79,3 +63,7 @@ target_sources(mbed-core
|
|||
device/system_MKW41Z4.c
|
||||
${STARTUP_FILE}
|
||||
)
|
||||
|
||||
mbed_set_linker_script(mbed-kw41z ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||
|
||||
target_link_libraries(mbed-kw41z INTERFACE mbed-mcuxpresso-mcus mbed-framework-5-3-3 mbed-frdm-kw41z)
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_library(mbed-frdm-kw41z INTERFACE)
|
||||
|
||||
target_include_directories(mbed-frdm-kw41z
|
||||
INTERFACE
|
||||
.
|
||||
)
|
||||
|
||||
target_sources(mbed-frdm-kw41z
|
||||
INTERFACE
|
||||
PeripheralPins.c
|
||||
fsl_clock_config.c
|
||||
mbed_overrides.c
|
||||
)
|
|
@ -1,53 +1,17 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if("MCU_K22F512" IN_LIST MBED_TARGET_LABELS)
|
||||
if("FRDM" IN_LIST MBED_TARGET_LABELS)
|
||||
target_include_directories(mbed-core
|
||||
INTERFACE
|
||||
TARGET_MCU_K22F512/TARGET_FRDM
|
||||
)
|
||||
add_subdirectory(TARGET_MCU_K22F512 EXCLUDE_FROM_ALL)
|
||||
|
||||
target_sources(mbed-core
|
||||
INTERFACE
|
||||
TARGET_MCU_K22F512/TARGET_FRDM/PeripheralPins.c
|
||||
TARGET_MCU_K22F512/TARGET_FRDM/fsl_clock_config.c
|
||||
TARGET_MCU_K22F512/TARGET_FRDM/mbed_overrides.c
|
||||
)
|
||||
endif()
|
||||
add_library(mbed-mcu-k22f INTERFACE)
|
||||
|
||||
target_include_directories(mbed-core
|
||||
INTERFACE
|
||||
TARGET_MCU_K22F512/device
|
||||
)
|
||||
|
||||
target_sources(mbed-core
|
||||
INTERFACE
|
||||
TARGET_MCU_K22F512/device/system_MK22F51212.c
|
||||
)
|
||||
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
set(LINKER_FILE TARGET_MCU_K22F512/device/TOOLCHAIN_ARM_STD/MK22FN512xxx12.sct)
|
||||
set(STARTUP_FILE TARGET_MCU_K22F512/device/TOOLCHAIN_ARM_STD/startup_MK22F51212.S)
|
||||
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||
set(LINKER_FILE TARGET_MCU_K22F512/device/TOOLCHAIN_GCC_ARM/MK22FN512xxx12.ld)
|
||||
set(STARTUP_FILE TARGET_MCU_K22F512/device/TOOLCHAIN_GCC_ARM/startup_MK22F51212.S)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_property(
|
||||
GLOBAL PROPERTY
|
||||
MBED_TARGET_LINKER_FILE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}
|
||||
)
|
||||
|
||||
target_include_directories(mbed-core
|
||||
target_include_directories(mbed-mcu-k22f
|
||||
INTERFACE
|
||||
.
|
||||
drivers
|
||||
)
|
||||
|
||||
target_sources(mbed-core
|
||||
target_sources(mbed-mcu-k22f
|
||||
INTERFACE
|
||||
pwmout_api.c
|
||||
serial_api.c
|
||||
|
@ -89,6 +53,6 @@ target_sources(mbed-core
|
|||
drivers/fsl_uart_edma.c
|
||||
drivers/fsl_vref.c
|
||||
drivers/fsl_wdog.c
|
||||
|
||||
${STARTUP_FILE}
|
||||
)
|
||||
|
||||
target_link_libraries(mbed-mcu-k22f INTERFACE mbed-mcuxpresso-mcus)
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
# Copyright (c) 2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_subdirectory(TARGET_FRDM EXCLUDE_FROM_ALL)
|
||||
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/MK22FN512xxx12.sct)
|
||||
set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_MK22F51212.S)
|
||||
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/MK22FN512xxx12.ld)
|
||||
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_MK22F51212.S)
|
||||
endif()
|
||||
|
||||
add_library(mbed-mcu-k22f512 INTERFACE)
|
||||
|
||||
target_include_directories(mbed-mcu-k22f512
|
||||
INTERFACE
|
||||
device
|
||||
)
|
||||
|
||||
target_sources(mbed-mcu-k22f512
|
||||
INTERFACE
|
||||
device/system_MK22F51212.c
|
||||
${STARTUP_FILE}
|
||||
)
|
||||
|
||||
target_link_libraries(mbed-mcu-k22f512 INTERFACE mbed-mcu-k22f mbed-frdm-mcu-k22f512)
|
||||
|
||||
add_library(mbed-k22f INTERFACE)
|
||||
|
||||
mbed_set_linker_script(mbed-k22f ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||
|
||||
target_link_libraries(mbed-k22f INTERFACE mbed-mcu-k22f512)
|
|
@ -0,0 +1,16 @@
|
|||
# Copyright (c) 2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_library(mbed-frdm-mcu-k22f512 INTERFACE)
|
||||
|
||||
target_include_directories(mbed-frdm-mcu-k22f512
|
||||
INTERFACE
|
||||
.
|
||||
)
|
||||
|
||||
target_sources(mbed-frdm-mcu-k22f512
|
||||
INTERFACE
|
||||
PeripheralPins.c
|
||||
fsl_clock_config.c
|
||||
mbed_overrides.c
|
||||
)
|
|
@ -1,16 +1,28 @@
|
|||
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_subdirectory(device)
|
||||
add_subdirectory(TARGET_FRDM EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(TARGET_HEXIWEAR EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(TARGET_SDT64B EXCLUDE_FROM_ALL)
|
||||
|
||||
if("FRDM" IN_LIST MBED_TARGET_LABELS)
|
||||
add_subdirectory(TARGET_FRDM)
|
||||
elseif("HEXIWEAR" IN_LIST MBED_TARGET_LABELS)
|
||||
add_subdirectory(TARGET_HEXIWEAR)
|
||||
elseif("SDT64B" IN_LIST MBED_TARGET_LABELS)
|
||||
add_subdirectory(TARGET_SDT64B)
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/MK64FN1M0xxx12.sct)
|
||||
set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_MK64F12.S)
|
||||
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/MK64FN1M0xxx12.ld)
|
||||
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_MK64F12.S)
|
||||
endif()
|
||||
|
||||
target_sources(mbed-core
|
||||
add_library(mbed-mcu-k64f INTERFACE)
|
||||
|
||||
target_include_directories(mbed-mcu-k64f
|
||||
INTERFACE
|
||||
.
|
||||
device
|
||||
drivers
|
||||
)
|
||||
|
||||
target_sources(mbed-mcu-k64f
|
||||
INTERFACE
|
||||
mbed_crc_api.c
|
||||
pwmout_api.c
|
||||
|
@ -58,10 +70,15 @@ target_sources(mbed-core
|
|||
drivers/fsl_uart_edma.c
|
||||
drivers/fsl_vref.c
|
||||
drivers/fsl_wdog.c
|
||||
|
||||
device/system_MK64F12.c
|
||||
${STARTUP_FILE}
|
||||
)
|
||||
|
||||
target_include_directories(mbed-core
|
||||
INTERFACE
|
||||
.
|
||||
drivers
|
||||
)
|
||||
target_link_libraries(mbed-mcu-k64f INTERFACE mbed-mcuxpresso-mcus)
|
||||
|
||||
mbed_set_linker_script(mbed-mcu-k64f ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||
|
||||
add_library(mbed-k64f INTERFACE)
|
||||
|
||||
target_link_libraries(mbed-k64f INTERFACE mbed-mcu-k64f mbed-frdm-k64f)
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
# Copyright (c) 2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
target_sources(mbed-core
|
||||
add_library(mbed-frdm-k64f INTERFACE)
|
||||
|
||||
target_sources(mbed-frdm-k64f
|
||||
INTERFACE
|
||||
crc.c
|
||||
fsl_clock_config.c
|
||||
|
@ -9,7 +12,7 @@ target_sources(mbed-core
|
|||
PeripheralPins.c
|
||||
)
|
||||
|
||||
target_include_directories(mbed-core
|
||||
target_include_directories(mbed-frdm-k64f
|
||||
INTERFACE
|
||||
.
|
||||
)
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
# Copyright (c) 2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_library(mbed-hexiwear INTERFACE)
|
||||
|
||||
target_include_directories(mbed-hexiwear
|
||||
INTERFACE
|
||||
.
|
||||
)
|
||||
|
||||
target_sources(mbed-hexiwear
|
||||
INTERFACE
|
||||
PeripheralPins.c
|
||||
fsl_clock_config.c
|
||||
mbed_overrides.c
|
||||
)
|
||||
|
||||
target_link_libraries(mbed-hexiwear INTERFACE mbed-mcu-k64f)
|
|
@ -0,0 +1,20 @@
|
|||
# Copyright (c) 2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_library(mbed-sdt64b INTERFACE)
|
||||
|
||||
target_include_directories(mbed-sdt64b
|
||||
INTERFACE
|
||||
.
|
||||
)
|
||||
|
||||
target_sources(mbed-sdt64b
|
||||
INTERFACE
|
||||
PeripheralPins.c
|
||||
crc.c
|
||||
fsl_clock_config.c
|
||||
fsl_phy.c
|
||||
mbed_overrides.c
|
||||
)
|
||||
|
||||
target_link_libraries(mbed-sdt64b INTERFACE mbed-mcu-k64f)
|
|
@ -1,36 +0,0 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
function(_mbed_get_assembly_k64f)
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_MK64F12.S)
|
||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
set(STARTUP_FILE TOOLCHAIN_ARM_STD/startup_MK64F12.S)
|
||||
elseif(${MBED_TOOLCHAIN} STREQUAL "IAR")
|
||||
set(STARTUP_FILE TOOLCHAIN_IAR/startup_MK64F12.S)
|
||||
endif()
|
||||
target_sources(mbed-core INTERFACE ${STARTUP_FILE})
|
||||
endfunction()
|
||||
|
||||
function(_mbed_set_linker_file)
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_GCC_ARM/MK64FN1M0xxx12.ld)
|
||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_ARM_STD/MK64FN1M0xxx12.sct)
|
||||
elseif(${MBED_TOOLCHAIN} STREQUAL "IAR")
|
||||
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_IAR/MK64FN1M0xxx12.icf)
|
||||
endif()
|
||||
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${LINKER_FILE})
|
||||
endfunction()
|
||||
|
||||
_mbed_get_assembly_k64f()
|
||||
_mbed_set_linker_file()
|
||||
|
||||
target_sources(mbed-core
|
||||
INTERFACE
|
||||
system_MK64F12.c
|
||||
)
|
||||
|
||||
target_include_directories(mbed-core
|
||||
INTERFACE
|
||||
.
|
||||
)
|
|
@ -1,14 +1,16 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
target_include_directories(mbed-core
|
||||
add_library(mbed-framework-5-3-3 INTERFACE)
|
||||
|
||||
target_include_directories(mbed-framework-5-3-3
|
||||
INTERFACE
|
||||
Common
|
||||
OSAbstraction/Interface
|
||||
XCVR/MKW41Z4
|
||||
)
|
||||
|
||||
target_sources(mbed-core
|
||||
target_sources(mbed-framework-5-3-3
|
||||
INTERFACE
|
||||
OSAbstraction/Source/fsl_os_abstraction_mbed.c
|
||||
|
||||
|
|
Loading…
Reference in New Issue