Makefile revision 1.24
1#	$NetBSD: Makefile,v 1.24 2003/06/03 03:16:48 uwe 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 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
16BUILD_OSTYPE!=  uname -s
17
18# Disable use of pre-compiled headers on Darwin.
19.if ${BUILD_OSTYPE} == "Darwin"
20CPPFLAGS+=	-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
29CPPFLAGS+=	-I. -I./include -I${.CURDIR} -DHAVE_CONFIG_H \
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
40DPSRCS+=	defs.mk
41CLEANFILES=	config.log config.status 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}
50
51config.cache: include/.stamp configure config.h.in defs.mk.in
52	rm -f ${.TARGET}
53	CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} LDFLAGS=${HOST_LDFLAGS:Q} \
54		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/nbautoconf
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 config.h
71
72HOST_CPPFLAGS:=	${CPPFLAGS}
73CPPFLAGS:=	# empty
74
75.include <bsd.hostlib.mk>
76