1# Copyright (c) 2022 HPMicro. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//kernel/liteos_m/liteos.gni") 15 16module_name = get_path_info(rebase_path("."), "name") 17module_switch = defined(LOSCFG_BOARD_HPM6300EVK) 18kernel_module(module_name) { 19 #deps = [ "$product_path/hdf_config:hdf_hcs" ] 20 cflags = [ "-Wall", "-Werror"] 21 sources = [ 22 "board.c", 23 "driver/uart.c" 24 ] 25 deps = [ 26 "littlefs", 27 #"//base/startup/init/interfaces/innerkits:libbegetutil" 28 ] 29} 30 31config("public") { 32 include_dirs = [ 33 ".", 34 "driver", 35 "littlefs" 36 ] 37 38 ldflags = [ 39 "-Wl,-mcmodel=medany", 40 "-Wl,-melf32lriscv", 41 "-nostartfiles", 42 "-Wl,-T" + rebase_path("ld/liteos_flash_xip.ld"), 43 "-Wl,--defsym=_flash_size=${LOSCFG_BOARD_FLASH_SIZE}M", 44 "-nostdlib", 45 ] 46 47 ldflags += [ "-L./libs" ] 48 ldflags += [ "-Wl,--whole-archive" ] 49 foreach(force_link_lib, force_link_libs) { 50 ldflags += [ "-l${force_link_lib}" ] 51 } 52 53 if (build_xts == true) { 54 ldflags += [ 55 "-lhctest", 56 "-lmodule_ActsBootstrapTest", 57 "-lmodule_ActsHieventLiteTest", 58 "-lmodule_ActsDfxFuncTest", 59 "-lmodule_ActsSamgrTest", 60 "-lhuks_test_common", 61 ] 62 } 63 64 ldflags += [ "-Wl,--no-whole-archive" ] 65 66 libs = [ 67 "gcc", 68 "stdc++", 69 ] 70 cflags_c = [ 71 "-DFLASH_XIP=1", 72 "-DUSE_NONVECTOR_MODE", 73 "-DDISABLE_IRQ_PREEMPTIVE", 74 ] 75} 76 77