xref: /minix3/tools/host-mkdep/Makefile (revision 84d9c625bfea59e274550651111ae9edfdc40fbd)
1#	$NetBSD: Makefile,v 1.12 2012/12/02 12:44:06 apb Exp $
2
3HOSTPROG= 	host-mkdep
4HOSTPROGNAME=	${_TOOL_PREFIX}host-mkdep
5HOST_BINDIR=	${TOOLDIR}/bin
6
7NOMAN=	# defined
8SRCS=	# empty
9
10CLEANFILES+=	config.cache config.log config.status host-mkdep
11
12.include <bsd.hostprog.mk>
13
14# XXX: The configure script needs to use awk, but we can't pass
15# AWK=${TOOL_AWK:Q} in CONFIGURE_ENV, because TOOL_AWK is not yet
16# available at the time that host-mkdep is built.  The configure script
17# will try to find some other version of awk.
18#
19CONFIGURE_ENV=	CC=${HOST_CC:Q}
20
21realall: host-mkdep
22host-mkdep: configure host-mkdep.in
23	-rm -f $@
24	${CONFIGURE_ENV} \
25	    ${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache
26	chmod +x $@
27
28# Use uninstalled copy of the install program
29INSTALL_OBJ!=	cd ${NETBSDSRCDIR}/tools/binstall && ${PRINTOBJDIR}
30INSTALL=	${INSTALL_OBJ}/xinstall
31
32# Install rule, copied from src/tools/Makefile.host.
33# We can't include Makefile.host because there is no HOST_SRCDIR
34# corresponding to host-mkdep.
35#
36realinstall: install.host
37install.host: ${HOST_BINDIR}/${HOSTPROGNAME}
38${HOST_BINDIR}/${HOSTPROGNAME}:: ${HOSTPROG}
39	${_MKTARGET_INSTALL}
40	mkdir -p ${HOST_BINDIR}
41	${HOST_INSTALL_FILE} -m ${BINMODE} ${HOSTPROG}${HOSTEXEEXT} ${.TARGET}
42
43.if ${MKUPDATE} == "no"
44.PHONY:		${HOST_BINDIR}/${HOSTPROGNAME}
45.endif
46
47# Run by hand, then "configure" script committed:
48regen:
49	cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf
50