Makefile.host revision 1.14
1# $NetBSD: Makefile.host,v 1.14 2001/12/12 02:48:46 tv Exp $ 2 3NOLINT= # defined 4NOMAN= # defined 5 6.include <bsd.own.mk> 7 8# Resolve pathnames in variables. 9_RESOLVE_VARS= CFLAGS CPPFLAGS DPADD HOST_CPPFLAGS LDADD 10.for var in ${_RESOLVE_VARS} 11${var}:= ${${var}} 12.endfor 13 14# Switch over to the "real" Makefile. 15.PROGDIR:= ${.CURDIR}/../../${HOST_SRCDIR} 16_CURDIR:= ${.CURDIR} 17HOSTPROG?= ${PROG} 18 19.CURDIR:= ${.PROGDIR} 20.PATH: ${.CURDIR} 21.include "${.CURDIR}/Makefile" 22.-include "${.CURDIR}/../Makefile.inc" 23 24# Resolve pathnames from "real" Makefile, and switch .CURDIR back. 25.for var in ${_RESOLVE_VARS} 26${var}:= ${${var}} 27.endfor 28.CURDIR:= ${_CURDIR} 29.undef _CURDIR 30 31# Set up the environment for <bsd.hostprog.mk>. 32.if ${USETOOLS} != "yes" 33.undef HOSTPROG 34.endif 35 36HOSTPROGNAME?= ${HOSTPROG} 37HOST_BINDIR?= ${TOOLDIR}/bin 38HOST_CPPFLAGS:= -Wall ${HOST_CPPFLAGS} ${CPPFLAGS} 39NOMAN= # defined 40.undef LINKS 41 42SRCS?= ${HOSTPROG}.c 43SRCS+= ${HOST_SRCS} 44 45.ifndef NOCOMPATLIB 46COMPATOBJ!= cd ${.CURDIR}/../compat && ${PRINTOBJDIR} 47DPADD+= ${COMPATOBJ}/libnbcompat.a 48LDADD+= -L${COMPATOBJ} -lnbcompat 49HOST_CPPFLAGS+= -include ${COMPATOBJ}/config.h 50.-include "${COMPATOBJ}/defs.mk" 51.endif 52 53.PATH: ${.PROGDIR} ${.CURDIR}/../compat 54 55# Install rule. 56realinstall: install.host install.files 57install.host: ${HOST_BINDIR}/${HOSTPROGNAME} 58${HOST_BINDIR}/${HOSTPROGNAME}:: ${HOSTPROG} 59 mkdir -p ${HOST_BINDIR} 60 ${HOST_INSTALL_FILE} -m ${BINMODE} ${.ALLSRC} ${.TARGET} 61 62.if !defined(UPDATE) 63.PHONY: ${HOST_BINDIR}/${HOSTPROGNAME} 64.endif 65 66install.files: 67.for F in ${HOSTFILES} 68install.files: ${HOST_FILESDIR}/${F} 69${HOST_FILESDIR}/${F}: ${F} 70 mkdir -p ${HOST_FILESDIR} 71 ${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET} 72 73.if !defined(UPDATE) 74.PHONY: ${HOST_FILESDIR}/${F} 75.endif 76.endfor 77 78.include <bsd.hostprog.mk> 79