2003-11-16 21:06:01 +03:00
|
|
|
# $NetBSD: Makefile.host,v 1.23 2003/11/16 18:06:01 dsl Exp $
|
2001-12-12 05:48:46 +03:00
|
|
|
|
|
|
|
NOLINT= # defined
|
|
|
|
NOMAN= # defined
|
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
|
|
|
|
2002-01-29 13:20:28 +03:00
|
|
|
.ifndef NOCOMPATLIB
|
|
|
|
COMPATOBJ!= cd ${.CURDIR}/../compat && ${PRINTOBJDIR}
|
|
|
|
.-include "${COMPATOBJ}/defs.mk"
|
|
|
|
.endif
|
|
|
|
|
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
|
2002-01-21 23:59:40 +03:00
|
|
|
HOST_CPPFLAGS:= ${HOST_CPPFLAGS} ${CPPFLAGS}
|
2001-08-14 15:01:55 +04:00
|
|
|
.undef LINKS
|
|
|
|
|
2001-12-12 00:17:56 +03:00
|
|
|
SRCS?= ${HOSTPROG}.c
|
|
|
|
SRCS+= ${HOST_SRCS}
|
|
|
|
|
2002-01-29 13:20:28 +03:00
|
|
|
.PATH: ${.PROGDIR}
|
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}
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_INSTALL}
|
2001-08-14 15:01:55 +04:00
|
|
|
mkdir -p ${HOST_BINDIR}
|
2002-01-21 23:59:40 +03:00
|
|
|
${HOST_INSTALL_FILE} -m ${BINMODE} ${HOSTPROG}${HOSTEXEEXT} ${.TARGET}
|
2001-11-13 02:16:17 +03:00
|
|
|
|
2003-11-16 21:06:01 +03:00
|
|
|
.if ${MKUPDATE} == "no"
|
2001-11-13 02:16:17 +03:00
|
|
|
.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}
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_INSTALL}
|
2001-10-13 10:09:25 +04:00
|
|
|
mkdir -p ${HOST_FILESDIR}
|
2001-11-19 07:47:42 +03:00
|
|
|
${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}
|
2001-11-13 02:16:17 +03:00
|
|
|
|
2003-11-16 21:06:01 +03:00
|
|
|
.if ${MKUPDATE} == "no"
|
2001-11-13 02:16:17 +03:00
|
|
|
.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>
|