56 lines
1.5 KiB
Makefile
56 lines
1.5 KiB
Makefile
# $NetBSD: Makefile.host,v 1.3 2001/10/22 05:30:47 jmc Exp $
|
|
|
|
# Preload <bsd.obj.mk> to set up obj rules (with proper ${.CURDIR}).
|
|
.include <bsd.obj.mk>
|
|
|
|
# Save value of .CURDIR, and reassign it to the "real" source directory.
|
|
_CURDIR:= ${.CURDIR}
|
|
.CURDIR:= ${_CURDIR}/../../${HOST_SRCDIR}
|
|
|
|
# Set HOSTPROG as a flag to the real program not to include <bsd.prog.mk>.
|
|
HOSTPROG?= ${PROG}
|
|
|
|
# Pull in the "real" Makefile.
|
|
.include "${.CURDIR}/Makefile"
|
|
.if exists(${.CURDIR}/../Makefile.inc)
|
|
.include "${.CURDIR}/../Makefile.inc"
|
|
.endif
|
|
|
|
# Set up the environment for <bsd.hostprog.mk>.
|
|
HOSTPROGNAME?= ${HOSTPROG}
|
|
HOST_BINDIR?= ${TOOLDIR}/bin
|
|
HOST_CPPFLAGS:= -include ${_CURDIR}/../compat/compat_netbsd.h -Wall \
|
|
${HOST_CPPFLAGS} ${CPPFLAGS}
|
|
MKMAN= no
|
|
SRCS?= ${PROG}.c
|
|
SRCS+= ${HOST_SRCS} nb_progname.c
|
|
TIMESTAMP?= ${HOST_BINDIR}/${HOSTPROGNAME}
|
|
.undef LINKS
|
|
|
|
.PATH: ${.CURDIR} ${_CURDIR}/../compat
|
|
${TIMESTAMP}: ${.CURDIR}/Makefile
|
|
|
|
# Include the local definitions, and then <bsd.hostprog.mk>.
|
|
.include "${_CURDIR}/../Makefile.inc"
|
|
.include <bsd.hostprog.mk>
|
|
|
|
# Install rule.
|
|
realinstall: install.host install.files
|
|
install.host:
|
|
mkdir -p ${HOST_BINDIR}
|
|
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -m ${BINMODE} \
|
|
${HOSTPROG} ${HOST_BINDIR}/${HOSTPROGNAME}
|
|
|
|
.if defined(HOSTFILES)
|
|
install.files:
|
|
mkdir -p ${HOST_FILESDIR}
|
|
for i in ${HOSTFILES}; \
|
|
do \
|
|
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -m ${NONBINMODE} \
|
|
${.CURDIR}/$$i ${HOST_FILESDIR}/$$i; \
|
|
done
|
|
.else
|
|
install.files:
|
|
.endif
|
|
|