Makefile.host revision 1.9
1#	$NetBSD: Makefile.host,v 1.9 2001/11/12 17:46:35 tv Exp $
2
3# Preload <bsd.obj.mk> to set up obj rules (with proper ${.CURDIR}).
4OBJHOSTMACHINE=	# set
5.include <bsd.obj.mk>
6
7# We might need the PRINTOBJDIR variable -- make sure it's defined.
8# XXX It really sucks to have to copy this from <bsd.own.mk>.
9PRINTOBJDIR=	printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}\n" | ${MAKE} -B -s -f-
10
11# Save value of .CURDIR, and reassign it to the "real" source directory.
12_CURDIR:=	${.CURDIR}
13.CURDIR:=	${_CURDIR}/../../${HOST_SRCDIR}
14
15# Set HOSTPROG as a flag to the real program not to include <bsd.prog.mk>.
16HOSTPROG?=	${PROG}
17
18# Pull in the "real" Makefile.
19.include "${.CURDIR}/Makefile"
20.if exists(${.CURDIR}/../Makefile.inc)
21.include "${.CURDIR}/../Makefile.inc"
22.endif
23
24# Set up the environment for <bsd.hostprog.mk>.
25HOSTPROGNAME?=	${HOSTPROG}
26HOST_BINDIR?=	${TOOLDIR}/bin
27HOST_CPPFLAGS:=	-include ${_CURDIR}/../compat/compat_netbsd.h -Wall \
28		${HOST_CPPFLAGS} ${CPPFLAGS}
29MKMAN=		no
30SRCS?=		${PROG}.c
31SRCS+=		${HOST_SRCS} nb_progname.c
32TIMESTAMP?=	${HOST_BINDIR}/${HOSTPROGNAME}
33.undef LINKS
34
35.PATH:		${.CURDIR} ${_CURDIR}/../compat
36${TIMESTAMP}:	${.CURDIR}/Makefile
37
38# Include the local definitions, and then <bsd.hostprog.mk>.
39.include "${_CURDIR}/../Makefile.inc"
40.include <bsd.hostprog.mk>
41
42# Install rule.
43realinstall: install.host install.files
44install.host:
45	mkdir -p ${HOST_BINDIR}
46	${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -m ${BINMODE} \
47		${HOSTPROG} ${HOST_BINDIR}/${HOSTPROGNAME}
48
49.if defined(HOSTFILES)
50install.files:
51	mkdir -p ${HOST_FILESDIR}
52	for i in ${HOSTFILES}; \
53	do \
54		${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -m ${NONBINMODE} \
55			${.CURDIR}/$$i ${HOST_FILESDIR}/$$i; \
56	done
57.else
58install.files:
59.endif
60