]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: Makefile: Implements the help target
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 13 Dec 2018 13:02:25 +0000 (14:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Dec 2018 13:06:57 +0000 (14:06 +0100)
Use the header of the Makefile to output the help target.

Makefile

index 587bc04867720ad0e1b5030a0d55e61a1dcb92ae..4e909e36ff68be2a44aac3ad33d0ef01f76ff14b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -966,6 +966,9 @@ LIB_EBTREE = $(EBTREE_DIR)/libebtree.a
 INCLUDES = $(wildcard include/*/*.h ebtree/*.h)
 DEP = $(INCLUDES) .build_opts
 
+help:
+       $(Q)sed -ne "/^[^#]*$$/q;s/^#\(.*\)/\1/p" Makefile
+
 # Used only to force a rebuild if some build options change
 .build_opts: $(shell rm -f .build_opts.new; echo \'$(TARGET) $(BUILD_OPTIONS) $(VERBOSE_CFLAGS)\' > .build_opts.new; if cmp -s .build_opts .build_opts.new; then rm -f .build_opts.new; else mv -f .build_opts.new .build_opts; fi)