Skip to content

Instantly share code, notes, and snippets.

@lighth7015
Created February 5, 2020 18:38
Show Gist options
  • Save lighth7015/082778c86f7f21f5c2fe22f86253f810 to your computer and use it in GitHub Desktop.
Save lighth7015/082778c86f7f21f5c2fe22f86253f810 to your computer and use it in GitHub Desktop.
Help target
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