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