11.13Stsutsui#	$NetBSD: Makefile.nbincludes,v 1.13 2025/03/29 23:37:00 tsutsui Exp $
21.1Sriz
31.6Slukem.include <bsd.hostinit.mk>
41.1Sriz
51.7Schristos_ARCHDIR:=	${.PARSEDIR}/../sys/arch
61.7Schristos_INCDIR:=	${.PARSEDIR}/../include
71.7Schristos_SYSDIR:=	${.PARSEDIR}/../sys/sys
81.7Schristos_UFSDIR:=	${.PARSEDIR}/../sys/ufs
91.11Stsutsui_FSDIR:=	${.PARSEDIR}/../sys/fs
101.1Sriz_SUBDIR!=	cd ${_ARCHDIR} && ${MAKE} -V SUBDIR
111.1Sriz
121.1Sriz.if make(depend) || make(all) || make(dependall) || make(install)
131.1Sriz# There's no need to run these commands for "make cleandir" or "make obj",
141.1Sriz# and TOOL_SED will not yet have been built.
151.1Sriz_UFS_INCS!=	cd ${_UFSDIR} && find ffs ufs -name '*.h'
161.11Stsutsui_FS_INCS!=	cd ${_FSDIR} && find cd9660 -name '*.h'
171.11Stsutsui_FS_INCS+=	unicode.h
181.13Stsutsui_ARCH_INCS!=	${TOOL_SED} -e 's/^\#.*//' ${.PARSEDIR}/headerlist 2> /dev/null || true
191.1Sriz.endif
201.1Sriz
211.1Sriz_ARCH_INCS+=	ews4800mips/include/pdinfo.h ews4800mips/include/vtoc.h
221.1Sriz
231.4Suwe# for sh3/include/elf_machdep.h
241.4Suwe.for sh3mach in dreamcast evbsh3 hpcsh landisk mmeye sh3
251.4Suwe_ARCH_INCS+=	${sh3mach}/include/endian_machdep.h
261.4Suwe.endfor
271.4Suwe
281.1Sriz_INCS=		disktab.h
291.1Sriz_SYSINCS=	bootblock.h \
301.1Sriz		disklabel.h disklabel_acorn.h disklabel_gpt.h disklabel_rdb.h \
311.1Sriz		dkbad.h \
321.5Schristos		exec_elf.h exec_ecoff.h
331.1Sriz
341.3SchristosHOST_CPPFLAGS+=	-I${TOOLDIR}/include -I${TOOLDIR}/include/nbinclude
351.1Sriz
361.1Srizbeforedepend: 
371.1Sriz	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude
381.1Sriz	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/sys
391.1Sriz	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/ufs
401.11Stsutsui	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/fs
411.11Stsutsui	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/fs/cd9660
421.1Sriz	cd ${_ARCHDIR} && \
431.1Sriz	    ${TOOL_PAX} -s /include\\/// -rw ${_ARCH_INCS} \
441.1Sriz	    ${TOOLDIR}/include/nbinclude
451.1Sriz	cd ${_INCDIR} && \
461.1Sriz	    ${TOOL_PAX} -rw ${_INCS} ${TOOLDIR}/include/nbinclude
471.1Sriz	cd ${_SYSDIR} && \
481.1Sriz	    ${TOOL_PAX} -rw ${_SYSINCS} ${TOOLDIR}/include/nbinclude/sys
491.1Sriz	cd ${_UFSDIR} && \
501.1Sriz	    ${TOOL_PAX} -rw ${_UFS_INCS} ${TOOLDIR}/include/nbinclude/ufs
511.11Stsutsui	cd ${_FSDIR} && \
521.11Stsutsui	    ${TOOL_PAX} -rw ${_FS_INCS} ${TOOLDIR}/include/nbinclude/fs
531.1Sriz	cd ${TOOLDIR}/include/nbinclude && rm -f machine && \
541.1Sriz	    ${HOST_INSTALL_SYMLINK} ${MACHINE} machine
55