I\'ve used rake a bit (a Ruby make program), and it has an option to get a list of all the available targets, eg
> rake --tasks
rake db:charset # ret
If you have bash completion for make
installed, the completion script will define a function _make_target_extract_script
. This function is meant to create a sed
script which can be used to obtain the targets as a list.
Use it like this:
# Make sure bash completion is enabled
source /etc/bash_completion
# List targets from Makefile
sed -nrf <(_make_target_extract_script --) Makefile