Makefile.nbincludes revision 1.4
1#	$NetBSD: Makefile.nbincludes,v 1.4 2015/01/24 16:21:33 uwe Exp $
2
3# NOxxx definitions are copied from Makefile.host, and are
4# required before .include <bsd.own.mk>.   The include of bsd.own.mk
5# itself is required to get definitions of TOOL_* variables used in
6# "!=" variable assignments (which are performed early).
7#
8NOINFO=		# defined
9NOLINT=		# defined
10NOMAN=		# defined
11
12.include <bsd.own.mk>
13
14_ARCHDIR=	${.CURDIR}/../../sys/arch
15_INCDIR=	${.CURDIR}/../../include
16_SYSDIR=	${.CURDIR}/../../sys/sys
17_UFSDIR=	${.CURDIR}/../../sys/ufs
18_SUBDIR!=	cd ${_ARCHDIR} && ${MAKE} -V SUBDIR
19
20.if make(depend) || make(all) || make(dependall) || make(install)
21# There's no need to run these commands for "make cleandir" or "make obj",
22# and TOOL_SED will not yet have been built.
23_UFS_INCS!=	cd ${_UFSDIR} && find ffs ufs -name '*.h'
24_ARCH_INCS!=	${TOOL_SED} -e 's/^\#.*//' ${.CURDIR}/../headerlist
25.endif
26
27_ARCH_INCS+=	ews4800mips/include/pdinfo.h ews4800mips/include/vtoc.h
28
29# for sh3/include/elf_machdep.h
30.for sh3mach in dreamcast evbsh3 hpcsh landisk mmeye sh3
31_ARCH_INCS+=	${sh3mach}/include/endian_machdep.h
32.endfor
33
34_INCS=		disktab.h
35_SYSINCS=	bootblock.h \
36		disklabel.h disklabel_acorn.h disklabel_gpt.h disklabel_rdb.h \
37		dkbad.h \
38		exec_elf.h
39
40HOST_CPPFLAGS+=	-I${TOOLDIR}/include -I${TOOLDIR}/include/nbinclude
41
42beforedepend: 
43	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude
44	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/sys
45	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/ufs
46	cd ${_ARCHDIR} && \
47	    ${TOOL_PAX} -s /include\\/// -rw ${_ARCH_INCS} \
48	    ${TOOLDIR}/include/nbinclude
49	cd ${_INCDIR} && \
50	    ${TOOL_PAX} -rw ${_INCS} ${TOOLDIR}/include/nbinclude
51	cd ${_SYSDIR} && \
52	    ${TOOL_PAX} -rw ${_SYSINCS} ${TOOLDIR}/include/nbinclude/sys
53	cd ${_UFSDIR} && \
54	    ${TOOL_PAX} -rw ${_UFS_INCS} ${TOOLDIR}/include/nbinclude/ufs
55	cd ${TOOLDIR}/include/nbinclude && rm -f machine && \
56	    ${HOST_INSTALL_SYMLINK} ${MACHINE} machine
57