xref: /openbsd/lib/libc/Makefile (revision 404b540a)
1#	$OpenBSD: Makefile,v 1.26 2006/03/14 09:19:37 deraadt Exp $
2#
3# All library objects contain sccsid strings by default; they may be
4# excluded as a space-saving measure.  To produce a library that does
5# not contain these strings, delete -DLIBC_SCCS and -DSYSLIBC_SCCS
6# from CFLAGS below.  To remove these strings from just the system call
7# stubs, remove just -DSYSLIBC_SCCS from CFLAGS.
8#
9# The NLS (message catalog) functions are always in libc.  To choose that
10# strerror(), perror(), strsignal(), psignal(), etc. actually call the NLS
11# functions, put -DNLS on the CFLAGS line below.
12#
13# The YP functions are always in libc. To choose that getpwent() and friends
14# actually call the YP functions, put -DYP on the CFLAGS line below.
15
16.include <bsd.own.mk>
17
18LIB=c
19WANTLINT=
20LINTFLAGS=-z
21CLEANFILES+=tags
22#CFLAGS+=-Werror
23
24LIBCSRCDIR=${.CURDIR}
25.include "${LIBCSRCDIR}/Makefile.inc"
26
27NLS=	C.msg Pig.msg de.msg es.msg fi.msg fr.msg nl.msg no.msg ru.msg sv.msg it.msg
28
29copy-to-libkern:	copy-to-libkern-machind copy-to-libkern-machdep
30
31.if make(copy-to-libkern)
32copy-to-libkern-machind: ${KSRCS}
33	cp -p ${.ALLSRC} ${LIBKERN}
34.if defined(KINCLUDES) && !empty(KINCLUDES)
35	(cd ${.CURDIR} ; cp -p ${KINCLUDES} ${LIBKERN})
36.endif
37
38copy-to-libkern-machdep: ${KMSRCS}
39.if defined(KMSRCS) && !empty(KMSRCS)
40	cp -p ${.ALLSRC} ${LIBKERN}/arch/${MACHINE_ARCH}
41.endif
42.if defined(KMINCLUDES) && !empty(KMINCLUDES)
43	(cd ${.CURDIR} ; cp -p ${KMINCLUDES} ${LIBKERN}/arch/${MACHINE_ARCH})
44.endif
45
46rm-from-libkern:
47	for i in ${KSRCS}; do rm -f ${LIBKERN}/$$i; done
48.if defined(KMSRCS) && !empty(KMSRCS)
49	for i in ${KMSRCS}; do rm -f ${LIBKERN}/arch/${MACHINE_ARCH}/$$i; done
50.endif
51.endif
52
53all: tags
54tags: ${SRCS}
55	ctags -w ${.ALLSRC:M*.c}
56	egrep "^SYSENTRY(.*)|^ENTRY(.*)|^FUNC(.*)|^SYSCALL(.*)" \
57	    /dev/null ${.ALLSRC:M*.S} | \
58	    sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3	\1	/^\2(\3\4$$/;" \
59	    >> tags; sort -o tags tags
60
61beforeinstall:
62	${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 tags \
63		${DESTDIR}/var/db/lib${LIB}.tags
64
65.include <bsd.lib.mk>
66