Makefile revision 129202
1251875Speter#	@(#)Makefile	8.2 (Berkeley) 2/3/94
2251875Speter# $FreeBSD: head/lib/libc/Makefile 129202 2004-05-14 12:04:31Z cognet $
3251875Speter#
4251875Speter# All library objects contain FreeBSD revision strings by default; they may be
5251875Speter# excluded as a space-saving measure.  To produce a library that does
6251875Speter# not contain these strings, add -DSTRIP_FBSDID (see <sys/cdefs.h>) to CFLAGS
7251875Speter# below.  Note: there are no IDs for syscall stubs whose sources are generated.
8251875Speter# To include legacy CSRG sccsid strings, add -DLIBC_SCCS and -DSYSLIBC_SCCS
9251875Speter# to CFLAGS below.  -DSYSLIBC_SCCS affects just the system call stubs.
10251875SpeterLIB=c
11251875Speter# If you bump SHLIB_MAJOR, remove the kluge from gen/gethostname.c.
12251875Speter# If you bump SHLIB_MAJOR, see standards/55112.
13251875SpeterSHLIB_MAJOR= 5
14251875SpeterSHLIBDIR?= /lib
15251875SpeterWARNS?=	2
16251875SpeterCFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include
17251875SpeterCFLAGS+=-I${.CURDIR}/${MACHINE_ARCH}
18251875SpeterCLEANFILES+=tags
19251875SpeterINSTALL_PIC_ARCHIVE=	yes
20251875SpeterPRECIOUSLIB=	yes
21251875Speter
22251875Speter# Define (empty) variables so that make doesn't give substitution
23251875Speter# errors if the included makefiles don't change these:
24251875SpeterMDSRCS=
25251875SpeterMISRCS=
26251875SpeterMDASM=
27251875SpeterMIASM=
28251875SpeterNOASM=
29251875Speter
30251875Speter#
31251875Speter# If there is a machine dependent makefile, use it:
32251875Speter#
33251875Speter.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
34251875Speter.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
35251875Speter.endif
36251875Speter
37251875Speter.include "${.CURDIR}/db/Makefile.inc"
38251875Speter.include "${.CURDIR}/compat-43/Makefile.inc"
39251875Speter.include "${.CURDIR}/gdtoa/Makefile.inc"
40251875Speter.include "${.CURDIR}/gen/Makefile.inc"
41251875Speter.if ${MACHINE_ARCH} != "powerpc"
42251875Speter.include "${.CURDIR}/gmon/Makefile.inc"
43251875Speter.endif
44251875Speter.include "${.CURDIR}/locale/Makefile.inc"
45251875Speter.include "${.CURDIR}/net/Makefile.inc"
46251875Speter.include "${.CURDIR}/nls/Makefile.inc"
47251875Speter.include "${.CURDIR}/posix1e/Makefile.inc"
48251875Speter.if !defined(NO_QUAD)
49251875Speter.include "${.CURDIR}/quad/Makefile.inc"
50251875Speter.endif
51251875Speter.include "${.CURDIR}/regex/Makefile.inc"
52251875Speter.include "${.CURDIR}/stdio/Makefile.inc"
53251875Speter.include "${.CURDIR}/stdlib/Makefile.inc"
54251875Speter.include "${.CURDIR}/stdtime/Makefile.inc"
55251875Speter.include "${.CURDIR}/string/Makefile.inc"
56251875Speter.include "${.CURDIR}/sys/Makefile.inc"
57251875Speter.include "${.CURDIR}/rpc/Makefile.inc"
58251875Speter.include "${.CURDIR}/uuid/Makefile.inc"
59251875Speter.include "${.CURDIR}/xdr/Makefile.inc"
60251875Speter.if ${MACHINE_ARCH} == "arm"
61251875Speter.include "${.CURDIR}/softfloat/Makefile.inc"
62251875Speter.endif
63251875Speter.if !defined(NO_YP_LIBC)
64251875SpeterCFLAGS+= -DYP
65251875Speter.include "${.CURDIR}/yp/Makefile.inc"
66251875Speter.endif
67251875Speter.if !defined(NO_HESIOD_LIBC)
68251875SpeterCFLAGS+= -DHESIOD
69251875Speter.endif
70251875Speter.if defined(NO_FP_LIBC)
71251875SpeterCFLAGS+= -DNO_FLOATING_POINT
72251875Speter.endif
73251875Speter
74251875Speter# If there are no machine dependent sources, append all the
75251875Speter# machine-independent sources:
76251875Speter.if empty(MDSRCS)
77251875SpeterSRCS+=	${MISRCS}
78251875Speter.else
79251875Speter# Append machine-dependent sources, then append machine-independent sources
80251875Speter# for which there is no machine-dependent variant.
81251875SpeterSRCS+=	${MDSRCS}
82251875Speter.for _src in ${MISRCS}
83251875Speter.if ${MDSRCS:R:M${_src:R}} == ""
84251875SpeterSRCS+=	${_src}
85251875Speter.endif
86251875Speter.endfor
87251875Speter.endif
88251875Speter
89251875SpeterKQSRCS=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
90251875Speter	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
91251875Speter	subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
92251875SpeterKSRCS=	bcmp.c ffs.c ffsl.c fls.c flsl.c index.c mcount.c rindex.c \
93251875Speter	strcat.c strcmp.c strcpy.c strlen.c strncpy.c
94251875Speter
95251875Speterlibkern: libkern.gen libkern.${MACHINE_ARCH}
96251875Speter
97251875Speterlibkern.gen: ${KQSRCS} ${KSRCS}
98251875Speter	cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
99251875Speter
100251875Speterlibkern.${MACHINE_ARCH}:: ${KMSRCS}
101251875Speter.if defined(KMSRCS) && !empty(KMSRCS)
102251875Speter	cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH}
103251875Speter.endif
104251875Speter
105251875Speter.include <bsd.lib.mk>
106251875Speter
107251875Speter# Disable warnings in contributed sources.
108251875SpeterCWARNFLAGS:=	${.IMPSRC:Ngdtoa_*.c:C/^.+$/${CWARNFLAGS}/}
109251875Speter