b5cd2489b2
* Rewrite src/tools Make logic to work like the rest of the tree wrt "dependall" and "install". The old "make build" hack is gone. * Remove the MKTOOLS logic. This was linked to the "make build" hack, and was only needed because TOOLDIR originally had no writable default. * Redo the GNU configure/make logic to make it fit reasonably in a BSD make wrapper. Use new ${.ALLTARGETS} variable to scan for targets in $(srcdir), and mark them with .MADE: to prevent rebuilding. * Only build cross tools in src/tools; remove some messy logic in src/usr.* and src/gnu/usr.* that would do target filename rewriting (improves consistency and readability). * Add the ability to build cross gdb at tool build time by setting MKCROSSGDB (default no) to "yes" in mk.conf. * Add src/tools/groff and set up paths to work with this cross groff.
68 lines
1.5 KiB
Makefile
68 lines
1.5 KiB
Makefile
# $NetBSD: Makefile.host,v 1.10 2001/11/12 23:16:24 tv Exp $
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
# Resolve pathnames in variables.
|
|
_RESOLVE_VARS= CFLAGS CPPFLAGS DPADD HOST_CPPFLAGS LDADD
|
|
.for var in ${_RESOLVE_VARS}
|
|
${var}:= ${${var}}
|
|
.endfor
|
|
|
|
# Switch over to the "real" Makefile.
|
|
.PROGDIR:= ${.CURDIR}/../../${HOST_SRCDIR}
|
|
_CURDIR:= ${.CURDIR}
|
|
HOSTPROG?= ${PROG}
|
|
|
|
.CURDIR:= ${.PROGDIR}
|
|
.PATH: ${.CURDIR}
|
|
.include "${.CURDIR}/Makefile"
|
|
.-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
|
|
|
|
# Set up the environment for <bsd.hostprog.mk>.
|
|
.if ${USETOOLS} != "yes"
|
|
.undef HOSTPROG
|
|
.endif
|
|
|
|
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
|
|
.undef LINKS
|
|
|
|
.PATH: ${.PROGDIR} ${.CURDIR}/../compat
|
|
|
|
# Install rule.
|
|
realinstall: install.host install.files
|
|
install.host: ${HOST_BINDIR}/${HOSTPROGNAME}
|
|
${HOST_BINDIR}/${HOSTPROGNAME}:: ${HOSTPROG}
|
|
mkdir -p ${HOST_BINDIR}
|
|
${INSTALL_FILE:N-U} -m ${BINMODE} ${.ALLSRC} ${.TARGET}
|
|
|
|
.if !defined(UPDATE)
|
|
.PHONY: ${HOST_BINDIR}/${HOSTPROGNAME}
|
|
.endif
|
|
|
|
install.files:
|
|
.for F in ${HOSTFILES}
|
|
install.files: ${HOST_FILESDIR}/${F}
|
|
${HOST_FILESDIR}/${F}: ${F}
|
|
mkdir -p ${HOST_FILESDIR}
|
|
${INSTALL_FILE:N-U} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}
|
|
|
|
.if !defined(UPDATE)
|
|
.PHONY: ${HOST_FILESDIR}/${F}
|
|
.endif
|
|
.endfor
|
|
|
|
.include <bsd.hostprog.mk>
|