Makefile revision 124483
1189747Ssam#	@(#)Makefile	8.2 (Berkeley) 2/3/94
2189747Ssam# $FreeBSD: head/lib/libc/Makefile 124483 2004-01-13 16:05:47Z des $
3189747Ssam#
4189747Ssam# All library objects contain FreeBSD revision strings by default; they may be
5189747Ssam# excluded as a space-saving measure.  To produce a library that does
6189747Ssam# not contain these strings, add -DSTRIP_FBSDID (see <sys/cdefs.h>) to CFLAGS
7189747Ssam# below.  Note: there are no IDs for syscall stubs whose sources are generated.
8189747Ssam# To include legacy CSRG sccsid strings, add -DLIBC_SCCS and -DSYSLIBC_SCCS
9189747Ssam# to CFLAGS below.  -DSYSLIBC_SCCS affects just the system call stubs.
10189747SsamLIB=c
11189747Ssam# If you bump SHLIB_MAJOR, remove the kluge from gen/gethostname.c.
12189747Ssam# If you bump SHLIB_MAJOR, see standards/55112.
13189747SsamSHLIB_MAJOR= 5
14189747SsamSHLIBDIR?= /lib
15189747SsamWARNS?=	1
16189747SsamCFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include
17189747SsamCFLAGS+=-I${.CURDIR}/${MACHINE_ARCH}
18189747SsamCLEANFILES+=tags
19189747SsamINSTALL_PIC_ARCHIVE=	yes
20189747SsamPRECIOUSLIB=	yes
21189747Ssam
22189747Ssam# Define (empty) variables so that make doesn't give substitution
23189747Ssam# errors if the included makefiles don't change these:
24189747SsamMDSRCS=
25189747SsamMISRCS=
26189747SsamMDASM=
27217631SadrianMIASM=
28189747SsamNOASM=
29189747Ssam
30189747Ssam#
31217631Sadrian# If there is a machine dependent makefile, use it:
32217631Sadrian#
33219393Sadrian.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
34189747Ssam.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
35189747Ssam.endif
36189747Ssam
37189747Ssam.include "${.CURDIR}/db/Makefile.inc"
38189747Ssam.include "${.CURDIR}/compat-43/Makefile.inc"
39189747Ssam.include "${.CURDIR}/gdtoa/Makefile.inc"
40189747Ssam.include "${.CURDIR}/gen/Makefile.inc"
41189747Ssam.if ${MACHINE_ARCH} != "powerpc"
42189747Ssam.include "${.CURDIR}/gmon/Makefile.inc"
43189747Ssam.endif
44189747Ssam.include "${.CURDIR}/locale/Makefile.inc"
45189747Ssam.include "${.CURDIR}/net/Makefile.inc"
46189747Ssam.include "${.CURDIR}/nls/Makefile.inc"
47189747Ssam.include "${.CURDIR}/posix1e/Makefile.inc"
48189747Ssam.if !defined(NO_QUAD)
49189747Ssam.include "${.CURDIR}/quad/Makefile.inc"
50189747Ssam.endif
51189747Ssam.include "${.CURDIR}/regex/Makefile.inc"
52189747Ssam.include "${.CURDIR}/stdio/Makefile.inc"
53189747Ssam.include "${.CURDIR}/stdlib/Makefile.inc"
54189747Ssam.include "${.CURDIR}/stdtime/Makefile.inc"
55189747Ssam.include "${.CURDIR}/string/Makefile.inc"
56189747Ssam.include "${.CURDIR}/sys/Makefile.inc"
57189747Ssam.include "${.CURDIR}/rpc/Makefile.inc"
58189747Ssam.include "${.CURDIR}/uuid/Makefile.inc"
59189747Ssam.include "${.CURDIR}/xdr/Makefile.inc"
60189747Ssam.if !defined(NO_YP_LIBC)
61189747SsamCFLAGS+= -DYP
62189747Ssam.include "${.CURDIR}/yp/Makefile.inc"
63189747Ssam.endif
64189747Ssam.if !defined(NO_HESIOD_LIBC)
65189747SsamCFLAGS+= -DHESIOD
66189747Ssam.endif
67189747Ssam
68189747Ssam# If there are no machine dependent sources, append all the
69189747Ssam# machine-independent sources:
70189747Ssam.if empty(MDSRCS)
71189747SsamSRCS+=	${MISRCS}
72218764Sadrian.else
73218764Sadrian# Append machine-dependent sources, then append machine-independent sources
74218764Sadrian# for which there is no machine-dependent variant.
75218764SadrianSRCS+=	${MDSRCS}
76218764Sadrian.for _src in ${MISRCS}
77218764Sadrian.if ${MDSRCS:R:M${_src:R}} == ""
78218764SadrianSRCS+=	${_src}
79218764Sadrian.endif
80218764Sadrian.endfor
81218764Sadrian.endif
82218764Sadrian
83218764SadrianKQSRCS=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
84218764Sadrian	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
85218764Sadrian	subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
86218764SadrianKSRCS=	bcmp.c ffs.c ffsl.c fls.c flsl.c index.c mcount.c rindex.c \
87218764Sadrian	strcat.c strcmp.c strcpy.c strlen.c strncpy.c
88218764Sadrian
89218764Sadrianlibkern: libkern.gen libkern.${MACHINE_ARCH}
90218764Sadrian
91218764Sadrianlibkern.gen: ${KQSRCS} ${KSRCS}
92218764Sadrian	cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
93218764Sadrian
94218764Sadrianlibkern.${MACHINE_ARCH}:: ${KMSRCS}
95218764Sadrian.if defined(KMSRCS) && !empty(KMSRCS)
96222276Sadrian	cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH}
97218764Sadrian.endif
98218764Sadrian
99219979Sadrian.include <bsd.lib.mk>
100189747Ssam
101189747Ssam# Disable warnings in contributed sources.
102221875SadrianCWARNFLAGS:=	${.IMPSRC:Ngdtoa_*.c:C/^.+$/${CWARNFLAGS}/}
103221875Sadrian