Makefile.nbincludes revision 1.7
11.7Schristos#	$NetBSD: Makefile.nbincludes,v 1.7 2024/03/26 16:48:34 christos 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.7Schristos_ELFTOOLCHAINDIR:=	${.PARSEDIR}/elftoolchain
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.7Schristos_ARCH_INCS!=	${TOOL_SED} -e 's/^\#.*//' ${.PARSEDIR}/headerlist
171.1Sriz.endif
181.1Sriz
191.1Sriz_ARCH_INCS+=	ews4800mips/include/pdinfo.h ews4800mips/include/vtoc.h
201.1Sriz
211.4Suwe# for sh3/include/elf_machdep.h
221.4Suwe.for sh3mach in dreamcast evbsh3 hpcsh landisk mmeye sh3
231.4Suwe_ARCH_INCS+=	${sh3mach}/include/endian_machdep.h
241.4Suwe.endfor
251.4Suwe
261.1Sriz_INCS=		disktab.h
271.1Sriz_SYSINCS=	bootblock.h \
281.1Sriz		disklabel.h disklabel_acorn.h disklabel_gpt.h disklabel_rdb.h \
291.1Sriz		dkbad.h \
301.5Schristos		exec_elf.h exec_ecoff.h
311.1Sriz
321.3SchristosHOST_CPPFLAGS+=	-I${TOOLDIR}/include -I${TOOLDIR}/include/nbinclude
331.1Sriz
341.1Srizbeforedepend: 
351.1Sriz	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude
361.1Sriz	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/sys
371.1Sriz	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/ufs
381.1Sriz	cd ${_ARCHDIR} && \
391.1Sriz	    ${TOOL_PAX} -s /include\\/// -rw ${_ARCH_INCS} \
401.1Sriz	    ${TOOLDIR}/include/nbinclude
411.1Sriz	cd ${_INCDIR} && \
421.1Sriz	    ${TOOL_PAX} -rw ${_INCS} ${TOOLDIR}/include/nbinclude
431.1Sriz	cd ${_SYSDIR} && \
441.1Sriz	    ${TOOL_PAX} -rw ${_SYSINCS} ${TOOLDIR}/include/nbinclude/sys
451.1Sriz	cd ${_UFSDIR} && \
461.1Sriz	    ${TOOL_PAX} -rw ${_UFS_INCS} ${TOOLDIR}/include/nbinclude/ufs
471.1Sriz	cd ${TOOLDIR}/include/nbinclude && rm -f machine && \
481.1Sriz	    ${HOST_INSTALL_SYMLINK} ${MACHINE} machine
491.7Schristos	cd ${_ELFTOOLCHAINDIR}/common && ${MAKE} includes
50