diff options
author | 2018-07-04 15:49:44 +0200 | |
---|---|---|
committer | 2018-07-04 17:57:31 +0200 | |
commit | 3033d31d7776f3d54dc0dd38d963c79fd3e0e9b2 (patch) | |
tree | c81c7f4c75c3513164b5a06c6ef3818f13dbcedb /Makefile | |
parent | 3dee549d6f0862125fb3b9b0fed55fa6e53cc1d6 (diff) |
make build: improve timestamps on output
for each output line, display:
* time from the beginning of the build
* time elapsed since previous line
Change-Id: I9ccd67f30c65576e1fa5456ec999236fb61dabc5
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -77,7 +77,9 @@ build-debug: INSTALL/flavours/$(FLAVOUR).tasks @echo "------------------- Building image $(NAME)-$(FLAVOUR) (debug mode) -------------------" @touch INSTALL/DEBUG @echo "FLAVOUR=$(FLAVOUR)" >INSTALL/flavour.conf - @docker build --no-cache=true --rm --pull -t $(IMAGE_NAME) . | awk '{ print strftime("[%Y-%m-%d %H:%M:%S]"), $$0 }' | tee build_$(FLAVOUR)_debug.log + @docker build --no-cache=true --rm --pull -t $(IMAGE_NAME) . \ + | awk 'BEGIN { t0=systime();t1=t0; }{t=systime(); printf("[%s|%3ds] %s\n",strftime("%H:%M:%S",t-t0,1),t-t1,$$0); t1=systime(); fflush();}' \ + | tee build_$(FLAVOUR)_debug.log @rm -f INSTALL/DEBUG INSTALL/flavour.conf @docker images @@ -89,7 +91,9 @@ build: INSTALL/flavours/$(FLAVOUR).tasks @echo "------------------- Building image $(NAME)-$(FLAVOUR) -------------------" @rm -f INSTALL/DEBUG @echo "FLAVOUR=$(FLAVOUR)" >INSTALL/flavour.conf - @docker build --no-cache=true --rm --pull -t $(IMAGE_NAME) . | awk '{ print strftime("[%Y-%m-%d %H:%M:%S]"), $$0 }' | tee build_$(FLAVOUR).log + @docker build --no-cache=true --rm --pull -t $(IMAGE_NAME) . \ + | awk 'BEGIN { t0=systime();t1=t0; }{t=systime(); printf("[%s|%3ds] %s\n",strftime("%H:%M:%S",t-t0,1),t-t1,$$0); t1=systime(); fflush();}' \ + | tee build_$(FLAVOUR)_debug.log @rm -f INSTALL/flavour.conf @docker images |