Makefile revision 1.35
1#	$NetBSD: Makefile,v 1.35 2005/09/13 02:30:23 christos Exp $
2
3HOSTLIB=	nbcompat
4
5SRCS=		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
17BUILD_OSTYPE!=  uname -s
18
19# Disable use of pre-compiled headers on Darwin.
20.if ${BUILD_OSTYPE} == "Darwin"
21CPPFLAGS+=	-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
27CPPFLAGS+=	-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/sha2 \
33		${.CURDIR}/../../lib/libc/md \
34		${.CURDIR}/../../lib/libc/stdio \
35		${.CURDIR}/../../lib/libc/stdlib \
36		${.CURDIR}/../../lib/libc/string \
37		${.CURDIR}/../../usr.bin/lex
38
39DPSRCS+=	defs.mk
40CLEANFILES+=	defs.mk
41CLEANFILES+=	config.log config.status configure.lineno confdefs.h *.stamp
42
43# Get components of Berkeley DB.
44_CURDIR:=	${.CURDIR}
45.CURDIR:=	${_CURDIR}/../../lib/libc
46.include "${.CURDIR}/db/Makefile.inc"
47.CURDIR:=	${_CURDIR}
48
49SRCS:=		${SRCS:Nndbm.c:N__ndbm13.c}
50
51config.cache: include/.stamp configure nbtool_config.h.in defs.mk.in
52	rm -f ${.TARGET}
53	CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} LDFLAGS=${HOST_LDFLAGS:Q} \
54		${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache
55
56defs.mk: config.cache
57	@touch ${.TARGET}
58
59# Run by hand, then "configure" script committed:
60regen:
61	cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf
62
63include/.stamp:
64	mkdir -p include/sys include/machine include/rpc
65	@touch ${.TARGET}
66
67cleandir: compat.clean
68compat.clean:
69	-rm -r -f include
70	-rm -f config.cache nbtool_config.h
71
72HOST_CPPFLAGS:=	${CPPFLAGS}
73CPPFLAGS:=	# empty
74
75.include <bsd.hostlib.mk>
76