1 # $NetBSD: Makefile,v 1.28 2003/10/27 00:12:42 lukem 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 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 snprintf.c \ 12 strlcat.c strlcpy.c strmode.c strsep.c strsuftoll.c \ 13 strtoll.c unvis.c vis.c _err.c _errx.c _verr.c _verrx.c \ 14 _vwarn.c _vwarnx.c _warn.c _warnx.c __fts13.c __glob13.c 15 16 BUILD_OSTYPE!= uname -s 17 18 # Disable use of pre-compiled headers on Darwin. 19 .if ${BUILD_OSTYPE} == "Darwin" 20 CPPFLAGS+= -no-cpp-precomp 21 .endif 22 23 # -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and 24 # other file ops, on many systems, without changing function names. 25 26 # -D_NETBSD_SOURCE is necessary for some of the NetBSD headers that we 27 # also use on the host system. 28 29 CPPFLAGS+= -I. -I./include -I${.CURDIR} -DHAVE_NBTOOL_CONFIG_H=1 \ 30 -D_FILE_OFFSET_BITS=64 -D_NETBSD_SOURCE 31 32 .PATH: ${.CURDIR}/../../lib/libc/gen \ 33 ${.CURDIR}/../../lib/libc/hash \ 34 ${.CURDIR}/../../lib/libc/md \ 35 ${.CURDIR}/../../lib/libc/stdio \ 36 ${.CURDIR}/../../lib/libc/stdlib \ 37 ${.CURDIR}/../../lib/libc/string \ 38 ${.CURDIR}/../../usr.bin/lex 39 40 DPSRCS+= defs.mk 41 CLEANFILES+= defs.mk 42 CLEANFILES+= config.log config.status configure.lineno confdefs.h *.stamp 43 44 # Get components of Berkeley DB. 45 _CURDIR:= ${.CURDIR} 46 .CURDIR:= ${_CURDIR}/../../lib/libc 47 .include "${.CURDIR}/db/Makefile.inc" 48 .CURDIR:= ${_CURDIR} 49 50 SRCS:= ${SRCS:Nndbm.c} 51 52 config.cache: include/.stamp configure nbtool_config.h.in defs.mk.in 53 rm -f ${.TARGET} 54 CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} LDFLAGS=${HOST_LDFLAGS:Q} \ 55 ${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache 56 57 defs.mk: config.cache 58 @touch ${.TARGET} 59 60 # Run by hand, then "configure" script committed: 61 regen: 62 cd ${.CURDIR} && ${TOOLDIR}/bin/nbautoconf 63 64 include/.stamp: 65 mkdir -p include/sys include/machine include/rpc 66 @touch ${.TARGET} 67 68 cleandir: compat.clean 69 compat.clean: 70 -rm -r -f include 71 -rm -f config.cache nbtool_config.h 72 73 HOST_CPPFLAGS:= ${CPPFLAGS} 74 CPPFLAGS:= # empty 75 76 .include <bsd.hostlib.mk> 77