xref: /netbsd/tools/Makefile.nbincludes (revision 891ab5cf)
1*891ab5cfSlukem#	$NetBSD: Makefile.nbincludes,v 1.6 2023/06/04 10:00:20 lukem Exp $
259292318Sriz
3*891ab5cfSlukem.include <bsd.hostinit.mk>
459292318Sriz
559292318Sriz_ARCHDIR=	${.CURDIR}/../../sys/arch
659292318Sriz_INCDIR=	${.CURDIR}/../../include
759292318Sriz_SYSDIR=	${.CURDIR}/../../sys/sys
859292318Sriz_UFSDIR=	${.CURDIR}/../../sys/ufs
959292318Sriz_SUBDIR!=	cd ${_ARCHDIR} && ${MAKE} -V SUBDIR
1059292318Sriz
1159292318Sriz.if make(depend) || make(all) || make(dependall) || make(install)
1259292318Sriz# There's no need to run these commands for "make cleandir" or "make obj",
1359292318Sriz# and TOOL_SED will not yet have been built.
1459292318Sriz_UFS_INCS!=	cd ${_UFSDIR} && find ffs ufs -name '*.h'
1559292318Sriz_ARCH_INCS!=	${TOOL_SED} -e 's/^\#.*//' ${.CURDIR}/../headerlist
1659292318Sriz.endif
1759292318Sriz
1859292318Sriz_ARCH_INCS+=	ews4800mips/include/pdinfo.h ews4800mips/include/vtoc.h
1959292318Sriz
20828c79adSuwe# for sh3/include/elf_machdep.h
21828c79adSuwe.for sh3mach in dreamcast evbsh3 hpcsh landisk mmeye sh3
22828c79adSuwe_ARCH_INCS+=	${sh3mach}/include/endian_machdep.h
23828c79adSuwe.endfor
24828c79adSuwe
2559292318Sriz_INCS=		disktab.h
2659292318Sriz_SYSINCS=	bootblock.h \
2759292318Sriz		disklabel.h disklabel_acorn.h disklabel_gpt.h disklabel_rdb.h \
2859292318Sriz		dkbad.h \
296c125d6bSchristos		exec_elf.h exec_ecoff.h
3059292318Sriz
312122e53bSchristosHOST_CPPFLAGS+=	-I${TOOLDIR}/include -I${TOOLDIR}/include/nbinclude
3259292318Sriz
3359292318Srizbeforedepend:
3459292318Sriz	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude
3559292318Sriz	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/sys
3659292318Sriz	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/ufs
3759292318Sriz	cd ${_ARCHDIR} && \
3859292318Sriz	    ${TOOL_PAX} -s /include\\/// -rw ${_ARCH_INCS} \
3959292318Sriz	    ${TOOLDIR}/include/nbinclude
4059292318Sriz	cd ${_INCDIR} && \
4159292318Sriz	    ${TOOL_PAX} -rw ${_INCS} ${TOOLDIR}/include/nbinclude
4259292318Sriz	cd ${_SYSDIR} && \
4359292318Sriz	    ${TOOL_PAX} -rw ${_SYSINCS} ${TOOLDIR}/include/nbinclude/sys
4459292318Sriz	cd ${_UFSDIR} && \
4559292318Sriz	    ${TOOL_PAX} -rw ${_UFS_INCS} ${TOOLDIR}/include/nbinclude/ufs
4659292318Sriz	cd ${TOOLDIR}/include/nbinclude && rm -f machine && \
4759292318Sriz	    ${HOST_INSTALL_SYMLINK} ${MACHINE} machine
48