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_HPM6750EVK2) 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 "-nostdlib", 44 ] 45 46 ldflags += [ "-L./libs" ] 47 ldflags += [ "-Wl,--whole-archive" ] 48 foreach(force_link_lib, force_link_libs) { 49 ldflags += [ "-l${force_link_lib}" ] 50 } 51 52 if (build_xts == true) { 53 ldflags += [ 54 "-lhctest", 55 "-lmodule_ActsBootstrapTest", 56 "-lmodule_ActsHieventLiteTest", 57 "-lmodule_ActsDfxFuncTest", 58 "-lmodule_ActsSamgrTest", 59 "-lmodule_ActsUtilsFileTest", 60 "-lhuks_test_common", 61 ] 62 } 63 64 ldflags += [ "-Wl,--no-whole-archive" ] 65 66 libs = [ 67 "nosys", 68 "gcc", 69 "stdc++", 70 ] 71 72 if (defined(LOSCFG_LIBC_NEWLIB)) { 73 ldflags -= [ "-nostdlib" ] 74 75 libs -= [ "nosys" ] 76 libs += [ 77 "c", 78 "m", 79 ] 80 81 cflags_c = [ 82 "-U__INT32_TYPE__", 83 "-D__INT32_TYPE__=int", 84 "-DLWIP_NO_CTYPE_H=1", 85 "-DFLASH_XIP=1", 86 "-DUSE_NONVECTOR_MODE", 87 "-DDISABLE_IRQ_PREEMPTIVE", 88 ] 89 } 90} 91 92