1#
2# SPDX-License-Identifier: BSD-3-Clause
3#
4# Copyright © 2022 Keith Packard
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9#
10# 1. Redistributions of source code must retain the above copyright
11#    notice, this list of conditions and the following disclaimer.
12#
13# 2. Redistributions in binary form must reproduce the above
14#    copyright notice, this list of conditions and the following
15#    disclaimer in the documentation and/or other materials provided
16#    with the distribution.
17#
18# 3. Neither the name of the copyright holder nor the names of its
19#    contributors may be used to endorse or promote products derived
20#    from this software without specific prior written permission.
21#
22# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
27# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
33# OF THE POSSIBILITY OF SUCH DAMAGE.
34#
35picolibc_sources(
36  a64l.c
37  abort.c
38  abs.c
39  aligned_alloc.c
40  arc4random.c
41  arc4random_uniform.c
42  assert.c
43  atof.c
44  atoff.c
45  atoi.c
46  atol.c
47  atoll.c
48  btowc.c
49  div.c
50  drand48.c
51  environ.c
52  eprintf.c
53  erand48.c
54  _Exit.c
55  getenv.c
56  getenv_r.c
57  getopt.c
58  getsubopt.c
59  imaxabs.c
60  imaxdiv.c
61  itoa.c
62  jrand48.c
63  l64a.c
64  labs.c
65  lcong48.c
66  ldiv.c
67  llabs.c
68  lldiv.c
69  lrand48.c
70  mblen.c
71  mbrlen.c
72  mbrtowc.c
73  mbsinit.c
74  mbsnrtowcs.c
75  mbsrtowcs.c
76  mbstowcs.c
77  mbtowc.c
78  mbtowc_r.c
79  mrand48.c
80  mstats.c
81  nrand48.c
82  putenv.c
83  rand48.c
84  rand.c
85  random.c
86  rand_r.c
87  reallocarray.c
88  reallocf.c
89  rpmatch.c
90  sb_charsets.c
91  seed48.c
92  setenv.c
93  srand.c
94  srand48.c
95  srandom.c
96  system.c
97  utoa.c
98  wcrtomb.c
99  wcsnrtombs.c
100  wcsrtombs.c
101  wcstod.c
102  wcstoimax.c
103  wcstol.c
104  wcstoll.c
105  wcstombs.c
106  wcstoul.c
107  wcstoull.c
108  wcstoumax.c
109  wctob.c
110  wctomb.c
111  wctomb_r.c
112  pico-atexit.c
113  pico-exit.c
114  pico-onexit.c
115  pico-cxa-atexit.c
116  )
117
118picolibc_sources_flags("-fno-builtin-malloc;-fno-builtin-free"
119  nano-malloc-calloc.c
120  nano-malloc-cfree.c
121  nano-malloc-free.c
122  nano-malloc-getpagesize.c
123  nano-malloc-mallinfo.c
124  nano-malloc-malloc.c
125  nano-malloc-malloc_stats.c
126  nano-malloc-malloc_usable_size.c
127  nano-malloc-mallopt.c
128  nano-malloc-memalign.c
129  nano-malloc-posix_memalign.c
130  nano-malloc-pvalloc.c
131  nano-malloc-realloc.c
132  nano-malloc-valloc.c
133  )
134