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