Makefile revision 119071
1#	@(#)Makefile	8.2 (Berkeley) 2/3/94
2# $FreeBSD: head/lib/libc/Makefile 119071 2003-08-18 15:25:39Z obrien $
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
12SHLIB_MAJOR= 5
13SHLIBDIR?= /lib
14CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include
15CFLAGS+=-I${.CURDIR}/${MACHINE_ARCH}
16CLEANFILES+=tags
17INSTALL_PIC_ARCHIVE=	yes
18PRECIOUSLIB=	yes
19
20# Define (empty) variables so that make doesn't give substitution
21# errors if the included makefiles don't change these:
22MDSRCS=
23MISRCS=
24MDASM=
25MIASM=
26NOASM=
27
28#
29# If there is a machine dependent makefile, use it:
30#
31.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
32.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
33.endif
34
35.include "${.CURDIR}/db/Makefile.inc"
36.include "${.CURDIR}/compat-43/Makefile.inc"
37.include "${.CURDIR}/gdtoa/Makefile.inc"
38.include "${.CURDIR}/gen/Makefile.inc"
39.if ${MACHINE_ARCH} != "powerpc"
40.include "${.CURDIR}/gmon/Makefile.inc"
41.endif
42.include "${.CURDIR}/locale/Makefile.inc"
43.include "${.CURDIR}/net/Makefile.inc"
44.include "${.CURDIR}/nls/Makefile.inc"
45.include "${.CURDIR}/posix1e/Makefile.inc"
46.if !defined(NO_QUAD)
47.include "${.CURDIR}/quad/Makefile.inc"
48.endif
49.include "${.CURDIR}/regex/Makefile.inc"
50.include "${.CURDIR}/stdio/Makefile.inc"
51.include "${.CURDIR}/stdlib/Makefile.inc"
52.include "${.CURDIR}/stdtime/Makefile.inc"
53.include "${.CURDIR}/string/Makefile.inc"
54.include "${.CURDIR}/sys/Makefile.inc"
55.include "${.CURDIR}/rpc/Makefile.inc"
56.include "${.CURDIR}/uuid/Makefile.inc"
57.include "${.CURDIR}/xdr/Makefile.inc"
58.if !defined(NO_YP_LIBC)
59CFLAGS+= -DYP
60.include "${.CURDIR}/yp/Makefile.inc"
61.endif
62.if !defined(NO_HESIOD_LIBC)
63CFLAGS+= -DHESIOD
64.endif
65
66# If there are no machine dependent sources, append all the
67# machine-independent sources:
68.if empty(MDSRCS)
69SRCS+=	${MISRCS}
70.else
71# Append machine-dependent sources, then append machine-independent sources
72# for which there is no machine-dependent variant.
73SRCS+=	${MDSRCS}
74.for _src in ${MISRCS}
75.if ${MDSRCS:R:M${_src:R}} == ""
76SRCS+=	${_src}
77.endif
78.endfor
79.endif
80
81KQSRCS=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
82	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
83	subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
84KSRCS=	bcmp.c ffs.c index.c mcount.c rindex.c strcat.c strcmp.c strcpy.c \
85	strlen.c strncpy.c
86
87libkern: libkern.gen libkern.${MACHINE_ARCH}
88
89libkern.gen: ${KQSRCS} ${KSRCS}
90	cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
91
92libkern.${MACHINE_ARCH}:: ${KMSRCS}
93.if defined(KMSRCS) && !empty(KMSRCS)
94	cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH}
95.endif
96
97.include <bsd.lib.mk>
98