Makefile revision 1.95
11.95Sitojun#	$NetBSD: Makefile,v 1.95 2001/01/08 08:30:00 itojun 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.95Sitojun.if exists(${.CURDIR}/arch/${MACHINE_ARCH})
311.95SitojunARCHSUBDIR=	${MACHINE_ARCH}
321.95Sitojun.elif exists(${.CURDIR}/arch/${MACHINE_CPU}) 
331.95SitojunARCHSUBDIR=	${MACHINE_CPU}
341.95Sitojun.else
351.95Sitojun.BEGIN:
361.95Sitojun	@echo no ARCHSUBDIR for ${MACHINE_ARCH} nor ${MACHINE_CPU}
371.95Sitojun	@false
381.95Sitojun.endif
391.95Sitojun
401.83SdrochnerARCHDIR=	${.CURDIR}/arch/${ARCHSUBDIR}
411.82StvAINC=		-I${ARCHDIR}
421.27Smycroft.if defined(DESTDIR)
431.82StvAINC+=		-nostdinc -idirafter ${DESTDIR}/usr/include
441.27Smycroft.endif
451.66SmikelCLEANFILES+=	${.CURDIR}/tags ${.OBJDIR}/tags
461.51Scgd
471.73Smikel# Don't try to lint the C library against itself when creating llib-lc.ln
481.51ScgdLLIBS=
491.89Sfvdl
501.89SfvdlINCSDIR=	/usr/include
511.9Sderaadt
521.82Stv.if exists (${ARCHDIR}/Makefile.inc)
531.82Stv.PATH:	${ARCHDIR}
541.82Stv.include "${ARCHDIR}/Makefile.inc"
551.9Sderaadt.endif
561.1Scgd
571.7Scgd.include "${.CURDIR}/db/Makefile.inc"
581.1Scgd.include "${.CURDIR}/compat-43/Makefile.inc"
591.88Sminoura.include "${.CURDIR}/dlfcn/Makefile.inc"
601.1Scgd.include "${.CURDIR}/gen/Makefile.inc"
611.24Scgd.include "${.CURDIR}/gmon/Makefile.inc"
621.81Sexplorer.include "${.CURDIR}/hash/Makefile.inc"
631.1Scgd.include "${.CURDIR}/locale/Makefile.inc"
641.52Sthorpej.include "${.CURDIR}/md/Makefile.inc"
651.1Scgd.include "${.CURDIR}/net/Makefile.inc"
661.25Sjtc.include "${.CURDIR}/nls/Makefile.inc"
671.78Seeh.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64")
681.24Scgd.include "${.CURDIR}/quad/Makefile.inc"
691.34Scgd.endif
701.24Scgd.include "${.CURDIR}/regex/Makefile.inc"
711.24Scgd.include "${.CURDIR}/rpc/Makefile.inc"
721.1Scgd.include "${.CURDIR}/stdio/Makefile.inc"
731.1Scgd.include "${.CURDIR}/stdlib/Makefile.inc"
741.1Scgd.include "${.CURDIR}/string/Makefile.inc"
751.40Sjtc.include "${.CURDIR}/termios/Makefile.inc"
761.38Sjtc.include "${.CURDIR}/time/Makefile.inc"
771.1Scgd.include "${.CURDIR}/sys/Makefile.inc"
781.4Sderaadt.include "${.CURDIR}/yp/Makefile.inc"
791.41Sjtc
801.85SjdolecekNLS=	C.msg Pig.msg cs.msg de.msg es.msg fi.msg fr.msg nl.msg no.msg sv.msg
811.1Scgd
821.30ScgdLIBKERN=	${.CURDIR}/../../sys/lib/libkern
831.14Sjtc
841.80SbouyerKSRCS=	bcopy.c bcmp.c bswap16.c bswap32.c bswap64.c bzero.c ffs.c \
851.76Sperry	strcat.c strchr.c strcmp.c strcpy.c strlen.c \
861.76Sperry	strncmp.c strncpy.c strrchr.c \
871.76Sperry	htonl.c htons.c ntohl.c ntohs.c md5c.c \
881.76Sperry	memchr.c memcmp.c memcpy.c memmove.c memset.c \
891.76Sperry	index.c rindex.c
901.78Seeh.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64")
911.22ScgdKSRCS+=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
921.22Scgd	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
931.22Scgd	subdi3.c  ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
941.22ScgdKINCLUDES+=	quad/quad.h
951.35Scgd.endif
961.14Sjtc
971.15Sjtccopy-to-libkern:	copy-to-libkern-machind copy-to-libkern-machdep
981.15Sjtc
991.15Sjtccopy-to-libkern-machind: ${KSRCS}
1001.14Sjtc	cp -p ${.ALLSRC} ${LIBKERN}
1011.35Scgd.if defined(KINCLUDES) && !empty(KINCLUDES)
1021.22Scgd	(cd ${.CURDIR} ; cp -p ${KINCLUDES} ${LIBKERN})
1031.35Scgd.endif
1041.14Sjtc
1051.15Sjtccopy-to-libkern-machdep: ${KMSRCS}
1061.15Sjtc.if defined(KMSRCS) && !empty(KMSRCS)
1071.83Sdrochner	cp -p ${.ALLSRC} ${LIBKERN}/arch/${ARCHSUBDIR}
1081.18Scgd.endif
1091.18Scgd.if defined(KMINCLUDES) && !empty(KMINCLUDES)
1101.83Sdrochner	(cd ${.CURDIR} ; cp -p ${KMINCLUDES} ${LIBKERN}/arch/${ARCHSUBDIR})
1111.15Sjtc.endif
1121.15Sjtc
1131.14Sjtcrm-from-libkern:
1141.14Sjtc	for i in ${KSRCS}; do rm -f ${LIBKERN}/$$i; done
1151.15Sjtc.if defined(KMSRCS) && !empty(KMSRCS)
1161.83Sdrochner	for i in ${KMSRCS}; do rm -f ${LIBKERN}/arch/${ARCHSUBDIR}/$$i; done
1171.15Sjtc.endif
1181.36Scgd
1191.86Smycroftrealall: ${.OBJDIR}/tags
1201.65Schristos${.OBJDIR}/tags: ${SRCS}
1211.90Schristos	ctags -w ${.ALLSRC:M*.c}
1221.37Sjtc	egrep "^ENTRY(.*)|^FUNC(.*)|^SYSCALL(.*)" /dev/null ${.ALLSRC:M*.S} | \
1231.36Scgd	    sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \
1241.64Schristos	    >> ${.TARGET}; sort -o ${.TARGET} ${.TARGET}
1251.42Scgd
1261.65Schristostags: ${.CURDIR}/tags
1271.65Schristos${.CURDIR}/tags: 
1281.65Schristos	@rm -f ${.TARGET}
1291.65Schristos	ln -s /var/db/libc.tags ${.TARGET}
1301.65Schristos
1311.82StvFILES=		${.OBJDIR}/tags
1321.82StvFILESNAME=	libc.tags
1331.82StvFILESDIR=	/var/db
1341.32Scgd
1351.1Scgd.include <bsd.lib.mk>
136