BUILD.gn 6.3 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",
A
arvinzzz 已提交
62
    "src/locale/iconv.c",
S
silen 已提交
63 64
    "src/locale/langinfo.c",
    "src/misc/dirname.c",
S
SimonLi 已提交
65
    "src/misc/realpath.c",
X
x-xiny 已提交
66 67
    "src/multibyte/internal.c",
    "src/multibyte/mbtowc.c",
S
silen 已提交
68 69 70 71 72 73 74
    "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 已提交
75
    "src/prng/rand.c",
S
silen 已提交
76 77 78 79 80 81 82 83
    "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",
84 85
    "src/stdio/__stdio_close.c",
    "src/stdio/__stdio_read.c",
S
silen 已提交
86
    "src/stdio/__stdio_seek.c",
87 88
    "src/stdio/__stdio_write.c",
    "src/stdio/__stdout_write.c",
S
silen 已提交
89
    "src/stdio/__toread.c",
90
    "src/stdio/__towrite.c",
S
silen 已提交
91 92 93
    "src/stdio/__uflow.c",
    "src/stdio/clearerr.c",
    "src/stdio/fclose.c",
94
    "src/stdio/feof.c",
S
silen 已提交
95 96 97
    "src/stdio/fflush.c",
    "src/stdio/fgets.c",
    "src/stdio/fileno.c",
98
    "src/stdio/fopen.c",
S
silen 已提交
99 100 101 102 103 104 105 106 107 108 109 110 111
    "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 已提交
112
    "src/stdio/stdin.c",
S
silen 已提交
113
    "src/stdio/stdout.c",
A
arvinzzz 已提交
114
    "src/stdio/ungetc.c",
S
silen 已提交
115 116 117 118
    "src/stdio/vfprintf.c",
    "src/stdio/vsnprintf.c",
    "src/stdio/vsprintf.c",
    "src/stdlib/abs.c",
X
x-xiny 已提交
119
    "src/stdlib/atof.c",
S
silen 已提交
120 121 122
    "src/stdlib/atoi.c",
    "src/stdlib/atol.c",
    "src/stdlib/atoll.c",
X
x-xiny 已提交
123 124 125
    "src/stdlib/bsearch.c",
    "src/stdlib/llabs.c",
    "src/stdlib/strtod.c",
A
arvinzzz 已提交
126
    "src/stdlib/strtol.c",
S
silen 已提交
127
    "src/string/memchr.c",
128 129
    "src/string/memcmp.c",
    "src/string/memcpy.c",
X
x-xiny 已提交
130
    "src/string/memmove.c",
S
silen 已提交
131 132
    "src/string/memrchr.c",
    "src/string/memset.c",
X
x-xiny 已提交
133
    "src/string/stpcpy.c",
L
LiteOS2021 已提交
134
    "src/string/stpncpy.c",
135
    "src/string/strcasecmp.c",
X
x-xiny 已提交
136
    "src/string/strcat.c",
S
silen 已提交
137 138
    "src/string/strchr.c",
    "src/string/strchrnul.c",
139
    "src/string/strcmp.c",
L
LiteOS2021 已提交
140
    "src/string/strcpy.c",
S
silen 已提交
141
    "src/string/strcspn.c",
142 143
    "src/string/strdup.c",
    "src/string/strlen.c",
S
silen 已提交
144
    "src/string/strncasecmp.c",
L
LiteOS2021 已提交
145
    "src/string/strncat.c",
S
silen 已提交
146
    "src/string/strncmp.c",
X
x-xiny 已提交
147
    "src/string/strncpy.c",
S
silen 已提交
148 149
    "src/string/strnlen.c",
    "src/string/strrchr.c",
X
x-xiny 已提交
150
    "src/string/strspn.c",
S
silen 已提交
151
    "src/string/strstr.c",
X
x-xiny 已提交
152
    "src/string/strtok.c",
153
    "src/string/wcschr.c",
S
silen 已提交
154 155
    "src/string/wcslen.c",
    "src/time/__month_to_secs.c",
X
x-xiny 已提交
156
    "src/time/__secs_to_tm.c",
S
silen 已提交
157 158 159 160 161 162 163 164
    "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",
165 166 167 168 169 170 171 172 173 174 175 176 177
  ]

  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 已提交
178 179 180 181 182
  cflags = [
    "-imacros",
    "$LITEOS_MENUCONFIG_H",
  ]

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

static_library(libm) {
  sources = [
188 189
    "src/math/__fpclassify.c",
    "src/math/__fpclassifyl.c",
A
arvinzzz 已提交
190 191 192 193 194 195 196 197 198 199
    "src/math/__math_divzero.c",
    "src/math/__math_divzerof.c",
    "src/math/__math_invalid.c",
    "src/math/__math_invalidf.c",
    "src/math/__math_oflow.c",
    "src/math/__math_oflowf.c",
    "src/math/__math_uflow.c",
    "src/math/__math_uflowf.c",
    "src/math/__math_xflow.c",
    "src/math/__math_xflowf.c",
200 201
    "src/math/__signbit.c",
    "src/math/__signbitl.c",
A
arvinzzz 已提交
202
    "src/math/arm/fabs.c",
S
silen 已提交
203
    "src/math/exp_data.c",
A
arvinzzz 已提交
204
    "src/math/floor.c",
S
silen 已提交
205 206
    "src/math/frexp.c",
    "src/math/frexpl.c",
207 208
    "src/math/log.c",
    "src/math/log_data.c",
S
silen 已提交
209 210
    "src/math/pow.c",
    "src/math/pow_data.c",
211
    "src/math/round.c",
S
silen 已提交
212
    "src/math/sqrt.c",
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
  ]

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

  public_configs = [ ":include" ]
}

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