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