Makefile revision 1.23
11.23Sbjh21#	$NetBSD: Makefile,v 1.23 2003/04/28 23:16:11 bjh21 Exp $
21.1Stv
31.1StvHOSTLIB=	nbcompat
41.1Stv
51.6StvSRCS=		basename.c dirname.c fgetln.c flock.c fparseln.c \
61.17Slukem		getmode.c getopt_long.c gettemp.c issetugid.c \
71.17Slukem		lchflags.c lchmod.c lchown.c libyywrap.c \
81.15Sthorpej		md2c.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c mkdtemp.c \
91.22Sthorpej		mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \
101.22Sthorpej		pw_scan.c rmd160.c rmd160hl.c setenv.c setgroupent.c \
111.22Sthorpej		setpassent.c setprogname.c sha1.c sha1hl.c snprintf.c \
121.22Sthorpej		strlcat.c strlcpy.c strmode.c strsep.c strsuftoll.c \
131.22Sthorpej		strtoll.c unvis.c vis.c _err.c _errx.c _verr.c _verrx.c \
141.22Sthorpej		_vwarn.c _vwarnx.c _warn.c _warnx.c __fts13.c __glob13.c
151.21Sthorpej
161.21SthorpejBUILD_OSTYPE!=  uname -s
171.21Sthorpej
181.21Sthorpej# Disable use of pre-compiled headers on Darwin.
191.21Sthorpej.if ${BUILD_OSTYPE} == "Darwin"
201.21SthorpejCPPFLAGS+=	-no-cpp-precomp
211.21Sthorpej.endif
221.6Stv
231.6Stv# -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and
241.6Stv# other file ops, on many systems, without changing function names.
251.6Stv
261.23Sbjh21# -D_NETBSD_SOURCE is necessary for some of the NetBSD headers that we
271.23Sbjh21# also use on the host system.
281.23Sbjh21
291.7StvCPPFLAGS+=	-I. -I./include -I${.CURDIR} -DHAVE_CONFIG_H \
301.23Sbjh21		-D_FILE_OFFSET_BITS=64 -D_NETBSD_SOURCE
311.3Stv
321.3Stv.PATH:		${.CURDIR}/../../lib/libc/gen \
331.9Sbjh21		${.CURDIR}/../../lib/libc/hash \
341.9Sbjh21		${.CURDIR}/../../lib/libc/md \
351.15Sthorpej		${.CURDIR}/../../lib/libc/stdio \
361.6Stv		${.CURDIR}/../../lib/libc/stdlib \
371.4Slukem		${.CURDIR}/../../lib/libc/string \
381.7Stv		${.CURDIR}/../../usr.bin/lex
391.1Stv
401.6StvDPSRCS+=	defs.mk
411.7StvCLEANFILES=	config.log config.status confdefs.h *.stamp
421.3Stv
431.3Stv# Get components of Berkeley DB.
441.3Stv_CURDIR:=	${.CURDIR}
451.3Stv.CURDIR:=	${_CURDIR}/../../lib/libc
461.3Stv.include "${.CURDIR}/db/Makefile.inc"
471.3Stv.CURDIR:=	${_CURDIR}
481.3Stv
491.3StvSRCS:=		${SRCS:Nndbm.c}
501.1Stv
511.20Slukemconfig.cache: include/.stamp configure config.h.in defs.mk.in
521.20Slukem	rm -f ${.TARGET}
531.3Stv	CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} LDFLAGS=${HOST_LDFLAGS:Q} \
541.3Stv		sh ${.CURDIR}/configure --cache-file=config.cache
551.20Slukem
561.20Slukemdefs.mk: config.cache
571.20Slukem	@touch ${.TARGET}
581.1Stv
591.1Stv# Run by hand, then "configure" script committed:
601.1Stvregen:
611.1Stv	cd ${.CURDIR} && ${TOOLDIR}/bin/nbautoconf
621.6Stv
631.13Stvinclude/.stamp:
641.8Stv	mkdir -p include/sys include/machine include/rpc
651.20Slukem	@touch ${.TARGET}
661.6Stv
671.6Stvcleandir: compat.clean
681.6Stvcompat.clean:
691.6Stv	-rm -r -f include
701.6Stv	-rm -f config.cache config.h
711.6Stv
721.6StvHOST_CPPFLAGS:=	${CPPFLAGS}
731.6StvCPPFLAGS:=	# empty
741.1Stv
751.1Stv.include <bsd.hostlib.mk>
76