2018-05-01 22:59:42 +03:00
|
|
|
# $NetBSD: Makefile,v 1.83 2018/05/01 19:59:46 christos Exp $
|
2001-12-12 00:17:56 +03:00
|
|
|
|
|
|
|
HOSTLIB= nbcompat
|
|
|
|
|
2018-05-01 22:59:42 +03:00
|
|
|
.include <bsd.hostinit.mk>
|
2012-12-10 04:34:56 +04:00
|
|
|
|
2012-06-04 23:06:45 +04:00
|
|
|
SRCS= atoll.c basename.c cdbr.c cdbw.c dirname.c \
|
2013-03-05 20:26:41 +04:00
|
|
|
dprintf.c fgetln.c flock.c fparseln.c fpurge.c \
|
2012-06-04 22:53:02 +04:00
|
|
|
getcap.c getline.c getmode.c getopt_long.c gettemp.c \
|
2011-11-03 23:30:05 +04:00
|
|
|
heapsort.c \
|
2005-09-25 00:52:22 +04:00
|
|
|
issetugid.c lchflags.c lchmod.c lchown.c libyywrap.c \
|
2010-02-03 18:34:37 +03:00
|
|
|
md2.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c \
|
|
|
|
mi_vector_hash.c mkdtemp.c \
|
2003-03-14 06:38:42 +03:00
|
|
|
mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \
|
2007-09-28 13:12:49 +04:00
|
|
|
pw_scan.c \
|
2015-07-26 17:01:53 +03:00
|
|
|
raise_default_signal.c reallocarr.c rmd160.c rmd160hl.c \
|
2016-03-06 13:19:01 +03:00
|
|
|
regcomp.c regerror.c regexec.c regfree.c \
|
2007-09-28 13:12:49 +04:00
|
|
|
setenv.c setgroupent.c \
|
2005-08-26 19:59:00 +04:00
|
|
|
setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \
|
2013-08-07 02:04:25 +04:00
|
|
|
sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \
|
2014-01-09 15:31:12 +04:00
|
|
|
stat_flags.c strlcat.c strlcpy.c strmode.c \
|
|
|
|
strndup.c strnlen.c \
|
2013-08-07 02:04:25 +04:00
|
|
|
strsep.c strsuftoll.c strtoll.c \
|
2015-01-18 21:09:10 +03:00
|
|
|
strtoi.c strtou.c \
|
2014-01-16 21:24:56 +04:00
|
|
|
unvis.c vis.c err.c errx.c errc.c verr.c verrx.c verrc.c \
|
|
|
|
vwarn.c vwarnx.c vwarnc.c warn.c warnx.c warnc.c \
|
|
|
|
fts.c glob.c efun.c
|
2002-01-29 13:20:28 +03:00
|
|
|
|
2003-03-13 08:00:28 +03:00
|
|
|
BUILD_OSTYPE!= uname -s
|
|
|
|
|
|
|
|
# Disable use of pre-compiled headers on Darwin.
|
|
|
|
.if ${BUILD_OSTYPE} == "Darwin"
|
|
|
|
CPPFLAGS+= -no-cpp-precomp
|
|
|
|
.endif
|
|
|
|
|
2002-01-29 13:20:28 +03:00
|
|
|
# -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and
|
|
|
|
# other file ops, on many systems, without changing function names.
|
|
|
|
|
2006-10-29 09:56:01 +03:00
|
|
|
CPPFLAGS+= -I. -I./include -I${.CURDIR} -I${.CURDIR}/sys \
|
|
|
|
-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
|
2002-01-21 23:04:36 +03:00
|
|
|
|
2012-06-04 01:02:50 +04:00
|
|
|
.PATH: ${.CURDIR}/../../lib/libc/cdb \
|
|
|
|
${.CURDIR}/../../lib/libc/gen \
|
2002-03-31 16:58:54 +04:00
|
|
|
${.CURDIR}/../../lib/libc/hash \
|
2005-09-25 00:52:22 +04:00
|
|
|
${.CURDIR}/../../lib/libc/hash/md2 \
|
2005-09-24 23:06:20 +04:00
|
|
|
${.CURDIR}/../../lib/libc/hash/md5 \
|
|
|
|
${.CURDIR}/../../lib/libc/hash/rmd160 \
|
|
|
|
${.CURDIR}/../../lib/libc/hash/sha1 \
|
2005-08-26 19:59:00 +04:00
|
|
|
${.CURDIR}/../../lib/libc/hash/sha2 \
|
2002-03-31 16:58:54 +04:00
|
|
|
${.CURDIR}/../../lib/libc/md \
|
2016-03-06 13:19:01 +03:00
|
|
|
${.CURDIR}/../../lib/libc/regex \
|
2002-09-14 08:30:27 +04:00
|
|
|
${.CURDIR}/../../lib/libc/stdio \
|
2002-01-29 13:20:28 +03:00
|
|
|
${.CURDIR}/../../lib/libc/stdlib \
|
2002-01-22 02:35:14 +03:00
|
|
|
${.CURDIR}/../../lib/libc/string \
|
2006-08-26 22:26:14 +04:00
|
|
|
${.CURDIR}/../../lib/libutil \
|
2013-12-11 05:24:08 +04:00
|
|
|
${.CURDIR}/../../common/lib/libc/cdb \
|
2005-12-20 23:39:15 +03:00
|
|
|
${.CURDIR}/../../common/lib/libc/string \
|
2006-10-28 02:25:26 +04:00
|
|
|
${.CURDIR}/../../common/lib/libc/hash/rmd160 \
|
2005-12-20 23:39:15 +03:00
|
|
|
${.CURDIR}/../../common/lib/libc/hash/sha1 \
|
2006-10-28 02:25:26 +04:00
|
|
|
${.CURDIR}/../../common/lib/libc/hash/sha2 \
|
2005-12-20 23:39:15 +03:00
|
|
|
${.CURDIR}/../../common/lib/libc/md \
|
2006-10-08 08:31:55 +04:00
|
|
|
${.CURDIR}/../../common/lib/libc/stdlib \
|
2013-08-07 02:04:25 +04:00
|
|
|
${.CURDIR}/../../common/lib/libutil \
|
2016-01-09 20:40:37 +03:00
|
|
|
${.CURDIR}/../../external/bsd/flex/dist/src
|
2001-12-12 00:17:56 +03:00
|
|
|
|
2002-01-29 13:20:28 +03:00
|
|
|
DPSRCS+= defs.mk
|
2006-05-20 04:23:39 +04:00
|
|
|
CLEANFILES+= config.log config.status configure.lineno *.stamp
|
2012-12-02 16:34:51 +04:00
|
|
|
CLEANDIRFILES+= defs.mk config.cache confdefs.h
|
2002-01-21 23:04:36 +03:00
|
|
|
|
|
|
|
# Get components of Berkeley DB.
|
|
|
|
_CURDIR:= ${.CURDIR}
|
|
|
|
.CURDIR:= ${_CURDIR}/../../lib/libc
|
|
|
|
.include "${.CURDIR}/db/Makefile.inc"
|
|
|
|
.CURDIR:= ${_CURDIR}
|
|
|
|
|
2010-02-03 18:34:37 +03:00
|
|
|
SRCS:= ${SRCS:M*.c}
|
2001-12-12 00:17:56 +03:00
|
|
|
|
2006-02-11 13:35:29 +03:00
|
|
|
config.cache: include/.stamp configure nbtool_config.h.in defs.mk.in
|
2002-12-05 02:27:54 +03:00
|
|
|
rm -f ${.TARGET}
|
2002-01-21 23:04:36 +03:00
|
|
|
CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} LDFLAGS=${HOST_LDFLAGS:Q} \
|
2003-10-26 10:25:33 +03:00
|
|
|
${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache
|
2002-12-05 02:27:54 +03:00
|
|
|
|
|
|
|
defs.mk: config.cache
|
|
|
|
@touch ${.TARGET}
|
2001-12-12 00:17:56 +03:00
|
|
|
|
2012-12-02 16:34:51 +04:00
|
|
|
INCFILES= nbtool_config.h
|
2012-12-10 03:18:30 +04:00
|
|
|
INCSUBDIRS= sys machine rpc arpa
|
2012-12-02 16:34:51 +04:00
|
|
|
CLEANDIRFILES+= ${INCFILES}
|
|
|
|
|
|
|
|
# CLEANDIRFILES may not contain directory names
|
|
|
|
cleandir: cleandir.include
|
|
|
|
cleandir.include: .PHONY
|
|
|
|
rm -rf include
|
|
|
|
|
2002-04-19 01:15:08 +04:00
|
|
|
include/.stamp:
|
2012-12-02 16:34:51 +04:00
|
|
|
mkdir -p ${INCSUBDIRS:@d@ include/$d @}
|
2002-12-05 02:27:54 +03:00
|
|
|
@touch ${.TARGET}
|
2002-01-29 13:20:28 +03:00
|
|
|
|
2012-12-02 16:34:51 +04:00
|
|
|
# Install rules
|
|
|
|
|
|
|
|
HOST_LIBDIR= ${TOOLDIR}/lib
|
|
|
|
HOST_INCSDIR= ${TOOLDIR}/include
|
2012-12-10 03:18:30 +04:00
|
|
|
HOST_SHAREDIR= ${TOOLDIR}/share
|
2012-12-02 16:34:51 +04:00
|
|
|
|
2012-12-09 23:15:48 +04:00
|
|
|
install: .PHONY install.lib includes install.defs.mk
|
2012-12-02 16:34:51 +04:00
|
|
|
|
|
|
|
# Install lib${HOSTLIB}.a in ${TOOLDIR}/lib
|
|
|
|
install.lib: .PHONY ${HOST_LIBDIR}/lib${HOSTLIB}.a
|
|
|
|
${HOST_LIBDIR}/lib${HOSTLIB}.a: lib${HOSTLIB}.a
|
|
|
|
${_MKTARGET_INSTALL}
|
|
|
|
${HOST_INSTALL_DIR} ${HOST_LIBDIR}
|
|
|
|
${HOST_INSTALL_FILE} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}
|
|
|
|
|
2012-12-09 23:15:48 +04:00
|
|
|
.for _f in ${INCFILES}
|
|
|
|
HOST_INCINSTFILES+= ${HOST_INCSDIR}/compat/${_f}
|
|
|
|
${HOST_INCSDIR}/compat/${_f}: ${_f}
|
|
|
|
${_MKTARGET_INSTALL}
|
|
|
|
${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET}
|
|
|
|
.endfor
|
|
|
|
|
2012-12-02 16:34:51 +04:00
|
|
|
.for _d in ${INCSUBDIRS}
|
2012-12-09 23:15:48 +04:00
|
|
|
HOST_INCINSTDIRS+= ${HOST_INCSDIR}/compat/${_d}
|
|
|
|
${HOST_INCSDIR}/compat/${_d}:
|
|
|
|
${_MKTARGET_INSTALL}
|
|
|
|
${HOST_INSTALL_DIR} ${.TARGET}
|
2012-12-02 16:34:51 +04:00
|
|
|
.endfor
|
2012-12-09 23:15:48 +04:00
|
|
|
|
|
|
|
# Install include files in ${TOOLDIR}/include/compat
|
|
|
|
includes: .PHONY ${HOST_INCINSTDIRS} .WAIT ${HOST_INCINSTFILES}
|
2015-09-17 17:25:43 +03:00
|
|
|
@(cd include && find . -name '*.h' -print | while read f ; do \
|
2012-12-10 03:18:30 +04:00
|
|
|
${HOST_INSTALL_FILE} $$f ${HOST_INCSDIR}/compat/$$f ; \
|
|
|
|
done)
|
|
|
|
|
2012-12-02 16:34:51 +04:00
|
|
|
|
|
|
|
# Install defs.mk in ${TOOLDIR}/share/compat
|
|
|
|
install.defs.mk: .PHONY ${HOST_SHAREDIR}/compat/defs.mk
|
|
|
|
${HOST_SHAREDIR}/compat/defs.mk: defs.mk
|
|
|
|
${_MKTARGET_INSTALL}
|
|
|
|
${HOST_INSTALL_DIR} ${HOST_SHAREDIR}
|
|
|
|
${HOST_INSTALL_DIR} ${HOST_SHAREDIR}/compat
|
|
|
|
${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET}
|
|
|
|
|
|
|
|
# bsd.hostlib.mk wants HOST_CPPFLAGS, not CPPFLAGS
|
2002-01-29 13:20:28 +03:00
|
|
|
|
|
|
|
HOST_CPPFLAGS:= ${CPPFLAGS}
|
|
|
|
CPPFLAGS:= # empty
|
|
|
|
|
2001-12-12 00:17:56 +03:00
|
|
|
.include <bsd.hostlib.mk>
|
2012-12-02 16:19:34 +04:00
|
|
|
|
|
|
|
# Use uninstalled copy of host-mkdep
|
|
|
|
HOST_MKDEP_OBJ!= cd ${.CURDIR}/../host-mkdep && ${PRINTOBJDIR}
|
|
|
|
HOST_MKDEP= ${HOST_MKDEP_OBJ}/host-mkdep
|
|
|
|
MKDEP= ${HOST_MKDEP}
|
|
|
|
|
2012-12-02 16:34:51 +04:00
|
|
|
# Use uninstalled copy of the install program
|
|
|
|
INSTALL_OBJ!= cd ${NETBSDSRCDIR}/tools/binstall && ${PRINTOBJDIR}
|
|
|
|
INSTALL= ${INSTALL_OBJ}/xinstall
|
|
|
|
|
2012-12-02 16:19:34 +04:00
|
|
|
# Run "${TOOLDIR}/bin/nbmake-${MACHINE} regen" by hand after editing
|
|
|
|
# configure.ac. See more detailed instructions in configure.ac.
|
|
|
|
regen:
|
|
|
|
cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf
|
|
|
|
cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoheader
|