From d81da4c98328d4ee3fe4c0a85f6874a3c69a1afd Mon Sep 17 00:00:00 2001 From: Jessica Clarke Date: Thu, 27 Jul 2023 05:10:49 +0100 Subject: [PATCH] Makefile.inc1: Add new buildetc and installetc targets These implement the steps that etcupdate (and mergemaster) need in order to build their pristine trees, avoiding the need to use internal targets and variables. Additionally, buildetc includes the steps needed to build with BUILD_WITH_STRICT_TMPPATH enabled, since we need some host tools to be available during the various build and install steps. Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D41205 --- Makefile | 4 ++-- Makefile.inc1 | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f3bc3d1f96aa..699f003bf7df 100644 --- a/Makefile +++ b/Makefile @@ -158,14 +158,14 @@ __DO_KERNELS?=yes .include "${.CURDIR}/share/mk/bsd.compat.pre.mk" -TGTS= all all-man buildenv buildenvvars buildkernel buildworld \ +TGTS= all all-man buildenv buildenvvars buildetc buildkernel buildworld \ check check-old check-old-dirs check-old-files check-old-libs \ checkdpadd checkworld clean cleandepend cleandir cleankernel \ cleanworld cleanuniverse \ delete-old delete-old-dirs delete-old-files delete-old-libs \ depend distribute distributekernel distributekernel.debug \ distributeworld distrib-dirs distribution doxygen \ - everything hier hierarchy install installcheck installkernel \ + everything hier hierarchy install installcheck installetc installkernel \ installkernel.debug packagekernel packageworld \ reinstallkernel reinstallkernel.debug \ installworld kernel-toolchain libraries maninstall \ diff --git a/Makefile.inc1 b/Makefile.inc1 index aa65711fbc0b..f8d4b4333d99 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1623,6 +1623,29 @@ distrib-dirs distribution: .MAKE .PHONY MK_TESTS_SUPPORT=${MK_TESTS_SUPPORT} installconfig .endif +# +# buildetc and installetc +# +buildetc: .MAKE .PHONY + ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 _worldtmp + ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 _legacy + ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 _bootstrap-tools \ + MK_CROSS_COMPILER=no MK_TOOLCHAIN=no + ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 _obj \ + SUBDIR_OVERRIDE=etc + ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 everything \ + SUBDIR_OVERRIDE=etc + +installetc: .MAKE .PHONY + @echo "--------------------------------------------------------------" + @echo ">>> Making hierarchy" + @echo "--------------------------------------------------------------" + ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distrib-dirs + @echo "--------------------------------------------------------------" + @echo ">>> Making distribution" + @echo "--------------------------------------------------------------" + ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribution + # # buildkernel and installkernel #