xref: /netbsd-src/tools/compat/Makefile (revision a30f264f2a5f410ffefcc55600a9238b3a0c935c)
1#	$NetBSD: Makefile,v 1.40 2005/12/20 20:39:15 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 \
7		issetugid.c lchflags.c lchmod.c lchown.c libyywrap.c \
8		md2.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/md2 \
33		${.CURDIR}/../../lib/libc/hash/md5 \
34		${.CURDIR}/../../lib/libc/hash/rmd160 \
35		${.CURDIR}/../../lib/libc/hash/sha1 \
36		${.CURDIR}/../../lib/libc/hash/sha2 \
37		${.CURDIR}/../../lib/libc/md \
38		${.CURDIR}/../../lib/libc/stdio \
39		${.CURDIR}/../../lib/libc/stdlib \
40		${.CURDIR}/../../lib/libc/string \
41		${.CURDIR}/../../common/lib/libc/string \
42		${.CURDIR}/../../common/lib/libc/hash/sha1 \
43		${.CURDIR}/../../common/lib/libc/md \
44		${.CURDIR}/../../usr.bin/lex \
45
46DPSRCS+=	defs.mk
47CLEANFILES+=	defs.mk
48CLEANFILES+=	config.log config.status configure.lineno confdefs.h *.stamp
49
50# Get components of Berkeley DB.
51_CURDIR:=	${.CURDIR}
52.CURDIR:=	${_CURDIR}/../../lib/libc
53.include "${.CURDIR}/db/Makefile.inc"
54.CURDIR:=	${_CURDIR}
55
56SRCS:=		${SRCS:Nndbm*.c}
57
58config.cache: include/.stamp configure nbtool_config.h.in defs.mk.in
59	rm -f ${.TARGET}
60	CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} LDFLAGS=${HOST_LDFLAGS:Q} \
61		${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache
62
63defs.mk: config.cache
64	@touch ${.TARGET}
65
66# Run by hand, then "configure" script committed:
67regen:
68	cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf
69
70include/.stamp:
71	mkdir -p include/sys include/machine include/rpc
72	@touch ${.TARGET}
73
74cleandir: compat.clean
75compat.clean:
76	-rm -r -f include
77	-rm -f config.cache nbtool_config.h
78
79HOST_CPPFLAGS:=	${CPPFLAGS}
80CPPFLAGS:=	# empty
81
82.include <bsd.hostlib.mk>
83