From e5fae068fa2780bd10b8ff26797e8d9a6ab30315 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 24 Dec 2018 23:49:28 -0500 Subject: Makefile.am: Add "todo" target Copied from prokit. --- diff --git a/Makefile.am b/Makefile.am index 7ccb1ad..79143a1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -109,6 +109,40 @@ SH_LOG_DRIVER = \ LIBOPKBUILD_SHSOVERSION='$(libopkbuild_shsoversion)' \ $(SHELL) $(top_srcdir)/build-aux/tap-driver.sh +todo_script = \ + /^[0-9]* .[ \t]*\#[ \t]*TODO/,/^[0-9]* \.[ \t]*[^ \t\#]/{ \ + /^[0-9]* \.[ \t]*\#/p; \ + }; \ + /^[0-9]* .[ \t]*\#[ \t]*FIXME/,/^[0-9]* \.[ \t]*[^ \t\#]/{ \ + /^[0-9]* \.[ \t]*\#/p; \ + }; \ + /^[0-9]* .[ \t]*\#[ \t]*XXX/,/^[0-9]* \.[ \t]*[^ \t\#]/{ \ + /^[0-9]* \.[ \t]*\#/p; \ + }; +todo: + @set -e; \ + printf '\n'; \ + printf 'Code comments:\n'; \ + printf '==============\n\n'; \ + for f in $$(printf '%s\n' $(SOURCES) | sort -u); do \ + printed=false; \ + sed '=' "$(top_srcdir)/$${f}" | sed 'N; s/\n/ ./' | sed -n \ + '$(todo_script)' | while read -r lineno line; do \ + if ! $${printed}; then \ + printf '%s:\n' "$${f}"; \ + printed=true; \ + fi; \ + printf ' %6d %s\n' $${lineno} "$${line#.}"; \ + done; \ + done; \ + printf '\n'; \ + if [ -f '$(top_srcdir)/TODO' ]; then \ + printf 'TODO file:\n'; \ + printf '==========\n\n'; \ + cat '$(top_srcdir)/TODO'; \ + printf '\n'; \ + fi + all-local: $(locale_MESSAGES) install-data-local: $(locale_MESSAGES) -- cgit v0.9.1