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
|
|
|
|
2013-06-16 01:43:39 +02:00
|
|
|
LIBCDIR= ${NETBSDSRCDIR}/lib/libc
|
|
|
|
CPPFLAGS+= -I${LIBCDIR}/include -I${LIBCDIR}
|
2012-11-15 12:06:41 +01:00
|
|
|
CPPFLAGS+= -D_LIBMINC
|
|
|
|
|
2013-06-16 01:43:39 +02:00
|
|
|
ARCHDIR?= ${LIBCDIR}/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
|
2013-06-16 01:43:39 +02:00
|
|
|
.PATH.c: ${LIBCDIR}/misc
|
2012-11-15 12:06:41 +01:00
|
|
|
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
|
2013-06-16 01:43:39 +02:00
|
|
|
.PATH.c: ${LIBCDIR}/stdio
|
|
|
|
CPPFLAGS.${i}= -I${LIBCDIR}/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
|
2013-06-16 01:43:39 +02:00
|
|
|
.PATH.c: ${LIBCDIR}/stdlib
|
2011-04-27 15:00:52 +02:00
|
|
|
SRCS+= ${i}
|
2013-06-16 01:43:39 +02:00
|
|
|
CPPFLAGS.${i}+= -I${LIBCDIR}/stdlib
|
2011-04-27 15:00:52 +02:00
|
|
|
.endfor
|
|
|
|
|
2012-11-15 12:06:41 +01:00
|
|
|
# Import from gen
|
2013-06-16 01:43:39 +02:00
|
|
|
errlist.c: ${LIBCDIR}/gen/errlist.awk \
|
2012-11-15 12:06:41 +01:00
|
|
|
${NETBSDSRCDIR}/sys/sys/errno.h
|
2013-06-16 01:43:39 +02:00
|
|
|
${TOOL_CAT} ${NETBSDSRCDIR}/sys/sys/errno.h | ${TOOL_SED} 's/(_SIGN//' | ${TOOL_AWK} -f ${LIBCDIR}/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-06-16 01:43:39 +02:00
|
|
|
.PATH.c .PATH.S: ${ARCHDIR}/gen ${LIBCDIR}/gen/minix \
|
|
|
|
${LIBCDIR}/gen ${LIBCDIR}
|
2011-04-27 15:00:52 +02:00
|
|
|
SRCS+= ${i}
|
|
|
|
.endfor
|
2013-06-16 01:43:39 +02:00
|
|
|
CPPFLAGS.ctype_.c+= -I${LIBCDIR}/locale
|
|
|
|
CPPFLAGS.isctype.c+= -I${LIBCDIR}/locale
|
|
|
|
CPPFLAGS.tolower_.c+= -I${LIBCDIR}/locale
|
|
|
|
CPPFLAGS.toupper_.c+= -I${LIBCDIR}/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
|
2013-06-16 01:43:39 +02:00
|
|
|
.PATH.c: ${LIBCDIR}/regex
|
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 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
|
2013-06-16 01:43:39 +02:00
|
|
|
.PATH.c: ${LIBCDIR}/string
|
2011-04-27 15:00:52 +02:00
|
|
|
SRCS+= ${i}
|
2012-11-15 12:06:41 +01:00
|
|
|
CPPFLAGS.${i}+= -D_LIBC
|
2011-04-27 15:00:52 +02:00
|
|
|
.endfor
|
2013-06-16 01:43:39 +02:00
|
|
|
CPPFLAGS.strtol.c+= -I${LIBCDIR}/../../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
|
2013-06-16 01:43:39 +02:00
|
|
|
.PATH.c: ${LIBCDIR}/time
|
2011-04-27 15:00:52 +02:00
|
|
|
SRCS+= ${i}
|
|
|
|
.endfor
|
2012-11-15 12:06:41 +01:00
|
|
|
|
2013-02-08 13:12:45 +01:00
|
|
|
.if (${MACHINE_ARCH} == "earm")
|
|
|
|
SRCS += __aeabi_ldivmod.S __aeabi_uldivmod.S
|
|
|
|
.endif
|
|
|
|
|
2011-04-27 15:00:52 +02:00
|
|
|
# Import from locale
|
|
|
|
.for i in _def_time.c
|
2013-06-16 01:43:39 +02:00
|
|
|
.PATH.c: ${LIBCDIR}/locale
|
2011-04-27 15:00:52 +02:00
|
|
|
SRCS+= ${i}
|
2013-06-16 01:43:39 +02:00
|
|
|
CPPFLAGS.${i}+= -I${LIBCDIR}/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
|
2013-09-18 14:02:17 +02:00
|
|
|
.for i in access.c brk.c close.c environ.c execve.c fork.c fsync.c \
|
2013-08-20 01:39:47 +02:00
|
|
|
getgid.c getpid.c geteuid.c getuid.c gettimeofday.c getvfsstat.c \
|
2013-09-18 14:02:17 +02:00
|
|
|
init.c link.c loadname.c lseek.c lseek64.c _mcontext.c mknod.c \
|
2013-09-09 15:20:18 +02:00
|
|
|
mmap.c nanosleep.c open.c pread.c pwrite.c read.c sbrk.c \
|
2013-09-18 14:02:17 +02:00
|
|
|
select.c setuid.c sigprocmask.c stack_utils.c stat.c stime.c \
|
|
|
|
syscall.c _ucontext.c umask.c unlink.c waitpid.c write.c \
|
2013-09-09 15:20:18 +02:00
|
|
|
brksize.S _do_kernel_call_intr.S get_minix_kerninfo.S _ipc.S ucontext.S \
|
|
|
|
kill.c
|
2013-06-16 01:43:39 +02:00
|
|
|
.PATH.c: ${LIBCDIR}/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
|
|
|
|
|
2013-06-16 01:43:39 +02:00
|
|
|
.if exists (${ARCHDIR}/Makefile.inc)
|
|
|
|
.PATH: ${ARCHDIR}
|
|
|
|
.include "${ARCHDIR}/Makefile.inc"
|
|
|
|
.endif
|
|
|
|
|
2011-07-09 15:17:12 +02:00
|
|
|
.include <bsd.lib.mk>
|