BUILD.gn 5.7 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 33
# 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"

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

static_library(libc) {
  sources = [
S
silen 已提交
39 40
    "src/ctype/__ctype_get_mb_cur_max.c",
    "src/ctype/isalnum.c",
41 42 43
    "src/ctype/isascii.c",
    "src/ctype/isdigit.c",
    "src/ctype/islower.c",
S
silen 已提交
44 45 46 47
    "src/ctype/isprint.c",
    "src/ctype/isspace.c",
    "src/ctype/isupper.c",
    "src/ctype/isxdigit.c",
48 49
    "src/ctype/tolower.c",
    "src/ctype/toupper.c",
S
silen 已提交
50 51 52
    "src/errno/strerror.c",
    "src/exit/abort.c",
    "src/exit/assert.c",
X
x-xiny 已提交
53 54
    "src/exit/atexit.c",
    "src/internal/floatscan.c",
S
silen 已提交
55 56
    "src/internal/intscan.c",
    "src/internal/shgetc.c",
57 58
    "src/locale/__lctrans.c",
    "src/locale/c_locale.c",
S
silen 已提交
59 60
    "src/locale/langinfo.c",
    "src/misc/dirname.c",
X
x-xiny 已提交
61 62
    "src/multibyte/internal.c",
    "src/multibyte/mbtowc.c",
S
silen 已提交
63 64 65 66 67 68 69
    "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 已提交
70
    "src/prng/rand.c",
S
silen 已提交
71 72 73 74 75 76 77 78
    "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",
79 80
    "src/stdio/__stdio_close.c",
    "src/stdio/__stdio_read.c",
S
silen 已提交
81
    "src/stdio/__stdio_seek.c",
82 83
    "src/stdio/__stdio_write.c",
    "src/stdio/__stdout_write.c",
S
silen 已提交
84
    "src/stdio/__toread.c",
85
    "src/stdio/__towrite.c",
S
silen 已提交
86 87 88
    "src/stdio/__uflow.c",
    "src/stdio/clearerr.c",
    "src/stdio/fclose.c",
89
    "src/stdio/feof.c",
S
silen 已提交
90 91 92
    "src/stdio/fflush.c",
    "src/stdio/fgets.c",
    "src/stdio/fileno.c",
93
    "src/stdio/fopen.c",
S
silen 已提交
94 95 96 97 98 99 100 101 102 103 104 105 106
    "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 已提交
107
    "src/stdio/stdin.c",
S
silen 已提交
108 109 110 111 112
    "src/stdio/stdout.c",
    "src/stdio/vfprintf.c",
    "src/stdio/vsnprintf.c",
    "src/stdio/vsprintf.c",
    "src/stdlib/abs.c",
X
x-xiny 已提交
113
    "src/stdlib/atof.c",
S
silen 已提交
114 115 116
    "src/stdlib/atoi.c",

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

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

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

  public_configs = [ ":include" ]
}

static_library(libm) {
  sources = [
177 178 179 180
    "src/math/__fpclassify.c",
    "src/math/__fpclassifyl.c",
    "src/math/__signbit.c",
    "src/math/__signbitl.c",
S
silen 已提交
181 182 183
    "src/math/exp_data.c",
    "src/math/frexp.c",
    "src/math/frexpl.c",
184 185
    "src/math/log.c",
    "src/math/log_data.c",
S
silen 已提交
186 187
    "src/math/pow.c",
    "src/math/pow_data.c",
188
    "src/math/round.c",
S
silen 已提交
189
    "src/math/sqrt.c",
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
  ]

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

  public_configs = [ ":include" ]
}

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