1d6aed566Sopenharmony_ci# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. 2d6aed566Sopenharmony_ci# 3d6aed566Sopenharmony_ci# Redistribution and use in source and binary forms, with or without modification, 4d6aed566Sopenharmony_ci# are permitted provided that the following conditions are met: 5d6aed566Sopenharmony_ci# 6d6aed566Sopenharmony_ci# 1. Redistributions of source code must retain the above copyright notice, this list of 7d6aed566Sopenharmony_ci# conditions and the following disclaimer. 8d6aed566Sopenharmony_ci# 9d6aed566Sopenharmony_ci# 2. Redistributions in binary form must reproduce the above copyright notice, this list 10d6aed566Sopenharmony_ci# of conditions and the following disclaimer in the documentation and/or other materials 11d6aed566Sopenharmony_ci# provided with the distribution. 12d6aed566Sopenharmony_ci# 13d6aed566Sopenharmony_ci# 3. Neither the name of the copyright holder nor the names of its contributors may be used 14d6aed566Sopenharmony_ci# to endorse or promote products derived from this software without specific prior written 15d6aed566Sopenharmony_ci# permission. 16d6aed566Sopenharmony_ci# 17d6aed566Sopenharmony_ci# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18d6aed566Sopenharmony_ci# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 19d6aed566Sopenharmony_ci# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20d6aed566Sopenharmony_ci# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 21d6aed566Sopenharmony_ci# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22d6aed566Sopenharmony_ci# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23d6aed566Sopenharmony_ci# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24d6aed566Sopenharmony_ci# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25d6aed566Sopenharmony_ci# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26d6aed566Sopenharmony_ci# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27d6aed566Sopenharmony_ci# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28d6aed566Sopenharmony_ci 29d6aed566Sopenharmony_ciimport("//kernel/liteos_m/liteos.gni") 30d6aed566Sopenharmony_ci 31d6aed566Sopenharmony_cimodule_name = "bsp_config" 32d6aed566Sopenharmony_ci 33d6aed566Sopenharmony_cikernel_module(module_name) { 34d6aed566Sopenharmony_ci asmflags = board_asmflags 35d6aed566Sopenharmony_ci 36d6aed566Sopenharmony_ci sources = [ 37d6aed566Sopenharmony_ci "driver/arm_uart_drv.c", 38d6aed566Sopenharmony_ci "driver/net/lan9118_eth_drv.c", 39d6aed566Sopenharmony_ci "driver/uart.c", 40d6aed566Sopenharmony_ci "fs/ff_gen_drv.c", 41d6aed566Sopenharmony_ci "libc/dprintf.c", 42d6aed566Sopenharmony_ci "main.c", 43d6aed566Sopenharmony_ci "startup.s", 44d6aed566Sopenharmony_ci ] 45d6aed566Sopenharmony_ci deps = [ "//device/qemu/arm_mps2_an386/liteos_m/board/fs:fs_adapter" ] 46d6aed566Sopenharmony_ci include_dirs = [ "//device/qemu/arm_mps2_an386/liteos_m/board/fs" ] 47d6aed566Sopenharmony_ci if (!defined(LOSCFG_TEST)) { 48d6aed566Sopenharmony_ci # kernel's testsuites not enabled, use ower's 49d6aed566Sopenharmony_ci sources += [ "test/test_demo.c" ] 50d6aed566Sopenharmony_ci } 51d6aed566Sopenharmony_ci include_dirs += [ "driver/net/" ] 52d6aed566Sopenharmony_ci} 53d6aed566Sopenharmony_ci 54d6aed566Sopenharmony_ciconfig("public") { 55d6aed566Sopenharmony_ci include_dirs = [ 56d6aed566Sopenharmony_ci ".", 57d6aed566Sopenharmony_ci "include", 58d6aed566Sopenharmony_ci "fs", 59d6aed566Sopenharmony_ci "driver", 60d6aed566Sopenharmony_ci ] 61d6aed566Sopenharmony_ci ldflags = [ 62d6aed566Sopenharmony_ci "-nostartfiles", 63d6aed566Sopenharmony_ci "-Wl,-T" + rebase_path("liteos.ld"), 64d6aed566Sopenharmony_ci "-nostdlib", 65d6aed566Sopenharmony_ci ] 66d6aed566Sopenharmony_ci 67d6aed566Sopenharmony_ci libs = [ 68d6aed566Sopenharmony_ci "nosys", 69d6aed566Sopenharmony_ci "gcc", 70d6aed566Sopenharmony_ci ] 71d6aed566Sopenharmony_ci 72d6aed566Sopenharmony_ci if (defined(LOSCFG_LIBC_NEWLIB)) { 73d6aed566Sopenharmony_ci ldflags -= [ "-nostdlib" ] 74d6aed566Sopenharmony_ci libs -= [ "nosys" ] 75d6aed566Sopenharmony_ci libs += [ 76d6aed566Sopenharmony_ci "c", 77d6aed566Sopenharmony_ci "m", 78d6aed566Sopenharmony_ci ] 79d6aed566Sopenharmony_ci } 80d6aed566Sopenharmony_ci} 81