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