2001-11-11 04:36:15 +03:00
|
|
|
m $NetBSD: Makefile.host,v 1.8 2001/11/11 01:36:15 jmc Exp $
|
2001-08-14 15:01:55 +04:00
|
|
|
|
|
|
|
# Preload <bsd.obj.mk> to set up obj rules (with proper ${.CURDIR}).
|
|
|
|
.include <bsd.obj.mk>
|
|
|
|
|
2001-10-25 04:36:26 +04:00
|
|
|
# We might need the PRINTOBJDIR variable -- make sure it's defined.
|
|
|
|
# XXX It really sucks to have to copy this from <bsd.own.mk>.
|
|
|
|
PRINTOBJDIR= printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}\n" | ${MAKE} -B -s -f-
|
|
|
|
|
2001-08-14 15:01:55 +04:00
|
|
|
# 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"
|
2001-10-22 09:30:47 +04:00
|
|
|
.if exists(${.CURDIR}/../Makefile.inc)
|
|
|
|
.include "${.CURDIR}/../Makefile.inc"
|
|
|
|
.endif
|
2001-08-14 15:01:55 +04:00
|
|
|
|
|
|
|
# Set up the environment for <bsd.hostprog.mk>.
|
|
|
|
HOSTPROGNAME?= ${HOSTPROG}
|
|
|
|
HOST_BINDIR?= ${TOOLDIR}/bin
|
|
|
|
HOST_CPPFLAGS:= -include ${_CURDIR}/../compat/compat_netbsd.h -Wall \
|
2001-10-25 06:02:46 +04:00
|
|
|
${HOST_CPPFLAGS} ${CPPFLAGS}
|
2001-08-14 15:01:55 +04:00
|
|
|
MKMAN= no
|
|
|
|
SRCS?= ${PROG}.c
|
2001-11-11 04:36:15 +03:00
|
|
|
SRCS+= ${HOST_SRCS} nb_progname.c
|
2001-08-14 15:01:55 +04:00
|
|
|
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.
|
2001-10-13 10:09:25 +04:00
|
|
|
realinstall: install.host install.files
|
2001-08-14 15:01:55 +04:00
|
|
|
install.host:
|
|
|
|
mkdir -p ${HOST_BINDIR}
|
|
|
|
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -m ${BINMODE} \
|
|
|
|
${HOSTPROG} ${HOST_BINDIR}/${HOSTPROGNAME}
|
2001-10-13 10:09:25 +04:00
|
|
|
|
|
|
|
.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
|