Created
September 30, 2024 00:24
-
-
Save kborovik/06e09d19030f42885b230c71a105eafd to your computer and use it in GitHub Desktop.
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
#!/usr/bin/awk -f | |
# Print target name and description of Makefile | |
# The script expect: | |
# - 'make -qp' as input | |
# - '$(info ### description ###)' as one of the target's commands | |
BEGIN { | |
FS=":" | |
print "Targets:" | |
} | |
/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/ { | |
split($1,A,/:/) | |
target=A[1] | |
while (length($0) > 0) { | |
getline | |
if ($0 ~ /^[[:space:]]+\$\(info #+/) { | |
split($0,B,/#+/) | |
printf " %-20s %s\n", target, B[2] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment