VM: simplify slab allocator
[minix.git] / lib / libc / Makefile
blobf65088283c9d666c245f337d37279bcb5bfdcef2
1 # $NetBSD: Makefile,v 1.143 2010/09/04 12:17:58 ahoka Exp $
2 # @(#)Makefile 8.2 (Berkeley) 2/3/94
4 # All library objects contain sccsid strings by default; they may be
5 # excluded as a space-saving measure. To produce a library that does
6 # not contain these strings, delete -DLIBC_SCCS and -DSYSLIBC_SCCS
7 # from CPPFLAGS below. To remove these strings from just the system call
8 # stubs, remove just -DSYSLIBC_SCCS from CPPFLAGS.
10 # The NLS (message catalog) functions are always in libc. To choose that
11 # strerror(), perror(), strsignal(), psignal(), etc. actually call the NLS
12 # functions, put -DNLS on the CPPFLAGS line below.
14 # The YP functions are always in libc. To choose that getpwent() and friends
15 # actually call the YP functions, put -DYP on the CPPFLAGS line below.
17 # The Hesiod functions are always in libc. To choose that getpwent() and friends
18 # actually call the Hesiod functions, put -DHESIOD on the CPPFLAGS line below.
20 .if defined(__MINIX)
21 .include "minix-config.inc"
22 .endif
23 .include "Makefile.inc"
25 LIB= c
26 CPPFLAGS+= -I${.CURDIR}/include -I${.CURDIR}
28 LIBCDIR= ${.CURDIR}
30 .if exists (${ARCHDIR}/Makefile.inc)
31 .PATH: ${ARCHDIR}
32 .include "${ARCHDIR}/Makefile.inc"
33 .endif
35 .if exists (${ARCHDIR}/genassym.cf)
36 DPSRCS+= assym.h
37 CLEANFILES+= assym.h assym.h.tmp
39 assym.h: ${ARCHDIR}/genassym.cf
40 ${_MKTARGET_CREATE}
41 ${TOOL_GENASSYM} -- ${CC} ${CFLAGS} \
42 ${CPPFLAGS} ${CPPFLAGS.assym.h} ${PROF} \
43 < ${ARCHDIR}/genassym.cf > assym.h.tmp && \
44 mv -f assym.h.tmp assym.h
45 .endif
47 # The following controls how to build compatibility code for old NetBSD
48 # binaries. If BUILDCOLD is yes, then we build a separate library; otherwise
49 # we include the code in libc.
50 BUILDCOLD?= no
51 .if "${BUILDCOLD}" == "yes"
52 SUBDIR=compat
53 .include <bsd.subdir.mk>
54 .else
55 COMPATDIR= ${.CURDIR}/compat-minix
56 .include "${.CURDIR}/compat-minix/Makefile.inc"
57 .endif
59 .include "${.CURDIR}/../../common/lib/libc/Makefile.inc"
60 .include "${.CURDIR}/atomic/Makefile.inc"
61 .include "${.CURDIR}/cdb/Makefile.inc"
62 .include "${.CURDIR}/db/Makefile.inc"
63 .if (${CITRUS} == "yes")
64 .include "${.CURDIR}/citrus/Makefile.inc"
65 .endif
66 .include "${.CURDIR}/compat-43/Makefile.inc"
67 .include "${.CURDIR}/dlfcn/Makefile.inc"
68 .include "${.CURDIR}/gdtoa/Makefile.inc"
69 .include "${.CURDIR}/gen/Makefile.inc"
70 .if defined(__MINIX)
71 # gmon needs profil()
72 .else
73 .include "${.CURDIR}/gmon/Makefile.inc"
74 .endif
75 .include "${.CURDIR}/hash/Makefile.inc"
76 .include "${.CURDIR}/iconv/Makefile.inc"
77 .include "${.CURDIR}/inet/Makefile.inc"
78 .include "${.CURDIR}/isc/Makefile.inc"
79 .include "${.CURDIR}/locale/Makefile.inc"
80 .include "${.CURDIR}/md/Makefile.inc"
81 .include "${.CURDIR}/misc/Makefile.inc"
82 .include "${.CURDIR}/net/Makefile.inc"
83 .include "${.CURDIR}/nameser/Makefile.inc"
84 .include "${.CURDIR}/nls/Makefile.inc"
85 .if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64")
86 .include "${.CURDIR}/quad/Makefile.inc"
87 .endif
88 .if (${USE_LIBTRE} == "yes")
89 .include "${NETBSDSRCDIR}/external/bsd/tre/Makefile.inc"
90 .else
91 .include "${.CURDIR}/regex/Makefile.inc"
92 .endif
93 .include "${.CURDIR}/resolv/Makefile.inc"
94 .if defined(__MINIX)
95 # RPC needs pollts() and a reserved port allocator.
96 .else
97 .include "${.CURDIR}/rpc/Makefile.inc"
98 .endif
99 .include "${.CURDIR}/ssp/Makefile.inc"
100 .include "${.CURDIR}/stdio/Makefile.inc"
101 .include "${.CURDIR}/stdlib/Makefile.inc"
102 .include "${.CURDIR}/string/Makefile.inc"
103 .include "${.CURDIR}/termios/Makefile.inc"
104 .include "${.CURDIR}/thread-stub/Makefile.inc"
105 .include "${.CURDIR}/time/Makefile.inc"
106 .if defined(__MINIX)
107 .include "${.CURDIR}/sys-minix/Makefile.inc"
108 .else
109 .include "${.CURDIR}/sys/Makefile.inc"
110 .endif
111 .include "${.CURDIR}/uuid/Makefile.inc"
112 .if (${MKYP} != "no")
113 .include "${.CURDIR}/yp/Makefile.inc"
114 .endif
116 # Remove from SRCS the .c files for any .S files added by the MD makefiles,
117 # also remove from SRCS the .c files for the .S and .c files in NO_SRCS.
118 # Add the .c file for .S files (in both variables) to LSRCS so that the
119 # 'normal' .c file for assembly files is used for the lint librray.
121 # Usage:
122 # Add .S files to NO_SRSC when another .S file provides the entry points.
123 # Add .c files to NO_SRSC when another .c file provides the entry points.
124 # (lint is run on all .c files in SRCS)
126 .for check_file in ${SRCS:M*.S} ${NO_SRCS}
127 unwanted_file := ${SRCS:M${check_file:.S=.c}}
128 .if "${unwanted_file}" != ""
129 SRCS := ${SRCS:N${unwanted_file}}
130 .if "${unwanted_file}" != "${check_file}"
131 LSRCS := ${LSRCS} ${unwanted_file}
132 .endif
133 .endif
134 .endfor
136 NLS= C.msg Pig.msg ca.msg cs.msg de.msg es.msg fi.msg fr.msg nl.msg \
137 no.msg pl.msg sk.msg sv.msg
139 .if defined(__MINIX)
140 realall:
141 .else
142 realall: tags
143 .endif
144 tags: ${.OBJDIR}/tags
145 ${.OBJDIR}/tags: ${SRCS}
146 ${_MKTARGET_CREATE}
147 -${TOOL_CTAGS} -w ${.ALLSRC:M*.c}
148 -egrep "^ENTRY(.*)|^FUNC(.*)|^SYSCALL(.*)" /dev/null ${.ALLSRC:M*.S} | \
149 sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \
150 >> ${.TARGET}; sort -o ${.TARGET} ${.TARGET}
152 .if !defined(__MINIX)
153 FILES= ${.OBJDIR}/tags
154 FILESNAME= libc.tags
155 FILESDIR= /var/db
156 .endif
159 # workaround for I18N stuffs: build singlebyte setlocale() for libc.a,
160 # multibyte for libc.so. the quirk should be removed when we support
161 # dlopen() from within statically linked binaries.
162 #.if (${CITRUS} == "yes")
163 #CSHLIBFLAGS+= -D_I18N_DYNAMIC
164 #.endif
166 .include <bsd.lib.mk>
168 # force the dynamic linker to initialize libc first
169 SHLIB_SHFLAGS+= -Wl,-z,initfirst
171 .include <bsd.own.mk>
172 SUBDIR+= pkgconfig
173 .include <bsd.subdir.mk>