Makefile revision 209233
1# @(#)Makefile 8.2 (Berkeley) 2/3/94 2# $FreeBSD: head/lib/libc/Makefile 209233 2010-06-16 14:13:36Z jchandra $ 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 15SHLIB_MAJOR= 7 16WARNS?= 2 17CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include 18CFLAGS+=-I${.CURDIR}/${MACHINE_ARCH} 19CFLAGS+=-DNLS 20CLEANFILES+=tags 21INSTALL_PIC_ARCHIVE= 22PRECIOUSLIB= 23 24# 25# Only link with static libgcc.a (no libgcc_eh.a). 26# 27DPADD+= ${LIBGCC} 28LDFLAGS+= -nodefaultlibs 29LDADD+= -lgcc -lssp_nonshared 30 31# Define (empty) variables so that make doesn't give substitution 32# errors if the included makefiles don't change these: 33MDSRCS= 34MISRCS= 35MDASM= 36MIASM= 37NOASM= 38 39.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc" 40.include "${.CURDIR}/db/Makefile.inc" 41.include "${.CURDIR}/compat-43/Makefile.inc" 42.include "${.CURDIR}/gdtoa/Makefile.inc" 43.include "${.CURDIR}/gen/Makefile.inc" 44.include "${.CURDIR}/gmon/Makefile.inc" 45.include "${.CURDIR}/inet/Makefile.inc" 46.include "${.CURDIR}/isc/Makefile.inc" 47.include "${.CURDIR}/locale/Makefile.inc" 48.include "${.CURDIR}/nameser/Makefile.inc" 49.include "${.CURDIR}/net/Makefile.inc" 50.include "${.CURDIR}/nls/Makefile.inc" 51.include "${.CURDIR}/posix1e/Makefile.inc" 52.if ${MACHINE_ARCH} != "amd64" && \ 53 ${MACHINE_ARCH} != "ia64" && \ 54 ${MACHINE_ARCH} != "sparc64" && \ 55 ${MACHINE_ARCH} != "mips" 56.include "${.CURDIR}/quad/Makefile.inc" 57.endif 58.if ${MACHINE_ARCH} == "mips" && \ 59 (!defined(TARGET_ABI) || ${TARGET_ABI} == "o32") 60.include "${.CURDIR}/quad/Makefile.inc" 61.endif 62.include "${.CURDIR}/regex/Makefile.inc" 63.include "${.CURDIR}/resolv/Makefile.inc" 64.include "${.CURDIR}/stdio/Makefile.inc" 65.include "${.CURDIR}/stdlib/Makefile.inc" 66.include "${.CURDIR}/stdtime/Makefile.inc" 67.include "${.CURDIR}/string/Makefile.inc" 68.include "${.CURDIR}/sys/Makefile.inc" 69.include "${.CURDIR}/rpc/Makefile.inc" 70.include "${.CURDIR}/uuid/Makefile.inc" 71.include "${.CURDIR}/xdr/Makefile.inc" 72.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "mips" 73.include "${.CURDIR}/softfloat/Makefile.inc" 74.endif 75.if ${MK_NIS} != "no" 76CFLAGS+= -DYP 77.include "${.CURDIR}/yp/Makefile.inc" 78.endif 79.if ${MK_HESIOD} != "no" 80CFLAGS+= -DHESIOD 81.endif 82.if ${MK_FP_LIBC} == "no" 83CFLAGS+= -DNO_FLOATING_POINT 84.endif 85.if ${MK_NS_CACHING} != "no" 86CFLAGS+= -DNS_CACHING 87.endif 88.if defined(_FREEFALL_CONFIG) 89CFLAGS+=-D_FREEFALL_CONFIG 90.endif 91 92VERSION_DEF=${.CURDIR}/Versions.def 93SYMBOL_MAPS=${SYM_MAPS} 94CFLAGS+= -DSYMBOL_VERSIONING 95 96# If there are no machine dependent sources, append all the 97# machine-independent sources: 98.if empty(MDSRCS) 99SRCS+= ${MISRCS} 100.else 101# Append machine-dependent sources, then append machine-independent sources 102# for which there is no machine-dependent variant. 103SRCS+= ${MDSRCS} 104.for _src in ${MISRCS} 105.if ${MDSRCS:R:M${_src:R}} == "" 106SRCS+= ${_src} 107.endif 108.endfor 109.endif 110 111KQSRCS= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \ 112 lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \ 113 subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c 114KSRCS= bcmp.c ffs.c ffsl.c fls.c flsl.c index.c mcount.c rindex.c \ 115 strcat.c strcmp.c strcpy.c strlen.c strncpy.c 116 117libkern: libkern.gen libkern.${MACHINE_ARCH} 118 119libkern.gen: ${KQSRCS} ${KSRCS} 120 cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern 121 122libkern.${MACHINE_ARCH}:: ${KMSRCS} 123.if defined(KMSRCS) && !empty(KMSRCS) 124 cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH} 125.endif 126 127.include <bsd.lib.mk> 128 129# Disable warnings in contributed sources. 130CWARNFLAGS:= ${.IMPSRC:Ngdtoa_*.c:C/^.+$/${CWARNFLAGS}/} 131# XXX For now, we don't allow libc to be compiled with 132# -fstack-protector-all because it breaks rtld. We may want to make a librtld 133# in the future to circumvent this. 134SSP_CFLAGS:= ${SSP_CFLAGS:S/^-fstack-protector-all$/-fstack-protector/} 135# Disable stack protection for SSP symbols. 136SSP_CFLAGS:= ${.IMPSRC:N*/stack_protector.c:C/^.+$/${SSP_CFLAGS}/} 137