comparison bin/make-targets.sh @ 790:d4403d13fb31

correct
author Jeff Hammel <k0scist@gmail.com>
date Sun, 02 Oct 2016 18:37:16 -0700
parents 71345f4de3ce
children
comparison
equal deleted inserted replaced
789:2064d617fe56 790:d4403d13fb31
1 #!/bin/bash 1 #!/bin/bash
2 # list makefile targets 2 # list makefile targets
3 make -pn | grep '^ *[^#].*:.*' | sed 's/\([^:]+\):.*/\1/' | sort | uniq 3 # from http://stackoverflow.com/questions/4219255/how-do-you-get-the-list-of-targets-in-a-makefile
4 make -pRrq 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($1 !~ "^[#.]") {print $1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$'