11.16Slukem#	$NetBSD: Makefile,v 1.16 2020/06/13 10:49:17 lukem Exp $
21.13Schristos
31.13Schristos.include <bsd.hostinit.mk>
41.1Stv
51.12SapbHOSTPROG= 	host-mkdep
61.12SapbHOSTPROGNAME=	${_TOOL_PREFIX}host-mkdep
71.12SapbHOST_BINDIR=	${TOOLDIR}/bin
81.12Sapb
91.12SapbSRCS=	# empty
101.1Stv
111.1StvCLEANFILES+=	config.cache config.log config.status host-mkdep
121.1Stv
131.1Stv.include <bsd.hostprog.mk>
141.1Stv
151.11Sapb# XXX: The configure script needs to use awk, but we can't pass
161.11Sapb# AWK=${TOOL_AWK:Q} in CONFIGURE_ENV, because TOOL_AWK is not yet
171.11Sapb# available at the time that host-mkdep is built.  The configure script
181.11Sapb# will try to find some other version of awk.
191.11Sapb#
201.11SapbCONFIGURE_ENV=	CC=${HOST_CC:Q}
211.10Sapb
221.16SlukemCONFIGURE_ARGS=	--cache-file=config.cache
231.16Slukem.if ${MAKEVERBOSE} == 0
241.16SlukemCONFIGURE_ARGS+=--silent
251.16Slukem.endif
261.16Slukem
271.1Stvrealall: host-mkdep
281.1Stvhost-mkdep: configure host-mkdep.in
291.1Stv	-rm -f $@
301.16Slukem	${CONFIGURE_ENV} ${HOST_SH} ${.CURDIR}/configure ${CONFIGURE_ARGS}
311.7Schristos	chmod +x $@
321.1Stv
331.12Sapb# Use uninstalled copy of the install program
341.12SapbINSTALL_OBJ!=	cd ${NETBSDSRCDIR}/tools/binstall && ${PRINTOBJDIR}
351.12SapbINSTALL=	${INSTALL_OBJ}/xinstall
361.12Sapb
371.12Sapb# Install rule, copied from src/tools/Makefile.host.
381.12Sapb# We can't include Makefile.host because there is no HOST_SRCDIR
391.12Sapb# corresponding to host-mkdep.
401.12Sapb#
411.12Sapbrealinstall: install.host
421.12Sapbinstall.host: ${HOST_BINDIR}/${HOSTPROGNAME}
431.12Sapb${HOST_BINDIR}/${HOSTPROGNAME}:: ${HOSTPROG}
441.12Sapb	${_MKTARGET_INSTALL}
451.12Sapb	mkdir -p ${HOST_BINDIR}
461.12Sapb	${HOST_INSTALL_FILE} -m ${BINMODE} ${HOSTPROG}${HOSTEXEEXT} ${.TARGET}
471.12Sapb
481.12Sapb.if ${MKUPDATE} == "no"
491.12Sapb.PHONY:		${HOST_BINDIR}/${HOSTPROGNAME}
501.12Sapb.endif
511.1Stv
521.1Stv# Run by hand, then "configure" script committed:
531.1Stvregen:
541.6Sthorpej	cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf
55