Makefile revision 1.104
11.104Sthorpej#	$NetBSD: Makefile,v 1.104 2002/03/22 18:10:21 thorpej 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.104Sthorpej.include <bsd.own.mk>
211.104Sthorpej
221.82StvLIB=		c
231.100SlukemUSE_SHLIBDIR=	yes
241.104SthorpejCPPFLAGS+=	-D_LIBC -DLIBC_SCCS -DSYSLIBC_SCCS -D_REENTRANT
251.104SthorpejCPPFLAGS+=	-I${.CURDIR}/include
261.104Sthorpej
271.104Sthorpej.if (${USE_HESIOD} != "no")
281.104SthorpejCPPFLAGS+=	-DHESIOD
291.104Sthorpej.endif
301.104Sthorpej
311.87SitojunCPPFLAGS+=	-DINET6
321.104SthorpejCPPFLAGS+=	-DNLS
331.100Slukem
341.104Sthorpej.if (${USE_YP} != "no")
351.104SthorpejCPPFLAGS+=	-DYP
361.104Sthorpej.endif
371.98Schristos
381.98Schristos.if ${MACHINE_ARCH} == "i386"
391.98Schristos# Set lint to exit on warnings
401.98SchristosLINTFLAGS+=	-w
411.98Schristos.endif
421.98Schristos# ignore 'empty translation unit' warnings.
431.98SchristosLINTFLAGS+=	-X 272
441.82Stv
451.95Sitojun.if exists(${.CURDIR}/arch/${MACHINE_ARCH})
461.95SitojunARCHSUBDIR=	${MACHINE_ARCH}
471.95Sitojun.elif exists(${.CURDIR}/arch/${MACHINE_CPU}) 
481.95SitojunARCHSUBDIR=	${MACHINE_CPU}
491.95Sitojun.else
501.95Sitojun.BEGIN:
511.95Sitojun	@echo no ARCHSUBDIR for ${MACHINE_ARCH} nor ${MACHINE_CPU}
521.95Sitojun	@false
531.95Sitojun.endif
541.95Sitojun
551.83SdrochnerARCHDIR=	${.CURDIR}/arch/${ARCHSUBDIR}
561.82StvAINC=		-I${ARCHDIR}
571.27Smycroft.if defined(DESTDIR)
581.82StvAINC+=		-nostdinc -idirafter ${DESTDIR}/usr/include
591.27Smycroft.endif
601.102SthorpejCLEANFILES+=	tags
611.51Scgd
621.73Smikel# Don't try to lint the C library against itself when creating llib-lc.ln
631.51ScgdLLIBS=
641.89Sfvdl
651.89SfvdlINCSDIR=	/usr/include
661.9Sderaadt
671.82Stv.if exists (${ARCHDIR}/Makefile.inc)
681.82Stv.PATH:	${ARCHDIR}
691.82Stv.include "${ARCHDIR}/Makefile.inc"
701.9Sderaadt.endif
711.1Scgd
721.7Scgd.include "${.CURDIR}/db/Makefile.inc"
731.1Scgd.include "${.CURDIR}/compat-43/Makefile.inc"
741.88Sminoura.include "${.CURDIR}/dlfcn/Makefile.inc"
751.1Scgd.include "${.CURDIR}/gen/Makefile.inc"
761.24Scgd.include "${.CURDIR}/gmon/Makefile.inc"
771.81Sexplorer.include "${.CURDIR}/hash/Makefile.inc"
781.103Stshiozak.include "${.CURDIR}/citrus/Makefile.inc"
791.1Scgd.include "${.CURDIR}/locale/Makefile.inc"
801.52Sthorpej.include "${.CURDIR}/md/Makefile.inc"
811.1Scgd.include "${.CURDIR}/net/Makefile.inc"
821.25Sjtc.include "${.CURDIR}/nls/Makefile.inc"
831.78Seeh.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64")
841.24Scgd.include "${.CURDIR}/quad/Makefile.inc"
851.34Scgd.endif
861.24Scgd.include "${.CURDIR}/regex/Makefile.inc"
871.24Scgd.include "${.CURDIR}/rpc/Makefile.inc"
881.1Scgd.include "${.CURDIR}/stdio/Makefile.inc"
891.1Scgd.include "${.CURDIR}/stdlib/Makefile.inc"
901.1Scgd.include "${.CURDIR}/string/Makefile.inc"
911.40Sjtc.include "${.CURDIR}/termios/Makefile.inc"
921.38Sjtc.include "${.CURDIR}/time/Makefile.inc"
931.1Scgd.include "${.CURDIR}/sys/Makefile.inc"
941.104Sthorpej.if (${MKYP} != "no")
951.4Sderaadt.include "${.CURDIR}/yp/Makefile.inc"
961.104Sthorpej.endif
971.41Sjtc
981.99SzuntumNLS=	C.msg Pig.msg cs.msg de.msg es.msg fi.msg fr.msg nl.msg no.msg \
991.99Szuntum	sv.msg pl.msg
1001.1Scgd
1011.30ScgdLIBKERN=	${.CURDIR}/../../sys/lib/libkern
1021.14Sjtc
1031.80SbouyerKSRCS=	bcopy.c bcmp.c bswap16.c bswap32.c bswap64.c bzero.c ffs.c \
1041.76Sperry	strcat.c strchr.c strcmp.c strcpy.c strlen.c \
1051.76Sperry	strncmp.c strncpy.c strrchr.c \
1061.76Sperry	htonl.c htons.c ntohl.c ntohs.c md5c.c \
1071.76Sperry	memchr.c memcmp.c memcpy.c memmove.c memset.c \
1081.76Sperry	index.c rindex.c
1091.78Seeh.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64")
1101.22ScgdKSRCS+=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
1111.22Scgd	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
1121.22Scgd	subdi3.c  ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
1131.22ScgdKINCLUDES+=	quad/quad.h
1141.35Scgd.endif
1151.14Sjtc
1161.15Sjtccopy-to-libkern:	copy-to-libkern-machind copy-to-libkern-machdep
1171.15Sjtc
1181.15Sjtccopy-to-libkern-machind: ${KSRCS}
1191.14Sjtc	cp -p ${.ALLSRC} ${LIBKERN}
1201.35Scgd.if defined(KINCLUDES) && !empty(KINCLUDES)
1211.22Scgd	(cd ${.CURDIR} ; cp -p ${KINCLUDES} ${LIBKERN})
1221.35Scgd.endif
1231.14Sjtc
1241.15Sjtccopy-to-libkern-machdep: ${KMSRCS}
1251.15Sjtc.if defined(KMSRCS) && !empty(KMSRCS)
1261.83Sdrochner	cp -p ${.ALLSRC} ${LIBKERN}/arch/${ARCHSUBDIR}
1271.18Scgd.endif
1281.18Scgd.if defined(KMINCLUDES) && !empty(KMINCLUDES)
1291.83Sdrochner	(cd ${.CURDIR} ; cp -p ${KMINCLUDES} ${LIBKERN}/arch/${ARCHSUBDIR})
1301.15Sjtc.endif
1311.15Sjtc
1321.14Sjtcrm-from-libkern:
1331.14Sjtc	for i in ${KSRCS}; do rm -f ${LIBKERN}/$$i; done
1341.15Sjtc.if defined(KMSRCS) && !empty(KMSRCS)
1351.83Sdrochner	for i in ${KMSRCS}; do rm -f ${LIBKERN}/arch/${ARCHSUBDIR}/$$i; done
1361.15Sjtc.endif
1371.36Scgd
1381.101StvCTAGS?=		ctags
1391.101Stv
1401.102Sthorpejrealall: tags
1411.102Sthorpejtags: ${SRCS}
1421.101Stv	${CTAGS} -w ${.ALLSRC:M*.c}
1431.37Sjtc	egrep "^ENTRY(.*)|^FUNC(.*)|^SYSCALL(.*)" /dev/null ${.ALLSRC:M*.S} | \
1441.36Scgd	    sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \
1451.64Schristos	    >> ${.TARGET}; sort -o ${.TARGET} ${.TARGET}
1461.65Schristos
1471.102SthorpejFILES=		tags
1481.82StvFILESNAME=	libc.tags
1491.82StvFILESDIR=	/var/db
1501.32Scgd
1511.1Scgd.include <bsd.lib.mk>
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.103StshiozakCPICFLAGS+=	-D_I18N_DYNAMIC
157