11.96Sroy# $NetBSD: Makefile,v 1.96 2025/10/22 12:34:00 roy Exp $ 21.67Schristos 31.67SchristosHOSTLIB= nbcompat 41.63Schristos 51.83Schristos.include <bsd.hostinit.mk> 61.1Stv 71.59SjoergSRCS= atoll.c basename.c cdbr.c cdbw.c dirname.c \ 81.68Schristos dprintf.c fgetln.c flock.c fparseln.c fpurge.c \ 91.58Sjoerg getcap.c getline.c getmode.c getopt_long.c gettemp.c \ 101.86Schristos heapsort.c getsubopt.c \ 111.39Selad issetugid.c lchflags.c lchmod.c lchown.c libyywrap.c \ 121.54Sroy md2.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c \ 131.95Schristos mi_vector_hash.c mkdtemp.c mkstemps.c \ 141.22Sthorpej mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \ 151.51Slukem pw_scan.c \ 161.96Sroy raise_default_signal.c rbtree.c reallocarr.c reallocarray.c \ 171.89Schristos rmd160.c rmd160hl.c \ 181.81Saymeric regcomp.c regerror.c regexec.c regfree.c \ 191.51Slukem setenv.c setgroupent.c \ 201.34Selad setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \ 211.93Sjakllsch sha256hl.c sha384hl.c sha512hl.c \ 221.93Sjakllsch shquote.c \ 231.93Sjakllsch snprintb.c snprintf.c \ 241.71Sapb stat_flags.c strlcat.c strlcpy.c strmode.c \ 251.95Schristos strcasecmp.c strncasecmp.c strcasestr.c strndup.c strnlen.c \ 261.95Schristos strsep.c strsuftoll.c strtonum.c strtoll.c \ 271.73Schristos strtoi.c strtou.c \ 281.72Schristos unvis.c vis.c err.c errx.c errc.c verr.c verrx.c verrc.c \ 291.72Schristos vwarn.c vwarnx.c vwarnc.c warn.c warnx.c warnc.c \ 301.72Schristos fts.c glob.c efun.c 311.21Sthorpej 321.21SthorpejBUILD_OSTYPE!= uname -s 331.21Sthorpej 341.21Sthorpej# Disable use of pre-compiled headers on Darwin. 351.21Sthorpej.if ${BUILD_OSTYPE} == "Darwin" 361.90SchristosHOST_CPPFLAGS+= -no-cpp-precomp 371.21Sthorpej.endif 381.6Stv 391.6Stv# -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and 401.6Stv# other file ops, on many systems, without changing function names. 411.6Stv 421.90SchristosHOST_CPPFLAGS+= -I. -I./include -I${.CURDIR} -I${.CURDIR}/sys \ 431.47Sdogcow -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 441.3Stv 451.57Sjoerg.PATH: ${.CURDIR}/../../lib/libc/cdb \ 461.57Sjoerg ${.CURDIR}/../../lib/libc/gen \ 471.9Sbjh21 ${.CURDIR}/../../lib/libc/hash \ 481.39Selad ${.CURDIR}/../../lib/libc/hash/md2 \ 491.38Selad ${.CURDIR}/../../lib/libc/hash/md5 \ 501.38Selad ${.CURDIR}/../../lib/libc/hash/rmd160 \ 511.38Selad ${.CURDIR}/../../lib/libc/hash/sha1 \ 521.34Selad ${.CURDIR}/../../lib/libc/hash/sha2 \ 531.9Sbjh21 ${.CURDIR}/../../lib/libc/md \ 541.81Saymeric ${.CURDIR}/../../lib/libc/regex \ 551.15Sthorpej ${.CURDIR}/../../lib/libc/stdio \ 561.6Stv ${.CURDIR}/../../lib/libc/stdlib \ 571.4Slukem ${.CURDIR}/../../lib/libc/string \ 581.44Schristos ${.CURDIR}/../../lib/libutil \ 591.70Sjoerg ${.CURDIR}/../../common/lib/libc/cdb \ 601.87Sthorpej ${.CURDIR}/../../common/lib/libc/gen \ 611.40Schristos ${.CURDIR}/../../common/lib/libc/string \ 621.46Smrg ${.CURDIR}/../../common/lib/libc/hash/rmd160 \ 631.40Schristos ${.CURDIR}/../../common/lib/libc/hash/sha1 \ 641.46Smrg ${.CURDIR}/../../common/lib/libc/hash/sha2 \ 651.40Schristos ${.CURDIR}/../../common/lib/libc/md \ 661.45Sthorpej ${.CURDIR}/../../common/lib/libc/stdlib \ 671.69Sapb ${.CURDIR}/../../common/lib/libutil \ 681.77Schristos ${.CURDIR}/../../external/bsd/flex/dist/src 691.1Stv 701.6StvDPSRCS+= defs.mk 711.43SchristosCLEANFILES+= config.log config.status configure.lineno *.stamp 721.94SriastradCLEANFILES+= config.cache.tmp 731.61SapbCLEANDIRFILES+= defs.mk config.cache confdefs.h 741.3Stv 751.3Stv# Get components of Berkeley DB. 761.3Stv_CURDIR:= ${.CURDIR} 771.3Stv.CURDIR:= ${_CURDIR}/../../lib/libc 781.3Stv.include "${.CURDIR}/db/Makefile.inc" 791.3Stv.CURDIR:= ${_CURDIR} 801.3Stv 811.54SroySRCS:= ${SRCS:M*.c} 821.1Stv 831.88Slukem.if ${MAKEVERBOSE} == 0 841.88SlukemCONFIGURE_ARGS+=--silent 851.88Slukem.endif 861.88Slukem 871.42Swizconfig.cache: include/.stamp configure nbtool_config.h.in defs.mk.in 881.94Sriastrad rm -f ${.TARGET}.tmp ${.TARGET} 891.90Schristos CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} CPPFLAGS=${HOST_CPPFLAGS:Q} \ 901.90Schristos LDFLAGS=${HOST_LDFLAGS:Q} \ 911.94Sriastrad ${HOST_SH} ${.CURDIR}/configure \ 921.94Sriastrad --cache-file=${.TARGET}.tmp \ 931.94Sriastrad ${CONFIGURE_ARGS} 941.94Sriastrad mv -f ${.TARGET}.tmp ${.TARGET} 951.20Slukem 961.20Slukemdefs.mk: config.cache 971.20Slukem @touch ${.TARGET} 981.1Stv 991.61SapbINCFILES= nbtool_config.h 1001.66SchristosINCSUBDIRS= sys machine rpc arpa 1011.61SapbCLEANDIRFILES+= ${INCFILES} 1021.61Sapb 1031.61Sapb# CLEANDIRFILES may not contain directory names 1041.61Sapbcleandir: cleandir.include 1051.61Sapbcleandir.include: .PHONY 1061.61Sapb rm -rf include 1071.61Sapb 1081.13Stvinclude/.stamp: 1091.61Sapb mkdir -p ${INCSUBDIRS:@d@ include/$d @} 1101.20Slukem @touch ${.TARGET} 1111.6Stv 1121.61Sapb# Install rules 1131.61Sapb 1141.61SapbHOST_LIBDIR= ${TOOLDIR}/lib 1151.61SapbHOST_INCSDIR= ${TOOLDIR}/include 1161.66SchristosHOST_SHAREDIR= ${TOOLDIR}/share 1171.61Sapb 1181.64Schristosinstall: .PHONY install.lib includes install.defs.mk 1191.61Sapb 1201.61Sapb# Install lib${HOSTLIB}.a in ${TOOLDIR}/lib 1211.61Sapbinstall.lib: .PHONY ${HOST_LIBDIR}/lib${HOSTLIB}.a 1221.61Sapb${HOST_LIBDIR}/lib${HOSTLIB}.a: lib${HOSTLIB}.a 1231.61Sapb ${_MKTARGET_INSTALL} 1241.61Sapb ${HOST_INSTALL_DIR} ${HOST_LIBDIR} 1251.61Sapb ${HOST_INSTALL_FILE} -m ${LIBMODE} ${.ALLSRC} ${.TARGET} 1261.61Sapb 1271.64Schristos.for _f in ${INCFILES} 1281.64SchristosHOST_INCINSTFILES+= ${HOST_INCSDIR}/compat/${_f} 1291.64Schristos${HOST_INCSDIR}/compat/${_f}: ${_f} 1301.64Schristos ${_MKTARGET_INSTALL} 1311.64Schristos ${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET} 1321.64Schristos.endfor 1331.64Schristos 1341.61Sapb.for _d in ${INCSUBDIRS} 1351.64SchristosHOST_INCINSTDIRS+= ${HOST_INCSDIR}/compat/${_d} 1361.64Schristos${HOST_INCSDIR}/compat/${_d}: 1371.64Schristos ${_MKTARGET_INSTALL} 1381.64Schristos ${HOST_INSTALL_DIR} ${.TARGET} 1391.61Sapb.endfor 1401.64Schristos 1411.64Schristos# Install include files in ${TOOLDIR}/include/compat 1421.64Schristosincludes: .PHONY ${HOST_INCINSTDIRS} .WAIT ${HOST_INCINSTFILES} 1431.76Schristos @(cd include && find . -name '*.h' -print | while read f ; do \ 1441.66Schristos ${HOST_INSTALL_FILE} $$f ${HOST_INCSDIR}/compat/$$f ; \ 1451.66Schristos done) 1461.66Schristos 1471.61Sapb 1481.61Sapb# Install defs.mk in ${TOOLDIR}/share/compat 1491.61Sapbinstall.defs.mk: .PHONY ${HOST_SHAREDIR}/compat/defs.mk 1501.61Sapb${HOST_SHAREDIR}/compat/defs.mk: defs.mk 1511.61Sapb ${_MKTARGET_INSTALL} 1521.61Sapb ${HOST_INSTALL_DIR} ${HOST_SHAREDIR} 1531.61Sapb ${HOST_INSTALL_DIR} ${HOST_SHAREDIR}/compat 1541.61Sapb ${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET} 1551.61Sapb 1561.61Sapb# bsd.hostlib.mk wants HOST_CPPFLAGS, not CPPFLAGS 1571.6Stv 1581.90SchristosHOST_CPPFLAGS+= ${CPPFLAGS} 1591.1Stv 1601.1Stv.include <bsd.hostlib.mk> 1611.60Sapb 1621.60Sapb# Use uninstalled copy of host-mkdep 1631.60SapbHOST_MKDEP_OBJ!= cd ${.CURDIR}/../host-mkdep && ${PRINTOBJDIR} 1641.60SapbHOST_MKDEP= ${HOST_MKDEP_OBJ}/host-mkdep 1651.60SapbMKDEP= ${HOST_MKDEP} 1661.60Sapb 1671.61Sapb# Use uninstalled copy of the install program 1681.61SapbINSTALL_OBJ!= cd ${NETBSDSRCDIR}/tools/binstall && ${PRINTOBJDIR} 1691.61SapbINSTALL= ${INSTALL_OBJ}/xinstall 1701.61Sapb 1711.60Sapb# Run "${TOOLDIR}/bin/nbmake-${MACHINE} regen" by hand after editing 1721.60Sapb# configure.ac. See more detailed instructions in configure.ac. 1731.60Sapbregen: 1741.92Slukem ${_MKMSG_REGEN} configure nbtool_config.h.in 1751.92Slukem cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoreconf \ 1761.92Slukem ${${MAKEVERBOSE} >= 2 :? -v :} 177