Makefile revision 211704
12061Sjkh#	@(#)Makefile	8.2 (Berkeley) 2/3/94
250479Speter# $FreeBSD: head/lib/libc/Makefile 211704 2010-08-23 15:18:35Z kib $
32061Sjkh
438666SjbSHLIBDIR?= /lib
532427Sjb
6111131Sru.include <bsd.own.mk>
7111131Sru
838666Sjb# All library objects contain FreeBSD revision strings by default; they may be
938666Sjb# excluded as a space-saving measure.  To produce a library that does
1038666Sjb# not contain these strings, add -DSTRIP_FBSDID (see <sys/cdefs.h>) to CFLAGS
11159363Strhodes# below.  Note: there are no IDs for syscall stubs whose sources are generated.
1264049Salex# To include legacy CSRG sccsid strings, add -DLIBC_SCCS and -DSYSLIBC_SCCS
1364049Salex# to CFLAGS below.  -DSYSLIBC_SCCS affects just the system call stubs.
14116679SsimokawaLIB=c
1566071SmarkmSHLIB_MAJOR= 7
16116679SsimokawaWARNS?=	2
1773504SobrienCFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include
18158962SnetchildCFLAGS+=-I${.CURDIR}/${MACHINE_ARCH}
1938666SjbCFLAGS+=-DNLS
20148330SnetchildCLEANFILES+=tags
21148330SnetchildINSTALL_PIC_ARCHIVE=
22148330SnetchildPRECIOUSLIB=
2332427Sjb
2438666Sjb#
25108451Sschweikh# Only link with static libgcc.a (no libgcc_eh.a).
2638666Sjb#
2738666SjbDPADD+=	${LIBGCC}
2838666SjbLDFLAGS+= -nodefaultlibs
2938666SjbLDADD+= -lgcc -lssp_nonshared
3017308Speter
3191606Skeramida# Define (empty) variables so that make doesn't give substitution
3219175Sbde# errors if the included makefiles don't change these:
3396205SjwdMDSRCS=
3496205SjwdMISRCS=
3538042SbdeMDASM=
3696205SjwdMIASM=
3796205SjwdNOASM=
3838042Sbde
3996205Sjwd.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
40159363Strhodes.include "${.CURDIR}/db/Makefile.inc"
41159363Strhodes.include "${.CURDIR}/compat-43/Makefile.inc"
4217308Speter.include "${.CURDIR}/gdtoa/Makefile.inc"
4396205Sjwd.include "${.CURDIR}/gen/Makefile.inc"
4496205Sjwd.include "${.CURDIR}/gmon/Makefile.inc"
4517308Speter.include "${.CURDIR}/inet/Makefile.inc"
46148330Snetchild.include "${.CURDIR}/isc/Makefile.inc"
47148330Snetchild.include "${.CURDIR}/locale/Makefile.inc"
48148330Snetchild.include "${.CURDIR}/nameser/Makefile.inc"
49148330Snetchild.include "${.CURDIR}/net/Makefile.inc"
50159831Sobrien.include "${.CURDIR}/nls/Makefile.inc"
51148330Snetchild.include "${.CURDIR}/posix1e/Makefile.inc"
52148330Snetchild.if ${MACHINE_ARCH} != "amd64" && \
53148330Snetchild    ${MACHINE_ARCH} != "ia64" && \
54148330Snetchild    ${MACHINE_ARCH} != "powerpc64" && \
55148330Snetchild    ${MACHINE_ARCH} != "sparc64" && \
56148330Snetchild    ${MACHINE_ARCH} != "mips"
57148330Snetchild.include "${.CURDIR}/quad/Makefile.inc"
5896205Sjwd.endif
5996205Sjwd.if ${MACHINE_ARCH} == "mips" && \
6096205Sjwd    (!defined(TARGET_ABI) || ${TARGET_ABI} == "o32")
61162147Sru.include "${.CURDIR}/quad/Makefile.inc"
62162147Sru.endif
6398723Sdillon.include "${.CURDIR}/regex/Makefile.inc"
6498723Sdillon.include "${.CURDIR}/resolv/Makefile.inc"
6598723Sdillon.include "${.CURDIR}/stdio/Makefile.inc"
6638666Sjb.include "${.CURDIR}/stdlib/Makefile.inc"
6738666Sjb.include "${.CURDIR}/stdtime/Makefile.inc"
6817308Speter.include "${.CURDIR}/string/Makefile.inc"
69123311Speter.include "${.CURDIR}/sys/Makefile.inc"
70123311Speter.include "${.CURDIR}/rpc/Makefile.inc"
71123311Speter.include "${.CURDIR}/uuid/Makefile.inc"
72123311Speter.include "${.CURDIR}/xdr/Makefile.inc"
73159349Simp.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "mips"
74159349Simp.include "${.CURDIR}/softfloat/Makefile.inc"
75159349Simp.endif
76158962Snetchild.if ${MK_NIS} != "no"
77158962SnetchildCFLAGS+= -DYP
78158962Snetchild.include "${.CURDIR}/yp/Makefile.inc"
79156840Sru.endif
80123311Speter.if ${MK_HESIOD} != "no"
81137288SpeterCFLAGS+= -DHESIOD
82147425Sru.endif
83156740Sru.if ${MK_FP_LIBC} == "no"
842061SjkhCFLAGS+= -DNO_FLOATING_POINT
8597769Sru.endif
8697252Sru.if ${MK_NS_CACHING} != "no"
87119579SruCFLAGS+= -DNS_CACHING
8897252Sru.endif
8995730Sru.if defined(_FREEFALL_CONFIG)
9095793SruCFLAGS+=-D_FREEFALL_CONFIG
91111617Sru.endif
9295730Sru
93116679SsimokawaVERSION_DEF=${.CURDIR}/Versions.def
9495730SruSYMBOL_MAPS=${SYM_MAPS}
95116679SsimokawaCFLAGS+= -DSYMBOL_VERSIONING
9695730Sru
97110035Sru# If there are no machine dependent sources, append all the
98107516Sru# machine-independent sources:
99138921Sru.if empty(MDSRCS)
100156145SyarSRCS+=	${MISRCS}
101138921Sru.else
102133942Sru# Append machine-dependent sources, then append machine-independent sources
103133942Sru# for which there is no machine-dependent variant.
104156145SyarSRCS+=	${MDSRCS}
105133942Sru.for _src in ${MISRCS}
106110035Sru.if ${MDSRCS:R:M${_src:R}} == ""
107117234SruSRCS+=	${_src}
108110035Sru.endif
109117229Sru.endfor
110117234Sru.endif
11154324Smarcel
11217308SpeterKQSRCS=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
113119519Smarcel	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
114119519Smarcel	subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
115119519SmarcelKSRCS=	bcmp.c ffs.c ffsl.c fls.c flsl.c index.c mcount.c rindex.c \
116119519Smarcel	strcat.c strcmp.c strcpy.c strlen.c strncpy.c
117119519Smarcel
118119519Smarcellibkern: libkern.gen libkern.${MACHINE_ARCH}
119119579Sru
120119519Smarcellibkern.gen: ${KQSRCS} ${KSRCS}
121119519Smarcel	cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
122119519Smarcel
123119519Smarcellibkern.${MACHINE_ARCH}:: ${KMSRCS}
124119519Smarcel.if defined(KMSRCS) && !empty(KMSRCS)
125126031Sgad	cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH}
126126024Sgad.endif
127126024Sgad
128126024Sgad.include <bsd.lib.mk>
129126024Sgad
130126024Sgad# Disable warnings in contributed sources.
131126024SgadCWARNFLAGS:=	${.IMPSRC:Ngdtoa_*.c:C/^.+$/${CWARNFLAGS}/:C/^$/-w/}
132126024Sgad# XXX For now, we don't allow libc to be compiled with
133126024Sgad# -fstack-protector-all because it breaks rtld.  We may want to make a librtld
134126024Sgad# in the future to circumvent this.
135126024SgadSSP_CFLAGS:=	${SSP_CFLAGS:S/^-fstack-protector-all$/-fstack-protector/}
136126024Sgad# Disable stack protection for SSP symbols.
137126024SgadSSP_CFLAGS:=	${.IMPSRC:N*/stack_protector.c:C/^.+$/${SSP_CFLAGS}/}
138126024Sgad