From 9314b2fe81b5354e7c3b8db39df51fd118f45e95 Mon Sep 17 00:00:00 2001 From: Hongjin Li Date: Mon, 10 Jan 2022 16:02:35 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20liteos-m=20kernel=20=E9=83=A8=E4=BB=B6?= =?UTF-8?q?=E6=A0=87=E5=87=86=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1、添加liteos-m kernel的部件描述文件bundle.json 2、依赖三方开源软件的编译脚本修改,取消直接include头文件,改为引用三方开源软件提供的公共配置。 Signed-off-by: Hongjin Li Change-Id: I345c105a75c5cd87144c821fae123abf1f53e9f7 --- bundle.json | 63 +++++++++++++++++++++++++++++++++ components/fs/fatfs/BUILD.gn | 12 ++----- components/fs/littlefs/BUILD.gn | 12 ++----- kal/cmsis/BUILD.gn | 7 ++-- kal/libc/musl/BUILD.gn | 3 +- testsuites/BUILD.gn | 7 +--- 6 files changed, 74 insertions(+), 30 deletions(-) create mode 100644 bundle.json diff --git a/bundle.json b/bundle.json new file mode 100644 index 00000000..04ba4239 --- /dev/null +++ b/bundle.json @@ -0,0 +1,63 @@ +{ + "name": "@ohos/liteos_m", + "version": "3.1.0", + "description": "liteos-m kernel", + "publishAs": "code-segment", + "homePage": "https://gitee.com/openharmony", + "repository": "https://gitee.com/openharmony/kernel_liteos_m", + "license": "BSD 3-clause", + "domain": "os", + "language": "", + "private": false, + "scripts": {}, + "tags": [ + "kernel" + ], + "keywords": [ + "kernel", + "liteos-m" + ], + "envs": [], + "dirs": [], + "author": {}, + "contributors": [], + "segment": { + "destPath": "kernel/liteos_m" + }, + "component": { + "name": "liteos_m", + "subsystem": "kernel", + "syscap": [ + "SystemCapability.Kernel.liteos-m" + ], + "features": [], + "adapted_system_type": [ + "mini" + ], + "rom": "300KB", + "ram": "100KB", + "deps": { + "components": [ + "utils_lite" + ], + "third_party": [ + "bounds_checking_function", + "cmsis", + "fatfs", + "littlefs", + "lwip", + "musl" + ] + }, + "build": { + "sub_component": [ + "//kernel/liteos_m:kernel", + "//kernel/liteos_m:build_kernel_image" + ], + "inner_kits": [], + "test": [ + "//kernel/liteos_m/testsuites:testsuites" + ] + } + } +} \ No newline at end of file diff --git a/components/fs/fatfs/BUILD.gn b/components/fs/fatfs/BUILD.gn index 7667cf0d..0c999cf0 100644 --- a/components/fs/fatfs/BUILD.gn +++ b/components/fs/fatfs/BUILD.gn @@ -28,21 +28,15 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//kernel/liteos_m/liteos.gni") +import("//third_party/FatFs/FatFs.gni") module_switch = defined(LOSCFG_FS_FAT) module_name = get_path_info(rebase_path("."), "name") kernel_module(module_name) { - sources = [ - "$LITEOSTHIRDPARTY/FatFs/source/diskio.c", - "$LITEOSTHIRDPARTY/FatFs/source/ff.c", - "$LITEOSTHIRDPARTY/FatFs/source/ffsystem.c", - "$LITEOSTHIRDPARTY/FatFs/source/ffunicode.c", - "fatfs.c", - ] configs += [ "$LITEOSTOPDIR:warn_config" ] + sources = FATFS_SRC_FILES + [ "fatfs.c" ] } config("public") { - include_dirs = [ "." ] - include_dirs += [ "$LITEOSTHIRDPARTY/FatFs/source" ] + include_dirs = FATFS_INCLUDE_DIRS + [ "." ] } diff --git a/components/fs/littlefs/BUILD.gn b/components/fs/littlefs/BUILD.gn index 3407d2d4..a7faa85a 100644 --- a/components/fs/littlefs/BUILD.gn +++ b/components/fs/littlefs/BUILD.gn @@ -28,21 +28,15 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//kernel/liteos_m/liteos.gni") +import("//third_party/littlefs/littlefs.gni") module_switch = defined(LOSCFG_FS_LITTLEFS) module_name = get_path_info(rebase_path("."), "name") kernel_module(module_name) { - sources = [ - "$LITEOSTHIRDPARTY/littlefs/bd/lfs_rambd.c", - "$LITEOSTHIRDPARTY/littlefs/lfs.c", - "$LITEOSTHIRDPARTY/littlefs/lfs_util.c", - "lfs_api.c", - ] configs += [ "$LITEOSTOPDIR:warn_config" ] + sources = LITTLEFS_SRC_FILES_FOR_KERNEL_MODULE + [ "lfs_api.c" ] } config("public") { - include_dirs = [ "." ] - include_dirs += [ "$LITEOSTHIRDPARTY/littlefs" ] - include_dirs += [ "$LITEOSTHIRDPARTY/littlefs/bd" ] + include_dirs = LITTLEFS_INCLUDE_DIRS + [ "." ] } diff --git a/kal/cmsis/BUILD.gn b/kal/cmsis/BUILD.gn index 619ec86c..6bb15b1f 100644 --- a/kal/cmsis/BUILD.gn +++ b/kal/cmsis/BUILD.gn @@ -28,6 +28,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//kernel/liteos_m/liteos.gni") +import("//third_party/cmsis/cmsis.gni") module_switch = defined(LOSCFG_KAL_CMSIS) module_name = get_path_info(rebase_path("."), "name") @@ -37,9 +38,5 @@ kernel_module(module_name) { } config("public") { - include_dirs = [ - ".", - "$LITEOSTHIRDPARTY/cmsis/CMSIS/RTOS2/Include", - "$LITEOSTHIRDPARTY/cmsis/CMSIS/Core/Include", - ] + include_dirs = CMSIS_INCLUDE_DIRS + [ "." ] } diff --git a/kal/libc/musl/BUILD.gn b/kal/libc/musl/BUILD.gn index 97e6038e..27c0cc57 100644 --- a/kal/libc/musl/BUILD.gn +++ b/kal/libc/musl/BUILD.gn @@ -28,6 +28,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//kernel/liteos_m/liteos.gni") +import("//third_party/musl/porting/liteos_m/kernel/musl.gni") module_switch = defined(LOSCFG_LIBC_MUSL) module_name = get_path_info(rebase_path("."), "name") @@ -43,5 +44,5 @@ kernel_module(module_name) { } config("public") { - include_dirs = [ "//third_party/musl/porting/liteos_m/kernel/include" ] + include_dirs = MUSL_INCLUDE_DIRS } diff --git a/testsuites/BUILD.gn b/testsuites/BUILD.gn index 525d4f6f..e5682d5d 100644 --- a/testsuites/BUILD.gn +++ b/testsuites/BUILD.gn @@ -31,12 +31,7 @@ import("//kernel/liteos_m/liteos.gni") config("include") { defines = [] - include_dirs = [ - "include", - "//kernel/liteos_m/kernel/include", - "//kernel/liteos_m/kernel/arch/include", - "//kernel/liteos_m/components/cpup", - ] + include_dirs = [ "include" ] if (defined(LOSCFG_KERNEL_TEST_FULL)) { defines += [ "LOS_KERNEL_TEST_FULL=1" ]