Makefile revision 158115
1158115Sume#	@(#)Makefile	8.2 (Berkeley) 2/3/94
2158115Sume# $FreeBSD: head/lib/libc/Makefile 158115 2006-04-28 12:03:38Z ume $
3158115Sume
4158115SumeSHLIBDIR?= /lib
5158115Sume
6158115Sume.include <bsd.own.mk>
7158115Sume
8158115Sume# All library objects contain FreeBSD revision strings by default; they may be
9158115Sume# excluded as a space-saving measure.  To produce a library that does
10158115Sume# not contain these strings, add -DSTRIP_FBSDID (see <sys/cdefs.h>) to CFLAGS
11158115Sume# below.  Note: there are no IDs for syscall stubs whose sources are generated.
12158115Sume# To include legacy CSRG sccsid strings, add -DLIBC_SCCS and -DSYSLIBC_SCCS
13158115Sume# to CFLAGS below.  -DSYSLIBC_SCCS affects just the system call stubs.
14158115SumeLIB=c
15158115Sume# If you bump SHLIB_MAJOR, remove the kluge from gen/gethostname.c.
16158115Sume# If you bump SHLIB_MAJOR, see standards/55112.
17158115SumeSHLIB_MAJOR= 6
18158115SumeWARNS?=	2
19158115SumeCFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include
20158115SumeCFLAGS+=-I${.CURDIR}/${MACHINE_ARCH}
21158115SumeCLEANFILES+=tags
22158115SumeINSTALL_PIC_ARCHIVE=
23158115SumePRECIOUSLIB=
24158115Sume
25158115Sume# Define (empty) variables so that make doesn't give substitution
26158115Sume# errors if the included makefiles don't change these:
27158115SumeMDSRCS=
28158115SumeMISRCS=
29171795SbushmanMDASM=
30171795SbushmanMIASM=
31158115SumeNOASM=
32158115Sume
33158115Sume.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
34158115Sume.include "${.CURDIR}/db/Makefile.inc"
35158115Sume.include "${.CURDIR}/compat-43/Makefile.inc"
36158115Sume.include "${.CURDIR}/gdtoa/Makefile.inc"
37158115Sume.include "${.CURDIR}/gen/Makefile.inc"
38158115Sume.include "${.CURDIR}/gmon/Makefile.inc"
39158115Sume.include "${.CURDIR}/inet/Makefile.inc"
40158115Sume.include "${.CURDIR}/isc/Makefile.inc"
41158115Sume.include "${.CURDIR}/locale/Makefile.inc"
42158115Sume.include "${.CURDIR}/nameser/Makefile.inc"
43158115Sume.include "${.CURDIR}/net/Makefile.inc"
44158115Sume.include "${.CURDIR}/nls/Makefile.inc"
45158115Sume.include "${.CURDIR}/posix1e/Makefile.inc"
46158115Sume.if ${MACHINE_ARCH} != "alpha" && \
47158115Sume    ${MACHINE_ARCH} != "amd64" && \
48158115Sume    ${MACHINE_ARCH} != "ia64" && \
49158115Sume    ${MACHINE_ARCH} != "sparc64"
50158115Sume.include "${.CURDIR}/quad/Makefile.inc"
51158115Sume.endif
52158115Sume.include "${.CURDIR}/regex/Makefile.inc"
53158115Sume.include "${.CURDIR}/resolv/Makefile.inc"
54158115Sume.include "${.CURDIR}/stdio/Makefile.inc"
55158115Sume.include "${.CURDIR}/stdlib/Makefile.inc"
56194087Sdes.include "${.CURDIR}/stdtime/Makefile.inc"
57158115Sume.include "${.CURDIR}/string/Makefile.inc"
58158115Sume.include "${.CURDIR}/sys/Makefile.inc"
59158115Sume.include "${.CURDIR}/rpc/Makefile.inc"
60158115Sume.include "${.CURDIR}/uuid/Makefile.inc"
61158115Sume.include "${.CURDIR}/xdr/Makefile.inc"
62158115Sume.if ${MACHINE_ARCH} == "arm"
63158115Sume.include "${.CURDIR}/softfloat/Makefile.inc"
64158115Sume.endif
65158115Sume.if ${MK_NIS} != "no"
66194112SdesCFLAGS+= -DYP
67194112Sdes.include "${.CURDIR}/yp/Makefile.inc"
68194112Sdes.endif
69194112Sdes.if ${MK_HESIOD} != "no"
70158115SumeCFLAGS+= -DHESIOD
71158115Sume.endif
72.if ${MK_FP_LIBC} == "no"
73CFLAGS+= -DNO_FLOATING_POINT
74.endif
75.if ${MK_NS_CACHING} != "no"
76CFLAGS+= -DNS_CACHING
77.endif
78
79.if defined(SYMVER_ENABLED)
80VERSION_DEF=${.CURDIR}/Versions.def
81SYMBOL_MAPS=${SYM_MAPS}
82CFLAGS+= -DSYMBOL_VERSIONING
83.endif
84
85# If there are no machine dependent sources, append all the
86# machine-independent sources:
87.if empty(MDSRCS)
88SRCS+=	${MISRCS}
89.else
90# Append machine-dependent sources, then append machine-independent sources
91# for which there is no machine-dependent variant.
92SRCS+=	${MDSRCS}
93.for _src in ${MISRCS}
94.if ${MDSRCS:R:M${_src:R}} == ""
95SRCS+=	${_src}
96.endif
97.endfor
98.endif
99
100KQSRCS=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
101	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
102	subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
103KSRCS=	bcmp.c ffs.c ffsl.c fls.c flsl.c index.c mcount.c rindex.c \
104	strcat.c strcmp.c strcpy.c strlen.c strncpy.c
105
106libkern: libkern.gen libkern.${MACHINE_ARCH}
107
108libkern.gen: ${KQSRCS} ${KSRCS}
109	cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
110
111libkern.${MACHINE_ARCH}:: ${KMSRCS}
112.if defined(KMSRCS) && !empty(KMSRCS)
113	cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH}
114.endif
115        
116.include <bsd.lib.mk>
117
118# Disable warnings in contributed sources.
119CWARNFLAGS:=	${.IMPSRC:Ngdtoa_*.c:C/^.+$/${CWARNFLAGS}/}
120