Makefile.host revision 1.15
1# $NetBSD: Makefile.host,v 1.15 2001/12/12 12:07:26 lukem 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} 39.undef LINKS 40 41SRCS?= ${HOSTPROG}.c 42SRCS+= ${HOST_SRCS} 43 44.ifndef NOCOMPATLIB 45COMPATOBJ!= cd ${.CURDIR}/../compat && ${PRINTOBJDIR} 46DPADD+= ${COMPATOBJ}/libnbcompat.a 47LDADD+= -L${COMPATOBJ} -lnbcompat 48HOST_CPPFLAGS+= -include ${COMPATOBJ}/config.h 49.-include "${COMPATOBJ}/defs.mk" 50.endif 51 52.PATH: ${.PROGDIR} ${.CURDIR}/../compat 53 54# Install rule. 55realinstall: install.host install.files 56install.host: ${HOST_BINDIR}/${HOSTPROGNAME} 57${HOST_BINDIR}/${HOSTPROGNAME}:: ${HOSTPROG} 58 mkdir -p ${HOST_BINDIR} 59 ${HOST_INSTALL_FILE} -m ${BINMODE} ${.ALLSRC} ${.TARGET} 60 61.if !defined(UPDATE) 62.PHONY: ${HOST_BINDIR}/${HOSTPROGNAME} 63.endif 64 65install.files: 66.for F in ${HOSTFILES} 67install.files: ${HOST_FILESDIR}/${F} 68${HOST_FILESDIR}/${F}: ${F} 69 mkdir -p ${HOST_FILESDIR} 70 ${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET} 71 72.if !defined(UPDATE) 73.PHONY: ${HOST_FILESDIR}/${F} 74.endif 75.endfor 76 77.include <bsd.hostprog.mk> 78