Makefile revision 1.113
1# $NetBSD: Makefile,v 1.113 2003/12/07 21:57:22 matt Exp $ 2# @(#)Makefile 8.2 (Berkeley) 2/3/94 3# 4# All library objects contain sccsid strings by default; they may be 5# excluded as a space-saving measure. To produce a library that does 6# not contain these strings, delete -DLIBC_SCCS and -DSYSLIBC_SCCS 7# from CPPFLAGS below. To remove these strings from just the system call 8# stubs, remove just -DSYSLIBC_SCCS from CPPFLAGS. 9# 10# The NLS (message catalog) functions are always in libc. To choose that 11# strerror(), perror(), strsignal(), psignal(), etc. actually call the NLS 12# functions, put -DNLS on the CPPFLAGS line below. 13# 14# The YP functions are always in libc. To choose that getpwent() and friends 15# actually call the YP functions, put -DYP on the CPPFLAGS line below. 16# 17# The Hesiod functions are always in libc. To choose that getpwent() and friends 18# actually call the Hesiod functions, put -DHESIOD on the CPPFLAGS line below. 19 20USE_SHLIBDIR= yes 21 22.include <bsd.own.mk> 23 24LIB= c 25CPPFLAGS+= -D_LIBC -DLIBC_SCCS -DSYSLIBC_SCCS -D_REENTRANT 26CPPFLAGS+= -I${.CURDIR}/include 27 28.if (${USE_HESIOD} != "no") 29CPPFLAGS+= -DHESIOD 30.endif 31 32.if (${USE_INET6} != "no") 33CPPFLAGS+= -DINET6 34.endif 35CPPFLAGS+= -DNLS 36 37.if (${USE_YP} != "no") 38CPPFLAGS+= -DYP 39.endif 40 41.if ${MACHINE_ARCH} == "i386" 42# Set lint to exit on warnings 43LINTFLAGS+= -w 44.endif 45# ignore 'empty translation unit' warnings. 46LINTFLAGS+= -X 272 47 48.if exists(${.CURDIR}/arch/${MACHINE_ARCH}) 49ARCHSUBDIR= ${MACHINE_ARCH} 50.elif exists(${.CURDIR}/arch/${MACHINE_CPU}) 51ARCHSUBDIR= ${MACHINE_CPU} 52.else 53.BEGIN: 54 @echo no ARCHSUBDIR for ${MACHINE_ARCH} nor ${MACHINE_CPU} 55 @false 56.endif 57 58ARCHDIR= ${.CURDIR}/arch/${ARCHSUBDIR} 59AINC= -I${ARCHDIR} 60.if defined(DESTDIR) 61AINC+= -nostdinc -idirafter ${DESTDIR}/usr/include 62.endif 63CLEANFILES+= tags 64 65# Don't try to lint the C library against itself when creating llib-lc.ln 66LLIBS= 67 68INCSDIR= /usr/include 69 70.if exists (${ARCHDIR}/Makefile.inc) 71.PATH: ${ARCHDIR} 72.include "${ARCHDIR}/Makefile.inc" 73.endif 74 75.include "${.CURDIR}/db/Makefile.inc" 76.include "${.CURDIR}/citrus/Makefile.inc" 77.include "${.CURDIR}/compat-43/Makefile.inc" 78.include "${.CURDIR}/dlfcn/Makefile.inc" 79.include "${.CURDIR}/gen/Makefile.inc" 80.include "${.CURDIR}/gmon/Makefile.inc" 81.include "${.CURDIR}/hash/Makefile.inc" 82.include "${.CURDIR}/iconv/Makefile.inc" 83.include "${.CURDIR}/locale/Makefile.inc" 84.include "${.CURDIR}/md/Makefile.inc" 85.include "${.CURDIR}/net/Makefile.inc" 86.include "${.CURDIR}/nls/Makefile.inc" 87.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64") 88.include "${.CURDIR}/quad/Makefile.inc" 89.endif 90.include "${.CURDIR}/regex/Makefile.inc" 91.include "${.CURDIR}/rpc/Makefile.inc" 92.include "${.CURDIR}/stdio/Makefile.inc" 93.include "${.CURDIR}/stdlib/Makefile.inc" 94.include "${.CURDIR}/string/Makefile.inc" 95.include "${.CURDIR}/termios/Makefile.inc" 96.include "${.CURDIR}/thread-stub/Makefile.inc" 97.include "${.CURDIR}/time/Makefile.inc" 98.include "${.CURDIR}/sys/Makefile.inc" 99.if (${MKYP} != "no") 100.include "${.CURDIR}/yp/Makefile.inc" 101.endif 102 103NLS= C.msg Pig.msg ca.msg cs.msg de.msg es.msg fi.msg fr.msg nl.msg \ 104 no.msg pl.msg sk.msg sv.msg 105 106LIBKERN= ${NETBSDSRCDIR}/sys/lib/libkern 107 108KSRCS= bcopy.c bcmp.c bswap16.c bswap32.c bswap64.c bzero.c ffs.c \ 109 strcat.c strchr.c strcmp.c strcpy.c strlen.c \ 110 strncmp.c strncpy.c strrchr.c \ 111 htonl.c htons.c ntohl.c ntohs.c md5c.c \ 112 memchr.c memcmp.c memcpy.c memmove.c memset.c \ 113 index.c rindex.c 114.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64") 115KSRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \ 116 lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \ 117 subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c 118KINCLUDES+= quad/quad.h 119.endif 120 121copy-to-libkern: copy-to-libkern-machind copy-to-libkern-machdep 122 123copy-to-libkern-machind: ${KSRCS} 124 cp -p ${.ALLSRC} ${LIBKERN} 125.if defined(KINCLUDES) && !empty(KINCLUDES) 126 (cd ${.CURDIR} ; cp -p ${KINCLUDES} ${LIBKERN}) 127.endif 128 129copy-to-libkern-machdep: ${KMSRCS} 130.if defined(KMSRCS) && !empty(KMSRCS) 131 cp -p ${.ALLSRC} ${LIBKERN}/arch/${ARCHSUBDIR} 132.endif 133.if defined(KMINCLUDES) && !empty(KMINCLUDES) 134 (cd ${.CURDIR} ; cp -p ${KMINCLUDES} ${LIBKERN}/arch/${ARCHSUBDIR}) 135.endif 136 137rm-from-libkern: 138 for i in ${KSRCS}; do rm -f ${LIBKERN}/$$i; done 139.if defined(KMSRCS) && !empty(KMSRCS) 140 for i in ${KMSRCS}; do rm -f ${LIBKERN}/arch/${ARCHSUBDIR}/$$i; done 141.endif 142 143realall: tags 144tags: ${SRCS} 145 ${TOOL_CTAGS} -w ${.ALLSRC:M*.c} 146 egrep "^ENTRY(.*)|^FUNC(.*)|^SYSCALL(.*)" /dev/null ${.ALLSRC:M*.S} | \ 147 sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \ 148 >> ${.TARGET}; sort -o ${.TARGET} ${.TARGET} 149 150FILES= tags 151FILESNAME= libc.tags 152FILESDIR= /var/db 153 154 155# workaround for I18N stuffs: build singlebyte setlocale() for libc.a, 156# multibyte for libc.so. the quirk should be removed when we support 157# dlopen() from within statically linked binaries. 158CSHLIBFLAGS+= -D_I18N_DYNAMIC 159 160.include <bsd.lib.mk> 161