From e2cf1f143cf1798c55d4845afa3ed45bb81fe639 Mon Sep 17 00:00:00 2001 From: wosch Date: Tue, 12 Mar 2019 07:40:38 +0000 Subject: [PATCH] `make buildworld' should display the build time in seconds PR: 224433 Reviewed by: emaste, @bdrewery Approved by: cem Differential Revision: https://reviews.freebsd.org/D13911 --- Makefile.inc1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index e5a062acb64..511f63c6307 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1143,6 +1143,12 @@ WMAKE_TGTS+= everything WMAKE_TGTS+= build${libcompat} .endif +# record buildworld time in seconds +.if make(buildworld) +_BUILDWORLD_START!= date '+%s' +.export _BUILDWORLD_START +.endif + buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue .PHONY .ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue @@ -1155,6 +1161,9 @@ buildworld_epilogue: .PHONY @echo @echo "--------------------------------------------------------------" @echo ">>> World build completed on `LC_ALL=C date`" + @seconds=$$(($$(date '+%s') - ${_BUILDWORLD_START})); \ + echo -n ">>> World build in $$seconds seconds, "; \ + echo "ncpu: $$(sysctl -n hw.ncpu)${.MAKE.JOBS:S/^/, make -j/}" @echo "--------------------------------------------------------------" # -- 2.45.0