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