Last active
July 28, 2021 16:15
-
-
Save Addvilz/50d3d3ee2265ddb9a8bfd404655ca49a to your computer and use it in GitHub Desktop.
Makefile help snipped
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
# Lines prefixed with [hash]- are header lines | |
# Targets can have tailing [hash]: to document functions | |
# Target groups can have preceding lines [hash]? name: description to document target groups | |
help: #: Show this help | |
@fgrep -h "#-" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/#-\s//' | |
@printf "\n" | |
@printf "Common targets:\n" | |
@fgrep -h "#+" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -Ee "s/([^:]+)(.*)(#\+(.*))/- \1:\4/g" | |
@printf "\nAvailable target groups:\n" | |
@fgrep -h "#?" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -Ee "s/^\#\? ([^:]+)\: (.*)/- \1: \2/g" | sort -bfi | |
@printf "\nAvailable targets:\n" | |
@fgrep -h "#:" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -Ee "s/([^:]+)(.*)(#:(.*))/- \1:\4/g" | sort -bfi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment