mirror of https://github.com/ARMmbed/mbed-os.git
CMake: Refactor Nuvoton targets
Refactor all Nuvoton 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/14282/head
parent
3174a4c6a5
commit
2a6a840903
|
@ -1,28 +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
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if("M2351" IN_LIST MBED_TARGET_LABELS)
|
add_library(mbed-nuvoton INTERFACE)
|
||||||
add_subdirectory(TARGET_M2351)
|
|
||||||
elseif("M251" IN_LIST MBED_TARGET_LABELS)
|
|
||||||
add_subdirectory(TARGET_M251)
|
|
||||||
elseif("M261" IN_LIST MBED_TARGET_LABELS)
|
|
||||||
add_subdirectory(TARGET_M261)
|
|
||||||
elseif("M451" IN_LIST MBED_TARGET_LABELS)
|
|
||||||
add_subdirectory(TARGET_M451)
|
|
||||||
elseif("M480" IN_LIST MBED_TARGET_LABELS)
|
|
||||||
add_subdirectory(TARGET_M480)
|
|
||||||
elseif("NANO100" IN_LIST MBED_TARGET_LABELS)
|
|
||||||
add_subdirectory(TARGET_NANO100)
|
|
||||||
elseif("NUC472" IN_LIST MBED_TARGET_LABELS)
|
|
||||||
add_subdirectory(TARGET_NUC472)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
add_subdirectory(TARGET_M2351 EXCLUDE_FROM_ALL)
|
||||||
|
add_subdirectory(TARGET_M251 EXCLUDE_FROM_ALL)
|
||||||
|
add_subdirectory(TARGET_M261 EXCLUDE_FROM_ALL)
|
||||||
|
add_subdirectory(TARGET_M451 EXCLUDE_FROM_ALL)
|
||||||
|
add_subdirectory(TARGET_M480 EXCLUDE_FROM_ALL)
|
||||||
|
add_subdirectory(TARGET_NANO100 EXCLUDE_FROM_ALL)
|
||||||
|
add_subdirectory(TARGET_NUC472 EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
|
target_include_directories(mbed-nuvoton
|
||||||
INTERFACE
|
INTERFACE
|
||||||
.
|
.
|
||||||
)
|
)
|
||||||
|
|
||||||
target_sources(mbed-core
|
target_sources(mbed-nuvoton
|
||||||
INTERFACE
|
INTERFACE
|
||||||
nu_miscutil.c
|
nu_miscutil.c
|
||||||
nu_modutil.c
|
nu_modutil.c
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if("M23_NS" IN_LIST MBED_TARGET_LABELS)
|
add_subdirectory(TARGET_M23_NS EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(TARGET_M23_NS)
|
add_subdirectory(TARGET_M23_S EXCLUDE_FROM_ALL)
|
||||||
elseif("M23_S" IN_LIST MBED_TARGET_LABELS)
|
add_subdirectory(TARGET_NU_PFM_M2351 EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(TARGET_M23_S)
|
|
||||||
elseif("NU_PFM_M2351" IN_LIST MBED_TARGET_LABELS)
|
|
||||||
add_subdirectory(TARGET_NU_PFM_M2351)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_sources(mbed-core
|
add_library(mbed-m2351 INTERFACE)
|
||||||
|
|
||||||
|
target_sources(mbed-m2351
|
||||||
INTERFACE
|
INTERFACE
|
||||||
dma_api.c
|
dma_api.c
|
||||||
flash_api.c
|
flash_api.c
|
||||||
|
@ -80,7 +78,7 @@ target_sources(mbed-core
|
||||||
device/startup_M2351.c
|
device/startup_M2351.c
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
target_include_directories(mbed-m2351
|
||||||
INTERFACE
|
INTERFACE
|
||||||
.
|
.
|
||||||
device
|
device
|
||||||
|
@ -88,3 +86,5 @@ target_include_directories(mbed-core
|
||||||
device/StdDriver/inc
|
device/StdDriver/inc
|
||||||
crypto
|
crypto
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-m2351 INTERFACE mbed-nuvoton)
|
||||||
|
|
|
@ -1,17 +1,43 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if("NU_PFM_M2351_NPSA_NS" IN_LIST MBED_TARGET_LABELS)
|
add_library(mbed-nu-pfm-m2351-npsa-ns INTERFACE)
|
||||||
add_subdirectory(TARGET_NU_PFM_M2351_NPSA_NS)
|
target_link_libraries(mbed-nu-pfm-m2351-npsa-ns
|
||||||
elseif("NU_PFM_M2351_NS" IN_LIST MBED_TARGET_LABELS)
|
INTERFACE
|
||||||
add_subdirectory(TARGET_NU_PFM_M2351_NS)
|
TARGET_NU_PFM_M2351_NPSA_NS/TARGET_NU_PREBUILD_SECURE/cmse_lib.o
|
||||||
elseif("TFM" IN_LIST MBED_TARGET_LABELS)
|
)
|
||||||
add_subdirectory(TARGET_TFM)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_subdirectory(device)
|
add_library(mbed-nu-pfm-m2351-ns INTERFACE)
|
||||||
|
target_link_libraries(mbed-nu-pfm-m2351-ns
|
||||||
|
INTERFACE
|
||||||
|
TARGET_NU_PFM_M2351_NS/TARGET_NU_PREBUILD_SECURE/cmse_lib.o
|
||||||
|
)
|
||||||
|
|
||||||
target_sources(mbed-core
|
add_library(mbed-nu-m23-ns-tfm INTERFACE)
|
||||||
|
target_include_directories(mbed-nu-m23-ns-tfm
|
||||||
|
INTERFACE
|
||||||
|
device/TARGET_TFM
|
||||||
|
)
|
||||||
|
target_sources(mbed-nu-m23-ns-tfm
|
||||||
|
INTERFACE
|
||||||
|
TARGET_TFM/tfm_ns_lock_rtx.c
|
||||||
|
device/TARGET_TFM/cmsis_nvic_virtual.c
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
add_library(mbed-m23-ns INTERFACE)
|
||||||
|
|
||||||
|
target_sources(mbed-m23-ns
|
||||||
INTERFACE
|
INTERFACE
|
||||||
wait_ns.c
|
wait_ns.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
|
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/M2351.ld)
|
||||||
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
|
set(LINKER_FILE device/TOOLCHAIN_ARMC6/M2351.sct)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mbed_set_linker_script(mbed-m23-ns ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||||
|
|
||||||
|
target_link_libraries(mbed-m23-ns INTERFACE mbed-2351)
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
target_sources(mbed-core
|
|
||||||
INTERFACE
|
|
||||||
tfm_ns_lock_rtx.c
|
|
||||||
)
|
|
|
@ -1,14 +0,0 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
if("TFM" IN_LIST MBED_TARGET_LABELS)
|
|
||||||
add_subdirectory(TARGET_TFM)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
|
||||||
set(LINKER_FILE TOOLCHAIN_GCC_ARM/M2351.ld)
|
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
|
||||||
set(LINKER_FILE TOOLCHAIN_ARMC6/M2351.sct)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
|
|
@ -1,12 +0,0 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
target_sources(mbed-core
|
|
||||||
INTERFACE
|
|
||||||
cmsis_nvic_virtual.c
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
|
||||||
INTERFACE
|
|
||||||
.
|
|
||||||
)
|
|
|
@ -1,9 +1,18 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if("TFM" IN_LIST MBED_TARGET_LABELS)
|
add_library(mbed-nu-m23-s-tfm INTERFACE)
|
||||||
add_subdirectory(TARGET_TFM)
|
target_include_directories(mbed-nu-m23-s-tfm
|
||||||
endif()
|
INTERFACE
|
||||||
|
TARGET_TFM
|
||||||
|
)
|
||||||
|
target_sources(mbed-nu-m23-s-tfm
|
||||||
|
INTERFACE
|
||||||
|
TARGET_TFM/spm_hal.c
|
||||||
|
TARGET_TFM/target_cfg.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(mbed-m23-s INTERFACE)
|
||||||
|
|
||||||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/M2351.ld)
|
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/M2351.ld)
|
||||||
|
@ -11,4 +20,6 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/M2351.sct)
|
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/M2351.sct)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
mbed_set_linker_script(mbed-m23-s ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||||
|
|
||||||
|
target_link_libraries(mbed-m23-s INTERFACE mbed-2351)
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
target_sources(mbed-core
|
|
||||||
INTERFACE
|
|
||||||
target_cfg.cpp
|
|
||||||
spm_hal.c
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
|
||||||
INTERFACE
|
|
||||||
.
|
|
||||||
)
|
|
|
@ -1,7 +1,9 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
add_library(mbed-nu-pfm-m2351 INTERFACE)
|
||||||
|
|
||||||
|
target_include_directories(mbed-nu-pfm-m2351
|
||||||
INTERFACE
|
INTERFACE
|
||||||
.
|
.
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,19 +1,15 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if("NUMAKER_IOT_M252" IN_LIST MBED_TARGET_LABELS)
|
|
||||||
add_subdirectory(TARGET_NUMAKER_IOT_M252)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/M251.ld)
|
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/M251.ld)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/M251.sct)
|
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/M251.sct)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
add_library(mbed-m251 INTERFACE)
|
||||||
|
|
||||||
target_sources(mbed-core
|
target_sources(mbed-m251
|
||||||
INTERFACE
|
INTERFACE
|
||||||
analogin_api.c
|
analogin_api.c
|
||||||
analogout_api.c
|
analogout_api.c
|
||||||
|
@ -66,10 +62,23 @@ target_sources(mbed-core
|
||||||
us_ticker.c
|
us_ticker.c
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
target_include_directories(mbed-m251
|
||||||
INTERFACE
|
INTERFACE
|
||||||
.
|
.
|
||||||
device
|
device
|
||||||
device/Reg
|
device/Reg
|
||||||
device/StdDriver/inc
|
device/StdDriver/inc
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-m251 INTERFACE mbed-nuvoton)
|
||||||
|
|
||||||
|
mbed_set_linker_script(mbed-m251 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||||
|
|
||||||
|
add_library(mbed-numaker-iot-m252 INTERFACE)
|
||||||
|
|
||||||
|
target_include_directories(mbed-numaker-iot-m252
|
||||||
|
INTERFACE
|
||||||
|
TARGET_NUMAKER_IOT_M252
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-numaker-iot-m252 INTERFACE mbed-m251)
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
|
||||||
INTERFACE
|
|
||||||
.
|
|
||||||
)
|
|
|
@ -1,19 +1,15 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if("NUMAKER_IOT_M263A" IN_LIST MBED_TARGET_LABELS)
|
|
||||||
add_subdirectory(TARGET_NUMAKER_IOT_M263A)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/M261.ld)
|
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/M261.ld)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/M261.sct)
|
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/M261.sct)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
add_library(mbed-m261 INTERFACE)
|
||||||
|
|
||||||
target_sources(mbed-core
|
target_sources(mbed-m261
|
||||||
INTERFACE
|
INTERFACE
|
||||||
analogin_api.c
|
analogin_api.c
|
||||||
analogout_api.c
|
analogout_api.c
|
||||||
|
@ -76,7 +72,7 @@ target_sources(mbed-core
|
||||||
crypto/crypto-misc.cpp
|
crypto/crypto-misc.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
target_include_directories(mbed-m261
|
||||||
INTERFACE
|
INTERFACE
|
||||||
.
|
.
|
||||||
crypto
|
crypto
|
||||||
|
@ -84,3 +80,16 @@ target_include_directories(mbed-core
|
||||||
device/Reg
|
device/Reg
|
||||||
device/StdDriver/inc
|
device/StdDriver/inc
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-m261 INTERFACE mbed-nuvoton)
|
||||||
|
|
||||||
|
mbed_set_linker_script(mbed-m261 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||||
|
|
||||||
|
add_library(mbed-numaker-iot-m263a INTERFACE)
|
||||||
|
|
||||||
|
target_include_directories(mbed-numaker-iot-m263a
|
||||||
|
INTERFACE
|
||||||
|
TARGET_NUMAKER_IOT_M263A
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-numaker-iot-m263a INTERFACE mbed-m261)
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
|
||||||
INTERFACE
|
|
||||||
.
|
|
||||||
)
|
|
|
@ -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
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
|
@ -7,9 +7,9 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
set(LINKER_FILE device/TOOLCHAIN_ARM/M453.sct)
|
set(LINKER_FILE device/TOOLCHAIN_ARM/M453.sct)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
add_library(mbed-m451 INTERFACE)
|
||||||
|
|
||||||
target_sources(mbed-core
|
target_sources(mbed-m451
|
||||||
INTERFACE
|
INTERFACE
|
||||||
analogin_api.c
|
analogin_api.c
|
||||||
analogout_api.c
|
analogout_api.c
|
||||||
|
@ -61,9 +61,18 @@ target_sources(mbed-core
|
||||||
watchdog_api.c
|
watchdog_api.c
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
target_include_directories(mbed-m451
|
||||||
INTERFACE
|
INTERFACE
|
||||||
.
|
.
|
||||||
device
|
device
|
||||||
device/StdDriver
|
device/StdDriver
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-m451 INTERFACE mbed-nuvoton)
|
||||||
|
|
||||||
|
mbed_set_linker_script(mbed-m451 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||||
|
|
||||||
|
|
||||||
|
add_library(mbed-numaker-pfm-m453 INTERFACE)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-numaker-pfm-m453 INTERFACE mbed-m451)
|
||||||
|
|
|
@ -1,21 +1,15 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if("NUMAKER_IOT_M487" IN_LIST MBED_TARGET_LABELS)
|
|
||||||
add_subdirectory(TARGET_NUMAKER_IOT_M487)
|
|
||||||
elseif("NUMAKER_PFM_M487" IN_LIST MBED_TARGET_LABELS)
|
|
||||||
add_subdirectory(TARGET_NUMAKER_PFM_M487)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/M487.ld)
|
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/M487.ld)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/M487.sct)
|
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/M487.sct)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
add_library(mbed-m480 INTERFACE)
|
||||||
|
|
||||||
target_sources(mbed-core
|
target_sources(mbed-m480
|
||||||
INTERFACE
|
INTERFACE
|
||||||
analogin_api.c
|
analogin_api.c
|
||||||
analogout_api.c
|
analogout_api.c
|
||||||
|
@ -83,7 +77,7 @@ target_sources(mbed-core
|
||||||
watchdog_api.c
|
watchdog_api.c
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
target_include_directories(mbed-m480
|
||||||
INTERFACE
|
INTERFACE
|
||||||
.
|
.
|
||||||
crypto
|
crypto
|
||||||
|
@ -91,3 +85,25 @@ target_include_directories(mbed-core
|
||||||
device/Reg
|
device/Reg
|
||||||
device/StdDriver/inc
|
device/StdDriver/inc
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-m480 INTERFACE mbed-nuvoton)
|
||||||
|
|
||||||
|
mbed_set_linker_script(mbed-m480 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||||
|
|
||||||
|
add_library(mbed-numaker-iot-m487 INTERFACE)
|
||||||
|
|
||||||
|
target_include_directories(mbed-numaker-iot-m487
|
||||||
|
INTERFACE
|
||||||
|
TARGET_NUMAKER_IOT_M487
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-numaker-iot-m487 INTERFACE mbed-m480)
|
||||||
|
|
||||||
|
add_library(mbed-numaker-pfm-m487 INTERFACE)
|
||||||
|
|
||||||
|
target_include_directories(mbed-numaker-pfm-m487
|
||||||
|
INTERFACE
|
||||||
|
TARGET_NUMAKER_PFM_M487
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-numaker-pfm-m487 INTERFACE mbed-m480)
|
||||||
|
|
|
@ -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
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
|
@ -7,9 +7,9 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
set(LINKER_FILE device/TOOLCHAIN_ARM/NANO130.sct)
|
set(LINKER_FILE device/TOOLCHAIN_ARM/NANO130.sct)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
add_library(mbed-nano100 INTERFACE)
|
||||||
|
|
||||||
target_sources(mbed-core
|
target_sources(mbed-nano100
|
||||||
INTERFACE
|
INTERFACE
|
||||||
device/cmsis_nvic.c
|
device/cmsis_nvic.c
|
||||||
device/startup_Nano100Series.c
|
device/startup_Nano100Series.c
|
||||||
|
@ -60,9 +60,17 @@ target_sources(mbed-core
|
||||||
watchdog_api.c
|
watchdog_api.c
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
target_include_directories(mbed-nano100
|
||||||
INTERFACE
|
INTERFACE
|
||||||
.
|
.
|
||||||
device
|
device
|
||||||
device/StdDriver
|
device/StdDriver
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-nano100 INTERFACE mbed-nuvoton)
|
||||||
|
|
||||||
|
mbed_set_linker_script(mbed-nano100 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||||
|
|
||||||
|
add_library(mbed-numaker-pfm-nano130 INTERFACE)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-numaker-pfm-nano130 INTERFACE mbed-nano100)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#! armcc -E
|
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020, Nuvoton Technology Corporation
|
* Copyright (c) 2020, Nuvoton Technology Corporation
|
||||||
|
|
|
@ -1,23 +1,31 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
if("NU_XRAM_SUPPORTED" IN_LIST MBED_TARGET_LABELS)
|
if("NU_XRAM_SUPPORTED" IN_LIST MBED_TARGET_LABELS)
|
||||||
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/TARGET_NU_XRAM_SUPPORTED/NUC472.ld)
|
set(LINKER_FILE_NU_XRAM_SUPPORTED device/TOOLCHAIN_GCC_ARM/TARGET_NU_XRAM_SUPPORTED/NUC472.ld)
|
||||||
elseif("NU_XRAM_UNSUPPORTED" IN_LIST MBED_TARGET_LABELS)
|
elseif("NU_XRAM_UNSUPPORTED" IN_LIST MBED_TARGET_LABELS)
|
||||||
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/TARGET_NU_XRAM_UNSUPPORTED/NUC472.ld)
|
set(LINKER_FILE_NU_XRAM_UNSUPPORTED device/TOOLCHAIN_GCC_ARM/TARGET_NU_XRAM_UNSUPPORTED/NUC472.ld)
|
||||||
endif()
|
endif()
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
if("NU_XRAM_SUPPORTED" IN_LIST MBED_TARGET_LABELS)
|
if("NU_XRAM_SUPPORTED" IN_LIST MBED_TARGET_LABELS)
|
||||||
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/TARGET_NU_XRAM_SUPPORTED/NUC472.sct)
|
set(LINKER_FILE_NU_XRAM_SUPPORTED device/TOOLCHAIN_ARM_STD/TARGET_NU_XRAM_SUPPORTED/NUC472.sct)
|
||||||
elseif("NU_XRAM_UNSUPPORTED" IN_LIST MBED_TARGET_LABELS)
|
elseif("NU_XRAM_UNSUPPORTED" IN_LIST MBED_TARGET_LABELS)
|
||||||
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/TARGET_NU_XRAM_UNSUPPORTED/NUC472.sct)
|
set(LINKER_FILE_NU_XRAM_UNSUPPORTED device/TOOLCHAIN_ARM_STD/TARGET_NU_XRAM_UNSUPPORTED/NUC472.sct)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
add_library(mbed-nu-xram-supported INTERFACE)
|
||||||
|
mbed_set_linker_script(mbed-nu-xram-supported ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_NU_XRAM_SUPPORTED})
|
||||||
|
|
||||||
target_sources(mbed-core
|
add_library(mbed-nu-xram-unsupported INTERFACE)
|
||||||
|
mbed_set_linker_script(mbed-nu-xram-unsupported ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_NU_XRAM_UNSUPPORTED})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
add_library(mbed-nuc472 INTERFACE)
|
||||||
|
|
||||||
|
target_sources(mbed-nuc472
|
||||||
INTERFACE
|
INTERFACE
|
||||||
crypto/crypto-misc.cpp
|
crypto/crypto-misc.cpp
|
||||||
|
|
||||||
|
@ -74,10 +82,16 @@ target_sources(mbed-core
|
||||||
watchdog_api.c
|
watchdog_api.c
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
target_include_directories(mbed-nuc472
|
||||||
INTERFACE
|
INTERFACE
|
||||||
.
|
.
|
||||||
crypto
|
crypto
|
||||||
device
|
device
|
||||||
device/StdDriver
|
device/StdDriver
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-nuc472 INTERFACE mbed-nuvoton)
|
||||||
|
|
||||||
|
add_library(mbed-numaker-pfm-nuc472 INTERFACE)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-numaker-pfm-nuc472 INTERFACE mbed-nuc472 mbed-nu-xram-supported)
|
||||||
|
|
Loading…
Reference in New Issue