BUILD.gn 6.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
#    conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
#    of conditions and the following disclaimer in the documentation and/or other materials
#    provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
#    to endorse or promote products derived from this software without specific prior written
#    permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

libc = "musl-c"
libm = "musl-m"

L
LiteOS2021 已提交
33 34
LITEOS_MENUCONFIG_H = rebase_path("$root_out_dir/config.h")

35
config("include") {
S
silen 已提交
36
  include_dirs = [ "include" ]
37 38 39 40
}

static_library(libc) {
  sources = [
S
silen 已提交
41 42
    "src/ctype/__ctype_get_mb_cur_max.c",
    "src/ctype/isalnum.c",
43 44 45
    "src/ctype/isascii.c",
    "src/ctype/isdigit.c",
    "src/ctype/islower.c",
S
silen 已提交
46 47 48 49
    "src/ctype/isprint.c",
    "src/ctype/isspace.c",
    "src/ctype/isupper.c",
    "src/ctype/isxdigit.c",
50 51
    "src/ctype/tolower.c",
    "src/ctype/toupper.c",
X
xiexg-dc 已提交
52
    "src/env/__stack_chk_fail.c",
S
silen 已提交
53 54 55
    "src/errno/strerror.c",
    "src/exit/abort.c",
    "src/exit/assert.c",
X
x-xiny 已提交
56 57
    "src/exit/atexit.c",
    "src/internal/floatscan.c",
S
silen 已提交
58 59
    "src/internal/intscan.c",
    "src/internal/shgetc.c",
60 61
    "src/locale/__lctrans.c",
    "src/locale/c_locale.c",
S
silen 已提交
62 63
    "src/locale/langinfo.c",
    "src/misc/dirname.c",
S
SimonLi 已提交
64
    "src/misc/realpath.c",
X
x-xiny 已提交
65 66
    "src/multibyte/internal.c",
    "src/multibyte/mbtowc.c",
S
silen 已提交
67 68 69 70 71 72 73
    "src/multibyte/wcrtomb.c",
    "src/multibyte/wctomb.c",
    "src/network/h_errno.c",
    "src/network/htonl.c",
    "src/network/htons.c",
    "src/network/ntohl.c",
    "src/network/ntohs.c",
X
x-xiny 已提交
74
    "src/prng/rand.c",
S
silen 已提交
75 76 77 78 79 80 81 82
    "src/prng/random.c",
    "src/regex/regcomp.c",
    "src/regex/regexec.c",
    "src/regex/tre-mem.c",
    "src/stdio/__fdopen.c",
    "src/stdio/__fmodeflags.c",
    "src/stdio/__lockfile.c",
    "src/stdio/__overflow.c",
83 84
    "src/stdio/__stdio_close.c",
    "src/stdio/__stdio_read.c",
S
silen 已提交
85
    "src/stdio/__stdio_seek.c",
86 87
    "src/stdio/__stdio_write.c",
    "src/stdio/__stdout_write.c",
S
silen 已提交
88
    "src/stdio/__toread.c",
89
    "src/stdio/__towrite.c",
S
silen 已提交
90 91 92
    "src/stdio/__uflow.c",
    "src/stdio/clearerr.c",
    "src/stdio/fclose.c",
93
    "src/stdio/feof.c",
S
silen 已提交
94 95 96
    "src/stdio/fflush.c",
    "src/stdio/fgets.c",
    "src/stdio/fileno.c",
97
    "src/stdio/fopen.c",
S
silen 已提交
98 99 100 101 102 103 104 105 106 107 108 109 110
    "src/stdio/fputc.c",
    "src/stdio/fputs.c",
    "src/stdio/fread.c",
    "src/stdio/fseek.c",
    "src/stdio/ftell.c",
    "src/stdio/fwrite.c",
    "src/stdio/ofl.c",
    "src/stdio/ofl_add.c",
    "src/stdio/perror.c",
    "src/stdio/remove.c",
    "src/stdio/rewind.c",
    "src/stdio/snprintf.c",
    "src/stdio/stderr.c",
L
lnlan 已提交
111
    "src/stdio/stdin.c",
S
silen 已提交
112 113 114 115 116
    "src/stdio/stdout.c",
    "src/stdio/vfprintf.c",
    "src/stdio/vsnprintf.c",
    "src/stdio/vsprintf.c",
    "src/stdlib/abs.c",
X
x-xiny 已提交
117
    "src/stdlib/atof.c",
S
silen 已提交
118 119 120
    "src/stdlib/atoi.c",

    #"src/stdlib/strtol.c",
X
x-xiny 已提交
121 122
    "src/locale/iconv.c",
    "src/stdio/ungetc.c",
S
silen 已提交
123 124
    "src/stdlib/atol.c",
    "src/stdlib/atoll.c",
X
x-xiny 已提交
125 126 127
    "src/stdlib/bsearch.c",
    "src/stdlib/llabs.c",
    "src/stdlib/strtod.c",
S
silen 已提交
128
    "src/string/memchr.c",
129 130
    "src/string/memcmp.c",
    "src/string/memcpy.c",
X
x-xiny 已提交
131
    "src/string/memmove.c",
S
silen 已提交
132 133
    "src/string/memrchr.c",
    "src/string/memset.c",
X
x-xiny 已提交
134
    "src/string/stpcpy.c",
L
LiteOS2021 已提交
135
    "src/string/stpncpy.c",
136
    "src/string/strcasecmp.c",
X
x-xiny 已提交
137
    "src/string/strcat.c",
S
silen 已提交
138 139
    "src/string/strchr.c",
    "src/string/strchrnul.c",
140
    "src/string/strcmp.c",
L
LiteOS2021 已提交
141
    "src/string/strcpy.c",
S
silen 已提交
142
    "src/string/strcspn.c",
143 144
    "src/string/strdup.c",
    "src/string/strlen.c",
S
silen 已提交
145
    "src/string/strncasecmp.c",
L
LiteOS2021 已提交
146
    "src/string/strncat.c",
S
silen 已提交
147
    "src/string/strncmp.c",
X
x-xiny 已提交
148
    "src/string/strncpy.c",
S
silen 已提交
149 150
    "src/string/strnlen.c",
    "src/string/strrchr.c",
X
x-xiny 已提交
151
    "src/string/strspn.c",
S
silen 已提交
152
    "src/string/strstr.c",
X
x-xiny 已提交
153
    "src/string/strtok.c",
154
    "src/string/wcschr.c",
S
silen 已提交
155 156
    "src/string/wcslen.c",
    "src/time/__month_to_secs.c",
X
x-xiny 已提交
157
    "src/time/__secs_to_tm.c",
S
silen 已提交
158 159 160 161 162 163 164 165
    "src/time/__tm_to_secs.c",
    "src/time/__tz.c",
    "src/time/__year_to_secs.c",
    "src/time/asctime.c",
    "src/time/asctime_r.c",
    "src/time/ctime.c",
    "src/time/strftime.c",
    "src/time/strptime.c",
166 167 168 169 170 171 172 173 174 175 176 177 178
  ]

  include_dirs = [
    "src/include",
    "src/internal",
  ]

  include_dirs += [
    "//kernel/liteos_m/kernel/arch/include",
    "//kernel/liteos_m/kernel/include",
    "//kernel/liteos_m/utils",
  ]

L
LiteOS2021 已提交
179 180 181 182 183
  cflags = [
    "-imacros",
    "$LITEOS_MENUCONFIG_H",
  ]

184 185 186 187 188
  public_configs = [ ":include" ]
}

static_library(libm) {
  sources = [
189 190 191 192
    "src/math/__fpclassify.c",
    "src/math/__fpclassifyl.c",
    "src/math/__signbit.c",
    "src/math/__signbitl.c",
S
silen 已提交
193 194 195
    "src/math/exp_data.c",
    "src/math/frexp.c",
    "src/math/frexpl.c",
196 197
    "src/math/log.c",
    "src/math/log_data.c",
S
silen 已提交
198 199
    "src/math/pow.c",
    "src/math/pow_data.c",
200
    "src/math/round.c",
S
silen 已提交
201
    "src/math/sqrt.c",
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
  ]

  include_dirs = [
    "src/include",
    "src/internal",
  ]

  public_configs = [ ":include" ]
}

group("kernel") {
  public_deps = [
    ":$libc",
    ":$libm",
  ]
}