2011-04-27 15:00:52 +02:00
|
|
|
#
|
|
|
|
# Minimal libc for servers and drivers.
|
|
|
|
#
|
|
|
|
|
2011-07-09 15:17:12 +02:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
|
|
|
LIB= minc
|
|
|
|
|
2012-06-06 13:16:32 +02:00
|
|
|
CPPFLAGS.sched_start.c+= -I${NETBSDSRCDIR}
|
2011-07-09 15:17:12 +02:00
|
|
|
|
2012-11-15 12:06:41 +01:00
|
|
|
LIBCSRCDIR= ${NETBSDSRCDIR}/lib/libc
|
|
|
|
CPPFLAGS+= -I${LIBCSRCDIR}/include -I${LIBCSRCDIR}
|
|
|
|
CPPFLAGS+= -D_LIBMINC
|
|
|
|
|
2013-01-13 17:20:11 +01:00
|
|
|
ARCHDIR?= ${LIBCSRCDIR}/arch/${MACHINE_CPU}
|
2012-11-15 12:06:41 +01:00
|
|
|
#
|
|
|
|
# Customized versions of libc functions.
|
|
|
|
#
|
|
|
|
SRCS+= fputs.c
|
2011-04-27 15:00:52 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Shared libc with userspace (/common/lib/libc)
|
|
|
|
#
|
2012-06-06 13:16:32 +02:00
|
|
|
.include "${NETBSDSRCDIR}/common/lib/libc/Makefile.inc"
|
2012-08-10 19:02:30 +02:00
|
|
|
.include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.libc.inc"
|
2012-11-15 12:06:41 +01:00
|
|
|
|
2011-04-27 15:00:52 +02:00
|
|
|
.if empty(SRCS:Mbyte_swap_8.*)
|
|
|
|
SRCS+= bswap64.c
|
|
|
|
.endif
|
|
|
|
|
2012-11-15 12:06:41 +01:00
|
|
|
.if empty(SRCS:Mmemset2.*)
|
|
|
|
SRCS+= memset.c
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Quad support
|
2011-04-27 15:00:52 +02:00
|
|
|
.if (${MACHINE_ARCH} != "alpha") && \
|
|
|
|
(${MACHINE_ARCH} != "mips64eb") && \
|
|
|
|
(${MACHINE_ARCH} != "mips64el") && \
|
|
|
|
(${MACHINE_ARCH} != "powerpc64") && \
|
|
|
|
(${MACHINE_ARCH} != "sparc64") && \
|
|
|
|
(${MACHINE_ARCH} != "x86_64")
|
|
|
|
SRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c \
|
|
|
|
iordi3.c lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c \
|
|
|
|
notdi2.c qdivrem.c subdi3.c ucmpdi2.c udivdi3.c umoddi3.c \
|
|
|
|
xordi3.c
|
|
|
|
.endif
|
2012-11-15 12:06:41 +01:00
|
|
|
|
2011-04-27 15:00:52 +02:00
|
|
|
.for i in \
|
|
|
|
random.c strtoll.c strtoul.c strtoull.c strtoumax.c \
|
|
|
|
memchr.c memcmp.c memcpy.c memmove.c popcount32.c popcount64.c \
|
|
|
|
strcasecmp.c strcat.c strchr.c strcmp.c strcpy.c strlcat.c \
|
2012-06-05 11:37:32 +02:00
|
|
|
strlcpy.c strlen.c strncasecmp.c strncmp.c strncpy.c strnlen.c \
|
|
|
|
strrchr.c strsep.c strstr.c ptree.c rb.c sha1.c sha2.c
|
2011-04-27 15:00:52 +02:00
|
|
|
SRCS+= ${i}
|
|
|
|
.endfor
|
2012-11-15 12:06:41 +01:00
|
|
|
CPPFLAGS.sha2.c+= -D_LIBC
|
|
|
|
CPPFLAGS.rb.c+= -D_LIBC
|
|
|
|
CPPFLAGS.strlcpy.c+= -D_LIBC
|
2011-04-27 15:00:52 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Functions imported directly from the libc.
|
|
|
|
#
|
|
|
|
|
2012-11-15 12:06:41 +01:00
|
|
|
# Import from misc (_libc_init symbols)
|
|
|
|
.for i in initfini.c stack_protector.c
|
|
|
|
.PATH.c: ${LIBCSRCDIR}/misc
|
|
|
|
SRCS+= ${i}
|
|
|
|
CPPFLAGS.${i}+= -Dxprintf=printf
|
|
|
|
.endfor
|
|
|
|
|
2011-04-27 15:00:52 +02:00
|
|
|
# Import from stdio
|
2012-11-15 12:06:41 +01:00
|
|
|
.for i in findfp.c sprintf.c fprintf.c perror.c vsnprintf.c snprintf.c \
|
2012-03-09 00:49:46 +01:00
|
|
|
_rand48.c lrand48.c srand48.c
|
2011-04-27 15:00:52 +02:00
|
|
|
.PATH.c: ${LIBCSRCDIR}/stdio
|
2012-11-15 12:06:41 +01:00
|
|
|
CPPFLAGS.${i}= -I${LIBCSRCDIR}/stdio
|
2011-04-27 15:00:52 +02:00
|
|
|
SRCS+= ${i}
|
|
|
|
.endfor
|
2012-11-15 12:06:41 +01:00
|
|
|
|
2011-04-27 15:00:52 +02:00
|
|
|
# Import from stdlib
|
|
|
|
.for i in abort.c atexit.c atoi.c exit.c getenv.c \
|
2012-09-18 13:17:44 +02:00
|
|
|
getopt.c ldiv.c malloc.c
|
2011-04-27 15:00:52 +02:00
|
|
|
.PATH.c: ${LIBCSRCDIR}/stdlib
|
|
|
|
SRCS+= ${i}
|
2012-11-15 12:06:41 +01:00
|
|
|
CPPFLAGS.${i}+= -I${LIBCSRCDIR}/stdlib
|
2011-04-27 15:00:52 +02:00
|
|
|
.endfor
|
|
|
|
|
2012-11-15 12:06:41 +01:00
|
|
|
# Import from gen
|
2011-07-13 22:34:37 +02:00
|
|
|
errlist.c: ${LIBCSRCDIR}/gen/errlist.awk \
|
2012-11-15 12:06:41 +01:00
|
|
|
${NETBSDSRCDIR}/sys/sys/errno.h
|
|
|
|
${TOOL_CAT} ${NETBSDSRCDIR}/sys/sys/errno.h | ${TOOL_SED} 's/(_SIGN//' | ${TOOL_AWK} -f ${LIBCSRCDIR}/gen/errlist.awk > ${.TARGET}
|
2012-06-13 11:25:15 +02:00
|
|
|
CLEANFILES+= errlist.c
|
2011-04-27 15:00:52 +02:00
|
|
|
|
|
|
|
.for i in assert.c _errno.c errno.c _env.c errlist.c \
|
|
|
|
execle.c getprogname.c sleep.c time.c \
|
2012-03-09 00:49:46 +01:00
|
|
|
ctype_.c isctype.c tolower_.c toupper_.c usleep.c \
|
2011-04-27 15:00:52 +02:00
|
|
|
infinityf_ieee754.c infinity_ieee754.c \
|
|
|
|
fpclassifyf_ieee754.c fpclassifyd_ieee754.c \
|
|
|
|
isinff_ieee754.c isinfd_ieee754.c \
|
|
|
|
isnanf_ieee754.c isnand_ieee754.c \
|
|
|
|
isfinitef_ieee754.c isfinited_ieee754.c \
|
|
|
|
signbitf_ieee754.c signbitd_ieee754.c \
|
2012-08-10 19:02:30 +02:00
|
|
|
nanf.c
|
2013-01-13 17:20:11 +01:00
|
|
|
.PATH.c .PATH.S: ${ARCHDIR}/gen ${LIBCSRCDIR}/gen/minix \
|
2011-04-27 15:00:52 +02:00
|
|
|
${LIBCSRCDIR}/gen ${LIBCSRCDIR}
|
|
|
|
SRCS+= ${i}
|
|
|
|
.endfor
|
|
|
|
CPPFLAGS.ctype_.c+= -I${LIBCSRCDIR}/locale
|
|
|
|
CPPFLAGS.isctype.c+= -I${LIBCSRCDIR}/locale
|
|
|
|
CPPFLAGS.tolower_.c+= -I${LIBCSRCDIR}/locale
|
|
|
|
CPPFLAGS.toupper_.c+= -I${LIBCSRCDIR}/locale
|
2012-11-15 12:06:41 +01:00
|
|
|
|
2011-04-27 15:00:52 +02:00
|
|
|
# Import from regex
|
|
|
|
.for i in regcomp.c regerror.c regexec.c regfree.c
|
|
|
|
.PATH.c: ${LIBCSRCDIR}/regex
|
|
|
|
SRCS+= ${i}
|
|
|
|
.endfor
|
2012-11-15 12:06:41 +01:00
|
|
|
|
2011-04-27 15:00:52 +02:00
|
|
|
# Import from string
|
|
|
|
.for i in strcspn.c strerror.c strerror_r.c strtol.c \
|
2012-08-10 19:02:30 +02:00
|
|
|
bcopy.S bzero.S
|
2013-01-13 17:20:11 +01:00
|
|
|
.PATH.S: ${ARCHDIR}/string
|
2011-04-27 15:00:52 +02:00
|
|
|
.PATH.c: ${LIBCSRCDIR}/string
|
|
|
|
SRCS+= ${i}
|
2012-11-15 12:06:41 +01:00
|
|
|
CPPFLAGS.${i}+= -D_LIBC
|
2011-04-27 15:00:52 +02:00
|
|
|
.endfor
|
|
|
|
CPPFLAGS.strtol.c+= -I${LIBCSRCDIR}/../../common/lib/libc/stdlib
|
2012-11-15 12:06:41 +01:00
|
|
|
|
2011-04-27 15:00:52 +02:00
|
|
|
# Import from time
|
|
|
|
.for i in asctime.c localtime.c strftime.c
|
|
|
|
.PATH.c: ${LIBCSRCDIR}/time
|
|
|
|
SRCS+= ${i}
|
|
|
|
.endfor
|
2012-11-15 12:06:41 +01:00
|
|
|
|
2011-04-27 15:00:52 +02:00
|
|
|
# Import from locale
|
|
|
|
.for i in _def_time.c
|
|
|
|
.PATH.c: ${LIBCSRCDIR}/locale
|
|
|
|
SRCS+= ${i}
|
2012-11-15 12:06:41 +01:00
|
|
|
CPPFLAGS.${i}+= -I${LIBCSRCDIR}/locale
|
2011-04-27 15:00:52 +02:00
|
|
|
.endfor
|
2012-11-15 12:06:41 +01:00
|
|
|
|
2011-04-27 15:00:52 +02:00
|
|
|
# Import from sys-minix
|
|
|
|
.for i in access.c brk.c close.c environ.c execve.c fork.c \
|
|
|
|
getgid.c getpid.c getuid.c gettimeofday.c loadname.c \
|
2012-03-09 00:49:46 +01:00
|
|
|
link.c _mcontext.c mknod.c mmap.c nanosleep.c open.c \
|
|
|
|
read.c sbrk.c select.c setuid.c sigprocmask.c stat.c \
|
|
|
|
stime.c syscall.c _ucontext.c umask.c unlink.c waitpid.c \
|
2012-07-18 18:53:20 +02:00
|
|
|
brksize.S _ipc.S _senda.S ucontext.S mmap.c init.c
|
2011-04-27 15:00:52 +02:00
|
|
|
.PATH.c: ${LIBCSRCDIR}/sys-minix
|
2013-01-13 17:20:11 +01:00
|
|
|
.PATH.S: ${ARCHDIR}/sys-minix
|
2011-04-27 15:00:52 +02:00
|
|
|
SRCS+= ${i}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
CPPFLAGS+= -D_LIBSYS
|
|
|
|
|
2011-07-09 15:17:12 +02:00
|
|
|
.include <bsd.lib.mk>
|