Build host tools on non-FreeBSD host with DIRDEPS_BUILD

Add Makefile.depend.options to libnetbsd, mkimg and makefs
to ensure libegacy is build if needed.

targets/pseudo/stage/Makefile avoid the need for mtree
the staging process creates target dirs as needed anyway.

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D39757
This commit is contained in:
Simon J. Gerraty 2023-04-22 13:13:22 -07:00
parent db98bc2c0d
commit 188bf8876f
8 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,6 @@
DIRDEPS_OPTIONS = host_egacy
DIRDEPS.host_egacy.yes = tools/build
.include <dirdeps-options.mk>

View File

@ -0,0 +1 @@
.include "../Makefile.inc"

View File

@ -0,0 +1,7 @@
DIRDEPS= \
usr.bin/mkimg \
usr.bin/tar \
usr.sbin/makefs \
.include <dirdeps.mk>

View File

@ -4,6 +4,7 @@
# distrib-dirs can be done in STAGE_OBJTOP
all:
.if ${.MAKE.OS} == "FreeBSD"
# mtree makes a lot of noise if we are not root,
# we don't need to see it.
stage-distrib-dirs: .META ${META_DEPS}
@ -11,6 +12,21 @@ stage-distrib-dirs: .META ${META_DEPS}
INSTALL="sh ${SRCTOP}/tools/install.sh" ${.MAKE} -C ${SRCTOP}/etc \
distrib-dirs -DNO_FSCHG -DWITH_TESTS DESTDIR=${STAGE_OBJTOP}
.else
std_dirs= \
/bin \
/etc \
/sbin \
/usr/bin \
/usr/include/sys \
/usr/lib \
/usr/sbin \
stage-distrib-dirs: .META
mkdir -p ${std_dirs:@d@${STAGE_OBJTOP}$d@}
.endif
.include <bsd.prog.mk>
.if ${.MAKE.LEVEL} > 0 && ${MK_STAGING} == "yes"

View File

@ -0,0 +1,11 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
.include <dirdeps.mk>
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
.endif

View File

@ -0,0 +1,6 @@
DIRDEPS_OPTIONS = host_egacy
DIRDEPS.host_egacy.yes = tools/build
.include <dirdeps-options.mk>

View File

@ -0,0 +1,12 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
lib/libnetbsd \
.include <dirdeps.mk>
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
.endif

View File

@ -0,0 +1,6 @@
DIRDEPS_OPTIONS = host_egacy
DIRDEPS.host_egacy.yes = tools/build
.include <dirdeps-options.mk>