xref: /netbsd-src/tools/elftoolchain/common/sys/Makefile (revision 878fdbc71b08bbf79d3d4dfc1526be61e53032c1)
1*878fdbc7Schristos#	$NetBSD: Makefile,v 1.5 2024/04/01 02:18:30 christos Exp $
242c1249eSjkoshy
342c1249eSjkoshy.include <bsd.hostinit.mk>
442c1249eSjkoshy
542c1249eSjkoshySRCDIR=	${.CURDIR}/../../../../external/bsd/elftoolchain/dist/common/sys
642c1249eSjkoshy
742c1249eSjkoshy.PATH:	${SRCDIR}
842c1249eSjkoshy
942c1249eSjkoshyINCS=		elfdefinitions.h
1042c1249eSjkoshyHOST_INCSDIR=	${TOOLDIR}/include/sys
1142c1249eSjkoshy
1297a4ef43Schristos# Too early for ${TOOL_M4}
13*878fdbc7Schristoselfdefinitions.h:	elfdefinitions.m4 elfconstants.m4
14*878fdbc7Schristos	${_MKTARGET_CREATE}
15*878fdbc7Schristos	${TOOL_M4} -I${SRCDIR} -D SRCDIR=${SRCDIR} ${M4FLAGS} \
16*878fdbc7Schristos		elfdefinitions.m4 > ${.TARGET}
1742c1249eSjkoshy
1842c1249eSjkoshy.PHONY:	all clean clobber depend
1942c1249eSjkoshy
2042c1249eSjkoshyinstall: .PHONY ${HOST_INCSDIR} .WAIT includes
2142c1249eSjkoshy
2242c1249eSjkoshy${HOST_INCSDIR}:
2342c1249eSjkoshy	${_MKTARGET_INSTALL}
2442c1249eSjkoshy	${HOST_INSTALL_DIR} ${HOST_INCSDIR}
2542c1249eSjkoshy
2642c1249eSjkoshy.for _f in ${INCS}
2742c1249eSjkoshyHOST_INCINSTFILES+= ${HOST_INCSDIR}/${_f}
2842c1249eSjkoshy${HOST_INCSDIR}/${_f}: ${_f}
2942c1249eSjkoshy	${_MKTARGET_INSTALL}
30cc85530fSchristos	${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}
3142c1249eSjkoshy.endfor
3242c1249eSjkoshy
3342c1249eSjkoshyincludes: .PHONY ${HOST_INCSDIR} .WAIT ${HOST_INCINSTFILES}
3442c1249eSjkoshy
3542c1249eSjkoshyall dependall depend:	${INCS}
3642c1249eSjkoshy
3742c1249eSjkoshyclean clobber:
38*878fdbc7Schristos	rm -f ${INCS}
3942c1249eSjkoshy
4042c1249eSjkoshycleandepend:
4142c1249eSjkoshy	rm -f ${.OBJDIR}/.depend
4242c1249eSjkoshy
4342c1249eSjkoshy.include <bsd.obj.mk>
44