1 1.54.6.4 yamt # $NetBSD: Makefile,v 1.54.6.4 2013/01/16 05:34:03 yamt Exp $ 2 1.1 tv 3 1.1 tv HOSTLIB= nbcompat 4 1.1 tv 5 1.54.6.4 yamt .include <bsd.own.mk> 6 1.54.6.4 yamt 7 1.54.6.3 yamt SRCS= atoll.c basename.c cdbr.c cdbw.c dirname.c \ 8 1.54.6.3 yamt fgetln.c flock.c fparseln.c fpurge.c \ 9 1.54.6.3 yamt getcap.c getline.c getmode.c getopt_long.c gettemp.c \ 10 1.54.6.1 yamt heapsort.c \ 11 1.39 elad issetugid.c lchflags.c lchmod.c lchown.c libyywrap.c \ 12 1.54 roy md2.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c \ 13 1.54 roy mi_vector_hash.c mkdtemp.c \ 14 1.22 thorpej mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \ 15 1.51 lukem pw_scan.c \ 16 1.51 lukem raise_default_signal.c rmd160.c rmd160hl.c \ 17 1.51 lukem setenv.c setgroupent.c \ 18 1.34 elad setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \ 19 1.48 he sha256hl.c sha384hl.c sha512hl.c snprintf.c stat_flags.c \ 20 1.49 nakayama strlcat.c strlcpy.c strmode.c strndup.c strsep.c strsuftoll.c \ 21 1.36 christos strtoll.c unvis.c vis.c err.c errx.c verr.c verrx.c \ 22 1.44 christos vwarn.c vwarnx.c warn.c warnx.c fts.c glob.c efun.c 23 1.21 thorpej 24 1.21 thorpej BUILD_OSTYPE!= uname -s 25 1.21 thorpej 26 1.21 thorpej # Disable use of pre-compiled headers on Darwin. 27 1.21 thorpej .if ${BUILD_OSTYPE} == "Darwin" 28 1.21 thorpej CPPFLAGS+= -no-cpp-precomp 29 1.21 thorpej .endif 30 1.6 tv 31 1.6 tv # -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and 32 1.6 tv # other file ops, on many systems, without changing function names. 33 1.6 tv 34 1.47 dogcow CPPFLAGS+= -I. -I./include -I${.CURDIR} -I${.CURDIR}/sys \ 35 1.47 dogcow -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 36 1.3 tv 37 1.54.6.3 yamt .PATH: ${.CURDIR}/../../lib/libc/cdb \ 38 1.54.6.3 yamt ${.CURDIR}/../../lib/libc/gen \ 39 1.9 bjh21 ${.CURDIR}/../../lib/libc/hash \ 40 1.39 elad ${.CURDIR}/../../lib/libc/hash/md2 \ 41 1.38 elad ${.CURDIR}/../../lib/libc/hash/md5 \ 42 1.38 elad ${.CURDIR}/../../lib/libc/hash/rmd160 \ 43 1.38 elad ${.CURDIR}/../../lib/libc/hash/sha1 \ 44 1.34 elad ${.CURDIR}/../../lib/libc/hash/sha2 \ 45 1.9 bjh21 ${.CURDIR}/../../lib/libc/md \ 46 1.15 thorpej ${.CURDIR}/../../lib/libc/stdio \ 47 1.6 tv ${.CURDIR}/../../lib/libc/stdlib \ 48 1.4 lukem ${.CURDIR}/../../lib/libc/string \ 49 1.44 christos ${.CURDIR}/../../lib/libutil \ 50 1.40 christos ${.CURDIR}/../../common/lib/libc/string \ 51 1.46 mrg ${.CURDIR}/../../common/lib/libc/hash/rmd160 \ 52 1.40 christos ${.CURDIR}/../../common/lib/libc/hash/sha1 \ 53 1.46 mrg ${.CURDIR}/../../common/lib/libc/hash/sha2 \ 54 1.40 christos ${.CURDIR}/../../common/lib/libc/md \ 55 1.45 thorpej ${.CURDIR}/../../common/lib/libc/stdlib \ 56 1.54.6.2 yamt ${.CURDIR}/../../external/bsd/flex/dist 57 1.1 tv 58 1.6 tv DPSRCS+= defs.mk 59 1.43 christos CLEANFILES+= config.log config.status configure.lineno *.stamp 60 1.54.6.4 yamt CLEANDIRFILES+= defs.mk config.cache confdefs.h 61 1.3 tv 62 1.3 tv # Get components of Berkeley DB. 63 1.3 tv _CURDIR:= ${.CURDIR} 64 1.3 tv .CURDIR:= ${_CURDIR}/../../lib/libc 65 1.3 tv .include "${.CURDIR}/db/Makefile.inc" 66 1.3 tv .CURDIR:= ${_CURDIR} 67 1.3 tv 68 1.54 roy SRCS:= ${SRCS:M*.c} 69 1.1 tv 70 1.42 wiz config.cache: include/.stamp configure nbtool_config.h.in defs.mk.in 71 1.20 lukem rm -f ${.TARGET} 72 1.3 tv CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} LDFLAGS=${HOST_LDFLAGS:Q} \ 73 1.27 lukem ${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache 74 1.20 lukem 75 1.20 lukem defs.mk: config.cache 76 1.20 lukem @touch ${.TARGET} 77 1.1 tv 78 1.54.6.4 yamt INCFILES= nbtool_config.h 79 1.54.6.4 yamt INCSUBDIRS= sys machine rpc arpa 80 1.54.6.4 yamt CLEANDIRFILES+= ${INCFILES} 81 1.54.6.4 yamt 82 1.54.6.4 yamt # CLEANDIRFILES may not contain directory names 83 1.54.6.4 yamt cleandir: cleandir.include 84 1.54.6.4 yamt cleandir.include: .PHONY 85 1.54.6.4 yamt rm -rf include 86 1.6 tv 87 1.13 tv include/.stamp: 88 1.54.6.4 yamt mkdir -p ${INCSUBDIRS:@d@ include/$d @} 89 1.20 lukem @touch ${.TARGET} 90 1.6 tv 91 1.54.6.4 yamt # Install rules 92 1.54.6.4 yamt 93 1.54.6.4 yamt HOST_LIBDIR= ${TOOLDIR}/lib 94 1.54.6.4 yamt HOST_INCSDIR= ${TOOLDIR}/include 95 1.54.6.4 yamt HOST_SHAREDIR= ${TOOLDIR}/share 96 1.54.6.4 yamt 97 1.54.6.4 yamt install: .PHONY install.lib includes install.defs.mk 98 1.54.6.4 yamt 99 1.54.6.4 yamt # Install lib${HOSTLIB}.a in ${TOOLDIR}/lib 100 1.54.6.4 yamt install.lib: .PHONY ${HOST_LIBDIR}/lib${HOSTLIB}.a 101 1.54.6.4 yamt ${HOST_LIBDIR}/lib${HOSTLIB}.a: lib${HOSTLIB}.a 102 1.54.6.4 yamt ${_MKTARGET_INSTALL} 103 1.54.6.4 yamt ${HOST_INSTALL_DIR} ${HOST_LIBDIR} 104 1.54.6.4 yamt ${HOST_INSTALL_FILE} -m ${LIBMODE} ${.ALLSRC} ${.TARGET} 105 1.54.6.4 yamt 106 1.54.6.4 yamt .for _f in ${INCFILES} 107 1.54.6.4 yamt HOST_INCINSTFILES+= ${HOST_INCSDIR}/compat/${_f} 108 1.54.6.4 yamt ${HOST_INCSDIR}/compat/${_f}: ${_f} 109 1.54.6.4 yamt ${_MKTARGET_INSTALL} 110 1.54.6.4 yamt ${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET} 111 1.54.6.4 yamt .endfor 112 1.54.6.4 yamt 113 1.54.6.4 yamt .for _d in ${INCSUBDIRS} 114 1.54.6.4 yamt HOST_INCINSTDIRS+= ${HOST_INCSDIR}/compat/${_d} 115 1.54.6.4 yamt ${HOST_INCSDIR}/compat/${_d}: 116 1.54.6.4 yamt ${_MKTARGET_INSTALL} 117 1.54.6.4 yamt ${HOST_INSTALL_DIR} ${.TARGET} 118 1.54.6.4 yamt .endfor 119 1.54.6.4 yamt 120 1.54.6.4 yamt # Install include files in ${TOOLDIR}/include/compat 121 1.54.6.4 yamt includes: .PHONY ${HOST_INCINSTDIRS} .WAIT ${HOST_INCINSTFILES} 122 1.54.6.4 yamt @(cd include && find . -name '*.h' -print | while read f ; do \ 123 1.54.6.4 yamt ${HOST_INSTALL_FILE} $$f ${HOST_INCSDIR}/compat/$$f ; \ 124 1.54.6.4 yamt done) 125 1.54.6.4 yamt 126 1.54.6.4 yamt 127 1.54.6.4 yamt # Install defs.mk in ${TOOLDIR}/share/compat 128 1.54.6.4 yamt install.defs.mk: .PHONY ${HOST_SHAREDIR}/compat/defs.mk 129 1.54.6.4 yamt ${HOST_SHAREDIR}/compat/defs.mk: defs.mk 130 1.54.6.4 yamt ${_MKTARGET_INSTALL} 131 1.54.6.4 yamt ${HOST_INSTALL_DIR} ${HOST_SHAREDIR} 132 1.54.6.4 yamt ${HOST_INSTALL_DIR} ${HOST_SHAREDIR}/compat 133 1.54.6.4 yamt ${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET} 134 1.54.6.4 yamt 135 1.54.6.4 yamt # bsd.hostlib.mk wants HOST_CPPFLAGS, not CPPFLAGS 136 1.6 tv 137 1.6 tv HOST_CPPFLAGS:= ${CPPFLAGS} 138 1.6 tv CPPFLAGS:= # empty 139 1.1 tv 140 1.1 tv .include <bsd.hostlib.mk> 141 1.54.6.4 yamt 142 1.54.6.4 yamt # Use uninstalled copy of host-mkdep 143 1.54.6.4 yamt HOST_MKDEP_OBJ!= cd ${.CURDIR}/../host-mkdep && ${PRINTOBJDIR} 144 1.54.6.4 yamt HOST_MKDEP= ${HOST_MKDEP_OBJ}/host-mkdep 145 1.54.6.4 yamt MKDEP= ${HOST_MKDEP} 146 1.54.6.4 yamt 147 1.54.6.4 yamt # Use uninstalled copy of the install program 148 1.54.6.4 yamt INSTALL_OBJ!= cd ${NETBSDSRCDIR}/tools/binstall && ${PRINTOBJDIR} 149 1.54.6.4 yamt INSTALL= ${INSTALL_OBJ}/xinstall 150 1.54.6.4 yamt 151 1.54.6.4 yamt # Run "${TOOLDIR}/bin/nbmake-${MACHINE} regen" by hand after editing 152 1.54.6.4 yamt # configure.ac. See more detailed instructions in configure.ac. 153 1.54.6.4 yamt regen: 154 1.54.6.4 yamt cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf 155 1.54.6.4 yamt cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoheader 156