#!/bin/bash
# list makefile targets
# 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 '^$@$'