Makefile revision 123393
1#	@(#)Makefile	8.2 (Berkeley) 2/3/94
2# $FreeBSD: head/lib/libc/Makefile 123393 2003-12-10 16:33:17Z mikeh $
3#
4# All library objects contain FreeBSD revision strings by default; they may be
5# excluded as a space-saving measure.  To produce a library that does
6# not contain these strings, add -DSTRIP_FBSDID (see <sys/cdefs.h>) to CFLAGS
7# below.  Note, there are no IDs for syscall stubs whose sources are generated.
8# To included legacy CSRG sccsid strings, add -DLIBC_SCCS and -DSYSLIBC_SCCS
9# (for system call stubs) to CFLAGS below.  -DSYSLIBC_SCCS affects just the
10# system call stubs.
11LIB=c
12# If you bump SHLIB_MAJOR, remove kluge from gen/gethostname.c.
13# If you bump SHLIB_MAJOR, see standards/55112
14SHLIB_MAJOR= 5
15SHLIBDIR?= /lib
16WARNS?=	1
17CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include
18CFLAGS+=-I${.CURDIR}/${MACHINE_ARCH}
19CLEANFILES+=tags
20INSTALL_PIC_ARCHIVE=	yes
21PRECIOUSLIB=	yes
22
23# Define (empty) variables so that make doesn't give substitution
24# errors if the included makefiles don't change these:
25MDSRCS=
26MISRCS=
27MDASM=
28MIASM=
29NOASM=
30
31#
32# If there is a machine dependent makefile, use it:
33#
34.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
35.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
36.endif
37
38.include "${.CURDIR}/db/Makefile.inc"
39.include "${.CURDIR}/compat-43/Makefile.inc"
40.include "${.CURDIR}/gdtoa/Makefile.inc"
41.include "${.CURDIR}/gen/Makefile.inc"
42.if ${MACHINE_ARCH} != "powerpc"
43.include "${.CURDIR}/gmon/Makefile.inc"
44.endif
45.include "${.CURDIR}/locale/Makefile.inc"
46.include "${.CURDIR}/net/Makefile.inc"
47.include "${.CURDIR}/nls/Makefile.inc"
48.include "${.CURDIR}/posix1e/Makefile.inc"
49.if !defined(NO_QUAD)
50.include "${.CURDIR}/quad/Makefile.inc"
51.endif
52.include "${.CURDIR}/regex/Makefile.inc"
53.include "${.CURDIR}/stdio/Makefile.inc"
54.include "${.CURDIR}/stdlib/Makefile.inc"
55.include "${.CURDIR}/stdtime/Makefile.inc"
56.include "${.CURDIR}/string/Makefile.inc"
57.include "${.CURDIR}/sys/Makefile.inc"
58.include "${.CURDIR}/rpc/Makefile.inc"
59.include "${.CURDIR}/uuid/Makefile.inc"
60.include "${.CURDIR}/xdr/Makefile.inc"
61.if !defined(NO_YP_LIBC)
62CFLAGS+= -DYP
63.include "${.CURDIR}/yp/Makefile.inc"
64.endif
65.if !defined(NO_HESIOD_LIBC)
66CFLAGS+= -DHESIOD
67.endif
68
69# If there are no machine dependent sources, append all the
70# machine-independent sources:
71.if empty(MDSRCS)
72SRCS+=	${MISRCS}
73.else
74# Append machine-dependent sources, then append machine-independent sources
75# for which there is no machine-dependent variant.
76SRCS+=	${MDSRCS}
77.for _src in ${MISRCS}
78.if ${MDSRCS:R:M${_src:R}} == ""
79SRCS+=	${_src}
80.endif
81.endfor
82.endif
83
84KQSRCS=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
85	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
86	subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
87KSRCS=	bcmp.c ffs.c index.c mcount.c rindex.c strcat.c strcmp.c strcpy.c \
88	strlen.c strncpy.c
89
90libkern: libkern.gen libkern.${MACHINE_ARCH}
91
92libkern.gen: ${KQSRCS} ${KSRCS}
93	cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
94
95libkern.${MACHINE_ARCH}:: ${KMSRCS}
96.if defined(KMSRCS) && !empty(KMSRCS)
97	cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH}
98.endif
99
100.include <bsd.lib.mk>
101