xref: /netbsd/tools/compat/Makefile (revision 6550d01e)
1#	$NetBSD: Makefile,v 1.54 2010/02/03 15:34:44 roy Exp $
2
3HOSTLIB=	nbcompat
4
5SRCS=		atoll.c basename.c dirname.c fgetln.c flock.c fparseln.c \
6		fpurge.c 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 \
9		mi_vector_hash.c mkdtemp.c \
10		mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \
11		pw_scan.c \
12		raise_default_signal.c rmd160.c rmd160hl.c \
13		setenv.c setgroupent.c \
14		setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \
15		sha256hl.c sha384hl.c sha512hl.c snprintf.c stat_flags.c \
16		strlcat.c strlcpy.c strmode.c strndup.c strsep.c strsuftoll.c \
17		strtoll.c unvis.c vis.c err.c errx.c verr.c verrx.c \
18		vwarn.c vwarnx.c warn.c warnx.c fts.c glob.c efun.c
19
20BUILD_OSTYPE!=  uname -s
21
22# Disable use of pre-compiled headers on Darwin.
23.if ${BUILD_OSTYPE} == "Darwin"
24CPPFLAGS+=	-no-cpp-precomp
25.endif
26
27# -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and
28# other file ops, on many systems, without changing function names.
29
30CPPFLAGS+=	-I. -I./include -I${.CURDIR} -I${.CURDIR}/sys \
31		-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
32
33.PATH:		${.CURDIR}/../../lib/libc/gen \
34		${.CURDIR}/../../lib/libc/hash \
35		${.CURDIR}/../../lib/libc/hash/md2 \
36		${.CURDIR}/../../lib/libc/hash/md5 \
37		${.CURDIR}/../../lib/libc/hash/rmd160 \
38		${.CURDIR}/../../lib/libc/hash/sha1 \
39		${.CURDIR}/../../lib/libc/hash/sha2 \
40		${.CURDIR}/../../lib/libc/md \
41		${.CURDIR}/../../lib/libc/stdio \
42		${.CURDIR}/../../lib/libc/stdlib \
43		${.CURDIR}/../../lib/libc/string \
44		${.CURDIR}/../../lib/libutil \
45		${.CURDIR}/../../common/lib/libc/string \
46		${.CURDIR}/../../common/lib/libc/hash/rmd160 \
47		${.CURDIR}/../../common/lib/libc/hash/sha1 \
48		${.CURDIR}/../../common/lib/libc/hash/sha2 \
49		${.CURDIR}/../../common/lib/libc/md \
50		${.CURDIR}/../../common/lib/libc/stdlib \
51		${.CURDIR}/../../usr.bin/lex
52
53DPSRCS+=	defs.mk
54CLEANFILES+=	config.log config.status configure.lineno *.stamp
55
56# Get components of Berkeley DB.
57_CURDIR:=	${.CURDIR}
58.CURDIR:=	${_CURDIR}/../../lib/libc
59.include "${.CURDIR}/db/Makefile.inc"
60.CURDIR:=	${_CURDIR}
61
62SRCS:=		${SRCS:M*.c}
63
64config.cache: include/.stamp configure nbtool_config.h.in defs.mk.in
65	rm -f ${.TARGET}
66	CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} LDFLAGS=${HOST_LDFLAGS:Q} \
67		${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache
68
69defs.mk: config.cache
70	@touch ${.TARGET}
71
72# Run "${TOOLDIR}/bin/nbmake-${MACHINE} regen" by hand after editing
73# configure.ac.  See more detailed instructions in configure.ac.
74regen:
75	cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf
76	cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoheader
77
78include/.stamp:
79	mkdir -p include/sys include/machine include/rpc include/arpa
80	@touch ${.TARGET}
81
82cleandir:
83	-rm -f nbtool_config.h confdefs.h defs.mk
84	-rm -r -f include
85	-rm -f config.cache
86
87HOST_CPPFLAGS:=	${CPPFLAGS}
88CPPFLAGS:=	# empty
89
90.include <bsd.hostlib.mk>
91