Makefile revision 156837
1#	@(#)Makefile	8.2 (Berkeley) 2/3/94
2# $FreeBSD: head/lib/libc/Makefile 156837 2006-03-18 11:01:06Z ru $
3
4SHLIBDIR?= /lib
5
6.include <bsd.own.mk>
7
8# All library objects contain FreeBSD revision strings by default; they may be
9# excluded as a space-saving measure.  To produce a library that does
10# not contain these strings, add -DSTRIP_FBSDID (see <sys/cdefs.h>) to CFLAGS
11# below.  Note: there are no IDs for syscall stubs whose sources are generated.
12# To include legacy CSRG sccsid strings, add -DLIBC_SCCS and -DSYSLIBC_SCCS
13# to CFLAGS below.  -DSYSLIBC_SCCS affects just the system call stubs.
14LIB=c
15# If you bump SHLIB_MAJOR, remove the kluge from gen/gethostname.c.
16# If you bump SHLIB_MAJOR, see standards/55112.
17SHLIB_MAJOR= 6
18WARNS?=	2
19CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include
20CFLAGS+=-I${.CURDIR}/${MACHINE_ARCH}
21CLEANFILES+=tags
22INSTALL_PIC_ARCHIVE=
23PRECIOUSLIB=
24
25# Define (empty) variables so that make doesn't give substitution
26# errors if the included makefiles don't change these:
27MDSRCS=
28MISRCS=
29MDASM=
30MIASM=
31NOASM=
32
33.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
34.include "${.CURDIR}/db/Makefile.inc"
35.include "${.CURDIR}/compat-43/Makefile.inc"
36.include "${.CURDIR}/gdtoa/Makefile.inc"
37.include "${.CURDIR}/gen/Makefile.inc"
38.include "${.CURDIR}/gmon/Makefile.inc"
39.include "${.CURDIR}/locale/Makefile.inc"
40.include "${.CURDIR}/net/Makefile.inc"
41.include "${.CURDIR}/nls/Makefile.inc"
42.include "${.CURDIR}/posix1e/Makefile.inc"
43.if ${MACHINE_ARCH} != "alpha" && \
44    ${MACHINE_ARCH} != "amd64" && \
45    ${MACHINE_ARCH} != "ia64" && \
46    ${MACHINE_ARCH} != "sparc64"
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 ${MACHINE_ARCH} == "arm"
59.include "${.CURDIR}/softfloat/Makefile.inc"
60.endif
61.if ${MK_NIS} != "no"
62CFLAGS+= -DYP
63.include "${.CURDIR}/yp/Makefile.inc"
64.endif
65.if ${MK_HESIOD} != "no"
66CFLAGS+= -DHESIOD
67.endif
68.if ${MK_FP_LIBC} == "no"
69CFLAGS+= -DNO_FLOATING_POINT
70.endif
71
72.if defined(SYMVER_ENABLED)
73VERSION_DEF=${.CURDIR}/Versions.def
74SYMBOL_MAPS=${SYM_MAPS}
75CFLAGS+= -DSYMBOL_VERSIONING
76.endif
77
78# If there are no machine dependent sources, append all the
79# machine-independent sources:
80.if empty(MDSRCS)
81SRCS+=	${MISRCS}
82.else
83# Append machine-dependent sources, then append machine-independent sources
84# for which there is no machine-dependent variant.
85SRCS+=	${MDSRCS}
86.for _src in ${MISRCS}
87.if ${MDSRCS:R:M${_src:R}} == ""
88SRCS+=	${_src}
89.endif
90.endfor
91.endif
92
93KQSRCS=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
94	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
95	subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
96KSRCS=	bcmp.c ffs.c ffsl.c fls.c flsl.c index.c mcount.c rindex.c \
97	strcat.c strcmp.c strcpy.c strlen.c strncpy.c
98
99libkern: libkern.gen libkern.${MACHINE_ARCH}
100
101libkern.gen: ${KQSRCS} ${KSRCS}
102	cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
103
104libkern.${MACHINE_ARCH}:: ${KMSRCS}
105.if defined(KMSRCS) && !empty(KMSRCS)
106	cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH}
107.endif
108        
109.include <bsd.lib.mk>
110
111# Disable warnings in contributed sources.
112CWARNFLAGS:=	${.IMPSRC:Ngdtoa_*.c:C/^.+$/${CWARNFLAGS}/}
113