2001-12-12 05:48:46 +03:00
|
|
|
# $NetBSD: Makefile.host,v 1.14 2001/12/12 02:48:46 tv Exp $
|
|
|
|
|
|
|
|
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
|
|
|
|
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-12-12 00:17:56 +03:00
|
|
|
HOST_CPPFLAGS:= -Wall ${HOST_CPPFLAGS} ${CPPFLAGS}
|
2001-12-12 04:48:43 +03:00
|
|
|
NOMAN= # defined
|
2001-08-14 15:01:55 +04:00
|
|
|
.undef LINKS
|
|
|
|
|
2001-12-12 00:17:56 +03:00
|
|
|
SRCS?= ${HOSTPROG}.c
|
|
|
|
SRCS+= ${HOST_SRCS}
|
|
|
|
|
|
|
|
.ifndef NOCOMPATLIB
|
|
|
|
COMPATOBJ!= cd ${.CURDIR}/../compat && ${PRINTOBJDIR}
|
|
|
|
DPADD+= ${COMPATOBJ}/libnbcompat.a
|
|
|
|
LDADD+= -L${COMPATOBJ} -lnbcompat
|
|
|
|
HOST_CPPFLAGS+= -include ${COMPATOBJ}/config.h
|
|
|
|
.-include "${COMPATOBJ}/defs.mk"
|
|
|
|
.endif
|
|
|
|
|
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-19 07:47:42 +03:00
|
|
|
${HOST_INSTALL_FILE} -m ${BINMODE} ${.ALLSRC} ${.TARGET}
|
2001-11-13 02:16:17 +03:00
|
|
|
|
|
|
|
.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-19 07:47:42 +03:00
|
|
|
${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}
|
2001-11-13 02:16:17 +03:00
|
|
|
|
|
|
|
.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>
|