summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2018-12-24 23:49:28 (EST)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2018-12-24 23:49:28 (EST)
commite5fae068fa2780bd10b8ff26797e8d9a6ab30315 (patch)
tree5dec3a3d95580311f10066263084dcba4d32df4a
parenteed4834e28cf9c252886740915c8327dd538366f (diff)
Makefile.am: Add "todo" target
Copied from prokit.
-rw-r--r--Makefile.am34
1 files changed, 34 insertions, 0 deletions
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)