NetBSD/tools/Makefile.host

76 lines
1.7 KiB
Makefile
Raw Normal View History

2001-12-12 04:48:43 +03:00
# $NetBSD: Makefile.host,v 1.13 2001/12/12 01:50:20 tv Exp $
.include <bsd.own.mk>
# 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
# Switch over to the "real" Makefile.
.PROGDIR:= ${.CURDIR}/../../${HOST_SRCDIR}
_CURDIR:= ${.CURDIR}
HOSTPROG?= ${PROG}
.CURDIR:= ${.PROGDIR}
.PATH: ${.CURDIR}
.include "${.CURDIR}/Makefile"
.-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
# Set up the environment for <bsd.hostprog.mk>.
.if ${USETOOLS} != "yes"
.undef HOSTPROG
.endif
HOSTPROGNAME?= ${HOSTPROG}
HOST_BINDIR?= ${TOOLDIR}/bin
HOST_CPPFLAGS:= -Wall ${HOST_CPPFLAGS} ${CPPFLAGS}
2001-12-12 04:48:43 +03:00
NOMAN= # defined
.undef LINKS
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
.PATH: ${.PROGDIR} ${.CURDIR}/../compat
# Install rule.
realinstall: install.host install.files
install.host: ${HOST_BINDIR}/${HOSTPROGNAME}
${HOST_BINDIR}/${HOSTPROGNAME}:: ${HOSTPROG}
mkdir -p ${HOST_BINDIR}
${HOST_INSTALL_FILE} -m ${BINMODE} ${.ALLSRC} ${.TARGET}
.if !defined(UPDATE)
.PHONY: ${HOST_BINDIR}/${HOSTPROGNAME}
.endif
install.files:
.for F in ${HOSTFILES}
install.files: ${HOST_FILESDIR}/${F}
${HOST_FILESDIR}/${F}: ${F}
mkdir -p ${HOST_FILESDIR}
${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}
.if !defined(UPDATE)
.PHONY: ${HOST_FILESDIR}/${F}
.endif
.endfor
.include <bsd.hostprog.mk>