Home | History | Annotate | Line # | Download | only in tools
Makefile.nbincludes revision 1.7
      1 #	$NetBSD: Makefile.nbincludes,v 1.7 2024/03/26 16:48:34 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 
     32 HOST_CPPFLAGS+=	-I${TOOLDIR}/include -I${TOOLDIR}/include/nbinclude
     33 
     34 beforedepend: 
     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 && ${MAKE} includes
     50