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
This commit is contained in:
Jessica Clarke 2023-07-27 05:10:49 +01:00
parent 03e62670c3
commit d81da4c983
2 changed files with 25 additions and 2 deletions

View File

@ -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 \

View File

@ -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
#