1#	$NetBSD: Makefile,v 1.5 2024/04/01 02:18:30 christos Exp $
2
3.include <bsd.hostinit.mk>
4
5SRCDIR=	${.CURDIR}/../../../../external/bsd/elftoolchain/dist/common/sys
6
7.PATH:	${SRCDIR}
8
9INCS=		elfdefinitions.h
10HOST_INCSDIR=	${TOOLDIR}/include/sys
11
12# Too early for ${TOOL_M4}
13elfdefinitions.h:	elfdefinitions.m4 elfconstants.m4
14	${_MKTARGET_CREATE}
15	${TOOL_M4} -I${SRCDIR} -D SRCDIR=${SRCDIR} ${M4FLAGS} \
16		elfdefinitions.m4 > ${.TARGET}
17
18.PHONY:	all clean clobber depend
19
20install: .PHONY ${HOST_INCSDIR} .WAIT includes
21
22${HOST_INCSDIR}:
23	${_MKTARGET_INSTALL}
24	${HOST_INSTALL_DIR} ${HOST_INCSDIR}
25
26.for _f in ${INCS}
27HOST_INCINSTFILES+= ${HOST_INCSDIR}/${_f}
28${HOST_INCSDIR}/${_f}: ${_f}
29	${_MKTARGET_INSTALL}
30	${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}
31.endfor
32
33includes: .PHONY ${HOST_INCSDIR} .WAIT ${HOST_INCINSTFILES}
34
35all dependall depend:	${INCS}
36
37clean clobber:
38	rm -f ${INCS}
39
40cleandepend:
41	rm -f ${.OBJDIR}/.depend
42
43.include <bsd.obj.mk>
44