2 # Minimal libc for servers and drivers.
9 CPPFLAGS.sched_start.c
+= -I
${NETBSDSRCDIR}
11 LIBCSRCDIR
= ${NETBSDSRCDIR}/lib
/libc
12 CPPFLAGS
+= -I
${LIBCSRCDIR}/include -I
${LIBCSRCDIR}
15 ARCHDIR?
= ${LIBCSRCDIR}/arch
/${MACHINE_CPU}
17 # Customized versions of libc functions.
22 # Shared libc with userspace (/common/lib/libc)
24 .
include "${NETBSDSRCDIR}/common/lib/libc/Makefile.inc"
25 .
include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.libc.inc"
27 .if empty
(SRCS
:Mbyte_swap_8.
*)
31 .if empty
(SRCS
:Mmemset2.
*)
36 .if
(${MACHINE_ARCH} != "alpha") && \
37 (${MACHINE_ARCH} != "mips64eb") && \
38 (${MACHINE_ARCH} != "mips64el") && \
39 (${MACHINE_ARCH} != "powerpc64") && \
40 (${MACHINE_ARCH} != "sparc64") && \
41 (${MACHINE_ARCH} != "x86_64")
42 SRCS
+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c \
43 iordi3.c lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c \
44 notdi2.c qdivrem.c subdi3.c ucmpdi2.c udivdi3.c umoddi3.c \
49 random.c strtoll.c strtoul.c strtoull.c strtoumax.c \
50 memchr.c memcmp.c memcpy.c memmove.c popcount32.c popcount64.c \
51 strcasecmp.c strcat.c strchr.c strcmp.c strcpy.c strlcat.c \
52 strlcpy.c strlen.c strncasecmp.c strncmp.c strncpy.c strnlen.c \
53 strrchr.c strsep.c strstr.c ptree.c rb.c sha1.c sha2.c
56 CPPFLAGS.sha2.c
+= -D_LIBC
57 CPPFLAGS.rb.c
+= -D_LIBC
58 CPPFLAGS.strlcpy.c
+= -D_LIBC
61 # Functions imported directly from the libc.
64 # Import from misc (_libc_init symbols)
65 .for i in initfini.c stack_protector.c
66 .PATH.c
: ${LIBCSRCDIR}/misc
68 CPPFLAGS.
${i}+= -Dxprintf
=printf
72 .for i in findfp.c sprintf.c fprintf.c perror.c vsnprintf.c snprintf.c \
73 _rand48.c lrand48.c srand48.c
74 .PATH.c
: ${LIBCSRCDIR}/stdio
75 CPPFLAGS.
${i}= -I
${LIBCSRCDIR}/stdio
80 .for i in abort.c atexit.c atoi.c exit.c getenv.c \
81 getopt.c ldiv.c malloc.c
82 .PATH.c
: ${LIBCSRCDIR}/stdlib
84 CPPFLAGS.
${i}+= -I
${LIBCSRCDIR}/stdlib
88 errlist.c
: ${LIBCSRCDIR}/gen
/errlist.awk \
89 ${NETBSDSRCDIR}/sys
/sys
/errno.h
90 ${TOOL_CAT} ${NETBSDSRCDIR}/sys
/sys
/errno.h |
${TOOL_SED} 's/(_SIGN//' |
${TOOL_AWK} -f
${LIBCSRCDIR}/gen
/errlist.awk
> ${.TARGET
}
91 CLEANFILES
+= errlist.c
93 .for i in assert.c _errno.c errno.c _env.c errlist.c \
94 execle.c getprogname.c sleep.c time.c \
95 ctype_.c isctype.c tolower_.c toupper_.c usleep.c \
96 infinityf_ieee754.c infinity_ieee754.c \
97 fpclassifyf_ieee754.c fpclassifyd_ieee754.c \
98 isinff_ieee754.c isinfd_ieee754.c \
99 isnanf_ieee754.c isnand_ieee754.c \
100 isfinitef_ieee754.c isfinited_ieee754.c \
101 signbitf_ieee754.c signbitd_ieee754.c \
103 .PATH.c .PATH.S
: ${ARCHDIR}/gen
${LIBCSRCDIR}/gen
/minix \
104 ${LIBCSRCDIR}/gen
${LIBCSRCDIR}
107 CPPFLAGS.ctype_.c
+= -I
${LIBCSRCDIR}/locale
108 CPPFLAGS.isctype.c
+= -I
${LIBCSRCDIR}/locale
109 CPPFLAGS.tolower_.c
+= -I
${LIBCSRCDIR}/locale
110 CPPFLAGS.toupper_.c
+= -I
${LIBCSRCDIR}/locale
113 .for i in regcomp.c regerror.c regexec.c regfree.c
114 .PATH.c
: ${LIBCSRCDIR}/regex
119 .for i in strcspn.c strerror.c strerror_r.c strtol.c \
121 .PATH.S
: ${ARCHDIR}/string
122 .PATH.c
: ${LIBCSRCDIR}/string
124 CPPFLAGS.
${i}+= -D_LIBC
126 CPPFLAGS.strtol.c
+= -I
${LIBCSRCDIR}/..
/..
/common
/lib
/libc
/stdlib
129 .for i in asctime.c localtime.c strftime.c
130 .PATH.c
: ${LIBCSRCDIR}/time
135 .for i in _def_time.c
136 .PATH.c
: ${LIBCSRCDIR}/locale
138 CPPFLAGS.
${i}+= -I
${LIBCSRCDIR}/locale
141 # Import from sys-minix
142 .for i in access.c brk.c close.c environ.c execve.c fork.c \
143 getgid.c getpid.c getuid.c gettimeofday.c loadname.c \
144 link.c _mcontext.c mknod.c mmap.c nanosleep.c open.c \
145 read.c sbrk.c select.c setuid.c sigprocmask.c stat.c \
146 stime.c syscall.c _ucontext.c umask.c unlink.c waitpid.c \
147 brksize.S _ipc.S _senda.S ucontext.S mmap.c init.c
148 .PATH.c
: ${LIBCSRCDIR}/sys-minix
149 .PATH.S
: ${ARCHDIR}/sys-minix
155 .
include <bsd.lib.mk
>