Makefile revision 1.92
11.92Schristos#	$NetBSD: Makefile,v 1.92 2000/12/20 21:13:56 christos 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.88Sminoura.include <bsd.own.mk>
211.88Sminoura
221.82StvLIB=		c
231.82StvCPPFLAGS+=	-D_LIBC -DNLS -DYP -DHESIOD -DLIBC_SCCS -DSYSLIBC_SCCS \
241.82Stv		-D_REENTRANT -I${.CURDIR}/include
251.87SitojunCPPFLAGS+=	-DINET6
261.90Schristos# Set lint to exit on warnings and ignore 'empty translation unit' warnings.
271.92Schristos#LINTFLAGS+=	-w
281.92SchristosLINTFLAGS+=-X 272
291.82Stv
301.84StvARCHSUBDIR=	${MACHINE_ARCH:C/mipse[bl]/mips/}
311.83SdrochnerARCHDIR=	${.CURDIR}/arch/${ARCHSUBDIR}
321.82StvAINC=		-I${ARCHDIR}
331.27Smycroft.if defined(DESTDIR)
341.82StvAINC+=		-nostdinc -idirafter ${DESTDIR}/usr/include
351.27Smycroft.endif
361.66SmikelCLEANFILES+=	${.CURDIR}/tags ${.OBJDIR}/tags
371.51Scgd
381.73Smikel# Don't try to lint the C library against itself when creating llib-lc.ln
391.51ScgdLLIBS=
401.89Sfvdl
411.89SfvdlINCSDIR=	/usr/include
421.9Sderaadt
431.82Stv.if exists (${ARCHDIR}/Makefile.inc)
441.82Stv.PATH:	${ARCHDIR}
451.82Stv.include "${ARCHDIR}/Makefile.inc"
461.9Sderaadt.endif
471.1Scgd
481.7Scgd.include "${.CURDIR}/db/Makefile.inc"
491.1Scgd.include "${.CURDIR}/compat-43/Makefile.inc"
501.88Sminoura.include "${.CURDIR}/dlfcn/Makefile.inc"
511.1Scgd.include "${.CURDIR}/gen/Makefile.inc"
521.24Scgd.include "${.CURDIR}/gmon/Makefile.inc"
531.81Sexplorer.include "${.CURDIR}/hash/Makefile.inc"
541.1Scgd.include "${.CURDIR}/locale/Makefile.inc"
551.52Sthorpej.include "${.CURDIR}/md/Makefile.inc"
561.1Scgd.include "${.CURDIR}/net/Makefile.inc"
571.25Sjtc.include "${.CURDIR}/nls/Makefile.inc"
581.78Seeh.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64")
591.24Scgd.include "${.CURDIR}/quad/Makefile.inc"
601.34Scgd.endif
611.24Scgd.include "${.CURDIR}/regex/Makefile.inc"
621.24Scgd.include "${.CURDIR}/rpc/Makefile.inc"
631.1Scgd.include "${.CURDIR}/stdio/Makefile.inc"
641.1Scgd.include "${.CURDIR}/stdlib/Makefile.inc"
651.1Scgd.include "${.CURDIR}/string/Makefile.inc"
661.40Sjtc.include "${.CURDIR}/termios/Makefile.inc"
671.38Sjtc.include "${.CURDIR}/time/Makefile.inc"
681.1Scgd.include "${.CURDIR}/sys/Makefile.inc"
691.4Sderaadt.include "${.CURDIR}/yp/Makefile.inc"
701.41Sjtc
711.85SjdolecekNLS=	C.msg Pig.msg cs.msg de.msg es.msg fi.msg fr.msg nl.msg no.msg sv.msg
721.1Scgd
731.30ScgdLIBKERN=	${.CURDIR}/../../sys/lib/libkern
741.14Sjtc
751.80SbouyerKSRCS=	bcopy.c bcmp.c bswap16.c bswap32.c bswap64.c bzero.c ffs.c \
761.76Sperry	strcat.c strchr.c strcmp.c strcpy.c strlen.c \
771.76Sperry	strncmp.c strncpy.c strrchr.c \
781.76Sperry	htonl.c htons.c ntohl.c ntohs.c md5c.c \
791.76Sperry	memchr.c memcmp.c memcpy.c memmove.c memset.c \
801.76Sperry	index.c rindex.c
811.78Seeh.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64")
821.22ScgdKSRCS+=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
831.22Scgd	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
841.22Scgd	subdi3.c  ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
851.22ScgdKINCLUDES+=	quad/quad.h
861.35Scgd.endif
871.14Sjtc
881.15Sjtccopy-to-libkern:	copy-to-libkern-machind copy-to-libkern-machdep
891.15Sjtc
901.15Sjtccopy-to-libkern-machind: ${KSRCS}
911.14Sjtc	cp -p ${.ALLSRC} ${LIBKERN}
921.35Scgd.if defined(KINCLUDES) && !empty(KINCLUDES)
931.22Scgd	(cd ${.CURDIR} ; cp -p ${KINCLUDES} ${LIBKERN})
941.35Scgd.endif
951.14Sjtc
961.15Sjtccopy-to-libkern-machdep: ${KMSRCS}
971.15Sjtc.if defined(KMSRCS) && !empty(KMSRCS)
981.83Sdrochner	cp -p ${.ALLSRC} ${LIBKERN}/arch/${ARCHSUBDIR}
991.18Scgd.endif
1001.18Scgd.if defined(KMINCLUDES) && !empty(KMINCLUDES)
1011.83Sdrochner	(cd ${.CURDIR} ; cp -p ${KMINCLUDES} ${LIBKERN}/arch/${ARCHSUBDIR})
1021.15Sjtc.endif
1031.15Sjtc
1041.14Sjtcrm-from-libkern:
1051.14Sjtc	for i in ${KSRCS}; do rm -f ${LIBKERN}/$$i; done
1061.15Sjtc.if defined(KMSRCS) && !empty(KMSRCS)
1071.83Sdrochner	for i in ${KMSRCS}; do rm -f ${LIBKERN}/arch/${ARCHSUBDIR}/$$i; done
1081.15Sjtc.endif
1091.36Scgd
1101.86Smycroftrealall: ${.OBJDIR}/tags
1111.65Schristos${.OBJDIR}/tags: ${SRCS}
1121.90Schristos	ctags -w ${.ALLSRC:M*.c}
1131.37Sjtc	egrep "^ENTRY(.*)|^FUNC(.*)|^SYSCALL(.*)" /dev/null ${.ALLSRC:M*.S} | \
1141.36Scgd	    sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \
1151.64Schristos	    >> ${.TARGET}; sort -o ${.TARGET} ${.TARGET}
1161.42Scgd
1171.65Schristostags: ${.CURDIR}/tags
1181.65Schristos${.CURDIR}/tags: 
1191.65Schristos	@rm -f ${.TARGET}
1201.65Schristos	ln -s /var/db/libc.tags ${.TARGET}
1211.65Schristos
1221.82StvFILES=		${.OBJDIR}/tags
1231.82StvFILESNAME=	libc.tags
1241.82StvFILESDIR=	/var/db
1251.32Scgd
1261.1Scgd.include <bsd.lib.mk>
127