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