xref: /netbsd/tools/compat/Makefile (revision bf9ec67e)
1#	$NetBSD: Makefile,v 1.13 2002/04/18 21:15:08 tv Exp $
2
3HOSTLIB=	nbcompat
4
5SRCS=		basename.c dirname.c fgetln.c flock.c fparseln.c \
6		getmode.c getopt_long.c issetugid.c libyywrap.c \
7		md2c.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c pread.c \
8		pwcache.c pwrite.c pw_scan.c rmd160.c rmd160hl.c setenv.c \
9		setgroupent.c setpassent.c setprogname.c sha1.c sha1hl.c \
10		snprintf.c strlcat.c strlcpy.c strmode.c strsep.c \
11		unvis.c vis.c \
12		_err.c _errx.c _verr.c _verrx.c _vwarn.c _vwarnx.c \
13		_warn.c _warnx.c __fts13.c
14
15# -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and
16# other file ops, on many systems, without changing function names.
17
18CPPFLAGS+=	-I. -I./include -I${.CURDIR} -DHAVE_CONFIG_H \
19		-D_FILE_OFFSET_BITS=64
20
21.PATH:		${.CURDIR}/../../lib/libc/gen \
22		${.CURDIR}/../../lib/libc/hash \
23		${.CURDIR}/../../lib/libc/md \
24		${.CURDIR}/../../lib/libc/stdlib \
25		${.CURDIR}/../../lib/libc/string \
26		${.CURDIR}/../../lib/libutil \
27		${.CURDIR}/../../usr.bin/lex
28
29DPSRCS+=	defs.mk
30CLEANFILES=	config.log config.status confdefs.h *.stamp
31
32# Get components of Berkeley DB.
33_CURDIR:=	${.CURDIR}
34.CURDIR:=	${_CURDIR}/../../lib/libc
35.include "${.CURDIR}/db/Makefile.inc"
36.CURDIR:=	${_CURDIR}
37
38SRCS:=		${SRCS:Nndbm.c}
39
40defs.mk: include/.stamp configure config.h.in defs.mk.in
41	CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} LDFLAGS=${HOST_LDFLAGS:Q} \
42		sh ${.CURDIR}/configure --cache-file=config.cache
43	@touch $@
44
45# Run by hand, then "configure" script committed:
46regen:
47	cd ${.CURDIR} && ${TOOLDIR}/bin/nbautoconf
48
49include/.stamp:
50	mkdir -p include/sys include/machine include/rpc
51	@touch $@
52
53cleandir: compat.clean
54compat.clean:
55	-rm -r -f include
56	-rm -f config.cache config.h
57
58HOST_CPPFLAGS:=	${CPPFLAGS}
59CPPFLAGS:=	# empty
60
61.include <bsd.hostlib.mk>
62