Created
November 15, 2021 15:20
-
-
Save davep/f2fc0a0645719bd7321090a22058f108 to your computer and use it in GitHub Desktop.
Handy self-help facility for a Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################## | |
# Self help | |
helper = @grep -Eh "^[a-z]+:.+\# " $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.+\# "}; {printf "$(1)%-20s$(2)%s$(3)\n", $$1, $$2}' | |
.PHONY: help | |
help: # Display this help | |
$(call helper,, ) | |
.PHONY: helpmd | |
helpmd: # Display this help as a markdown table | |
@echo "| Target | Purpose |\n| - | - |" | |
$(call helper,| , | , |) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment