changeset 790:d4403d13fb31

correct
author Jeff Hammel <k0scist@gmail.com>
date Sun, 02 Oct 2016 18:37:16 -0700
parents 2064d617fe56
children 46674fb64686
files bin/make-targets.sh
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bin/make-targets.sh	Wed Sep 28 17:58:48 2016 -0700
+++ b/bin/make-targets.sh	Sun Oct 02 18:37:16 2016 -0700
@@ -1,3 +1,4 @@
 #!/bin/bash
 # list makefile targets
-make -pn | grep '^ *[^#].*:.*' | sed 's/\([^:]+\):.*/\1/' | sort | uniq
\ No newline at end of file
+# from http://stackoverflow.com/questions/4219255/how-do-you-get-the-list-of-targets-in-a-makefile
+make -pRrq  2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($1 !~ "^[#.]") {print $1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$'
\ No newline at end of file