kernel, libc: signals fixes
[minix.git] / lib / libminc / Makefile
blobe9be11aae90311a4fd3936ad70a9002af83c5afe
2 # Minimal libc for servers and drivers.
5 .include <bsd.own.mk>
7 LIB= minc
9 CPPFLAGS.sched_start.c+= -I${NETBSDSRCDIR}
11 LIBCSRCDIR= ${NETBSDSRCDIR}/lib/libc
12 CPPFLAGS+= -I${LIBCSRCDIR}/include -I${LIBCSRCDIR}
13 CPPFLAGS+= -D_LIBMINC
15 ARCHDIR?= ${LIBCSRCDIR}/arch/${MACHINE_CPU}
17 # Customized versions of libc functions.
19 SRCS+= fputs.c
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.*)
28 SRCS+= bswap64.c
29 .endif
31 .if empty(SRCS:Mmemset2.*)
32 SRCS+= memset.c
33 .endif
35 # Quad support
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 \
45 xordi3.c
46 .endif
48 .for i in \
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
54 SRCS+= ${i}
55 .endfor
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
67 SRCS+= ${i}
68 CPPFLAGS.${i}+= -Dxprintf=printf
69 .endfor
71 # Import from stdio
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
76 SRCS+= ${i}
77 .endfor
79 # Import from stdlib
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
83 SRCS+= ${i}
84 CPPFLAGS.${i}+= -I${LIBCSRCDIR}/stdlib
85 .endfor
87 # Import from gen
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 \
102 nanf.c
103 .PATH.c .PATH.S: ${ARCHDIR}/gen ${LIBCSRCDIR}/gen/minix \
104 ${LIBCSRCDIR}/gen ${LIBCSRCDIR}
105 SRCS+= ${i}
106 .endfor
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
112 # Import from regex
113 .for i in regcomp.c regerror.c regexec.c regfree.c
114 .PATH.c: ${LIBCSRCDIR}/regex
115 SRCS+= ${i}
116 .endfor
118 # Import from string
119 .for i in strcspn.c strerror.c strerror_r.c strtol.c \
120 bcopy.S bzero.S
121 .PATH.S: ${ARCHDIR}/string
122 .PATH.c: ${LIBCSRCDIR}/string
123 SRCS+= ${i}
124 CPPFLAGS.${i}+= -D_LIBC
125 .endfor
126 CPPFLAGS.strtol.c+= -I${LIBCSRCDIR}/../../common/lib/libc/stdlib
128 # Import from time
129 .for i in asctime.c localtime.c strftime.c
130 .PATH.c: ${LIBCSRCDIR}/time
131 SRCS+= ${i}
132 .endfor
134 # Import from locale
135 .for i in _def_time.c
136 .PATH.c: ${LIBCSRCDIR}/locale
137 SRCS+= ${i}
138 CPPFLAGS.${i}+= -I${LIBCSRCDIR}/locale
139 .endfor
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
150 SRCS+= ${i}
151 .endfor
153 CPPFLAGS+= -D_LIBSYS
155 .include <bsd.lib.mk>