From 5b1c298b5947b5e3d18ef9b7eff6e987ab0afa3d Mon Sep 17 00:00:00 2001 From: lidongshan Date: Fri, 10 Dec 2021 17:22:33 +0800 Subject: [PATCH] opt build script Signed-off-by: zounan --- BUILD.gn | 14 +-- README.md | 7 +- drivers/BUILD.gn | 8 +- gr5515_sk/BUILD.gn | 10 +-- gr5515_sk/liteos_m/BUILD.gn | 2 +- gr5515_sk/liteos_m/config.gni | 160 ++++++++++------------------------ hcs/BUILD.gn | 10 +-- 7 files changed, 72 insertions(+), 139 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 912a017..a097ba8 100755 --- a/BUILD.gn +++ b/BUILD.gn @@ -12,13 +12,13 @@ # limitations under the License. if (ohos_kernel_type == "liteos_m") { - import("//kernel/liteos_m/liteos.gni") - module_name = get_path_info(rebase_path("."), "name") - module_group(module_name) { + import("//kernel/liteos_m/liteos.gni") + module_name = get_path_info(rebase_path("."), "name") + module_group(module_name) { modules = [ - "gr5515_sk", - "drivers", - "hcs", + "gr5515_sk", + "drivers", + "hcs", ] - } + } } diff --git a/README.md b/README.md index edbffa4..d4137d5 100755 --- a/README.md +++ b/README.md @@ -149,18 +149,19 @@ sudo pip3 install --upgrade pip ### 搭建过程 -参考 [环境搭建步骤](https://gitee.com/openharmony-sig/devboard_device_goodix_gr551x/blob/master/README.md) +参考 [环境搭建步骤](https://gitee.com/openharmony-sig/device_soc_goodix/blob/master/README.md) ## 编译调试 -参考 [编译调试步骤](https://gitee.com/openharmony-sig/devboard_device_goodix_gr551x/blob/master/README.md) +参考 [编译调试步骤](https://gitee.com/openharmony-sig/device_soc_goodix/blob/master/README.md) ## 首个示例 代码默认有1个示例: -1. [XTS测试示例](https://gitee.com/openharmony-sig/devboard_vendor_goodix_gr5515_sk_basic/tree/master/gr5515_sk_xts_demo) +1. [BLE应用示例](https://gitee.com/openharmony-sig/vendor_goodix/tree/master/gr5515_sk_iotlink_demo) +2. [XTS测试示例](https://gitee.com/openharmony-sig/vendor_goodix/tree/master/gr5515_sk_xts_demo) ## 参考资源 diff --git a/drivers/BUILD.gn b/drivers/BUILD.gn index 93e94c7..48f1dd1 100755 --- a/drivers/BUILD.gn +++ b/drivers/BUILD.gn @@ -12,8 +12,8 @@ # limitations under the License. if (ohos_kernel_type == "liteos_m") { - import("//kernel/liteos_m/liteos.gni") - module_name = get_path_info(rebase_path("."), "name") - kernel_module(module_name) { - } + import("//kernel/liteos_m/liteos.gni") + module_name = get_path_info(rebase_path("."), "name") + kernel_module(module_name) { + } } diff --git a/gr5515_sk/BUILD.gn b/gr5515_sk/BUILD.gn index 133055a..8a7daba 100755 --- a/gr5515_sk/BUILD.gn +++ b/gr5515_sk/BUILD.gn @@ -12,9 +12,9 @@ # limitations under the License. if (ohos_kernel_type == "liteos_m") { - import("//kernel/liteos_m/liteos.gni") - module_name = get_path_info(rebase_path("."), "name") - module_group(module_name) { - modules = [ "liteos_m" ] - } + import("//kernel/liteos_m/liteos.gni") + module_name = get_path_info(rebase_path("."), "name") + module_group(module_name) { + modules = [ "liteos_m" ] + } } diff --git a/gr5515_sk/liteos_m/BUILD.gn b/gr5515_sk/liteos_m/BUILD.gn index 124ed9d..dfd3136 100755 --- a/gr5515_sk/liteos_m/BUILD.gn +++ b/gr5515_sk/liteos_m/BUILD.gn @@ -15,5 +15,5 @@ import("//kernel/liteos_m/liteos.gni") module_name = get_path_info(rebase_path("."), "name") kernel_module(module_name) { - deps = [ "$product_path/hdf_config:hdf_hcs" ] + deps = [ "$product_path/hdf_config:hdf_hcs" ] } diff --git a/gr5515_sk/liteos_m/config.gni b/gr5515_sk/liteos_m/config.gni index d0bded5..6dd7cd3 100755 --- a/gr5515_sk/liteos_m/config.gni +++ b/gr5515_sk/liteos_m/config.gni @@ -40,125 +40,58 @@ board_toolchain_prefix = "arm-none-eabi-" board_toolchain_type = "gcc" # Board related common compile flags. -board_cflags = [ - "-std=c99", - "--inline", - "-ggdb", - "-O1", - "-ffunction-sections", - "-fdata-sections", - "-mfloat-abi=softfp", - "-mfpu=fpv4-sp-d16", - "-mapcs-frame", - "-mcpu=cortex-m4", - "-mthumb", - "-mthumb-interwork", - "-gdwarf-2", - "-MD", - "-fno-stack-protector", - "-DLOSCFG_BASE_CORE_HILOG=1", +board_cflags = [ + "-std=c99", + "--inline", + "-ggdb", + "-O0", + "-ffunction-sections", + "-fdata-sections", + "-mfloat-abi=softfp", + "-mfpu=fpv4-sp-d16", + "-mapcs-frame", + "-mcpu=cortex-m4", + "-mthumb", + "-mthumb-interwork", + "-gdwarf-2", + "-MD", + "-fno-stack-protector", + "-DLOSCFG_BASE_CORE_HILOG=1", ] -board_cxx_flags = [ ] +board_cxx_flags = [] board_ld_flags = [ - - "-nostartfiles", - "-mcpu=cortex-m4", - "-mfloat-abi=softfp", - "-mfpu=fpv4-sp-d16", - "-mapcs-frame", - "-mthumb", - "-mthumb-interwork", - "-Wl,--gc-sections", - "-Wl,--start-group", - "-Llibs", - "-Wl,--whole-archive", - - "-lbootstrap", - "-lsamgr_adapter", - "-lsamgr_source", - "-lbroadcast", - "-lhilog_lite", - "-lhiview_lite", - "-lutils_kv_store", - "-lkernel", - "-lble_sdk", - - "-Wl,--no-whole-archive", - "-Wl,--end-group", - "-Tbin/link.ld", - "-Trom_symbol_gcc.txt", - "-Wl,-Map=bin/application.map", + "-nostartfiles", + "-mcpu=cortex-m4", + "-mfloat-abi=softfp", + "-mfpu=fpv4-sp-d16", + "-mapcs-frame", + "-mthumb", + "-mthumb-interwork", + "-Wl,--gc-sections", + "-Wl,--start-group", + "-Wl,--whole-archive", + "-Llibs", + "-lbootstrap", + "-lsamgr_adapter", + "-lsamgr_source", + "-lbroadcast", + "-lhilog_lite", + "-lhiview_lite", + "-lutils_kv_store", + "-lkernel", + "-lble_sdk", + "-Wl,--no-whole-archive", + "-Wl,--end-group", + "-Tbin/link.ld", + "-Trom_symbol_gcc.txt", + "-Wl,-Map=bin/application.map", ] # Board related headfiles search path. board_include_dirs = [ - - "//kernel/liteos_m", - "//kernel/liteos_m/kernel/arch/arm/cortex-m4/gcc", - "//kernel/liteos_m/kernel/arch/include", - "//kernel/liteos_m/kernel/include", - "//kernel/liteos_m/kal/cmsis", - "//kernel/liteos_m/kal/posix/include", - "//kernel/liteos_m/utils", - "//kernel/liteos_m/components/exchook", - "//utils/native/lite/kal/timer", - "//utils/native/lite/include", - - "//kernel/liteos_m/components/fs/fatfs", - "//third_party/FatFs/source", - "//third_party/cmsis/CMSIS/Core/Include", - "//third_party/musl/porting/liteos_m/kernel/include", - "//third_party/bounds_checking_function/include", - "//third_party/openssl", - "//third_party/openssl/include", - "//third_party/openssl/crypto/include", - "//third_party/openssl/crypto/ec", - "//third_party/mbedtls/include", - "//foundation/communication/bluetooth/interfaces/innerkits/native_c/include", - - "//device/soc/goodix/gr551x/sdk_liteos/platform/include", - "//device/soc/goodix/gr551x/adapter/hals/bluetooth", - "//device/soc/goodix/gr551x/components/hilink/include", - "//device/soc/goodix/gr551x/sdk_liteos/config", - "//device/soc/goodix/gr551x/sdk_liteos/liteos_m", - "//device/soc/goodix/gr551x/components/watchdog", - - "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/app_drivers/inc", - "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/boards", - "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/drivers_ext/gr551x", - "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/app_lfs", - "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/app_assert", - "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/app_error", - "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/app_log", - "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/app_timer", - "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/hal_flash", - "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/pmu_calibration", - "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/ring_buffer", - "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/utility", - "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/patch/ind", - "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/sdk/", - "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/drivers/inc", - "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/toolchain/gr551x/include", -] - -# add hdf includes path -board_include_dirs += [ - "//drivers/adapter/khdf/liteos_m/osal/include/", - "//drivers/framework/ability/sbuf/include", - "//drivers/framework/core/host/include", - "//drivers/framework/core/common/include/host", - "//drivers/framework/core/shared/include", - "//drivers/framework/include", - "//drivers/framework/include/osal", - "//drivers/framework/include/config", - "//drivers/framework/include/core", - "//drivers/framework/include/platform", - "//drivers/framework/include/utils", - "//drivers/framework/include/platform", - "//drivers/framework/support/platform/include", - "//drivers/framework/support/platform/include/common", - "//drivers/framework/utils/include", - "//base/hiviewdfx/hilog_lite/interfaces/native/kits", + "//utils/native/lite/include", + "//third_party/bounds_checking_function/include", + "//third_party/mbedtls/include", ] # Board adapter dir for OHOS components. @@ -169,4 +102,3 @@ board_configed_sysroot = "" # Board storage type, it used for file system generation. storage_type = "" - diff --git a/hcs/BUILD.gn b/hcs/BUILD.gn index e1f18e9..f90c56c 100755 --- a/hcs/BUILD.gn +++ b/hcs/BUILD.gn @@ -12,8 +12,8 @@ # limitations under the License. if (ohos_kernel_type == "liteos_m") { - import("//kernel/liteos_m/liteos.gni") - module_name = get_path_info(rebase_path("."), "name") - kernel_module(module_name) { - } -} \ No newline at end of file + import("//kernel/liteos_m/liteos.gni") + module_name = get_path_info(rebase_path("."), "name") + kernel_module(module_name) { + } +}