2001-11-13 02:16:17 +03:00
|
|
|
# $NetBSD: Makefile.host,v 1.10 2001/11/12 23:16:24 tv Exp $
|
2001-08-14 15:01:55 +04:00
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
.include <bsd.own.mk>
|
2001-08-14 15:01:55 +04:00
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
# Resolve pathnames in variables.
|
|
|
|
_RESOLVE_VARS= CFLAGS CPPFLAGS DPADD HOST_CPPFLAGS LDADD
|
|
|
|
.for var in ${_RESOLVE_VARS}
|
|
|
|
${var}:= ${${var}}
|
|
|
|
.endfor
|
2001-10-25 04:36:26 +04:00
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
# Switch over to the "real" Makefile.
|
|
|
|
.PROGDIR:= ${.CURDIR}/../../${HOST_SRCDIR}
|
2001-08-14 15:01:55 +04:00
|
|
|
_CURDIR:= ${.CURDIR}
|
|
|
|
HOSTPROG?= ${PROG}
|
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
.CURDIR:= ${.PROGDIR}
|
|
|
|
.PATH: ${.CURDIR}
|
2001-08-14 15:01:55 +04:00
|
|
|
.include "${.CURDIR}/Makefile"
|
2001-11-13 02:16:17 +03:00
|
|
|
.-include "${.CURDIR}/../Makefile.inc"
|
|
|
|
|
|
|
|
# Resolve pathnames from "real" Makefile, and switch .CURDIR back.
|
|
|
|
.for var in ${_RESOLVE_VARS}
|
|
|
|
${var}:= ${${var}}
|
|
|
|
.endfor
|
|
|
|
.CURDIR:= ${_CURDIR}
|
|
|
|
.undef _CURDIR
|
2001-08-14 15:01:55 +04:00
|
|
|
|
|
|
|
# Set up the environment for <bsd.hostprog.mk>.
|
2001-11-13 02:16:17 +03:00
|
|
|
.if ${USETOOLS} != "yes"
|
|
|
|
.undef HOSTPROG
|
|
|
|
.endif
|
|
|
|
|
2001-08-14 15:01:55 +04:00
|
|
|
HOSTPROGNAME?= ${HOSTPROG}
|
|
|
|
HOST_BINDIR?= ${TOOLDIR}/bin
|
2001-11-13 02:16:17 +03:00
|
|
|
HOST_CPPFLAGS:= -include ${.CURDIR}/../compat/compat_netbsd.h -Wall \
|
2001-10-25 06:02:46 +04:00
|
|
|
${HOST_CPPFLAGS} ${CPPFLAGS}
|
2001-08-14 15:01:55 +04:00
|
|
|
MKMAN= no
|
|
|
|
SRCS?= ${PROG}.c
|
2001-11-11 04:36:15 +03:00
|
|
|
SRCS+= ${HOST_SRCS} nb_progname.c
|
2001-08-14 15:01:55 +04:00
|
|
|
.undef LINKS
|
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
.PATH: ${.PROGDIR} ${.CURDIR}/../compat
|
2001-08-14 15:01:55 +04:00
|
|
|
|
|
|
|
# Install rule.
|
2001-10-13 10:09:25 +04:00
|
|
|
realinstall: install.host install.files
|
2001-11-13 02:16:17 +03:00
|
|
|
install.host: ${HOST_BINDIR}/${HOSTPROGNAME}
|
|
|
|
${HOST_BINDIR}/${HOSTPROGNAME}:: ${HOSTPROG}
|
2001-08-14 15:01:55 +04:00
|
|
|
mkdir -p ${HOST_BINDIR}
|
2001-11-13 02:16:17 +03:00
|
|
|
${INSTALL_FILE:N-U} -m ${BINMODE} ${.ALLSRC} ${.TARGET}
|
|
|
|
|
|
|
|
.if !defined(UPDATE)
|
|
|
|
.PHONY: ${HOST_BINDIR}/${HOSTPROGNAME}
|
|
|
|
.endif
|
2001-10-13 10:09:25 +04:00
|
|
|
|
|
|
|
install.files:
|
2001-11-13 02:16:17 +03:00
|
|
|
.for F in ${HOSTFILES}
|
|
|
|
install.files: ${HOST_FILESDIR}/${F}
|
|
|
|
${HOST_FILESDIR}/${F}: ${F}
|
2001-10-13 10:09:25 +04:00
|
|
|
mkdir -p ${HOST_FILESDIR}
|
2001-11-13 02:16:17 +03:00
|
|
|
${INSTALL_FILE:N-U} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}
|
|
|
|
|
|
|
|
.if !defined(UPDATE)
|
|
|
|
.PHONY: ${HOST_FILESDIR}/${F}
|
2001-10-13 10:09:25 +04:00
|
|
|
.endif
|
2001-11-13 02:16:17 +03:00
|
|
|
.endfor
|
|
|
|
|
|
|
|
.include <bsd.hostprog.mk>
|