Home | History | Annotate | Line # | Download | only in tools
      1 #	$NetBSD: Makefile.nbincludes,v 1.13 2025/03/29 23:37:00 tsutsui 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 _FSDIR:=	${.PARSEDIR}/../sys/fs
     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 _FS_INCS!=	cd ${_FSDIR} && find cd9660 -name '*.h'
     17 _FS_INCS+=	unicode.h
     18 _ARCH_INCS!=	${TOOL_SED} -e 's/^\#.*//' ${.PARSEDIR}/headerlist 2> /dev/null || true
     19 .endif
     20 
     21 _ARCH_INCS+=	ews4800mips/include/pdinfo.h ews4800mips/include/vtoc.h
     22 
     23 # for sh3/include/elf_machdep.h
     24 .for sh3mach in dreamcast evbsh3 hpcsh landisk mmeye sh3
     25 _ARCH_INCS+=	${sh3mach}/include/endian_machdep.h
     26 .endfor
     27 
     28 _INCS=		disktab.h
     29 _SYSINCS=	bootblock.h \
     30 		disklabel.h disklabel_acorn.h disklabel_gpt.h disklabel_rdb.h \
     31 		dkbad.h \
     32 		exec_elf.h exec_ecoff.h
     33 
     34 HOST_CPPFLAGS+=	-I${TOOLDIR}/include -I${TOOLDIR}/include/nbinclude
     35 
     36 beforedepend: 
     37 	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude
     38 	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/sys
     39 	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/ufs
     40 	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/fs
     41 	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/fs/cd9660
     42 	cd ${_ARCHDIR} && \
     43 	    ${TOOL_PAX} -s /include\\/// -rw ${_ARCH_INCS} \
     44 	    ${TOOLDIR}/include/nbinclude
     45 	cd ${_INCDIR} && \
     46 	    ${TOOL_PAX} -rw ${_INCS} ${TOOLDIR}/include/nbinclude
     47 	cd ${_SYSDIR} && \
     48 	    ${TOOL_PAX} -rw ${_SYSINCS} ${TOOLDIR}/include/nbinclude/sys
     49 	cd ${_UFSDIR} && \
     50 	    ${TOOL_PAX} -rw ${_UFS_INCS} ${TOOLDIR}/include/nbinclude/ufs
     51 	cd ${_FSDIR} && \
     52 	    ${TOOL_PAX} -rw ${_FS_INCS} ${TOOLDIR}/include/nbinclude/fs
     53 	cd ${TOOLDIR}/include/nbinclude && rm -f machine && \
     54 	    ${HOST_INSTALL_SYMLINK} ${MACHINE} machine
     55