1# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. 2# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without modification, 5# are permitted provided that the following conditions are met: 6# 7# 1. Redistributions of source code must retain the above copyright notice, this list of 8# conditions and the following disclaimer. 9# 10# 2. Redistributions in binary form must reproduce the above copyright notice, this list 11# of conditions and the following disclaimer in the documentation and/or other materials 12# provided with the distribution. 13# 14# 3. Neither the name of the copyright holder nor the names of its contributors may be used 15# to endorse or promote products derived from this software without specific prior written 16# permission. 17# 18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 20# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 22# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 23# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 25# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 27# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 28# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 30libc = "musl-c" 31libm = "musl-m" 32 33LITEOS_MENUCONFIG_H = rebase_path("$root_out_dir/config.h") 34 35config("include") { 36 include_dirs = [ "include" ] 37} 38 39static_library(libc) { 40 sources = [ 41 "src/ctype/__ctype_get_mb_cur_max.c", 42 "src/ctype/isalnum.c", 43 "src/ctype/isascii.c", 44 "src/ctype/isdigit.c", 45 "src/ctype/islower.c", 46 "src/ctype/isprint.c", 47 "src/ctype/isspace.c", 48 "src/ctype/isupper.c", 49 "src/ctype/isxdigit.c", 50 "src/ctype/tolower.c", 51 "src/ctype/toupper.c", 52 "src/env/__stack_chk_fail.c", 53 "src/errno/strerror.c", 54 "src/exit/abort.c", 55 "src/exit/assert.c", 56 "src/exit/atexit.c", 57 "src/internal/floatscan.c", 58 "src/internal/intscan.c", 59 "src/internal/shgetc.c", 60 "src/locale/__lctrans.c", 61 "src/locale/c_locale.c", 62 "src/locale/iconv.c", 63 "src/locale/langinfo.c", 64 "src/misc/dirname.c", 65 "src/misc/realpath.c", 66 "src/multibyte/internal.c", 67 "src/multibyte/mbtowc.c", 68 "src/multibyte/wcrtomb.c", 69 "src/multibyte/wctomb.c", 70 "src/network/h_errno.c", 71 "src/network/htonl.c", 72 "src/network/htons.c", 73 "src/network/ntohl.c", 74 "src/network/ntohs.c", 75 "src/prng/rand.c", 76 "src/prng/random.c", 77 "src/regex/regcomp.c", 78 "src/regex/regexec.c", 79 "src/regex/tre-mem.c", 80 "src/stdio/__fdopen.c", 81 "src/stdio/__fmodeflags.c", 82 "src/stdio/__lockfile.c", 83 "src/stdio/__overflow.c", 84 "src/stdio/__stdio_close.c", 85 "src/stdio/__stdio_read.c", 86 "src/stdio/__stdio_seek.c", 87 "src/stdio/__stdio_write.c", 88 "src/stdio/__stdout_write.c", 89 "src/stdio/__toread.c", 90 "src/stdio/__towrite.c", 91 "src/stdio/__uflow.c", 92 "src/stdio/clearerr.c", 93 "src/stdio/fclose.c", 94 "src/stdio/feof.c", 95 "src/stdio/fflush.c", 96 "src/stdio/fgetc.c", 97 "src/stdio/fgets.c", 98 "src/stdio/fileno.c", 99 "src/stdio/fopen.c", 100 "src/stdio/fputc.c", 101 "src/stdio/fputs.c", 102 "src/stdio/fread.c", 103 "src/stdio/fseek.c", 104 "src/stdio/ftell.c", 105 "src/stdio/fwrite.c", 106 "src/stdio/ofl.c", 107 "src/stdio/ofl_add.c", 108 "src/stdio/perror.c", 109 "src/stdio/remove.c", 110 "src/stdio/rewind.c", 111 "src/stdio/snprintf.c", 112 "src/stdio/stderr.c", 113 "src/stdio/stdin.c", 114 "src/stdio/stdout.c", 115 "src/stdio/ungetc.c", 116 "src/stdio/vfprintf.c", 117 "src/stdio/vsnprintf.c", 118 "src/stdio/vsprintf.c", 119 "src/stdlib/abs.c", 120 "src/stdlib/atof.c", 121 "src/stdlib/atoi.c", 122 "src/stdlib/atol.c", 123 "src/stdlib/atoll.c", 124 "src/stdlib/bsearch.c", 125 "src/stdlib/llabs.c", 126 "src/stdlib/strtod.c", 127 "src/stdlib/strtol.c", 128 "src/string/memchr.c", 129 "src/string/memcmp.c", 130 "src/string/memcpy.c", 131 "src/string/memmove.c", 132 "src/string/memrchr.c", 133 "src/string/memset.c", 134 "src/string/stpcpy.c", 135 "src/string/stpncpy.c", 136 "src/string/strcasecmp.c", 137 "src/string/strcat.c", 138 "src/string/strchr.c", 139 "src/string/strchrnul.c", 140 "src/string/strcmp.c", 141 "src/string/strcpy.c", 142 "src/string/strcspn.c", 143 "src/string/strdup.c", 144 "src/string/strlen.c", 145 "src/string/strncasecmp.c", 146 "src/string/strncat.c", 147 "src/string/strncmp.c", 148 "src/string/strncpy.c", 149 "src/string/strnlen.c", 150 "src/string/strrchr.c", 151 "src/string/strspn.c", 152 "src/string/strstr.c", 153 "src/string/strtok.c", 154 "src/string/wcschr.c", 155 "src/string/wcslen.c", 156 "src/time/__month_to_secs.c", 157 "src/time/__secs_to_tm.c", 158 "src/time/__tm_to_secs.c", 159 "src/time/__tz.c", 160 "src/time/__year_to_secs.c", 161 "src/time/asctime.c", 162 "src/time/asctime_r.c", 163 "src/time/ctime.c", 164 "src/time/strftime.c", 165 "src/time/strptime.c", 166 ] 167 168 include_dirs = [ 169 "src/include", 170 "src/internal", 171 ] 172 173 include_dirs += [ 174 "//kernel/liteos_m/kernel/arch/include", 175 "//kernel/liteos_m/kernel/include", 176 "//kernel/liteos_m/utils", 177 ] 178 179 cflags = [ 180 "-imacros", 181 "$LITEOS_MENUCONFIG_H", 182 ] 183 184 public_configs = [ ":include" ] 185} 186 187static_library(libm) { 188 sources = [ 189 "src/math/__fpclassify.c", 190 "src/math/__fpclassifyl.c", 191 "src/math/__math_divzero.c", 192 "src/math/__math_divzerof.c", 193 "src/math/__math_invalid.c", 194 "src/math/__math_invalidf.c", 195 "src/math/__math_oflow.c", 196 "src/math/__math_oflowf.c", 197 "src/math/__math_uflow.c", 198 "src/math/__math_uflowf.c", 199 "src/math/__math_xflow.c", 200 "src/math/__math_xflowf.c", 201 "src/math/__signbit.c", 202 "src/math/__signbitl.c", 203 "src/math/arm/fabs.c", 204 "src/math/copysign.c", 205 "src/math/copysignl.c", 206 "src/math/exp_data.c", 207 "src/math/fabsl.c", 208 "src/math/floor.c", 209 "src/math/fmod.c", 210 "src/math/fmodl.c", 211 "src/math/frexp.c", 212 "src/math/frexpl.c", 213 "src/math/log.c", 214 "src/math/log_data.c", 215 "src/math/pow.c", 216 "src/math/pow_data.c", 217 "src/math/round.c", 218 "src/math/scalbn.c", 219 "src/math/scalbnl.c", 220 "src/math/sqrt.c", 221 ] 222 223 include_dirs = [ 224 "src/include", 225 "src/internal", 226 ] 227 228 public_configs = [ ":include" ] 229} 230 231group("kernel") { 232 public_deps = [ 233 ":$libc", 234 ":$libm", 235 ] 236} 237