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