• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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      "-lhuks_test_common",
60    ]
61  }
62
63  ldflags += [ "-Wl,--no-whole-archive" ]
64
65  libs = [
66    "nosys",
67    "gcc",
68    "stdc++",
69  ]
70
71  if (defined(LOSCFG_LIBC_NEWLIB)) {
72    ldflags -= [ "-nostdlib" ]
73
74    libs -= [ "nosys" ]
75    libs += [
76      "c",
77      "m",
78    ]
79
80    cflags_c = [
81      "-U__INT32_TYPE__",
82      "-D__INT32_TYPE__=int",
83      "-DLWIP_NO_CTYPE_H=1",
84      "-DFLASH_XIP=1",
85      "-DUSE_NONVECTOR_MODE",
86      "-DDISABLE_IRQ_PREEMPTIVE",
87    ]
88  }
89}
90
91