Makefile revision 180012
11556Srgrimes#	@(#)Makefile	8.2 (Berkeley) 2/3/94
21556Srgrimes# $FreeBSD: head/lib/libc/Makefile 180012 2008-06-25 21:33:28Z ru $
31556Srgrimes
41556SrgrimesSHLIBDIR?= /lib
51556Srgrimes
61556Srgrimes.include <bsd.own.mk>
71556Srgrimes
81556Srgrimes# All library objects contain FreeBSD revision strings by default; they may be
91556Srgrimes# excluded as a space-saving measure.  To produce a library that does
101556Srgrimes# not contain these strings, add -DSTRIP_FBSDID (see <sys/cdefs.h>) to CFLAGS
111556Srgrimes# below.  Note: there are no IDs for syscall stubs whose sources are generated.
121556Srgrimes# To include legacy CSRG sccsid strings, add -DLIBC_SCCS and -DSYSLIBC_SCCS
131556Srgrimes# to CFLAGS below.  -DSYSLIBC_SCCS affects just the system call stubs.
141556SrgrimesLIB=c
151556SrgrimesSHLIB_MAJOR= 7
161556SrgrimesWARNS?=	2
171556SrgrimesCFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include
181556SrgrimesCFLAGS+=-I${.CURDIR}/${MACHINE_ARCH}
191556SrgrimesCLEANFILES+=tags
201556SrgrimesINSTALL_PIC_ARCHIVE=
211556SrgrimesPRECIOUSLIB=
221556Srgrimes
231556Srgrimes#
241556Srgrimes# Only link with static libgcc.a (no libgcc_eh.a).
251556Srgrimes#
261556SrgrimesDPADD+=	${LIBGCC}
271556SrgrimesLDFLAGS+= -nodefaultlibs
281556SrgrimesLDADD+= -lgcc
291556Srgrimes
301556Srgrimes# Define (empty) variables so that make doesn't give substitution
3136152Scharnier# errors if the included makefiles don't change these:
3236152ScharnierMDSRCS=
3336152ScharnierMISRCS=
341556SrgrimesMDASM=
3599110SobrienMIASM=
3699110SobrienNOASM=
371556Srgrimes
381556Srgrimes.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
391556Srgrimes.include "${.CURDIR}/db/Makefile.inc"
401556Srgrimes.include "${.CURDIR}/compat-43/Makefile.inc"
411556Srgrimes.include "${.CURDIR}/gdtoa/Makefile.inc"
421556Srgrimes.include "${.CURDIR}/gen/Makefile.inc"
4390111Simp.include "${.CURDIR}/gmon/Makefile.inc"
4476810Skris.include "${.CURDIR}/inet/Makefile.inc"
451556Srgrimes.include "${.CURDIR}/isc/Makefile.inc"
4676810Skris.include "${.CURDIR}/locale/Makefile.inc"
471556Srgrimes.include "${.CURDIR}/nameser/Makefile.inc"
481556Srgrimes.include "${.CURDIR}/net/Makefile.inc"
491556Srgrimes.include "${.CURDIR}/nls/Makefile.inc"
501556Srgrimes.include "${.CURDIR}/posix1e/Makefile.inc"
511556Srgrimes.if ${MACHINE_ARCH} != "amd64" && \
521556Srgrimes    ${MACHINE_ARCH} != "ia64" && \
531556Srgrimes    ${MACHINE_ARCH} != "sparc64"
541556Srgrimes.include "${.CURDIR}/quad/Makefile.inc"
55228406Sed.endif
561556Srgrimes.include "${.CURDIR}/regex/Makefile.inc"
571556Srgrimes.include "${.CURDIR}/resolv/Makefile.inc"
581556Srgrimes.include "${.CURDIR}/stdio/Makefile.inc"
591556Srgrimes.include "${.CURDIR}/stdlib/Makefile.inc"
601556Srgrimes.include "${.CURDIR}/stdtime/Makefile.inc"
611556Srgrimes.include "${.CURDIR}/string/Makefile.inc"
621556Srgrimes.include "${.CURDIR}/sys/Makefile.inc"
631556Srgrimes.include "${.CURDIR}/rpc/Makefile.inc"
641556Srgrimes.include "${.CURDIR}/uuid/Makefile.inc"
651556Srgrimes.include "${.CURDIR}/xdr/Makefile.inc"
661556Srgrimes.if ${MACHINE_ARCH} == "arm"
671556Srgrimes.include "${.CURDIR}/softfloat/Makefile.inc"
681556Srgrimes.endif
691556Srgrimes.if ${MK_NIS} != "no"
701556SrgrimesCFLAGS+= -DYP
711556Srgrimes.include "${.CURDIR}/yp/Makefile.inc"
721556Srgrimes.endif
731556Srgrimes.if ${MK_HESIOD} != "no"
741556SrgrimesCFLAGS+= -DHESIOD
751556Srgrimes.endif
761556Srgrimes.if ${MK_FP_LIBC} == "no"
771556SrgrimesCFLAGS+= -DNO_FLOATING_POINT
781556Srgrimes.endif
791556Srgrimes.if ${MK_NS_CACHING} != "no"
801556SrgrimesCFLAGS+= -DNS_CACHING
811556Srgrimes.endif
821556Srgrimes.if defined(_FREEFALL_CONFIG)
831556SrgrimesCFLAGS+=-D_FREEFALL_CONFIG
848170Sbde.endif
858170Sbde
868170SbdeVERSION_DEF=${.CURDIR}/Versions.def
878170SbdeSYMBOL_MAPS=${SYM_MAPS}
888170SbdeCFLAGS+= -DSYMBOL_VERSIONING
898170Sbde
908170Sbde# If there are no machine dependent sources, append all the
918170Sbde# machine-independent sources:
921556Srgrimes.if empty(MDSRCS)
931556SrgrimesSRCS+=	${MISRCS}
9476810Skris.else
951556Srgrimes# Append machine-dependent sources, then append machine-independent sources
961556Srgrimes# for which there is no machine-dependent variant.
97228406SedSRCS+=	${MDSRCS}
981556Srgrimes.for _src in ${MISRCS}
991556Srgrimes.if ${MDSRCS:R:M${_src:R}} == ""
1001556SrgrimesSRCS+=	${_src}
1011556Srgrimes.endif
1021556Srgrimes.endfor
1031556Srgrimes.endif
1041556Srgrimes
1051556SrgrimesKQSRCS=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
1061556Srgrimes	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
1071556Srgrimes	subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
1081556SrgrimesKSRCS=	bcmp.c ffs.c ffsl.c fls.c flsl.c index.c mcount.c rindex.c \
1091556Srgrimes	strcat.c strcmp.c strcpy.c strlen.c strncpy.c
1101556Srgrimes
1111556Srgrimeslibkern: libkern.gen libkern.${MACHINE_ARCH}
1121556Srgrimes
1131556Srgrimeslibkern.gen: ${KQSRCS} ${KSRCS}
1141556Srgrimes	cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
1151556Srgrimes
1161556Srgrimeslibkern.${MACHINE_ARCH}:: ${KMSRCS}
1171556Srgrimes.if defined(KMSRCS) && !empty(KMSRCS)
1181556Srgrimes	cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH}
1191556Srgrimes.endif
1201556Srgrimes        
1211556Srgrimes.include <bsd.lib.mk>
1221556Srgrimes
1231556Srgrimes# Disable warnings in contributed sources.
1241556SrgrimesCWARNFLAGS:=	${.IMPSRC:Ngdtoa_*.c:C/^.+$/${CWARNFLAGS}/}
1251556Srgrimes# XXX For now, we don't allow libc to be compiled with
1261556Srgrimes# -fstack-protector-all because it breaks rtld.  We may want to make a librtld
1271556Srgrimes# in the future to circumvent this.
1281556SrgrimesSSP_CFLAGS:=	${SSP_CFLAGS:S/^-fstack-protector-all$/-fstack-protector/}
1291556Srgrimes# Disable stack protection for SSP symbols.
13076810SkrisSSP_CFLAGS:=	${.IMPSRC:N*/stack_protector.c:C/^.+$/${SSP_CFLAGS}/}
1311556Srgrimes