Created
February 5, 2020 18:38
-
-
Save lighth7015/082778c86f7f21f5c2fe22f86253f810 to your computer and use it in GitHub Desktop.
Help target
This file contains hidden or 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
help: ## Display usage and built-in help information. | |
$(shell printf "echo \"\"") | |
$(shell printf "echo \" %-20s %s\"" "Giza SDK Help" "Displays usage and built-in help information.") | |
$(shell printf "echo \"\"") | |
$(shell printf "echo \" ┌──────────────────────────────────────────────────────────────────────────────┐\"") | |
$(shell printf "echo \" │ %-76s │\"" "Available Targets:" ) | |
$(shell printf "echo \" ├──────────────────────────────────────────────────────────────────────────────┤\"") | |
for target in $(MAKE_TARGETS); do \ | |
echo "$${target}"; \ | |
if [ -f $$(dirname $${target})/$$(basename $${target} .mk).mk ]; then \ | |
$$(grep -E '\S+_HELPTEXT:=\s*\"([^"]+)\"' $${target} | \ | |
awk 'BEGIN { FS=":?="; }; { print $$2 }' | cut -d '"' -f2 ); \ | |
else \ | |
if [ -f $$(dirname $${target})/$$(basename $${target} .target).target ]; then \ | |
echo "category: $$(basename $${target} .target)"; \ | |
else \ | |
echo "$${target} is something else"; \ | |
fi \ | |
fi \ | |
done | |
$(shell printf "echo \" │ %-76s │\"" "" ) | |
$(shell printf "echo \" └──────────────────────────────────────────────────────────────────────────────┘\"") | |
$(shell printf "echo \"\"") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment