From d0bcca460ed3788053445e7e24bcb11523ba1184 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 14 Nov 2019 10:48:17 -0800 Subject: [PATCH] build - Add build-all and install-all targets * Add a 'smart' build-all and install-all target that spews to a log file instead of to the screen and. Will automatically run the build stage -j N, and both targets can be specified on one command line. make build-all install-all build-all: runs buildworld and buildkernel -j hw.ncpu install-all: runs installkernel and installworld -j 1 * The usual warnings and cautions still apply when installing a new world and kernel. --- Makefile | 3 ++- Makefile.inc1 | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index af913dcf7d..8abb280c22 100644 --- a/Makefile +++ b/Makefile @@ -83,6 +83,7 @@ TGTS= all all-man buildkernel quickkernel realquickkernel nativekernel \ libraries lint maninstall \ manlint mk obj objlink regress rerelease tags \ backupworld restoreworld restoreworld-auto \ + build-all install-all \ backup-clean backup-auto-clean \ _obj _includes _libraries _depend _worldtmp \ _bootstrap-tools _build-tools _cross-tools @@ -107,6 +108,7 @@ BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/} .ORDER: quickkernel reinstallkernel .ORDER: realquickkernel installkernel .ORDER: realquickkernel reinstallkernel +.ORDER: build-all install-all PATH= /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/pkg/bin MAKE= PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1 @@ -166,7 +168,6 @@ world: @printf ">>> make world completed on `LC_ALL=C date`\n (started ${STARTTIME})\n" @echo "--------------------------------------------------------------" -# # kernel # # Short hand for `make buildkernel installkernel' diff --git a/Makefile.inc1 b/Makefile.inc1 index 4d70cc56f5..2814430d74 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -463,6 +463,36 @@ realquickworld: _qwinit _mtreetmp _obj _includes _libraries everything _qwdone crossworld: _worldtmp _bootstrap-tools _obj _build-tools _cross-tools +GENLOGDIR= /usr/obj/${.CURDIR} +.ORDER: build-all install-all + +# build-all +# +# build +build-all: + @echo "Building world, log file in ${GENLOGDIR}/bw.out" + @mkdir -p ${GENLOGDIR} + @(cd ${.CURDIR}; ${MAKE} -j `sysctl -n hw.ncpu` buildworld > ${GENLOGDIR}/bw.out 2>&1) + @sync + @echo "Building kernel, log file in ${GENLOGDIR}/bk.out" + @(cd ${.CURDIR}; ${MAKE} -j `sysctl -n hw.ncpu` buildkernel > ${GENLOGDIR}/bk.out 2>&1) + @echo "build-all completed ok" + @sync + +install-all: + @echo "Installing kernel, log file in ${GENLOGDIR}/bk.out" + @mkdir -p ${GENLOGDIR} + @(cd ${.CURDIR}; ${MAKE} -j 1 installkernel >> ${GENLOGDIR}/bk.out 2>&1) + @sync + @echo "Installing world, log file in ${GENLOGDIR}/bw.out" + @(cd ${.CURDIR}; ${MAKE} -j 1 installworld >> ${GENLOGDIR}/bw.out 2>&1) + @sync + echo "Upgrading world" + @(cd ${.CURDIR}; ${MAKE} -j 1 upgrade >> ${GENLOGDIR}/bw.out 2>&1) + @sync + @echo "install-all completed ok. reboot recommended and after that, " + @echo "if doing a major upgrade, pkg upgrade -f" + .ORDER: _bwinit ${WMAKE_TGTS} _bwdone .ORDER: _obj _includes .ORDER: _qwinit _mtreetmp _obj -- 2.41.0