git: 188bf8876fdc - main - Build host tools on non-FreeBSD host with DIRDEPS_BUILD
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 22 Apr 2023 20:14:27 UTC
The branch main has been updated by sjg:
URL: https://cgit.FreeBSD.org/src/commit/?id=188bf8876fdc6e3edebeb76f80e764e419a65f1e
commit 188bf8876fdc6e3edebeb76f80e764e419a65f1e
Author: Simon J. Gerraty <sjg@FreeBSD.org>
AuthorDate: 2023-04-22 20:13:22 +0000
Commit: Simon J. Gerraty <sjg@FreeBSD.org>
CommitDate: 2023-04-22 20:13:22 +0000
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
---
lib/libnetbsd/Makefile.depend.options | 6 ++++++
targets/pseudo/host-tools/Makefile | 1 +
targets/pseudo/host-tools/Makefile.depend.host | 7 +++++++
targets/pseudo/stage/Makefile | 16 ++++++++++++++++
usr.bin/mkimg/Makefile.depend.host | 11 +++++++++++
usr.bin/mkimg/Makefile.depend.options | 6 ++++++
usr.sbin/makefs/Makefile.depend.host | 12 ++++++++++++
usr.sbin/makefs/Makefile.depend.options | 6 ++++++
8 files changed, 65 insertions(+)
diff --git a/lib/libnetbsd/Makefile.depend.options b/lib/libnetbsd/Makefile.depend.options
new file mode 100644
index 000000000000..4dcc6c412671
--- /dev/null
+++ b/lib/libnetbsd/Makefile.depend.options
@@ -0,0 +1,6 @@
+DIRDEPS_OPTIONS = host_egacy
+
+DIRDEPS.host_egacy.yes = tools/build
+
+.include <dirdeps-options.mk>
+
diff --git a/targets/pseudo/host-tools/Makefile b/targets/pseudo/host-tools/Makefile
new file mode 100644
index 000000000000..01b5f23410c8
--- /dev/null
+++ b/targets/pseudo/host-tools/Makefile
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/targets/pseudo/host-tools/Makefile.depend.host b/targets/pseudo/host-tools/Makefile.depend.host
new file mode 100644
index 000000000000..3be07061c202
--- /dev/null
+++ b/targets/pseudo/host-tools/Makefile.depend.host
@@ -0,0 +1,7 @@
+DIRDEPS= \
+ usr.bin/mkimg \
+ usr.bin/tar \
+ usr.sbin/makefs \
+
+.include <dirdeps.mk>
+
diff --git a/targets/pseudo/stage/Makefile b/targets/pseudo/stage/Makefile
index ed3217d9f743..3a17f8a2e648 100644
--- a/targets/pseudo/stage/Makefile
+++ b/targets/pseudo/stage/Makefile
@@ -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"
diff --git a/usr.bin/mkimg/Makefile.depend.host b/usr.bin/mkimg/Makefile.depend.host
new file mode 100644
index 000000000000..f80275d86ab1
--- /dev/null
+++ b/usr.bin/mkimg/Makefile.depend.host
@@ -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
diff --git a/usr.bin/mkimg/Makefile.depend.options b/usr.bin/mkimg/Makefile.depend.options
new file mode 100644
index 000000000000..4dcc6c412671
--- /dev/null
+++ b/usr.bin/mkimg/Makefile.depend.options
@@ -0,0 +1,6 @@
+DIRDEPS_OPTIONS = host_egacy
+
+DIRDEPS.host_egacy.yes = tools/build
+
+.include <dirdeps-options.mk>
+
diff --git a/usr.sbin/makefs/Makefile.depend.host b/usr.sbin/makefs/Makefile.depend.host
new file mode 100644
index 000000000000..858c2f2c11ec
--- /dev/null
+++ b/usr.sbin/makefs/Makefile.depend.host
@@ -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
diff --git a/usr.sbin/makefs/Makefile.depend.options b/usr.sbin/makefs/Makefile.depend.options
new file mode 100644
index 000000000000..4dcc6c412671
--- /dev/null
+++ b/usr.sbin/makefs/Makefile.depend.options
@@ -0,0 +1,6 @@
+DIRDEPS_OPTIONS = host_egacy
+
+DIRDEPS.host_egacy.yes = tools/build
+
+.include <dirdeps-options.mk>
+