# Copyright (c) 2022 HPMicro. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//kernel/liteos_m/liteos.gni") module_name = get_path_info(rebase_path("."), "name") module_switch = defined(LOSCFG_BOARD_HPM6750EVK2) kernel_module(module_name) { #deps = [ "$product_path/hdf_config:hdf_hcs" ] cflags = [ "-Wall", "-Werror"] sources = [ "board.c", "driver/uart.c" ] deps = [ "littlefs", "//base/startup/init/interfaces/innerkits:libbegetutil" ] } config("public") { include_dirs = [ ".", "driver", "littlefs" ] ldflags = [ "-Wl,-mcmodel=medany", "-Wl,-melf32lriscv", "-nostartfiles", "-Wl,-T" + rebase_path("ld/liteos_flash_xip.ld"), "-nostdlib", ] ldflags += [ "-L./libs" ] ldflags += [ "-Wl,--whole-archive" ] foreach(force_link_lib, force_link_libs) { ldflags += [ "-l${force_link_lib}" ] } if (build_xts == true) { ldflags += [ "-lhctest", "-lmodule_ActsBootstrapTest", "-lmodule_ActsHieventLiteTest", "-lmodule_ActsDfxFuncTest", "-lmodule_ActsSamgrTest", "-lmodule_ActsUtilsFileTest", "-lhuks_test_common", ] } ldflags += [ "-Wl,--no-whole-archive" ] libs = [ "nosys", "gcc", "stdc++", ] if (defined(LOSCFG_LIBC_NEWLIB)) { ldflags -= [ "-nostdlib" ] libs -= [ "nosys" ] libs += [ "c", "m", ] cflags_c = [ "-U__INT32_TYPE__", "-D__INT32_TYPE__=int", "-DLWIP_NO_CTYPE_H=1", "-DFLASH_XIP=1", "-DUSE_NONVECTOR_MODE", "-DDISABLE_IRQ_PREEMPTIVE", ] } }