Mercurial > hg > octave-shane > gnulib-hg
changeset 13208:85be704c72eb
maint.mk: print the elapsed time for each syntax-check rule
* top/maint.mk (sc_m_rules_): Save start time in a file.
(sc_z_rules_): New rules: remove temp file and print elapsed time.
(local-check): Interpose the .z rules
author | Jim Meyering <meyering@redhat.com> |
---|---|
date | Sun, 11 Apr 2010 10:26:52 +0200 |
parents | d6fb1e50d8db |
children | 473dffe238d2 |
files | ChangeLog top/maint.mk |
diffstat | 2 files changed, 23 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-04-11 Jim Meyering <meyering@redhat.com> + + maint.mk: print the elapsed time for each syntax-check rule + * top/maint.mk (sc_m_rules_): Save start time in a file. + (sc_z_rules_): New rules: remove temp file and print elapsed time. + (local-check): Interpose the .z rules + 2010-04-11 Jim Meyering <meyering@redhat.com> maint.mk: detect_empty_lines_at_EOF_: avoid FP for an empty file
--- a/top/maint.mk +++ b/top/maint.mk @@ -129,8 +129,23 @@ .PHONY: $(sc_m_rules_) $(sc_m_rules_): @echo $(patsubst sc_%.m, %, $@) + @date +%s.%N > .sc-start-$(basename $@) -local-check := $(filter-out $(local-checks-to-skip), $(local-checks-available)) +# Compute and print the elapsed time for each syntax-check rule. +sc_z_rules_ = $(patsubst %, %.z, $(syntax-check-rules)) +.PHONY: $(sc_z_rules_) +$(sc_z_rules_): %.z: % + @end=$$(date +%s.%N); \ + start=$$(cat .sc-start-$*); \ + rm -f .sc-start-$*; \ + awk -v s=$$start -v e=$$end \ + 'END {printf "%.2f: $* done\n", e - s}' < /dev/null + +# The patsubst here is to replace each sc_% rule with its sc_%.z wrapper +# that computes and prints elapsed time. +local-check := \ + $(patsubst sc_%, sc_%.z, \ + $(filter-out $(local-checks-to-skip), $(local-checks-available))) syntax-check: $(local-check) # @grep -nE '# *include <(limits|std(def|arg|bool))\.h>' \