NetBSD/lib/libc/Makefile

144 lines
4.6 KiB
Makefile
Raw Normal View History

# $NetBSD: Makefile,v 1.101 2002/01/31 19:13:12 tv Exp $
# @(#)Makefile 8.2 (Berkeley) 2/3/94
1993-03-21 12:45:37 +03:00
#
# All library objects contain sccsid strings by default; they may be
# excluded as a space-saving measure. To produce a library that does
# not contain these strings, delete -DLIBC_SCCS and -DSYSLIBC_SCCS
# from CPPFLAGS below. To remove these strings from just the system call
# stubs, remove just -DSYSLIBC_SCCS from CPPFLAGS.
#
# The NLS (message catalog) functions are always in libc. To choose that
# strerror(), perror(), strsignal(), psignal(), etc. actually call the NLS
# functions, put -DNLS on the CPPFLAGS line below.
#
# The YP functions are always in libc. To choose that getpwent() and friends
# actually call the YP functions, put -DYP on the CPPFLAGS line below.
1999-01-15 15:48:41 +03:00
#
# The Hesiod functions are always in libc. To choose that getpwent() and friends
# actually call the Hesiod functions, put -DHESIOD on the CPPFLAGS line below.
LIB= c
* Add user-controlled mk.conf variables - SHLIBDIR Location to install shared libraries if ${USE_SHLIBDIR} is "yes". Defaults to "/usr/lib". - USE_SHLIBDIR If "yes", install shared libraries in ${SHLIBDIR} instead of ${LIBDIR}. Defaults to "no". Sets ${_LIBSODIR} to the appropriate value. This may be set by individual Makefiles as well. - SHLINKDIR Location of shared linker. Defaults to "/usr/libexec". If != "/usr/libexec", change the dynamic-linker encoded in shared programs * Set USE_SHLIBDIR for libraries used by /bin and /sbin: libc libcrypt libcrypto libedit libipsec libkvm libm libmi387 libtermcap libutil libz * If ${_LIBSODIR} != ${LIBDIR}, add symlinks from ${LIBDIR}/${LIB}.so* to ${_LIBSODIR}/${LIB}.so* for compatibility. * Always install /sbin/init statically (for now) The net effect of these changes depends on how the variables are set: 1.) If nothing is set or changed, there is no change from the current behaviour: - Static /bin, /sbin, and bits of /usr/* - Dynamic rest - Shared linker is /usr/libexec/ld*so 2.) If the following make variables are set: LDSTATIC= SHLINKDIR=/lib SHLIBDIR=/lib Then the behaviour becomes: - Dynamic tools - .so libraries used by /bin and /sbin are installed to /lib, with symlinks from /usr/lib/lib*so to -> /lib/lib*so where appropriate - Shared linker is /lib/ld*so 3.) As per 2.), but add the following variable: USE_SHLIBDIR=yes This forces all .so's to be instaleld in /lib (with compat symlinks), not just those tagged by their Makefiles to be. Again, compat symlinks are installed
2001-12-28 04:32:37 +03:00
USE_SHLIBDIR= yes
CPPFLAGS+= -D_LIBC -DNLS -DYP -DHESIOD -DLIBC_SCCS -DSYSLIBC_SCCS \
-D_REENTRANT -I${.CURDIR}/include
CPPFLAGS+= -DINET6
* Add user-controlled mk.conf variables - SHLIBDIR Location to install shared libraries if ${USE_SHLIBDIR} is "yes". Defaults to "/usr/lib". - USE_SHLIBDIR If "yes", install shared libraries in ${SHLIBDIR} instead of ${LIBDIR}. Defaults to "no". Sets ${_LIBSODIR} to the appropriate value. This may be set by individual Makefiles as well. - SHLINKDIR Location of shared linker. Defaults to "/usr/libexec". If != "/usr/libexec", change the dynamic-linker encoded in shared programs * Set USE_SHLIBDIR for libraries used by /bin and /sbin: libc libcrypt libcrypto libedit libipsec libkvm libm libmi387 libtermcap libutil libz * If ${_LIBSODIR} != ${LIBDIR}, add symlinks from ${LIBDIR}/${LIB}.so* to ${_LIBSODIR}/${LIB}.so* for compatibility. * Always install /sbin/init statically (for now) The net effect of these changes depends on how the variables are set: 1.) If nothing is set or changed, there is no change from the current behaviour: - Static /bin, /sbin, and bits of /usr/* - Dynamic rest - Shared linker is /usr/libexec/ld*so 2.) If the following make variables are set: LDSTATIC= SHLINKDIR=/lib SHLIBDIR=/lib Then the behaviour becomes: - Dynamic tools - .so libraries used by /bin and /sbin are installed to /lib, with symlinks from /usr/lib/lib*so to -> /lib/lib*so where appropriate - Shared linker is /lib/ld*so 3.) As per 2.), but add the following variable: USE_SHLIBDIR=yes This forces all .so's to be instaleld in /lib (with compat symlinks), not just those tagged by their Makefiles to be. Again, compat symlinks are installed
2001-12-28 04:32:37 +03:00
.include <bsd.own.mk>
.if ${MACHINE_ARCH} == "i386"
# Set lint to exit on warnings
LINTFLAGS+= -w
.endif
# ignore 'empty translation unit' warnings.
LINTFLAGS+= -X 272
.if exists(${.CURDIR}/arch/${MACHINE_ARCH})
ARCHSUBDIR= ${MACHINE_ARCH}
.elif exists(${.CURDIR}/arch/${MACHINE_CPU})
ARCHSUBDIR= ${MACHINE_CPU}
.else
.BEGIN:
@echo no ARCHSUBDIR for ${MACHINE_ARCH} nor ${MACHINE_CPU}
@false
.endif
ARCHDIR= ${.CURDIR}/arch/${ARCHSUBDIR}
AINC= -I${ARCHDIR}
.if defined(DESTDIR)
AINC+= -nostdinc -idirafter ${DESTDIR}/usr/include
.endif
1997-06-19 10:12:10 +04:00
CLEANFILES+= ${.CURDIR}/tags ${.OBJDIR}/tags
1993-03-21 12:45:37 +03:00
1998-03-04 11:17:20 +03:00
# Don't try to lint the C library against itself when creating llib-lc.ln
LLIBS=
INCSDIR= /usr/include
.if exists (${ARCHDIR}/Makefile.inc)
.PATH: ${ARCHDIR}
.include "${ARCHDIR}/Makefile.inc"
.endif
.include "${.CURDIR}/db/Makefile.inc"
1993-03-21 12:45:37 +03:00
.include "${.CURDIR}/compat-43/Makefile.inc"
.include "${.CURDIR}/dlfcn/Makefile.inc"
1993-03-21 12:45:37 +03:00
.include "${.CURDIR}/gen/Makefile.inc"
.include "${.CURDIR}/gmon/Makefile.inc"
1999-02-04 08:08:58 +03:00
.include "${.CURDIR}/hash/Makefile.inc"
1993-03-21 12:45:37 +03:00
.include "${.CURDIR}/locale/Makefile.inc"
1997-01-30 04:02:17 +03:00
.include "${.CURDIR}/md/Makefile.inc"
1993-03-21 12:45:37 +03:00
.include "${.CURDIR}/net/Makefile.inc"
1994-05-30 02:09:13 +04:00
.include "${.CURDIR}/nls/Makefile.inc"
.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64")
.include "${.CURDIR}/quad/Makefile.inc"
1995-02-10 20:45:39 +03:00
.endif
.include "${.CURDIR}/regex/Makefile.inc"
.include "${.CURDIR}/rpc/Makefile.inc"
1993-03-21 12:45:37 +03:00
.include "${.CURDIR}/stdio/Makefile.inc"
.include "${.CURDIR}/stdlib/Makefile.inc"
.include "${.CURDIR}/string/Makefile.inc"
1995-04-25 04:00:58 +04:00
.include "${.CURDIR}/termios/Makefile.inc"
1995-03-13 08:26:07 +03:00
.include "${.CURDIR}/time/Makefile.inc"
1993-03-21 12:45:37 +03:00
.include "${.CURDIR}/sys/Makefile.inc"
.include "${.CURDIR}/yp/Makefile.inc"
1993-03-21 12:45:37 +03:00
NLS= C.msg Pig.msg cs.msg de.msg es.msg fi.msg fr.msg nl.msg no.msg \
sv.msg pl.msg
1994-10-19 06:05:22 +03:00
LIBKERN= ${.CURDIR}/../../sys/lib/libkern
KSRCS= bcopy.c bcmp.c bswap16.c bswap32.c bswap64.c bzero.c ffs.c \
strcat.c strchr.c strcmp.c strcpy.c strlen.c \
strncmp.c strncpy.c strrchr.c \
htonl.c htons.c ntohl.c ntohs.c md5c.c \
memchr.c memcmp.c memcpy.c memmove.c memset.c \
index.c rindex.c
.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64")
1993-12-04 08:15:26 +03:00
KSRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
KINCLUDES+= quad/quad.h
.endif
copy-to-libkern: copy-to-libkern-machind copy-to-libkern-machdep
copy-to-libkern-machind: ${KSRCS}
cp -p ${.ALLSRC} ${LIBKERN}
.if defined(KINCLUDES) && !empty(KINCLUDES)
1993-12-04 08:15:26 +03:00
(cd ${.CURDIR} ; cp -p ${KINCLUDES} ${LIBKERN})
.endif
copy-to-libkern-machdep: ${KMSRCS}
.if defined(KMSRCS) && !empty(KMSRCS)
cp -p ${.ALLSRC} ${LIBKERN}/arch/${ARCHSUBDIR}
.endif
.if defined(KMINCLUDES) && !empty(KMINCLUDES)
(cd ${.CURDIR} ; cp -p ${KMINCLUDES} ${LIBKERN}/arch/${ARCHSUBDIR})
.endif
rm-from-libkern:
for i in ${KSRCS}; do rm -f ${LIBKERN}/$$i; done
.if defined(KMSRCS) && !empty(KMSRCS)
for i in ${KMSRCS}; do rm -f ${LIBKERN}/arch/${ARCHSUBDIR}/$$i; done
.endif
1995-01-30 15:21:41 +03:00
CTAGS?= ctags
2000-01-23 10:10:13 +03:00
realall: ${.OBJDIR}/tags
${.OBJDIR}/tags: ${SRCS}
${CTAGS} -w ${.ALLSRC:M*.c}
egrep "^ENTRY(.*)|^FUNC(.*)|^SYSCALL(.*)" /dev/null ${.ALLSRC:M*.S} | \
sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \
>> ${.TARGET}; sort -o ${.TARGET} ${.TARGET}
FILES= ${.OBJDIR}/tags
FILESNAME= libc.tags
FILESDIR= /var/db
1993-03-21 12:45:37 +03:00
.include <bsd.lib.mk>
# workaround for lib/libc/locale: build singlebyte setlocale() for libc.a,
# multibyte for libc.so. the quirk should be removed when we support
# dlopen() from within statically linked binaries.
CPICFLAGS+= -DDLRUNE