1 # $NetBSD: Makefile,v 1.60 2012/12/02 12:19:34 apb Exp $ 2 3 HOSTLIB= nbcompat 4 5 SRCS= atoll.c basename.c cdbr.c cdbw.c dirname.c \ 6 fgetln.c flock.c fparseln.c fpurge.c \ 7 getcap.c getline.c getmode.c getopt_long.c gettemp.c \ 8 heapsort.c \ 9 issetugid.c lchflags.c lchmod.c lchown.c libyywrap.c \ 10 md2.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c \ 11 mi_vector_hash.c mkdtemp.c \ 12 mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \ 13 pw_scan.c \ 14 raise_default_signal.c rmd160.c rmd160hl.c \ 15 setenv.c setgroupent.c \ 16 setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \ 17 sha256hl.c sha384hl.c sha512hl.c snprintf.c stat_flags.c \ 18 strlcat.c strlcpy.c strmode.c strndup.c strsep.c strsuftoll.c \ 19 strtoll.c unvis.c vis.c err.c errx.c verr.c verrx.c \ 20 vwarn.c vwarnx.c warn.c warnx.c fts.c glob.c efun.c 21 22 BUILD_OSTYPE!= uname -s 23 24 # Disable use of pre-compiled headers on Darwin. 25 .if ${BUILD_OSTYPE} == "Darwin" 26 CPPFLAGS+= -no-cpp-precomp 27 .endif 28 29 # -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and 30 # other file ops, on many systems, without changing function names. 31 32 CPPFLAGS+= -I. -I./include -I${.CURDIR} -I${.CURDIR}/sys \ 33 -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 34 35 .PATH: ${.CURDIR}/../../lib/libc/cdb \ 36 ${.CURDIR}/../../lib/libc/gen \ 37 ${.CURDIR}/../../lib/libc/hash \ 38 ${.CURDIR}/../../lib/libc/hash/md2 \ 39 ${.CURDIR}/../../lib/libc/hash/md5 \ 40 ${.CURDIR}/../../lib/libc/hash/rmd160 \ 41 ${.CURDIR}/../../lib/libc/hash/sha1 \ 42 ${.CURDIR}/../../lib/libc/hash/sha2 \ 43 ${.CURDIR}/../../lib/libc/md \ 44 ${.CURDIR}/../../lib/libc/stdio \ 45 ${.CURDIR}/../../lib/libc/stdlib \ 46 ${.CURDIR}/../../lib/libc/string \ 47 ${.CURDIR}/../../lib/libutil \ 48 ${.CURDIR}/../../common/lib/libc/string \ 49 ${.CURDIR}/../../common/lib/libc/hash/rmd160 \ 50 ${.CURDIR}/../../common/lib/libc/hash/sha1 \ 51 ${.CURDIR}/../../common/lib/libc/hash/sha2 \ 52 ${.CURDIR}/../../common/lib/libc/md \ 53 ${.CURDIR}/../../common/lib/libc/stdlib \ 54 ${.CURDIR}/../../external/bsd/flex/dist 55 56 DPSRCS+= defs.mk 57 CLEANFILES+= config.log config.status configure.lineno *.stamp 58 59 # Get components of Berkeley DB. 60 _CURDIR:= ${.CURDIR} 61 .CURDIR:= ${_CURDIR}/../../lib/libc 62 .include "${.CURDIR}/db/Makefile.inc" 63 .CURDIR:= ${_CURDIR} 64 65 SRCS:= ${SRCS:M*.c} 66 67 config.cache: include/.stamp configure nbtool_config.h.in defs.mk.in 68 rm -f ${.TARGET} 69 CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} LDFLAGS=${HOST_LDFLAGS:Q} \ 70 ${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache 71 72 defs.mk: config.cache 73 @touch ${.TARGET} 74 75 include/.stamp: 76 mkdir -p include/sys include/machine include/rpc include/arpa 77 @touch ${.TARGET} 78 79 cleandir: 80 -rm -f nbtool_config.h confdefs.h defs.mk 81 -rm -r -f include 82 -rm -f config.cache 83 84 HOST_CPPFLAGS:= ${CPPFLAGS} 85 CPPFLAGS:= # empty 86 87 .include <bsd.hostlib.mk> 88 89 # Use uninstalled copy of host-mkdep 90 HOST_MKDEP_OBJ!= cd ${.CURDIR}/../host-mkdep && ${PRINTOBJDIR} 91 HOST_MKDEP= ${HOST_MKDEP_OBJ}/host-mkdep 92 MKDEP= ${HOST_MKDEP} 93 94 # Run "${TOOLDIR}/bin/nbmake-${MACHINE} regen" by hand after editing 95 # configure.ac. See more detailed instructions in configure.ac. 96 regen: 97 cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf 98 cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoheader 99