summaryrefslogtreecommitdiff
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorAlex Richardson <arichardson@FreeBSD.org>2020-08-24 09:20:38 +0000
committerAlex Richardson <arichardson@FreeBSD.org>2020-08-24 09:20:38 +0000
commitebae797c82a74cfbdc6acbb1a6bf977f7369e51b (patch)
treeed3fc0b987898d53df1f731066a6ae474c5a8ed8 /Makefile.inc1
parent0b862b03998a292a18bcc7f9ac5b05c0303c5de3 (diff)
downloadsrc-test2-ebae797c82a74cfbdc6acbb1a6bf977f7369e51b.tar.gz
src-test2-ebae797c82a74cfbdc6acbb1a6bf977f7369e51b.zip
Also print number of available CPUs on Linux
Without this change the buildworld/buildkernel epilogue looks like this: >>> World built in 249 seconds, sysctl: cannot stat /proc/sys/hw/ncpu: No such file or directory ncpu: , make -j72. Reviewed By: emaste, bdrewery Differential Revision: https://reviews.freebsd.org/D26056
Notes
Notes: svn path=/head/; revision=364650
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc16
1 files changed, 4 insertions, 2 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index d50bfd772d27..3a6e19e733df 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1136,6 +1136,8 @@ _BUILDWORLD_START!= date '+%s'
buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue .PHONY
.ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
+_ncpu_cmd=sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo unknown
+
buildworld_prologue: .PHONY
@echo "--------------------------------------------------------------"
@echo ">>> World build started on `LC_ALL=C date`"
@@ -1147,7 +1149,7 @@ buildworld_epilogue: .PHONY
@echo ">>> World build completed on `LC_ALL=C date`"
@seconds=$$(($$(date '+%s') - ${_BUILDWORLD_START})); \
echo -n ">>> World built in $$seconds seconds, "; \
- echo "ncpu: $$(sysctl -n hw.ncpu)${.MAKE.JOBS:S/^/, make -j/}"
+ echo "ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
@echo "--------------------------------------------------------------"
#
@@ -1656,7 +1658,7 @@ buildkernel: .MAKE .PHONY
.endfor
@seconds=$$(($$(date '+%s') - ${_BUILDKERNEL_START})); \
echo -n ">>> Kernel(s) ${BUILDKERNELS} built in $$seconds seconds, "; \
- echo "ncpu: $$(sysctl -n hw.ncpu)${.MAKE.JOBS:S/^/, make -j/}"
+ echo "ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
@echo "--------------------------------------------------------------"
NO_INSTALLEXTRAKERNELS?= yes