Makefile revision 1.101
11.101Stv#	$NetBSD: Makefile,v 1.101 2002/01/31 19:13:12 tv 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.82StvLIB=		c
211.100SlukemUSE_SHLIBDIR=	yes
221.82StvCPPFLAGS+=	-D_LIBC -DNLS -DYP -DHESIOD -DLIBC_SCCS -DSYSLIBC_SCCS \
231.82Stv		-D_REENTRANT -I${.CURDIR}/include
241.87SitojunCPPFLAGS+=	-DINET6
251.100Slukem
261.100Slukem.include <bsd.own.mk>
271.98Schristos
281.98Schristos.if ${MACHINE_ARCH} == "i386"
291.98Schristos# Set lint to exit on warnings
301.98SchristosLINTFLAGS+=	-w
311.98Schristos.endif
321.98Schristos# ignore 'empty translation unit' warnings.
331.98SchristosLINTFLAGS+=	-X 272
341.82Stv
351.95Sitojun.if exists(${.CURDIR}/arch/${MACHINE_ARCH})
361.95SitojunARCHSUBDIR=	${MACHINE_ARCH}
371.95Sitojun.elif exists(${.CURDIR}/arch/${MACHINE_CPU}) 
381.95SitojunARCHSUBDIR=	${MACHINE_CPU}
391.95Sitojun.else
401.95Sitojun.BEGIN:
411.95Sitojun	@echo no ARCHSUBDIR for ${MACHINE_ARCH} nor ${MACHINE_CPU}
421.95Sitojun	@false
431.95Sitojun.endif
441.95Sitojun
451.83SdrochnerARCHDIR=	${.CURDIR}/arch/${ARCHSUBDIR}
461.82StvAINC=		-I${ARCHDIR}
471.27Smycroft.if defined(DESTDIR)
481.82StvAINC+=		-nostdinc -idirafter ${DESTDIR}/usr/include
491.27Smycroft.endif
501.66SmikelCLEANFILES+=	${.CURDIR}/tags ${.OBJDIR}/tags
511.51Scgd
521.73Smikel# Don't try to lint the C library against itself when creating llib-lc.ln
531.51ScgdLLIBS=
541.89Sfvdl
551.89SfvdlINCSDIR=	/usr/include
561.9Sderaadt
571.82Stv.if exists (${ARCHDIR}/Makefile.inc)
581.82Stv.PATH:	${ARCHDIR}
591.82Stv.include "${ARCHDIR}/Makefile.inc"
601.9Sderaadt.endif
611.1Scgd
621.7Scgd.include "${.CURDIR}/db/Makefile.inc"
631.1Scgd.include "${.CURDIR}/compat-43/Makefile.inc"
641.88Sminoura.include "${.CURDIR}/dlfcn/Makefile.inc"
651.1Scgd.include "${.CURDIR}/gen/Makefile.inc"
661.24Scgd.include "${.CURDIR}/gmon/Makefile.inc"
671.81Sexplorer.include "${.CURDIR}/hash/Makefile.inc"
681.1Scgd.include "${.CURDIR}/locale/Makefile.inc"
691.52Sthorpej.include "${.CURDIR}/md/Makefile.inc"
701.1Scgd.include "${.CURDIR}/net/Makefile.inc"
711.25Sjtc.include "${.CURDIR}/nls/Makefile.inc"
721.78Seeh.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64")
731.24Scgd.include "${.CURDIR}/quad/Makefile.inc"
741.34Scgd.endif
751.24Scgd.include "${.CURDIR}/regex/Makefile.inc"
761.24Scgd.include "${.CURDIR}/rpc/Makefile.inc"
771.1Scgd.include "${.CURDIR}/stdio/Makefile.inc"
781.1Scgd.include "${.CURDIR}/stdlib/Makefile.inc"
791.1Scgd.include "${.CURDIR}/string/Makefile.inc"
801.40Sjtc.include "${.CURDIR}/termios/Makefile.inc"
811.38Sjtc.include "${.CURDIR}/time/Makefile.inc"
821.1Scgd.include "${.CURDIR}/sys/Makefile.inc"
831.4Sderaadt.include "${.CURDIR}/yp/Makefile.inc"
841.41Sjtc
851.99SzuntumNLS=	C.msg Pig.msg cs.msg de.msg es.msg fi.msg fr.msg nl.msg no.msg \
861.99Szuntum	sv.msg pl.msg
871.1Scgd
881.30ScgdLIBKERN=	${.CURDIR}/../../sys/lib/libkern
891.14Sjtc
901.80SbouyerKSRCS=	bcopy.c bcmp.c bswap16.c bswap32.c bswap64.c bzero.c ffs.c \
911.76Sperry	strcat.c strchr.c strcmp.c strcpy.c strlen.c \
921.76Sperry	strncmp.c strncpy.c strrchr.c \
931.76Sperry	htonl.c htons.c ntohl.c ntohs.c md5c.c \
941.76Sperry	memchr.c memcmp.c memcpy.c memmove.c memset.c \
951.76Sperry	index.c rindex.c
961.78Seeh.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64")
971.22ScgdKSRCS+=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
981.22Scgd	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
991.22Scgd	subdi3.c  ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
1001.22ScgdKINCLUDES+=	quad/quad.h
1011.35Scgd.endif
1021.14Sjtc
1031.15Sjtccopy-to-libkern:	copy-to-libkern-machind copy-to-libkern-machdep
1041.15Sjtc
1051.15Sjtccopy-to-libkern-machind: ${KSRCS}
1061.14Sjtc	cp -p ${.ALLSRC} ${LIBKERN}
1071.35Scgd.if defined(KINCLUDES) && !empty(KINCLUDES)
1081.22Scgd	(cd ${.CURDIR} ; cp -p ${KINCLUDES} ${LIBKERN})
1091.35Scgd.endif
1101.14Sjtc
1111.15Sjtccopy-to-libkern-machdep: ${KMSRCS}
1121.15Sjtc.if defined(KMSRCS) && !empty(KMSRCS)
1131.83Sdrochner	cp -p ${.ALLSRC} ${LIBKERN}/arch/${ARCHSUBDIR}
1141.18Scgd.endif
1151.18Scgd.if defined(KMINCLUDES) && !empty(KMINCLUDES)
1161.83Sdrochner	(cd ${.CURDIR} ; cp -p ${KMINCLUDES} ${LIBKERN}/arch/${ARCHSUBDIR})
1171.15Sjtc.endif
1181.15Sjtc
1191.14Sjtcrm-from-libkern:
1201.14Sjtc	for i in ${KSRCS}; do rm -f ${LIBKERN}/$$i; done
1211.15Sjtc.if defined(KMSRCS) && !empty(KMSRCS)
1221.83Sdrochner	for i in ${KMSRCS}; do rm -f ${LIBKERN}/arch/${ARCHSUBDIR}/$$i; done
1231.15Sjtc.endif
1241.36Scgd
1251.101StvCTAGS?=		ctags
1261.101Stv
1271.86Smycroftrealall: ${.OBJDIR}/tags
1281.65Schristos${.OBJDIR}/tags: ${SRCS}
1291.101Stv	${CTAGS} -w ${.ALLSRC:M*.c}
1301.37Sjtc	egrep "^ENTRY(.*)|^FUNC(.*)|^SYSCALL(.*)" /dev/null ${.ALLSRC:M*.S} | \
1311.36Scgd	    sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \
1321.64Schristos	    >> ${.TARGET}; sort -o ${.TARGET} ${.TARGET}
1331.65Schristos
1341.82StvFILES=		${.OBJDIR}/tags
1351.82StvFILESNAME=	libc.tags
1361.82StvFILESDIR=	/var/db
1371.32Scgd
1381.1Scgd.include <bsd.lib.mk>
1391.97Sitojun
1401.97Sitojun# workaround for lib/libc/locale: build singlebyte setlocale() for libc.a,
1411.97Sitojun# multibyte for libc.so.  the quirk should be removed when we support
1421.97Sitojun# dlopen() from within statically linked binaries.
1431.97SitojunCPICFLAGS+=	-DDLRUNE
144