2011-02-14 20:36:03 +01:00
|
|
|
# $NetBSD: Makefile,v 1.143 2010/09/04 12:17:58 ahoka Exp $
|
|
|
|
# @(#)Makefile 8.2 (Berkeley) 2/3/94
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2011-02-15 17:31:16 +01:00
|
|
|
.if defined(__MINIX)
|
2011-02-15 13:19:40 +01:00
|
|
|
.include "minix-config.inc"
|
2011-02-15 17:31:16 +01:00
|
|
|
.endif
|
2011-02-14 20:36:03 +01:00
|
|
|
.include "Makefile.inc"
|
|
|
|
|
|
|
|
LIB= c
|
|
|
|
CPPFLAGS+= -I${.CURDIR}/include -I${.CURDIR}
|
|
|
|
|
|
|
|
LIBCDIR= ${.CURDIR}
|
|
|
|
|
|
|
|
.if exists (${ARCHDIR}/Makefile.inc)
|
|
|
|
.PATH: ${ARCHDIR}
|
|
|
|
.include "${ARCHDIR}/Makefile.inc"
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if exists (${ARCHDIR}/genassym.cf)
|
|
|
|
DPSRCS+= assym.h
|
|
|
|
CLEANFILES+= assym.h assym.h.tmp
|
|
|
|
|
|
|
|
assym.h: ${ARCHDIR}/genassym.cf
|
|
|
|
${_MKTARGET_CREATE}
|
|
|
|
${TOOL_GENASSYM} -- ${CC} ${CFLAGS} \
|
|
|
|
${CPPFLAGS} ${CPPFLAGS.assym.h} ${PROF} \
|
|
|
|
< ${ARCHDIR}/genassym.cf > assym.h.tmp && \
|
|
|
|
mv -f assym.h.tmp assym.h
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# The following controls how to build compatibility code for old NetBSD
|
|
|
|
# binaries. If BUILDCOLD is yes, then we build a separate library; otherwise
|
|
|
|
# we include the code in libc.
|
2011-02-15 17:31:16 +01:00
|
|
|
BUILDCOLD?= no
|
|
|
|
.if "${BUILDCOLD}" == "yes"
|
|
|
|
SUBDIR=compat
|
|
|
|
.include <bsd.subdir.mk>
|
|
|
|
.else
|
Fine grained compatibility with _RENAMEd symbols
The NetBSD libc provides a mechanism to have versions of system calls.
By 'renaming' symbols to a new version, freshly compiled programs will
automatically use the new symbol iff they use the proper header files. The
old, not renamed, version of the symbol will still exist (after being moved
to the compat directory), so old programs can still link.
Since MINIX doesn't support dynamic linking, the whole rename mechanism
doesn't really work for us. However, removing it would create a huge diff
with the current NetBSD libc.
A lot of the compat code relies on things we don't (seem to) have, and
therefore does not get built and linked. This causes trouble for tools like
autoconf, which will fail to find the renamed symbols. For example,
currently select gets renamed to __select50 in libc. Autoconf looks for
'select' and doesn't find it and reports we don't have it. This is where
the compat.S stub comes into play: it generates the old symbols and jumps to
the new symbols. However, as this is done in one object file, all renamed
symbols get linked together, causing binaries to be huge. This patch fixes
that by generating an object file for each renamed symbol.
This patch also makes the MISSING_SYSCALLS more complete and marginally
reduces the diff with NetBSD.
2011-11-28 11:12:44 +01:00
|
|
|
COMPATDIR= ${.CURDIR}/compat-minix
|
|
|
|
.include "${.CURDIR}/compat-minix/Makefile.inc"
|
2011-02-15 17:31:16 +01:00
|
|
|
.endif
|
2011-02-14 20:36:03 +01:00
|
|
|
|
|
|
|
.include "${.CURDIR}/../../common/lib/libc/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/atomic/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/cdb/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/db/Makefile.inc"
|
|
|
|
.if (${CITRUS} == "yes")
|
|
|
|
.include "${.CURDIR}/citrus/Makefile.inc"
|
|
|
|
.endif
|
|
|
|
.include "${.CURDIR}/compat-43/Makefile.inc"
|
2011-02-15 17:31:16 +01:00
|
|
|
.include "${.CURDIR}/dlfcn/Makefile.inc"
|
2011-02-14 20:36:03 +01:00
|
|
|
.include "${.CURDIR}/gdtoa/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/gen/Makefile.inc"
|
2011-02-15 17:31:16 +01:00
|
|
|
.if defined(__MINIX)
|
2011-02-15 13:19:40 +01:00
|
|
|
# gmon needs profil()
|
2011-02-15 17:31:16 +01:00
|
|
|
.else
|
|
|
|
.include "${.CURDIR}/gmon/Makefile.inc"
|
|
|
|
.endif
|
2011-02-14 20:36:03 +01:00
|
|
|
.include "${.CURDIR}/hash/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/iconv/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/inet/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/isc/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/locale/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/md/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/misc/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/net/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/nameser/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/nls/Makefile.inc"
|
|
|
|
.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64")
|
|
|
|
.include "${.CURDIR}/quad/Makefile.inc"
|
|
|
|
.endif
|
|
|
|
.if (${USE_LIBTRE} == "yes")
|
|
|
|
.include "${NETBSDSRCDIR}/external/bsd/tre/Makefile.inc"
|
|
|
|
.else
|
|
|
|
.include "${.CURDIR}/regex/Makefile.inc"
|
|
|
|
.endif
|
|
|
|
.include "${.CURDIR}/resolv/Makefile.inc"
|
2011-02-15 17:31:16 +01:00
|
|
|
.if defined(__MINIX)
|
|
|
|
# RPC needs pollts() and a reserved port allocator.
|
|
|
|
.else
|
|
|
|
.include "${.CURDIR}/rpc/Makefile.inc"
|
|
|
|
.endif
|
2011-02-14 20:36:03 +01:00
|
|
|
.include "${.CURDIR}/ssp/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/stdio/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/stdlib/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/string/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/termios/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/thread-stub/Makefile.inc"
|
|
|
|
.include "${.CURDIR}/time/Makefile.inc"
|
2011-02-15 17:31:16 +01:00
|
|
|
.if defined(__MINIX)
|
2011-02-15 13:19:40 +01:00
|
|
|
.include "${.CURDIR}/sys-minix/Makefile.inc"
|
2011-02-15 17:31:16 +01:00
|
|
|
.else
|
|
|
|
.include "${.CURDIR}/sys/Makefile.inc"
|
|
|
|
.endif
|
2011-02-14 20:36:03 +01:00
|
|
|
.include "${.CURDIR}/uuid/Makefile.inc"
|
|
|
|
.if (${MKYP} != "no")
|
|
|
|
.include "${.CURDIR}/yp/Makefile.inc"
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Remove from SRCS the .c files for any .S files added by the MD makefiles,
|
|
|
|
# also remove from SRCS the .c files for the .S and .c files in NO_SRCS.
|
|
|
|
# Add the .c file for .S files (in both variables) to LSRCS so that the
|
|
|
|
# 'normal' .c file for assembly files is used for the lint librray.
|
|
|
|
#
|
|
|
|
# Usage:
|
|
|
|
# Add .S files to NO_SRSC when another .S file provides the entry points.
|
|
|
|
# Add .c files to NO_SRSC when another .c file provides the entry points.
|
|
|
|
# (lint is run on all .c files in SRCS)
|
|
|
|
|
|
|
|
.for check_file in ${SRCS:M*.S} ${NO_SRCS}
|
|
|
|
unwanted_file := ${SRCS:M${check_file:.S=.c}}
|
|
|
|
.if "${unwanted_file}" != ""
|
|
|
|
SRCS := ${SRCS:N${unwanted_file}}
|
|
|
|
.if "${unwanted_file}" != "${check_file}"
|
|
|
|
LSRCS := ${LSRCS} ${unwanted_file}
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
NLS= C.msg Pig.msg ca.msg cs.msg de.msg es.msg fi.msg fr.msg nl.msg \
|
|
|
|
no.msg pl.msg sk.msg sv.msg
|
|
|
|
|
2011-04-06 17:59:10 +02:00
|
|
|
.if defined(__MINIX)
|
|
|
|
realall:
|
|
|
|
.else
|
2011-02-14 20:36:03 +01:00
|
|
|
realall: tags
|
2011-04-06 17:59:10 +02:00
|
|
|
.endif
|
2011-02-14 20:36:03 +01:00
|
|
|
tags: ${.OBJDIR}/tags
|
|
|
|
${.OBJDIR}/tags: ${SRCS}
|
|
|
|
${_MKTARGET_CREATE}
|
|
|
|
-${TOOL_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}
|
|
|
|
|
2011-04-06 17:59:10 +02:00
|
|
|
.if !defined(__MINIX)
|
2011-02-14 20:36:03 +01:00
|
|
|
FILES= ${.OBJDIR}/tags
|
|
|
|
FILESNAME= libc.tags
|
|
|
|
FILESDIR= /var/db
|
2011-04-06 17:59:10 +02:00
|
|
|
.endif
|
2011-02-14 20:36:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
# workaround for I18N stuffs: build singlebyte setlocale() for libc.a,
|
|
|
|
# multibyte for libc.so. the quirk should be removed when we support
|
|
|
|
# dlopen() from within statically linked binaries.
|
|
|
|
.if (${CITRUS} == "yes")
|
|
|
|
CSHLIBFLAGS+= -D_I18N_DYNAMIC
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.include <bsd.lib.mk>
|
|
|
|
|
|
|
|
# force the dynamic linker to initialize libc first
|
|
|
|
SHLIB_SHFLAGS+= -Wl,-z,initfirst
|
|
|
|
|
2011-06-27 05:16:29 +02:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
SUBDIR+= pkgconfig
|
|
|
|
.include <bsd.subdir.mk>
|
|
|
|
|