Thread (11 messages) flat view 11 messages, 7 authors, 2016-06-15

Re: [PATCH] Makefile: implement help target

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:49:38

Possibly related (same subject, not in this thread)

Michael J Gruber [off-list ref] writes:
How's this for a version without maintenance issues?
Something along these lines would be closer to what I had in mind,
actually.

Traditionally a multi-line sed command embed in Makefile has been
portability nightmare, which is a bit worrysome.

Isn't there a "makedoc" ala "perldoc" or "javadoc", by the way?
...
+#H# Show help for main make targets
+help:
+	@sed -n  -e '/^#H#/ {N'\
+		-e 's/^#H# \(.*\)\n\([a-z0-9_-]*\):.*/\2 \1/p'\
+		-e '}' <Makefile | sort --key=2 | while read target txt;\
+	do \
+		printf "%-20s: %s\n" "$$target" "$$txt"; \
+	done
-- 
1.7.3.98.g5ad7d
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help