xref: /netbsd-src/tools/Makefile.nbincludes (revision 173d80ed84e4eea0b48419ad76f0d6917ed7a98b)
1*173d80edStsutsui#	$NetBSD: Makefile.nbincludes,v 1.11 2024/05/19 15:43:24 tsutsui Exp $
259292318Sriz
3333a9a00Slukem.include <bsd.hostinit.mk>
459292318Sriz
51a674930Schristos_ARCHDIR:=	${.PARSEDIR}/../sys/arch
61a674930Schristos_INCDIR:=	${.PARSEDIR}/../include
71a674930Schristos_SYSDIR:=	${.PARSEDIR}/../sys/sys
81a674930Schristos_UFSDIR:=	${.PARSEDIR}/../sys/ufs
9*173d80edStsutsui_FSDIR:=	${.PARSEDIR}/../sys/fs
1059292318Sriz_SUBDIR!=	cd ${_ARCHDIR} && ${MAKE} -V SUBDIR
1159292318Sriz
1259292318Sriz.if make(depend) || make(all) || make(dependall) || make(install)
1359292318Sriz# There's no need to run these commands for "make cleandir" or "make obj",
1459292318Sriz# and TOOL_SED will not yet have been built.
1559292318Sriz_UFS_INCS!=	cd ${_UFSDIR} && find ffs ufs -name '*.h'
16*173d80edStsutsui_FS_INCS!=	cd ${_FSDIR} && find cd9660 -name '*.h'
17*173d80edStsutsui_FS_INCS+=	unicode.h
181a674930Schristos_ARCH_INCS!=	${TOOL_SED} -e 's/^\#.*//' ${.PARSEDIR}/headerlist
1959292318Sriz.endif
2059292318Sriz
2159292318Sriz_ARCH_INCS+=	ews4800mips/include/pdinfo.h ews4800mips/include/vtoc.h
2259292318Sriz
23803bb83cSuwe# for sh3/include/elf_machdep.h
24803bb83cSuwe.for sh3mach in dreamcast evbsh3 hpcsh landisk mmeye sh3
25803bb83cSuwe_ARCH_INCS+=	${sh3mach}/include/endian_machdep.h
26803bb83cSuwe.endfor
27803bb83cSuwe
2859292318Sriz_INCS=		disktab.h
2959292318Sriz_SYSINCS=	bootblock.h \
3059292318Sriz		disklabel.h disklabel_acorn.h disklabel_gpt.h disklabel_rdb.h \
3159292318Sriz		dkbad.h \
32c232bb11Schristos		exec_elf.h exec_ecoff.h
3359292318Sriz
3453b6bc58SchristosHOST_CPPFLAGS+=	-I${TOOLDIR}/include -I${TOOLDIR}/include/nbinclude
3559292318Sriz
3659292318Srizbeforedepend:
3759292318Sriz	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude
3859292318Sriz	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/sys
3959292318Sriz	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/ufs
40*173d80edStsutsui	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/fs
41*173d80edStsutsui	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/fs/cd9660
4259292318Sriz	cd ${_ARCHDIR} && \
4359292318Sriz	    ${TOOL_PAX} -s /include\\/// -rw ${_ARCH_INCS} \
4459292318Sriz	    ${TOOLDIR}/include/nbinclude
4559292318Sriz	cd ${_INCDIR} && \
4659292318Sriz	    ${TOOL_PAX} -rw ${_INCS} ${TOOLDIR}/include/nbinclude
4759292318Sriz	cd ${_SYSDIR} && \
4859292318Sriz	    ${TOOL_PAX} -rw ${_SYSINCS} ${TOOLDIR}/include/nbinclude/sys
4959292318Sriz	cd ${_UFSDIR} && \
5059292318Sriz	    ${TOOL_PAX} -rw ${_UFS_INCS} ${TOOLDIR}/include/nbinclude/ufs
51*173d80edStsutsui	cd ${_FSDIR} && \
52*173d80edStsutsui	    ${TOOL_PAX} -rw ${_FS_INCS} ${TOOLDIR}/include/nbinclude/fs
5359292318Sriz	cd ${TOOLDIR}/include/nbinclude && rm -f machine && \
5459292318Sriz	    ${HOST_INSTALL_SYMLINK} ${MACHINE} machine
55