Skip to content

Instantly share code, notes, and snippets.

@bradobro
Created March 8, 2023 19:21
Show Gist options
  • Save bradobro/d17ac6c7aecbd0e1dcb4b65a44b2a541 to your computer and use it in GitHub Desktop.
Save bradobro/d17ac6c7aecbd0e1dcb4b65a44b2a541 to your computer and use it in GitHub Desktop.
Makefile: target to list targets
# Print out all targets and the line preceeding them.
help:
@# only print out targets that are lowercase letters and dashes followed by a colon
@awk '/^[[a-z\-]*:/{printf("%-15s %s\n", $$1, a)}{a=$$0}' ./Makefile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment