Makefile.nbincludes revision 1.9
1#	$NetBSD: Makefile.nbincludes,v 1.9 2024/03/31 03:20:38 christos Exp $
2
3.include <bsd.hostinit.mk>
4
5_ARCHDIR:=	${.PARSEDIR}/../sys/arch
6_INCDIR:=	${.PARSEDIR}/../include
7_SYSDIR:=	${.PARSEDIR}/../sys/sys
8_UFSDIR:=	${.PARSEDIR}/../sys/ufs
9_ELFTOOLCHAINDIR:=	${.PARSEDIR}/elftoolchain
10_SUBDIR!=	cd ${_ARCHDIR} && ${MAKE} -V SUBDIR
11
12.if make(depend) || make(all) || make(dependall) || make(install)
13# There's no need to run these commands for "make cleandir" or "make obj",
14# and TOOL_SED will not yet have been built.
15_UFS_INCS!=	cd ${_UFSDIR} && find ffs ufs -name '*.h'
16_ARCH_INCS!=	${TOOL_SED} -e 's/^\#.*//' ${.PARSEDIR}/headerlist
17.endif
18
19_ARCH_INCS+=	ews4800mips/include/pdinfo.h ews4800mips/include/vtoc.h
20
21# for sh3/include/elf_machdep.h
22.for sh3mach in dreamcast evbsh3 hpcsh landisk mmeye sh3
23_ARCH_INCS+=	${sh3mach}/include/endian_machdep.h
24.endfor
25
26_INCS=		disktab.h
27_SYSINCS=	bootblock.h \
28		disklabel.h disklabel_acorn.h disklabel_gpt.h disklabel_rdb.h \
29		dkbad.h \
30		exec_elf.h exec_ecoff.h
31
32HOST_CPPFLAGS+=	-I${TOOLDIR}/include -I${TOOLDIR}/include/nbinclude
33
34beforedepend: 
35	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude
36	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/sys
37	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/ufs
38	cd ${_ARCHDIR} && \
39	    ${TOOL_PAX} -s /include\\/// -rw ${_ARCH_INCS} \
40	    ${TOOLDIR}/include/nbinclude
41	cd ${_INCDIR} && \
42	    ${TOOL_PAX} -rw ${_INCS} ${TOOLDIR}/include/nbinclude
43	cd ${_SYSDIR} && \
44	    ${TOOL_PAX} -rw ${_SYSINCS} ${TOOLDIR}/include/nbinclude/sys
45	cd ${_UFSDIR} && \
46	    ${TOOL_PAX} -rw ${_UFS_INCS} ${TOOLDIR}/include/nbinclude/ufs
47	cd ${TOOLDIR}/include/nbinclude && rm -f machine && \
48	    ${HOST_INSTALL_SYMLINK} ${MACHINE} machine
49	cd ${_ELFTOOLCHAINDIR}/common/sys && \
50	    ${TOOL_PAX} -rw elfdefinitions.h ${TOOLDIR}/includes/sys
51