summaryrefslogtreecommitdiff
path: root/tools/Makefile.nbincludes
blob: 5d7c53b042e7def4a699e7aae8bfce29b53b1828 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#	$NetBSD: Makefile.nbincludes,v 1.4 2015/01/24 16:21:33 uwe Exp $

# NOxxx definitions are copied from Makefile.host, and are
# required before .include <bsd.own.mk>.   The include of bsd.own.mk
# itself is required to get definitions of TOOL_* variables used in
# "!=" variable assignments (which are performed early).
#
NOINFO=		# defined
NOLINT=		# defined
NOMAN=		# defined

.include <bsd.own.mk>

_ARCHDIR=	${.CURDIR}/../../sys/arch
_INCDIR=	${.CURDIR}/../../include
_SYSDIR=	${.CURDIR}/../../sys/sys
_UFSDIR=	${.CURDIR}/../../sys/ufs
_SUBDIR!=	cd ${_ARCHDIR} && ${MAKE} -V SUBDIR

.if make(depend) || make(all) || make(dependall) || make(install)
# There's no need to run these commands for "make cleandir" or "make obj",
# and TOOL_SED will not yet have been built.
_UFS_INCS!=	cd ${_UFSDIR} && find ffs ufs -name '*.h'
_ARCH_INCS!=	${TOOL_SED} -e 's/^\#.*//' ${.CURDIR}/../headerlist
.endif

.if !defined(__MINIX)
_ARCH_INCS+=	ews4800mips/include/pdinfo.h ews4800mips/include/vtoc.h

# for sh3/include/elf_machdep.h
.for sh3mach in dreamcast evbsh3 hpcsh landisk mmeye sh3
_ARCH_INCS+=	${sh3mach}/include/endian_machdep.h
.endfor
.endif # !defined(__MINIX)

_INCS=		disktab.h
_SYSINCS=	bootblock.h \
		disklabel.h disklabel_acorn.h disklabel_gpt.h disklabel_rdb.h \
		dkbad.h \
		exec_elf.h

HOST_CPPFLAGS+=	-I${TOOLDIR}/include -I${TOOLDIR}/include/nbinclude

beforedepend: 
	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude
	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/sys
	${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/ufs
	cd ${_ARCHDIR} && \
	    ${TOOL_PAX} -s /include\\/// -rw ${_ARCH_INCS} \
	    ${TOOLDIR}/include/nbinclude
	cd ${_INCDIR} && \
	    ${TOOL_PAX} -rw ${_INCS} ${TOOLDIR}/include/nbinclude
	cd ${_SYSDIR} && \
	    ${TOOL_PAX} -rw ${_SYSINCS} ${TOOLDIR}/include/nbinclude/sys
	cd ${_UFSDIR} && \
	    ${TOOL_PAX} -rw ${_UFS_INCS} ${TOOLDIR}/include/nbinclude/ufs
	cd ${TOOLDIR}/include/nbinclude && rm -f machine && \
	    ${HOST_INSTALL_SYMLINK} ${MACHINE} machine