xref: /freebsd/lib/libc/Makefile (revision e20b16589981d32aa042348126d24e4a73c98d76)
158f0484fSRodney W. Grimes#	@(#)Makefile	8.2 (Berkeley) 2/3/94
27f3dea24SPeter Wemm# $FreeBSD$
3e1fe3dbaSRuslan Ermilov
4fcaa4668SRuslan ErmilovSHLIBDIR?= /lib
5fcaa4668SRuslan Ermilov
6e1fe3dbaSRuslan Ermilov.include <bsd.own.mk>
7e1fe3dbaSRuslan Ermilov
8ecaaecd7SDavid E. O'Brien# All library objects contain FreeBSD revision strings by default; they may be
958f0484fSRodney W. Grimes# excluded as a space-saving measure.  To produce a library that does
1054a5fb6cSDavid E. O'Brien# not contain these strings, add -DSTRIP_FBSDID (see <sys/cdefs.h>) to CFLAGS
11e481bf77SBruce Evans# below.  Note: there are no IDs for syscall stubs whose sources are generated.
12e481bf77SBruce Evans# To include legacy CSRG sccsid strings, add -DLIBC_SCCS and -DSYSLIBC_SCCS
13e481bf77SBruce Evans# to CFLAGS below.  -DSYSLIBC_SCCS affects just the system call stubs.
1458f0484fSRodney W. GrimesLIB=c
15794063c0SHajimu UMEMOTOSHLIB_MAJOR= 7
168e1b0bc6SJacques VidrineWARNS?=	2
170b3cbc5cSRuslan ErmilovCFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include
180b3cbc5cSRuslan ErmilovCFLAGS+=-I${.CURDIR}/${MACHINE_ARCH}
1958f0484fSRodney W. GrimesCLEANFILES+=tags
20a35d8893SRuslan ErmilovINSTALL_PIC_ARCHIVE=
21a35d8893SRuslan ErmilovPRECIOUSLIB=
2258f0484fSRodney W. Grimes
23e20b1658SAlexander Kabaev#
24e20b1658SAlexander Kabaev# Only link with static libgcc.a (no libgcc_eh.a).
25e20b1658SAlexander Kabaev#
26e20b1658SAlexander KabaevLDFLAGS+= -nodefaultlibs -lgcc
27e20b1658SAlexander Kabaev
28c51d717fSRuslan Ermilov# Define (empty) variables so that make doesn't give substitution
29c51d717fSRuslan Ermilov# errors if the included makefiles don't change these:
30c51d717fSRuslan ErmilovMDSRCS=
31c51d717fSRuslan ErmilovMISRCS=
32c51d717fSRuslan ErmilovMDASM=
33c51d717fSRuslan ErmilovMIASM=
34c51d717fSRuslan ErmilovNOASM=
35c51d717fSRuslan Ermilov
36c51d717fSRuslan Ermilov.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
37c51d717fSRuslan Ermilov.include "${.CURDIR}/db/Makefile.inc"
38c51d717fSRuslan Ermilov.include "${.CURDIR}/compat-43/Makefile.inc"
39120a95cbSDavid E. O'Brien.include "${.CURDIR}/gdtoa/Makefile.inc"
40c51d717fSRuslan Ermilov.include "${.CURDIR}/gen/Makefile.inc"
41c51d717fSRuslan Ermilov.include "${.CURDIR}/gmon/Makefile.inc"
425342d17fSHajimu UMEMOTO.include "${.CURDIR}/inet/Makefile.inc"
435342d17fSHajimu UMEMOTO.include "${.CURDIR}/isc/Makefile.inc"
44c51d717fSRuslan Ermilov.include "${.CURDIR}/locale/Makefile.inc"
455342d17fSHajimu UMEMOTO.include "${.CURDIR}/nameser/Makefile.inc"
46c51d717fSRuslan Ermilov.include "${.CURDIR}/net/Makefile.inc"
47c51d717fSRuslan Ermilov.include "${.CURDIR}/nls/Makefile.inc"
48c51d717fSRuslan Ermilov.include "${.CURDIR}/posix1e/Makefile.inc"
492b46c64cSRuslan Ermilov.if ${MACHINE_ARCH} != "amd64" && \
503029eff7SRuslan Ermilov    ${MACHINE_ARCH} != "ia64" && \
513029eff7SRuslan Ermilov    ${MACHINE_ARCH} != "sparc64"
52c51d717fSRuslan Ermilov.include "${.CURDIR}/quad/Makefile.inc"
53c51d717fSRuslan Ermilov.endif
54c51d717fSRuslan Ermilov.include "${.CURDIR}/regex/Makefile.inc"
555342d17fSHajimu UMEMOTO.include "${.CURDIR}/resolv/Makefile.inc"
56c51d717fSRuslan Ermilov.include "${.CURDIR}/stdio/Makefile.inc"
57c51d717fSRuslan Ermilov.include "${.CURDIR}/stdlib/Makefile.inc"
58c51d717fSRuslan Ermilov.include "${.CURDIR}/stdtime/Makefile.inc"
59c51d717fSRuslan Ermilov.include "${.CURDIR}/string/Makefile.inc"
60c51d717fSRuslan Ermilov.include "${.CURDIR}/sys/Makefile.inc"
61c51d717fSRuslan Ermilov.include "${.CURDIR}/rpc/Makefile.inc"
62c51d717fSRuslan Ermilov.include "${.CURDIR}/uuid/Makefile.inc"
63c51d717fSRuslan Ermilov.include "${.CURDIR}/xdr/Makefile.inc"
642357939bSOlivier Houchard.if ${MACHINE_ARCH} == "arm"
652357939bSOlivier Houchard.include "${.CURDIR}/softfloat/Makefile.inc"
662357939bSOlivier Houchard.endif
67e1fe3dbaSRuslan Ermilov.if ${MK_NIS} != "no"
68c51d717fSRuslan ErmilovCFLAGS+= -DYP
69c51d717fSRuslan Ermilov.include "${.CURDIR}/yp/Makefile.inc"
70c51d717fSRuslan Ermilov.endif
71e1fe3dbaSRuslan Ermilov.if ${MK_HESIOD} != "no"
72c51d717fSRuslan ErmilovCFLAGS+= -DHESIOD
73c51d717fSRuslan Ermilov.endif
74e1fe3dbaSRuslan Ermilov.if ${MK_FP_LIBC} == "no"
75757edc65SDavid SchultzCFLAGS+= -DNO_FLOATING_POINT
76757edc65SDavid Schultz.endif
7706a99fe3SHajimu UMEMOTO.if ${MK_NS_CACHING} != "no"
7806a99fe3SHajimu UMEMOTOCFLAGS+= -DNS_CACHING
7906a99fe3SHajimu UMEMOTO.endif
803dd425f7SSimon L. B. Nielsen.if defined(_FREEFALL_CONFIG)
813dd425f7SSimon L. B. NielsenCFLAGS+=-D_FREEFALL_CONFIG
823dd425f7SSimon L. B. Nielsen.endif
83c51d717fSRuslan Ermilov
8496e022f7SDaniel EischenVERSION_DEF=${.CURDIR}/Versions.def
8596e022f7SDaniel EischenSYMBOL_MAPS=${SYM_MAPS}
8696e022f7SDaniel EischenCFLAGS+= -DSYMBOL_VERSIONING
8796e022f7SDaniel Eischen
88c51d717fSRuslan Ermilov# If there are no machine dependent sources, append all the
89c51d717fSRuslan Ermilov# machine-independent sources:
90c51d717fSRuslan Ermilov.if empty(MDSRCS)
91c51d717fSRuslan ErmilovSRCS+=	${MISRCS}
92c51d717fSRuslan Ermilov.else
93c51d717fSRuslan Ermilov# Append machine-dependent sources, then append machine-independent sources
94c51d717fSRuslan Ermilov# for which there is no machine-dependent variant.
95c51d717fSRuslan ErmilovSRCS+=	${MDSRCS}
96c51d717fSRuslan Ermilov.for _src in ${MISRCS}
97c51d717fSRuslan Ermilov.if ${MDSRCS:R:M${_src:R}} == ""
98c51d717fSRuslan ErmilovSRCS+=	${_src}
99c51d717fSRuslan Ermilov.endif
100c51d717fSRuslan Ermilov.endfor
101c51d717fSRuslan Ermilov.endif
10258f0484fSRodney W. Grimes
10358f0484fSRodney W. GrimesKQSRCS=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
10458f0484fSRodney W. Grimes	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
10558f0484fSRodney W. Grimes	subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
106f434fe12SDag-Erling SmørgravKSRCS=	bcmp.c ffs.c ffsl.c fls.c flsl.c index.c mcount.c rindex.c \
107f434fe12SDag-Erling Smørgrav	strcat.c strcmp.c strcpy.c strlen.c strncpy.c
10858f0484fSRodney W. Grimes
109d22114bfSKATO Takenorilibkern: libkern.gen libkern.${MACHINE_ARCH}
11058f0484fSRodney W. Grimes
11158f0484fSRodney W. Grimeslibkern.gen: ${KQSRCS} ${KSRCS}
1126ded366aSSatoshi Asami	cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
11358f0484fSRodney W. Grimes
114d22114bfSKATO Takenorilibkern.${MACHINE_ARCH}:: ${KMSRCS}
11558f0484fSRodney W. Grimes.if defined(KMSRCS) && !empty(KMSRCS)
116d22114bfSKATO Takenori	cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH}
11758f0484fSRodney W. Grimes.endif
11858f0484fSRodney W. Grimes
11958f0484fSRodney W. Grimes.include <bsd.lib.mk>
120042a0b7eSRuslan Ermilov
121042a0b7eSRuslan Ermilov# Disable warnings in contributed sources.
122042a0b7eSRuslan ErmilovCWARNFLAGS:=	${.IMPSRC:Ngdtoa_*.c:C/^.+$/${CWARNFLAGS}/}
123