Makefile revision 1.112
11.112Slukem#	$NetBSD: Makefile,v 1.112 2003/07/10 10:34:22 lukem Exp $
21.36Scgd#	@(#)Makefile	8.2 (Berkeley) 2/3/94
31.1Scgd#
41.1Scgd# All library objects contain sccsid strings by default; they may be
51.1Scgd# excluded as a space-saving measure.  To produce a library that does
61.1Scgd# not contain these strings, delete -DLIBC_SCCS and -DSYSLIBC_SCCS
71.71Slukem# from CPPFLAGS below.  To remove these strings from just the system call
81.71Slukem# stubs, remove just -DSYSLIBC_SCCS from CPPFLAGS.
91.28Sjtc#
101.28Sjtc# The NLS (message catalog) functions are always in libc.  To choose that
111.28Sjtc# strerror(), perror(), strsignal(), psignal(), etc. actually call the NLS
121.71Slukem# functions, put -DNLS on the CPPFLAGS line below.
131.4Sderaadt#
141.6Sderaadt# The YP functions are always in libc. To choose that getpwent() and friends
151.71Slukem# actually call the YP functions, put -DYP on the CPPFLAGS line below.
161.79Slukem#
171.79Slukem# The Hesiod functions are always in libc. To choose that getpwent() and friends
181.79Slukem# actually call the Hesiod functions, put -DHESIOD on the CPPFLAGS line below.
191.4Sderaadt
201.107SlukemUSE_SHLIBDIR=	yes
211.107Slukem
221.104Sthorpej.include <bsd.own.mk>
231.104Sthorpej
241.82StvLIB=		c
251.104SthorpejCPPFLAGS+=	-D_LIBC -DLIBC_SCCS -DSYSLIBC_SCCS -D_REENTRANT
261.104SthorpejCPPFLAGS+=	-I${.CURDIR}/include
271.104Sthorpej
281.104Sthorpej.if (${USE_HESIOD} != "no")
291.104SthorpejCPPFLAGS+=	-DHESIOD
301.104Sthorpej.endif
311.104Sthorpej
321.87SitojunCPPFLAGS+=	-DINET6
331.104SthorpejCPPFLAGS+=	-DNLS
341.100Slukem
351.104Sthorpej.if (${USE_YP} != "no")
361.104SthorpejCPPFLAGS+=	-DYP
371.104Sthorpej.endif
381.98Schristos
391.98Schristos.if ${MACHINE_ARCH} == "i386"
401.98Schristos# Set lint to exit on warnings
411.98SchristosLINTFLAGS+=	-w
421.98Schristos.endif
431.98Schristos# ignore 'empty translation unit' warnings.
441.98SchristosLINTFLAGS+=	-X 272
451.82Stv
461.95Sitojun.if exists(${.CURDIR}/arch/${MACHINE_ARCH})
471.95SitojunARCHSUBDIR=	${MACHINE_ARCH}
481.95Sitojun.elif exists(${.CURDIR}/arch/${MACHINE_CPU}) 
491.95SitojunARCHSUBDIR=	${MACHINE_CPU}
501.95Sitojun.else
511.95Sitojun.BEGIN:
521.95Sitojun	@echo no ARCHSUBDIR for ${MACHINE_ARCH} nor ${MACHINE_CPU}
531.95Sitojun	@false
541.95Sitojun.endif
551.95Sitojun
561.83SdrochnerARCHDIR=	${.CURDIR}/arch/${ARCHSUBDIR}
571.82StvAINC=		-I${ARCHDIR}
581.27Smycroft.if defined(DESTDIR)
591.82StvAINC+=		-nostdinc -idirafter ${DESTDIR}/usr/include
601.27Smycroft.endif
611.102SthorpejCLEANFILES+=	tags
621.51Scgd
631.73Smikel# Don't try to lint the C library against itself when creating llib-lc.ln
641.51ScgdLLIBS=
651.89Sfvdl
661.89SfvdlINCSDIR=	/usr/include
671.9Sderaadt
681.82Stv.if exists (${ARCHDIR}/Makefile.inc)
691.82Stv.PATH:	${ARCHDIR}
701.82Stv.include "${ARCHDIR}/Makefile.inc"
711.9Sderaadt.endif
721.1Scgd
731.7Scgd.include "${.CURDIR}/db/Makefile.inc"
741.111Stshiozak.include "${.CURDIR}/citrus/Makefile.inc"
751.1Scgd.include "${.CURDIR}/compat-43/Makefile.inc"
761.88Sminoura.include "${.CURDIR}/dlfcn/Makefile.inc"
771.1Scgd.include "${.CURDIR}/gen/Makefile.inc"
781.24Scgd.include "${.CURDIR}/gmon/Makefile.inc"
791.81Sexplorer.include "${.CURDIR}/hash/Makefile.inc"
801.111Stshiozak.include "${.CURDIR}/iconv/Makefile.inc"
811.1Scgd.include "${.CURDIR}/locale/Makefile.inc"
821.52Sthorpej.include "${.CURDIR}/md/Makefile.inc"
831.1Scgd.include "${.CURDIR}/net/Makefile.inc"
841.25Sjtc.include "${.CURDIR}/nls/Makefile.inc"
851.78Seeh.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64")
861.24Scgd.include "${.CURDIR}/quad/Makefile.inc"
871.34Scgd.endif
881.24Scgd.include "${.CURDIR}/regex/Makefile.inc"
891.24Scgd.include "${.CURDIR}/rpc/Makefile.inc"
901.1Scgd.include "${.CURDIR}/stdio/Makefile.inc"
911.1Scgd.include "${.CURDIR}/stdlib/Makefile.inc"
921.1Scgd.include "${.CURDIR}/string/Makefile.inc"
931.40Sjtc.include "${.CURDIR}/termios/Makefile.inc"
941.108Sthorpej.include "${.CURDIR}/thread-stub/Makefile.inc"
951.38Sjtc.include "${.CURDIR}/time/Makefile.inc"
961.1Scgd.include "${.CURDIR}/sys/Makefile.inc"
971.104Sthorpej.if (${MKYP} != "no")
981.4Sderaadt.include "${.CURDIR}/yp/Makefile.inc"
991.104Sthorpej.endif
1001.41Sjtc
1011.109SjmmvNLS=	C.msg Pig.msg ca.msg cs.msg de.msg es.msg fi.msg fr.msg nl.msg \
1021.110Ssalo	no.msg pl.msg sk.msg sv.msg
1031.1Scgd
1041.106SlukemLIBKERN=	${NETBSDSRCDIR}/sys/lib/libkern
1051.14Sjtc
1061.80SbouyerKSRCS=	bcopy.c bcmp.c bswap16.c bswap32.c bswap64.c bzero.c ffs.c \
1071.76Sperry	strcat.c strchr.c strcmp.c strcpy.c strlen.c \
1081.76Sperry	strncmp.c strncpy.c strrchr.c \
1091.76Sperry	htonl.c htons.c ntohl.c ntohs.c md5c.c \
1101.76Sperry	memchr.c memcmp.c memcpy.c memmove.c memset.c \
1111.76Sperry	index.c rindex.c
1121.78Seeh.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64")
1131.22ScgdKSRCS+=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
1141.22Scgd	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
1151.22Scgd	subdi3.c  ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
1161.22ScgdKINCLUDES+=	quad/quad.h
1171.35Scgd.endif
1181.14Sjtc
1191.15Sjtccopy-to-libkern:	copy-to-libkern-machind copy-to-libkern-machdep
1201.15Sjtc
1211.15Sjtccopy-to-libkern-machind: ${KSRCS}
1221.14Sjtc	cp -p ${.ALLSRC} ${LIBKERN}
1231.35Scgd.if defined(KINCLUDES) && !empty(KINCLUDES)
1241.22Scgd	(cd ${.CURDIR} ; cp -p ${KINCLUDES} ${LIBKERN})
1251.35Scgd.endif
1261.14Sjtc
1271.15Sjtccopy-to-libkern-machdep: ${KMSRCS}
1281.15Sjtc.if defined(KMSRCS) && !empty(KMSRCS)
1291.83Sdrochner	cp -p ${.ALLSRC} ${LIBKERN}/arch/${ARCHSUBDIR}
1301.18Scgd.endif
1311.18Scgd.if defined(KMINCLUDES) && !empty(KMINCLUDES)
1321.83Sdrochner	(cd ${.CURDIR} ; cp -p ${KMINCLUDES} ${LIBKERN}/arch/${ARCHSUBDIR})
1331.15Sjtc.endif
1341.15Sjtc
1351.14Sjtcrm-from-libkern:
1361.14Sjtc	for i in ${KSRCS}; do rm -f ${LIBKERN}/$$i; done
1371.15Sjtc.if defined(KMSRCS) && !empty(KMSRCS)
1381.83Sdrochner	for i in ${KMSRCS}; do rm -f ${LIBKERN}/arch/${ARCHSUBDIR}/$$i; done
1391.15Sjtc.endif
1401.36Scgd
1411.102Sthorpejrealall: tags
1421.102Sthorpejtags: ${SRCS}
1431.112Slukem	${TOOL_CTAGS} -w ${.ALLSRC:M*.c}
1441.37Sjtc	egrep "^ENTRY(.*)|^FUNC(.*)|^SYSCALL(.*)" /dev/null ${.ALLSRC:M*.S} | \
1451.36Scgd	    sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \
1461.64Schristos	    >> ${.TARGET}; sort -o ${.TARGET} ${.TARGET}
1471.65Schristos
1481.102SthorpejFILES=		tags
1491.82StvFILESNAME=	libc.tags
1501.82StvFILESDIR=	/var/db
1511.32Scgd
1521.97Sitojun
1531.103Stshiozak# workaround for I18N stuffs: build singlebyte setlocale() for libc.a,
1541.97Sitojun# multibyte for libc.so.  the quirk should be removed when we support
1551.97Sitojun# dlopen() from within statically linked binaries.
1561.105SyamtCSHLIBFLAGS+=	-D_I18N_DYNAMIC
1571.105Syamt
1581.105Syamt.include <bsd.lib.mk>
159