2018-05-04 17:50:18 +03:00
|
|
|
# $NetBSD: Makefile.host,v 1.34 2018/05/04 14:50:18 christos Exp $
|
2001-12-12 05:48:46 +03:00
|
|
|
|
2018-05-04 17:50:18 +03:00
|
|
|
NOINFO= # defined
|
|
|
|
NOLINT= # defined
|
|
|
|
NOMAN= # defined
|
|
|
|
MKREPRO=no # Native toolchain might be unable to do it
|
|
|
|
|
|
|
|
.include <bsd.own.mk>
|
2001-08-14 15:01:55 +04:00
|
|
|
|
2002-01-29 13:20:28 +03:00
|
|
|
.ifndef NOCOMPATLIB
|
2012-12-02 16:48:32 +04:00
|
|
|
# Use TOOLDIR copy of libnbcompat and associated *.h files
|
|
|
|
.-include "${TOOLDIR}/share/compat/defs.mk"
|
2013-02-17 04:32:42 +04:00
|
|
|
.elif !empty(.MAKE.OS:M*CYGWIN*)
|
|
|
|
HOSTEXEEXT=.exe
|
2002-01-29 13:20:28 +03:00
|
|
|
.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.
|
2009-12-01 20:06:34 +03:00
|
|
|
.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}
|
2011-04-10 20:52:36 +04:00
|
|
|
HOST_CPPFLAGS:= ${HOST_CPPFLAGS:N-Wp,-iremap,*:N--sysroot=*}
|
2013-02-17 04:32:42 +04:00
|
|
|
HOST_INSTALLPROG?=${HOST_BINDIR}/${HOSTPROGNAME}${HOSTEXEEXT}
|
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
|
2013-02-17 04:32:42 +04:00
|
|
|
install.host: ${HOST_INSTALLPROG}
|
|
|
|
${HOST_INSTALLPROG}:: ${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}
|
2013-02-17 04:32:42 +04:00
|
|
|
.if !empty(.MAKE.OS:M*CYGWIN*)
|
2013-06-14 20:10:02 +04:00
|
|
|
${HOST_SH} ${NETBSDSRCDIR}/tools/binstall/mkmanifest ${.TARGET}
|
2013-02-17 04:32:42 +04:00
|
|
|
.endif
|
2001-11-13 02:16:17 +03:00
|
|
|
|
2003-11-16 21:06:01 +03:00
|
|
|
.if ${MKUPDATE} == "no"
|
2013-02-17 04:32:42 +04:00
|
|
|
.PHONY: ${HOST_INSTALLPROG}
|
2001-11-13 02:16:17 +03:00
|
|
|
.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>
|